mirror of
https://chromium.googlesource.com/libyuv/libyuv
synced 2025-12-07 01:06:46 +08:00
Check number of functions available to cpuid before fetching function 7 results.
BUG=343 TESTED=local test on Windows. R=brettw@chromium.org, tpsiaki@google.com Review URL: https://webrtc-codereview.appspot.com/12969004 git-svn-id: http://libyuv.googlecode.com/svn/trunk@1035 16f28f9a-4ce2-e073-06de-1de4eb20be90
This commit is contained in:
parent
9ffb92fae0
commit
451a7541b7
@ -1,6 +1,6 @@
|
|||||||
Name: libyuv
|
Name: libyuv
|
||||||
URL: http://code.google.com/p/libyuv/
|
URL: http://code.google.com/p/libyuv/
|
||||||
Version: 1032
|
Version: 1035
|
||||||
License: BSD
|
License: BSD
|
||||||
License File: LICENSE
|
License File: LICENSE
|
||||||
|
|
||||||
|
|||||||
@ -11,6 +11,6 @@
|
|||||||
#ifndef INCLUDE_LIBYUV_VERSION_H_ // NOLINT
|
#ifndef INCLUDE_LIBYUV_VERSION_H_ // NOLINT
|
||||||
#define INCLUDE_LIBYUV_VERSION_H_
|
#define INCLUDE_LIBYUV_VERSION_H_
|
||||||
|
|
||||||
#define LIBYUV_VERSION 1032
|
#define LIBYUV_VERSION 1035
|
||||||
|
|
||||||
#endif // INCLUDE_LIBYUV_VERSION_H_ NOLINT
|
#endif // INCLUDE_LIBYUV_VERSION_H_ NOLINT
|
||||||
|
|||||||
@ -188,10 +188,14 @@ LIBYUV_API SAFEBUFFERS
|
|||||||
int InitCpuFlags(void) {
|
int InitCpuFlags(void) {
|
||||||
#if !defined(__pnacl__) && !defined(__CLR_VER) && defined(CPU_X86)
|
#if !defined(__pnacl__) && !defined(__CLR_VER) && defined(CPU_X86)
|
||||||
|
|
||||||
|
uint32 cpu_info0[4] = { 0, 0, 0, 0 };
|
||||||
uint32 cpu_info1[4] = { 0, 0, 0, 0 };
|
uint32 cpu_info1[4] = { 0, 0, 0, 0 };
|
||||||
uint32 cpu_info7[4] = { 0, 0, 0, 0 };
|
uint32 cpu_info7[4] = { 0, 0, 0, 0 };
|
||||||
|
CpuId(0, 0, cpu_info0);
|
||||||
CpuId(1, 0, cpu_info1);
|
CpuId(1, 0, cpu_info1);
|
||||||
CpuId(7, 0, cpu_info7);
|
if (cpu_info0[0] >= 7) {
|
||||||
|
CpuId(7, 0, cpu_info7);
|
||||||
|
}
|
||||||
cpu_info_ = ((cpu_info1[3] & 0x04000000) ? kCpuHasSSE2 : 0) |
|
cpu_info_ = ((cpu_info1[3] & 0x04000000) ? kCpuHasSSE2 : 0) |
|
||||||
((cpu_info1[2] & 0x00000200) ? kCpuHasSSSE3 : 0) |
|
((cpu_info1[2] & 0x00000200) ? kCpuHasSSSE3 : 0) |
|
||||||
((cpu_info1[2] & 0x00080000) ? kCpuHasSSE41 : 0) |
|
((cpu_info1[2] & 0x00080000) ? kCpuHasSSE41 : 0) |
|
||||||
@ -199,6 +203,7 @@ int InitCpuFlags(void) {
|
|||||||
((cpu_info7[1] & 0x00000200) ? kCpuHasERMS : 0) |
|
((cpu_info7[1] & 0x00000200) ? kCpuHasERMS : 0) |
|
||||||
((cpu_info1[2] & 0x00001000) ? kCpuHasFMA3 : 0) |
|
((cpu_info1[2] & 0x00001000) ? kCpuHasFMA3 : 0) |
|
||||||
kCpuHasX86;
|
kCpuHasX86;
|
||||||
|
|
||||||
#ifdef HAS_XGETBV
|
#ifdef HAS_XGETBV
|
||||||
if ((cpu_info1[2] & 0x18000000) == 0x18000000 && // AVX and OSSave
|
if ((cpu_info1[2] & 0x18000000) == 0x18000000 && // AVX and OSSave
|
||||||
TestOsSaveYmm()) { // Saves YMM.
|
TestOsSaveYmm()) { // Saves YMM.
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user