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
URL: http://code.google.com/p/libyuv/
Version: 821
Version: 822
License: BSD
License File: LICENSE
......
......@@ -11,6 +11,6 @@
#ifndef INCLUDE_LIBYUV_VERSION_H_ // NOLINT
#define INCLUDE_LIBYUV_VERSION_H_
#define LIBYUV_VERSION 821
#define LIBYUV_VERSION 822
#endif // INCLUDE_LIBYUV_VERSION_H_ NOLINT
......@@ -54,20 +54,25 @@ void CpuId(uint32 eax, uint32 ecx, uint32* cpu_info) {
: "+b" (ebx),
#endif // defined( __i386__) && defined(__PIC__)
"+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)
}
#if !defined(__native_client__)
#define HAS_XGETBV
// X86 CPUs have xgetbv to detect OS saves high parts of ymm registers.
int TestOsSaveYmm() {
uint32 xcr0;
#if defined(_MSC_VER)
xcr0 = (uint32)_xgetbv(0); /* min VS2010 SP1 compiler is required */
xcr0 = static_cast<uint32>(_xgetbv(0)); // VS2010 SP1 required.
#else
asm volatile ("xgetbv" : "=a" (xcr0) : "c" (0) : "%edx" ); // NOLINT
#endif // defined(_MSC_VER)
return((xcr0 & 6) == 6); // Is ymm saved?
}
#endif // !defined(__native_client__)
#else
LIBYUV_API
void CpuId(uint32 eax, uint32 ecx, uint32* cpu_info) {
......
......@@ -216,15 +216,15 @@ static int ARGBClipTestFilter(int src_width, int src_height,
TEST_FACTOR1(name, Bilinear, hfactor, vfactor, 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(4, 1 / 4, 1 / 4)
//TEST_FACTOR(8, 1 / 8, 1 / 8)
//TEST_FACTOR(16, 1 / 16, 1 / 16)
//TEST_FACTOR(2by3, 2 / 3, 2 / 3)
// TEST_FACTOR(8, 1 / 8, 1 / 8)
// TEST_FACTOR(16, 1 / 16, 1 / 16)
// TEST_FACTOR(2by3, 2 / 3, 2 / 3)
TEST_FACTOR(3by4, 3 / 4, 3 / 4)
//TEST_FACTOR(3by8, 3 / 8, 3 / 8)
//TEST_FACTOR(Vertical2by3, 1, 2 / 3)
// TEST_FACTOR(3by8, 3 / 8, 3 / 8)
// TEST_FACTOR(Vertical2by3, 1, 2 / 3)
#undef TEST_FACTOR1
#undef TEST_FACTOR
......
......@@ -149,26 +149,26 @@ static int TestFilter(int src_width, int src_height,
TEST_FACTOR1(name, Box, hfactor, vfactor, 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(4, 1 / 4, 1 / 4)
//TEST_FACTOR(8, 1 / 8, 1 / 8)
//TEST_FACTOR(16, 1 / 16, 1 / 16)
//TEST_FACTOR(2by3, 2 / 3, 2 / 3)
// TEST_FACTOR(8, 1 / 8, 1 / 8)
// TEST_FACTOR(16, 1 / 16, 1 / 16)
// TEST_FACTOR(2by3, 2 / 3, 2 / 3)
TEST_FACTOR(3by4, 3 / 4, 3 / 4)
//TEST_FACTOR(3by8, 3 / 8, 3 / 8)
//TEST_FACTOR(Vertical2by3, 1, 2 / 3)
// TEST_FACTOR(3by8, 3 / 8, 3 / 8)
// TEST_FACTOR(Vertical2by3, 1, 2 / 3)
#undef TEST_FACTOR1
#undef TEST_FACTOR
#define TEST_SCALETO1(name, width, height, filter, max_diff) \
TEST_F(libyuvTest, name##To##width##x##height##_##filter) { \
TEST_F(libyuvTest, name##To##width##x##height##_##filter) { \
int diff = TestFilter(benchmark_width_, benchmark_height_, \
width, height, \
kFilter##filter, benchmark_iterations_); \
EXPECT_LE(diff, max_diff); \
} \
TEST_F(libyuvTest, name##From##width##x##height##_##filter) { \
TEST_F(libyuvTest, name##From##width##x##height##_##filter) { \
int diff = TestFilter(width, height, \
Abs(benchmark_width_), Abs(benchmark_height_), \
kFilter##filter, benchmark_iterations_); \
......
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