From: Loren Merritt Date: Wed, 14 Mar 2007 22:41:50 +0000 (+0000) Subject: conflate HAVE_MMXEXT with HAVE_SSE2, since they were never used distinctly. X-Git-Url: http://www.zmx.ovh/git.videolan.org/?a=commitdiff_plain;h=8b37cc6aa5e23bf4a529b79745f73dedab1fa4ff;p=x264.git conflate HAVE_MMXEXT with HAVE_SSE2, since they were never used distinctly. git-svn-id: svn://svn.videolan.org/x264/trunk@634 df754926-b1dd-0310-bc7b-ec298dee348c --- diff --git a/build/win32/libx264.dsp b/build/win32/libx264.dsp index bfb87153..4885b48e 100644 --- a/build/win32/libx264.dsp +++ b/build/win32/libx264.dsp @@ -41,7 +41,7 @@ RSC=rc.exe # PROP Intermediate_Dir "Release" # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c -# ADD CPP /nologo /G6 /W3 /GX /O2 /Ob2 /I "./common" /I "./encode" /I "./decode" /I "../../extras" /I "../.." /D "NDEBUG" /D "_LIB" /D "WIN32" /D "_MBCS" /D "__X264__" /D "HAVE_MMXEXT" /D "HAVE_SSE2" /D "ARCH_X86" /D "HAVE_STDINT_H" /FD /c +# ADD CPP /nologo /G6 /W3 /GX /O2 /Ob2 /I "./common" /I "./encode" /I "./decode" /I "../../extras" /I "../.." /D "NDEBUG" /D "_LIB" /D "WIN32" /D "_MBCS" /D "__X264__" /D "HAVE_MMX" /D "ARCH_X86" /D "HAVE_STDINT_H" /FD /c # SUBTRACT CPP /YX # ADD BASE RSC /l 0x804 /d "NDEBUG" # ADD RSC /l 0x804 /d "NDEBUG" @@ -65,7 +65,7 @@ LIB32=link.exe -lib # PROP Intermediate_Dir "Debug" # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c -# ADD CPP /nologo /W3 /Gm /GX /Zi /Od /I "./common" /I "./encode" /I "./decode" /I "../../extras" /I "../.." /D "_DEBUG" /D "_LIB" /D "WIN32" /D "_MBCS" /D "__X264__" /D "HAVE_MMXEXT" /D "HAVE_SSE2" /D "ARCH_X86" /D "HAVE_STDINT_H" /FD /GZ /c +# ADD CPP /nologo /W3 /Gm /GX /Zi /Od /I "./common" /I "./encode" /I "./decode" /I "../../extras" /I "../.." /D "_DEBUG" /D "_LIB" /D "WIN32" /D "_MBCS" /D "__X264__" /D "HAVE_MMX" /D "ARCH_X86" /D "HAVE_STDINT_H" /FD /GZ /c # SUBTRACT CPP /YX # ADD BASE RSC /l 0x804 /d "_DEBUG" # ADD RSC /l 0x804 /d "_DEBUG" diff --git a/build/win32/libx264.vcproj b/build/win32/libx264.vcproj index 21d33059..dd57e52c 100644 --- a/build/win32/libx264.vcproj +++ b/build/win32/libx264.vcproj @@ -25,7 +25,7 @@ InlineFunctionExpansion="2" OptimizeForProcessor="2" AdditionalIncludeDirectories="./common,./encode,./decode,../../extras,../.." - PreprocessorDefinitions="NDEBUG;_LIB;WIN32;__X264__;HAVE_MMXEXT;ARCH_X86;HAVE_STDINT_H;HAVE_SSE2" + PreprocessorDefinitions="NDEBUG;_LIB;WIN32;__X264__;HAVE_MMX;ARCH_X86;HAVE_STDINT_H" StringPooling="TRUE" RuntimeLibrary="4" EnableFunctionLevelLinking="TRUE" @@ -75,7 +75,7 @@ Name="VCCLCompilerTool" Optimization="0" AdditionalIncludeDirectories="./common,./encode,./decode,../../extras,../.." - PreprocessorDefinitions="_DEBUG;_LIB;WIN32;__X264__;HAVE_MMXEXT;ARCH_X86;HAVE_STDINT_H;HAVE_SSE2" + PreprocessorDefinitions="_DEBUG;_LIB;WIN32;__X264__;HAVE_MMX;ARCH_X86;HAVE_STDINT_H" BasicRuntimeChecks="3" RuntimeLibrary="5" PrecompiledHeaderFile=".\Debug/libx264.pch" @@ -127,7 +127,7 @@ InlineFunctionExpansion="2" OptimizeForProcessor="2" AdditionalIncludeDirectories="./common,./encode,./decode,../../extras,../.." - PreprocessorDefinitions="NDEBUG;_LIB;WIN32;__X264__;HAVE_MMXEXT;ARCH_X86;HAVE_STDINT_H" + PreprocessorDefinitions="NDEBUG;_LIB;WIN32;__X264__;HAVE_MMX;ARCH_X86;HAVE_STDINT_H" StringPooling="TRUE" RuntimeLibrary="4" EnableFunctionLevelLinking="TRUE" diff --git a/build/win32/x264.dsp b/build/win32/x264.dsp index b524663b..22acf02d 100644 --- a/build/win32/x264.dsp +++ b/build/win32/x264.dsp @@ -42,7 +42,7 @@ RSC=rc.exe # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c -# ADD CPP /nologo /W3 /GX /O2 /I "./common" /I "./encode" /I "./decode" /I "../../extras" /I "../.." /D "NDEBUG" /D "_CONSOLE" /D "WIN32" /D "_MBCS" /D "__X264__" /D "HAVE_MMXEXT" /D "HAVE_SSE2" /D "HAVE_STDINT_H" /YX /FD /c +# ADD CPP /nologo /W3 /GX /O2 /I "./common" /I "./encode" /I "./decode" /I "../../extras" /I "../.." /D "NDEBUG" /D "_CONSOLE" /D "WIN32" /D "_MBCS" /D "__X264__" /D "HAVE_MMX" /D "HAVE_STDINT_H" /YX /FD /c # ADD BASE RSC /l 0x804 /d "NDEBUG" # ADD RSC /l 0x804 /d "NDEBUG" BSC32=bscmake.exe @@ -66,7 +66,7 @@ LINK32=link.exe # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c -# ADD CPP /nologo /W3 /Gm /GX /Zi /Od /I "../../common" /I "../../encode" /I "../../decode" /I "../../extras" /I "../.." /D "_DEBUG" /D "_CONSOLE" /D "WIN32" /D "_MBCS" /D "__X264__" /D "HAVE_MMXEXT" /D "HAVE_SSE2" /D "HAVE_STDINT_H" /YX /FD /GZ /c +# ADD CPP /nologo /W3 /Gm /GX /Zi /Od /I "../../common" /I "../../encode" /I "../../decode" /I "../../extras" /I "../.." /D "_DEBUG" /D "_CONSOLE" /D "WIN32" /D "_MBCS" /D "__X264__" /D "HAVE_MMX" /D "HAVE_STDINT_H" /YX /FD /GZ /c # ADD BASE RSC /l 0x804 /d "_DEBUG" # ADD RSC /l 0x804 /d "_DEBUG" BSC32=bscmake.exe diff --git a/build/win32/x264.vcproj b/build/win32/x264.vcproj index 517c7db7..78cbdae7 100644 --- a/build/win32/x264.vcproj +++ b/build/win32/x264.vcproj @@ -23,7 +23,7 @@ Name="VCCLCompilerTool" Optimization="0" AdditionalIncludeDirectories="../../common;../../encode;../../decode;../../extras;../..;L:\gpac\include" - PreprocessorDefinitions="_DEBUG;_CONSOLE;WIN32;__X264__;HAVE_MMXEXT;HAVE_STDINT_H;AVIS_INPUT" + PreprocessorDefinitions="_DEBUG;_CONSOLE;WIN32;__X264__;HAVE_MMX;HAVE_STDINT_H;AVIS_INPUT" BasicRuntimeChecks="3" RuntimeLibrary="5" UsePrecompiledHeader="2" @@ -85,7 +85,7 @@ Optimization="2" InlineFunctionExpansion="1" AdditionalIncludeDirectories="./common;./encode;./decode;../../extras;../..;L:\gpac\include" - PreprocessorDefinitions="NDEBUG;_CONSOLE;WIN32;__X264__;HAVE_MMXEXT;HAVE_STDINT_H;AVIS_INPUT" + PreprocessorDefinitions="NDEBUG;_CONSOLE;WIN32;__X264__;HAVE_MMX;HAVE_STDINT_H;AVIS_INPUT" StringPooling="TRUE" RuntimeLibrary="0" EnableFunctionLevelLinking="TRUE" @@ -146,7 +146,7 @@ Optimization="2" InlineFunctionExpansion="1" AdditionalIncludeDirectories="./common;./encode;./decode;../../extras;../..;..\..\..\gpac\include" - PreprocessorDefinitions="NDEBUG;_CONSOLE;WIN32;__X264__;HAVE_MMXEXT;HAVE_STDINT_H;AVIS_INPUT;MP4_OUTPUT" + PreprocessorDefinitions="NDEBUG;_CONSOLE;WIN32;__X264__;HAVE_MMX;HAVE_STDINT_H;AVIS_INPUT;MP4_OUTPUT" StringPooling="TRUE" RuntimeLibrary="0" EnableFunctionLevelLinking="TRUE" diff --git a/common/cpu.c b/common/cpu.c index 32c7cd3b..62235c3a 100644 --- a/common/cpu.c +++ b/common/cpu.c @@ -49,6 +49,9 @@ uint32_t x264_cpu_detect( void ) uint32_t eax, ebx, ecx, edx; int b_amd; +#ifndef HAVE_MMX + return 0; +#endif if( !x264_cpu_cpuid_test() ) { diff --git a/common/dct.c b/common/dct.c index e67b2c60..15bcfd04 100644 --- a/common/dct.c +++ b/common/dct.c @@ -22,7 +22,7 @@ *****************************************************************************/ #include "common.h" -#ifdef HAVE_MMXEXT +#ifdef HAVE_MMX # include "i386/dct.h" #endif #ifdef ARCH_PPC @@ -398,7 +398,7 @@ void x264_dct_init( int cpu, x264_dct_function_t *dctf ) dctf->dct2x2dc = dct2x2dc; dctf->idct2x2dc = dct2x2dc; -#ifdef HAVE_MMXEXT +#ifdef HAVE_MMX if( cpu&X264_CPU_MMX ) { dctf->sub4x4_dct = x264_sub4x4_dct_mmx; @@ -420,9 +420,8 @@ void x264_dct_init( int cpu, x264_dct_function_t *dctf ) dctf->add16x16_idct8= x264_add16x16_idct8_mmx; #endif } -#endif -#if defined(HAVE_SSE2) && defined(ARCH_X86_64) +#ifdef ARCH_X86_64 if( cpu&X264_CPU_SSE2 ) { dctf->sub8x8_dct8 = x264_sub8x8_dct8_sse2; @@ -432,6 +431,7 @@ void x264_dct_init( int cpu, x264_dct_function_t *dctf ) dctf->add16x16_idct8= x264_add16x16_idct8_sse2; } #endif +#endif //HAVE_MMX #ifdef ARCH_PPC if( cpu&X264_CPU_ALTIVEC ) @@ -588,13 +588,15 @@ void x264_zigzag_init( int cpu, x264_zigzag_function_t *pf, int b_interlaced ) pf->scan_4x4ac = zigzag_scan_4x4ac_field; pf->sub_4x4 = zigzag_sub_4x4_field; pf->sub_4x4ac = zigzag_sub_4x4ac_field; -#if defined(HAVE_MMXEXT) && defined(ARCH_X86) +#ifdef HAVE_MMX +#ifdef ARCH_X86 if( cpu&X264_CPU_MMX ) pf->scan_4x4 = x264_zigzag_scan_4x4_field_mmx; #endif -#if defined(HAVE_SSE2) && defined(ARCH_X86_64) +#ifdef ARCH_X86_64 if( cpu&X264_CPU_SSE2 ) pf->scan_4x4 = x264_zigzag_scan_4x4_field_sse2; +#endif #endif } else diff --git a/common/frame.c b/common/frame.c index 57dfbd78..04c0fd6d 100644 --- a/common/frame.c +++ b/common/frame.c @@ -703,7 +703,7 @@ void x264_frame_deblock( x264_t *h ) x264_frame_deblock_row( h, mb_y ); } -#ifdef HAVE_MMXEXT +#ifdef HAVE_MMX void x264_deblock_v_chroma_mmxext( uint8_t *pix, int stride, int alpha, int beta, int8_t *tc0 ); void x264_deblock_h_chroma_mmxext( uint8_t *pix, int stride, int alpha, int beta, int8_t *tc0 ); void x264_deblock_v_chroma_intra_mmxext( uint8_t *pix, int stride, int alpha, int beta ); @@ -735,7 +735,7 @@ void x264_deblock_init( int cpu, x264_deblock_function_t *pf ) pf->deblock_v_chroma_intra = deblock_v_chroma_intra_c; pf->deblock_h_chroma_intra = deblock_h_chroma_intra_c; -#ifdef HAVE_MMXEXT +#ifdef HAVE_MMX if( cpu&X264_CPU_MMXEXT ) { pf->deblock_v_chroma = x264_deblock_v_chroma_mmxext; diff --git a/common/mc.c b/common/mc.c index 6944281c..5227ecae 100644 --- a/common/mc.c +++ b/common/mc.c @@ -27,7 +27,7 @@ #include "common.h" #include "clip1.h" -#ifdef HAVE_MMXEXT +#ifdef HAVE_MMX #include "i386/mc.h" #endif #ifdef ARCH_PPC @@ -371,13 +371,11 @@ void x264_mc_init( int cpu, x264_mc_functions_t *pf ) pf->prefetch_fenc = prefetch_fenc_null; pf->prefetch_ref = prefetch_ref_null; -#ifdef HAVE_MMXEXT +#ifdef HAVE_MMX if( cpu&X264_CPU_MMXEXT ) { x264_mc_mmxext_init( pf ); pf->mc_chroma = x264_mc_chroma_mmxext; } -#endif -#ifdef HAVE_SSE2 if( cpu&X264_CPU_SSE2 ) x264_mc_sse2_init( pf ); #endif @@ -402,7 +400,7 @@ void x264_frame_filter( int cpu, x264_frame_t *frame, int b_interlaced, int mb_y return; mb_y >>= b_interlaced; -#ifdef HAVE_MMXEXT +#ifdef HAVE_MMX if ( cpu & X264_CPU_MMXEXT ) { // buffer = 4 for deblock + 3 for 6tap, rounded to 8 diff --git a/common/pixel.c b/common/pixel.c index 51c52c05..e4d813a6 100644 --- a/common/pixel.c +++ b/common/pixel.c @@ -26,7 +26,7 @@ #include "common.h" #include "clip1.h" -#ifdef HAVE_MMXEXT +#ifdef HAVE_MMX # include "i386/pixel.h" #endif #ifdef ARCH_PPC @@ -470,7 +470,7 @@ void x264_pixel_init( int cpu, x264_pixel_function_t *pixf ) pixf->ads[PIXEL_16x8] = pixel_ads2; pixf->ads[PIXEL_8x8] = pixel_ads1; -#ifdef HAVE_MMXEXT +#ifdef HAVE_MMX if( cpu&X264_CPU_MMX ) { INIT( ssd, _mmx ); @@ -501,9 +501,7 @@ void x264_pixel_init( int cpu, x264_pixel_function_t *pixf ) pixf->intra_satd_x3_8x8c = x264_intra_satd_x3_8x8c_mmxext; pixf->intra_satd_x3_4x4 = x264_intra_satd_x3_4x4_mmxext; } -#endif -#ifdef HAVE_SSE2 // disable on AMD processors since it is slower if( (cpu&X264_CPU_SSE2) && !(cpu&X264_CPU_3DNOW) ) { @@ -551,7 +549,7 @@ void x264_pixel_init( int cpu, x264_pixel_function_t *pixf ) pixf->sa8d[PIXEL_8x8] = x264_pixel_sa8d_8x8_ssse3; #endif } -#endif +#endif //HAVE_MMX #ifdef ARCH_PPC if( cpu&X264_CPU_ALTIVEC ) diff --git a/common/predict.c b/common/predict.c index a5e99553..870508c4 100644 --- a/common/predict.c +++ b/common/predict.c @@ -29,9 +29,9 @@ #include "clip1.h" #ifdef _MSC_VER -#undef HAVE_MMXEXT /* not finished now */ +#undef HAVE_MMX /* not finished now */ #endif -#ifdef HAVE_MMXEXT +#ifdef HAVE_MMX # include "i386/predict.h" #endif @@ -843,7 +843,7 @@ void x264_predict_16x16_init( int cpu, x264_predict_t pf[7] ) pf[I_PRED_16x16_DC_TOP ]= predict_16x16_dc_top; pf[I_PRED_16x16_DC_128 ]= predict_16x16_dc_128; -#ifdef HAVE_MMXEXT +#ifdef HAVE_MMX if( cpu&X264_CPU_MMXEXT ) { x264_predict_16x16_init_mmxext( pf ); @@ -861,7 +861,7 @@ void x264_predict_8x8c_init( int cpu, x264_predict_t pf[7] ) pf[I_PRED_CHROMA_DC_TOP ]= predict_8x8c_dc_top; pf[I_PRED_CHROMA_DC_128 ]= predict_8x8c_dc_128; -#ifdef HAVE_MMXEXT +#ifdef HAVE_MMX if( cpu&X264_CPU_MMXEXT ) { x264_predict_8x8c_init_mmxext( pf ); @@ -884,13 +884,11 @@ void x264_predict_8x8_init( int cpu, x264_predict8x8_t pf[12] ) pf[I_PRED_8x8_DC_TOP] = predict_8x8_dc_top; pf[I_PRED_8x8_DC_128] = predict_8x8_dc_128; -#ifdef HAVE_MMXEXT +#ifdef HAVE_MMX if( cpu&X264_CPU_MMXEXT ) { x264_predict_8x8_init_mmxext( pf ); } -#endif -#ifdef HAVE_SSE2 if( cpu&X264_CPU_SSE2 ) { x264_predict_8x8_init_sse2( pf ); @@ -913,7 +911,7 @@ void x264_predict_4x4_init( int cpu, x264_predict_t pf[12] ) pf[I_PRED_4x4_DC_TOP] = predict_4x4_dc_top; pf[I_PRED_4x4_DC_128] = predict_4x4_dc_128; -#ifdef HAVE_MMXEXT +#ifdef HAVE_MMX if( cpu&X264_CPU_MMXEXT ) { x264_predict_4x4_init_mmxext( pf ); diff --git a/common/quant.c b/common/quant.c index ad25824c..9d0ffee4 100644 --- a/common/quant.c +++ b/common/quant.c @@ -22,7 +22,7 @@ #include "common.h" -#ifdef HAVE_MMXEXT +#ifdef HAVE_MMX #include "i386/quant.h" #endif #ifdef ARCH_PPC @@ -226,7 +226,7 @@ void x264_quant_init( x264_t *h, int cpu, x264_quant_function_t *pf ) maxQdc = q; } -#ifdef HAVE_MMXEXT +#ifdef HAVE_MMX /* select quant_8x8 based on CPU and maxQ8 */ #if defined(ARCH_X86_64) && defined(HAVE_SSE3) @@ -290,7 +290,7 @@ void x264_quant_init( x264_t *h, int cpu, x264_quant_function_t *pf ) pf->dequant_4x4 = x264_dequant_4x4_mmx; pf->dequant_8x8 = x264_dequant_8x8_mmx; } -#endif /* HAVE_MMXEXT */ +#endif /* HAVE_MMX */ #ifdef ARCH_PPC if( cpu&X264_CPU_ALTIVEC ) { diff --git a/configure b/configure index e594db50..b7152be5 100755 --- a/configure +++ b/configure @@ -147,7 +147,7 @@ esac case "${MACHINE%%-*}" in i*86) ARCH="X86" - CFLAGS="$CFLAGS -DHAVE_MMXEXT -DHAVE_SSE2" + CFLAGS="$CFLAGS -DHAVE_MMX" AS="nasm" ASFLAGS="-O2" if [ "$SYS" = MACOSX ]; then @@ -162,7 +162,7 @@ case "${MACHINE%%-*}" in ;; x86_64) ARCH="X86_64" - CFLAGS="$CFLAGS -DHAVE_MMXEXT -DHAVE_SSE2" + CFLAGS="$CFLAGS -DHAVE_MMX" AS="yasm" ASFLAGS="-f elf -m amd64" ;; diff --git a/tools/checkasm.c b/tools/checkasm.c index 396f8b58..3152a5af 100644 --- a/tools/checkasm.c +++ b/tools/checkasm.c @@ -5,7 +5,7 @@ #include "common/common.h" #include "common/cpu.h" -#ifdef HAVE_MMXEXT +#ifdef HAVE_MMX #include "common/i386/pixel.h" #include "common/i386/dct.h" #include "common/i386/mc.h" @@ -758,11 +758,11 @@ int main(int argc, char *argv[]) buf3[i] = buf4[i] = 0; } -#ifdef HAVE_MMXEXT +#ifdef HAVE_MMX fprintf( stderr, "x264: MMXEXT against C\n" ); cpu1 = X264_CPU_MMX | X264_CPU_MMXEXT; ret = check_all( 0, cpu1 ); -#ifdef HAVE_SSE2 + if( x264_cpu_detect() & X264_CPU_SSE2 ) { fprintf( stderr, "\nx264: SSE2 against C\n" ); @@ -778,7 +778,6 @@ int main(int argc, char *argv[]) ret |= check_all( cpu0, cpu1 ); } } -#endif #elif ARCH_PPC if( x264_cpu_detect() & X264_CPU_ALTIVEC ) {