Commit a721402a authored by fbarchard@google.com's avatar fbarchard@google.com

Disable xgetbv for NaCL

BUG=none
TEST=ncval
R=nfullagar@google.com

Review URL: https://webrtc-codereview.appspot.com/2719004

git-svn-id: http://libyuv.googlecode.com/svn/trunk@822 16f28f9a-4ce2-e073-06de-1de4eb20be90
parent 38157bdc
Name: libyuv Name: libyuv
URL: http://code.google.com/p/libyuv/ URL: http://code.google.com/p/libyuv/
Version: 821 Version: 822
License: BSD License: BSD
License File: LICENSE License File: LICENSE
......
...@@ -11,6 +11,6 @@ ...@@ -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 821 #define LIBYUV_VERSION 822
#endif // INCLUDE_LIBYUV_VERSION_H_ NOLINT #endif // INCLUDE_LIBYUV_VERSION_H_ NOLINT
...@@ -54,20 +54,25 @@ void CpuId(uint32 eax, uint32 ecx, uint32* cpu_info) { ...@@ -54,20 +54,25 @@ void CpuId(uint32 eax, uint32 ecx, uint32* cpu_info) {
: "+b" (ebx), : "+b" (ebx),
#endif // defined( __i386__) && defined(__PIC__) #endif // defined( __i386__) && defined(__PIC__)
"+a" (eax), "+c" (ecx), "=d" (edx)); "+a" (eax), "+c" (ecx), "=d" (edx));
cpu_info[0] = eax; cpu_info[1] = ebx; cpu_info[2] = ecx; cpu_info[3] = edx; cpu_info[0] = eax;
cpu_info[1] = ebx;
cpu_info[2] = ecx;
cpu_info[3] = edx;
#endif // defined(_MSC_VER) #endif // defined(_MSC_VER)
} }
#if !defined(__native_client__)
#define HAS_XGETBV #define HAS_XGETBV
// X86 CPUs have xgetbv to detect OS saves high parts of ymm registers. // X86 CPUs have xgetbv to detect OS saves high parts of ymm registers.
int TestOsSaveYmm() { int TestOsSaveYmm() {
uint32 xcr0; uint32 xcr0;
#if defined(_MSC_VER) #if defined(_MSC_VER)
xcr0 = (uint32)_xgetbv(0); /* min VS2010 SP1 compiler is required */ xcr0 = static_cast<uint32>(_xgetbv(0)); // VS2010 SP1 required.
#else #else
asm volatile ("xgetbv" : "=a" (xcr0) : "c" (0) : "%edx" ); // NOLINT asm volatile ("xgetbv" : "=a" (xcr0) : "c" (0) : "%edx" ); // NOLINT
#endif // defined(_MSC_VER) #endif // defined(_MSC_VER)
return((xcr0 & 6) == 6); // Is ymm saved? return((xcr0 & 6) == 6); // Is ymm saved?
} }
#endif // !defined(__native_client__)
#else #else
LIBYUV_API LIBYUV_API
void CpuId(uint32 eax, uint32 ecx, uint32* cpu_info) { void CpuId(uint32 eax, uint32 ecx, uint32* cpu_info) {
......
...@@ -216,15 +216,15 @@ static int ARGBClipTestFilter(int src_width, int src_height, ...@@ -216,15 +216,15 @@ static int ARGBClipTestFilter(int src_width, int src_height,
TEST_FACTOR1(name, Bilinear, hfactor, vfactor, 2) TEST_FACTOR1(name, Bilinear, hfactor, vfactor, 2)
// TODO(fbarchard): ScaleDownBy1 should be lossless, but Box has error of 2. // TODO(fbarchard): ScaleDownBy1 should be lossless, but Box has error of 2.
//TEST_FACTOR(1, 1 / 1, 1 / 1) // TEST_FACTOR(1, 1 / 1, 1 / 1)
TEST_FACTOR(2, 1 / 2, 1 / 2) TEST_FACTOR(2, 1 / 2, 1 / 2)
TEST_FACTOR(4, 1 / 4, 1 / 4) TEST_FACTOR(4, 1 / 4, 1 / 4)
//TEST_FACTOR(8, 1 / 8, 1 / 8) // TEST_FACTOR(8, 1 / 8, 1 / 8)
//TEST_FACTOR(16, 1 / 16, 1 / 16) // TEST_FACTOR(16, 1 / 16, 1 / 16)
//TEST_FACTOR(2by3, 2 / 3, 2 / 3) // TEST_FACTOR(2by3, 2 / 3, 2 / 3)
TEST_FACTOR(3by4, 3 / 4, 3 / 4) TEST_FACTOR(3by4, 3 / 4, 3 / 4)
//TEST_FACTOR(3by8, 3 / 8, 3 / 8) // TEST_FACTOR(3by8, 3 / 8, 3 / 8)
//TEST_FACTOR(Vertical2by3, 1, 2 / 3) // TEST_FACTOR(Vertical2by3, 1, 2 / 3)
#undef TEST_FACTOR1 #undef TEST_FACTOR1
#undef TEST_FACTOR #undef TEST_FACTOR
......
...@@ -149,15 +149,15 @@ static int TestFilter(int src_width, int src_height, ...@@ -149,15 +149,15 @@ static int TestFilter(int src_width, int src_height,
TEST_FACTOR1(name, Box, hfactor, vfactor, 2) \ TEST_FACTOR1(name, Box, hfactor, vfactor, 2) \
// TODO(fbarchard): ScaleDownBy1 should be lossless, but Box has error of 2. // TODO(fbarchard): ScaleDownBy1 should be lossless, but Box has error of 2.
//TEST_FACTOR(1, 1 / 1, 1 / 1) // TEST_FACTOR(1, 1 / 1, 1 / 1)
TEST_FACTOR(2, 1 / 2, 1 / 2) TEST_FACTOR(2, 1 / 2, 1 / 2)
TEST_FACTOR(4, 1 / 4, 1 / 4) TEST_FACTOR(4, 1 / 4, 1 / 4)
//TEST_FACTOR(8, 1 / 8, 1 / 8) // TEST_FACTOR(8, 1 / 8, 1 / 8)
//TEST_FACTOR(16, 1 / 16, 1 / 16) // TEST_FACTOR(16, 1 / 16, 1 / 16)
//TEST_FACTOR(2by3, 2 / 3, 2 / 3) // TEST_FACTOR(2by3, 2 / 3, 2 / 3)
TEST_FACTOR(3by4, 3 / 4, 3 / 4) TEST_FACTOR(3by4, 3 / 4, 3 / 4)
//TEST_FACTOR(3by8, 3 / 8, 3 / 8) // TEST_FACTOR(3by8, 3 / 8, 3 / 8)
//TEST_FACTOR(Vertical2by3, 1, 2 / 3) // TEST_FACTOR(Vertical2by3, 1, 2 / 3)
#undef TEST_FACTOR1 #undef TEST_FACTOR1
#undef TEST_FACTOR #undef TEST_FACTOR
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment