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

index 8fb1e84266f3024ddfd44e39ed5fd070d66f7779..e6a250585b9adc80b17be1cdcb793d3ae45b30b1 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 244acfde420ef6290053f01f0872c7c67d10cd34..e046cb0f2df36b1db6f904df2b565750d5cd4580 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;
     }