[x264-devel] commit: Fix build on x86 with asm on but SSE off (Jason Garrett-Glaser )

git at videolan.org git at videolan.org
Thu Apr 29 19:58:08 CEST 2010


x264 | branch: master | Jason Garrett-Glaser <darkshikari at gmail.com> | Sun Apr 25 14:54:29 2010 -0700| [bf49210db8acd958a3cb266d6ecb679d16901a1d] | committer: Jason Garrett-Glaser 

Fix build on x86 with asm on but SSE off

> http://git.videolan.org/gitweb.cgi/x264.git/?a=commit;h=bf49210db8acd958a3cb266d6ecb679d16901a1d
---

 common/x86/util.h |    4 ++++
 encoder/encoder.c |    6 ++++++
 2 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/common/x86/util.h b/common/x86/util.h
index 8fb1e84..e6a2505 100644
--- a/common/x86/util.h
+++ b/common/x86/util.h
@@ -26,7 +26,9 @@
 
 #ifdef __GNUC__
 
+#ifdef __SSE__
 #include <xmmintrin.h>
+#endif
 
 #define x264_median_mv x264_median_mv_mmxext
 static ALWAYS_INLINE void x264_median_mv_mmxext( int16_t *dst, int16_t *a, int16_t *b, int16_t *c )
@@ -144,10 +146,12 @@ static void ALWAYS_INLINE x264_predictor_roundclip_mmxext( int16_t (*mvc)[2], in
     );
 }
 
+#ifdef __SSE__
 #undef M128_ZERO
 #define M128_ZERO ((__m128){0,0,0,0})
 #define x264_union128_t x264_union128_sse_t
 typedef union { __m128 i; uint64_t a[2]; uint32_t b[4]; uint16_t c[8]; uint8_t d[16]; } MAY_ALIAS x264_union128_sse_t;
+#endif
 
 #endif
 
diff --git a/encoder/encoder.c b/encoder/encoder.c
index 244acfd..e046cb0 100644
--- a/encoder/encoder.c
+++ b/encoder/encoder.c
@@ -356,9 +356,15 @@ fail:
 static int x264_validate_parameters( x264_t *h )
 {
 #ifdef HAVE_MMX
+#ifdef __SSE__
     if( !(x264_cpu_detect() & X264_CPU_SSE) )
     {
         x264_log( h, X264_LOG_ERROR, "your cpu does not support SSE1, but x264 was compiled with asm support\n");
+#else
+    if( !(x264_cpu_detect() & X264_CPU_MMXEXT) )
+    {
+        x264_log( h, X264_LOG_ERROR, "your cpu does not support MMXEXT, but x264 was compiled with asm support\n");
+#endif
         x264_log( h, X264_LOG_ERROR, "to run x264, recompile without asm support (configure --disable-asm)\n");
         return -1;
     }



More information about the x264-devel mailing list