Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(673)

Unified Diff: media/base/yuv_convert.cc

Issue 12082087: Replace or exclude MMX intrinsics in yuv_convert_simd_x86 due to lack of VS2010 support for them in… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix some lint errors Created 7 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: media/base/yuv_convert.cc
diff --git a/media/base/yuv_convert.cc b/media/base/yuv_convert.cc
index 7aa16cc063a630833378c557bf0b05bdf8130b97..9de1dd210677d4a2faddba32354aa43acbf277ea 100644
--- a/media/base/yuv_convert.cc
+++ b/media/base/yuv_convert.cc
@@ -23,6 +23,9 @@
#include "build/build_config.h"
#include "media/base/simd/convert_rgb_to_yuv.h"
#include "media/base/simd/convert_yuv_to_rgb.h"
+#if defined(ARCH_CPU_X86_FAMILY)
Alpha Left Google 2013/01/31 19:43:15 No need to do ifdef, it's just a header file.
wolenetz 2013/01/31 22:13:45 Done.
+#include "media/base/simd/empty_register_state.h"
+#endif
#include "media/base/simd/filter_yuv.h"
#if defined(ARCH_CPU_X86_FAMILY)
@@ -40,9 +43,15 @@ static FilterYUVRowsProc ChooseFilterYUVRowsProc() {
base::CPU cpu;
if (cpu.has_sse2())
return &FilterYUVRows_SSE2;
+
+ // Visual Studio 2010 does not support the needed MMX intrinsics on x64.
+ // SSE2 is faster and guaranteed to exist in x64, so exclude the MMX
+ // version in Win64.
+#if !(defined(ARCH_CPU_X86_64) && defined(COMPILER_MSVC))
Alpha Left Google 2013/01/31 19:43:15 I suggest you move this block to yuv_convert.h and
wolenetz 2013/01/31 22:13:45 Done.
if (cpu.has_mmx())
return &FilterYUVRows_MMX;
-#endif
+#endif // !(defined(ARCH_CPU_X86_64) && defined(COMPILER_MSVC))
+#endif // defined(ARCH_CPU_X86_FAMILY)
return &FilterYUVRows_C;
}
@@ -97,8 +106,11 @@ void EmptyRegisterState() {
has_mmx = cpu.has_mmx();
checked = true;
}
+
+ // Visual Studio 2010 does not support _mm_empty() intrinsic on x64,
+ // so unifying on yasm emms.
if (has_mmx)
- _mm_empty();
+ EmptyRegisterState_MMX();
Alpha Left Google 2013/01/31 19:43:15 Use the MEDIA_DO_NOT_USE_MMX_INTRINSICS macro.
wolenetz 2013/01/31 22:13:45 Done.
#endif
}

Powered by Google App Engine
This is Rietveld 408576698