From bf49210db8acd958a3cb266d6ecb679d16901a1d Mon Sep 17 00:00:00 2001 From: Jason Garrett-Glaser Date: Sun, 25 Apr 2010 14:54:29 -0700 Subject: [PATCH] Fix build on x86 with asm on but SSE off --- common/x86/util.h | 4 ++++ encoder/encoder.c | 6 ++++++ 2 files changed, 10 insertions(+) diff --git a/common/x86/util.h b/common/x86/util.h index 8fb1e842..e6a25058 100644 --- a/common/x86/util.h +++ b/common/x86/util.h @@ -26,7 +26,9 @@ #ifdef __GNUC__ +#ifdef __SSE__ #include +#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 244acfde..e046cb0f 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; } -- 2.47.3