diff options
author | wolenetz@chromium.org <wolenetz@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-02-07 19:09:39 +0000 |
---|---|---|
committer | wolenetz@chromium.org <wolenetz@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-02-07 19:09:39 +0000 |
commit | 27c6ab8eb676c36e7f0e1851737d7634378a313a (patch) | |
tree | 3a271dc307886714e5c8b31839387b2e53d8acc7 /media | |
parent | fa777a4150b17e16d77d8bf38525ac29169283b9 (diff) | |
download | chromium_src-27c6ab8eb676c36e7f0e1851737d7634378a313a.zip chromium_src-27c6ab8eb676c36e7f0e1851737d7634378a313a.tar.gz chromium_src-27c6ab8eb676c36e7f0e1851737d7634378a313a.tar.bz2 |
Lift MEDIA_MMX_INTRINSICS_AVAILABLE definition to header and use it to condition media_unittests
BUG=173697, 166496
TEST=With other build errors fixed in privates (fix win64 gmock_mutant template functor redefinitions & ignore C4267 size_t to int truncations), win64 media_unittests builds without link error to (shared library) media::FilterYUVRows_MMX
R=scherkus@chromium.org
Review URL: https://chromiumcodereview.appspot.com/12213029
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@181344 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'media')
-rw-r--r-- | media/base/yuv_convert.cc | 10 | ||||
-rw-r--r-- | media/base/yuv_convert.h | 10 | ||||
-rw-r--r-- | media/base/yuv_convert_unittest.cc | 4 |
3 files changed, 14 insertions, 10 deletions
diff --git a/media/base/yuv_convert.cc b/media/base/yuv_convert.cc index f32c1d2..85b0699 100644 --- a/media/base/yuv_convert.cc +++ b/media/base/yuv_convert.cc @@ -33,16 +33,6 @@ #endif #endif -// Visual Studio 2010 does not support MMX intrinsics on x64. -// Some win64 yuv_convert code paths use SSE+MMX yasm, so without rewriting -// them, we use yasm EmptyRegisterState_MMX in place of _mm_empty() or -// hide the versions implemented with heavy use of MMX intrinsics. -// TODO(wolenetz): Use MMX intrinsics when compiling win64 with Visual -// Studio 2012? http://crbug.com/173450 -#if !(defined(ARCH_CPU_X86_64) && defined(COMPILER_MSVC)) -#define MEDIA_MMX_INTRINSICS_AVAILABLE -#endif - // Assembly functions are declared without namespace. extern "C" { void EmptyRegisterState_MMX(); diff --git a/media/base/yuv_convert.h b/media/base/yuv_convert.h index 719e6a3..30c07ab 100644 --- a/media/base/yuv_convert.h +++ b/media/base/yuv_convert.h @@ -7,6 +7,16 @@ #include "base/basictypes.h" +// Visual Studio 2010 does not support MMX intrinsics on x64. +// Some win64 yuv_convert code paths use SSE+MMX yasm, so without rewriting +// them, we use yasm EmptyRegisterState_MMX in place of _mm_empty() or +// hide the versions implemented with heavy use of MMX intrinsics. +// TODO(wolenetz): Use MMX intrinsics when compiling win64 with Visual +// Studio 2012? http://crbug.com/173450 +#if !(defined(ARCH_CPU_X86_64) && defined(COMPILER_MSVC)) +#define MEDIA_MMX_INTRINSICS_AVAILABLE +#endif + namespace media { // Type of YUV surface. diff --git a/media/base/yuv_convert_unittest.cc b/media/base/yuv_convert_unittest.cc index c57f715..c2647e7 100644 --- a/media/base/yuv_convert_unittest.cc +++ b/media/base/yuv_convert_unittest.cc @@ -775,6 +775,7 @@ TEST(YUVConvertTest, FilterYUVRows_C_OutOfBounds) { } } +#if defined(MEDIA_MMX_INTRINSICS_AVAILABLE) TEST(YUVConvertTest, FilterYUVRows_MMX_OutOfBounds) { base::CPU cpu; if (!cpu.has_mmx()) { @@ -796,6 +797,7 @@ TEST(YUVConvertTest, FilterYUVRows_MMX_OutOfBounds) { EXPECT_EQ(0u, dst[i]); } } +#endif // defined(MEDIA_MMX_INTRINSICS_AVAILABLE) TEST(YUVConvertTest, FilterYUVRows_SSE2_OutOfBounds) { base::CPU cpu; @@ -818,6 +820,7 @@ TEST(YUVConvertTest, FilterYUVRows_SSE2_OutOfBounds) { } } +#if defined(MEDIA_MMX_INTRINSICS_AVAILABLE) TEST(YUVConvertTest, FilterYUVRows_MMX_UnalignedDestination) { base::CPU cpu; if (!cpu.has_mmx()) { @@ -847,6 +850,7 @@ TEST(YUVConvertTest, FilterYUVRows_MMX_UnalignedDestination) { EXPECT_EQ(0, memcmp(dst_sample.get(), dst_ptr, 17)); } +#endif // defined(MEDIA_MMX_INTRINSICS_AVAILABLE) TEST(YUVConvertTest, FilterYUVRows_SSE2_UnalignedDestination) { base::CPU cpu; |