]> git.sesse.net Git - x264/commitdiff
Fix build on x86 with asm on but SSE off
authorFiona Glaser <fiona@x264.com>
Sun, 25 Apr 2010 21:54:29 +0000 (14:54 -0700)
committerFiona Glaser <fiona@x264.com>
Mon, 26 Apr 2010 22:11:33 +0000 (15:11 -0700)
common/x86/util.h
encoder/encoder.c

index 2250a3dc7c8c989159be33cf82e8882388432a6e..3721fab69eb70a556d8840d6fffdbdbfcaa4e4b1 100644 (file)
@@ -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
 
index e59e48b6815d077d458dcbbfd4675f2497b81d3b..79f655462786669db9ffec43e41b49a57225e0f2 100644 (file)
@@ -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;
     }