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

Unified Diff: media/base/yuv_convert.cc

Issue 12090114: 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: 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
« no previous file with comments | « media/base/yuv_convert.h ('k') | media/media.gyp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/base/yuv_convert.cc
===================================================================
--- media/base/yuv_convert.cc (revision 180095)
+++ media/base/yuv_convert.cc (working copy)
@@ -33,6 +33,21 @@
#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();
+} // extern "C"
+
namespace media {
static FilterYUVRowsProc ChooseFilterYUVRowsProc() {
@@ -40,9 +55,12 @@
base::CPU cpu;
if (cpu.has_sse2())
return &FilterYUVRows_SSE2;
+
+#if defined(MEDIA_MMX_INTRINSICS_AVAILABLE)
if (cpu.has_mmx())
return &FilterYUVRows_MMX;
-#endif
+#endif // defined(MEDIA_MMX_INTRINSICS_AVAILABLE)
+#endif // defined(ARCH_CPU_X86_FAMILY)
return &FilterYUVRows_C;
}
@@ -97,9 +115,16 @@
has_mmx = cpu.has_mmx();
checked = true;
}
- if (has_mmx)
+
+ if (has_mmx) {
+#if defined(MEDIA_MMX_INTRINSICS_AVAILABLE)
_mm_empty();
-#endif
+#else
+ EmptyRegisterState_MMX();
+#endif // defined(MEDIA_MMX_INTRINSICS_AVAILABLE)
+ }
+
+#endif // defined(ARCH_CPU_X86_FAMILY)
}
// 16.16 fixed point arithmetic
« no previous file with comments | « media/base/yuv_convert.h ('k') | media/media.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698