From b4be6e56629cf8fdcf53adc6b879969d8f6760b3 Mon Sep 17 00:00:00 2001 From: Henrik Gramner Date: Fri, 3 May 2013 23:06:10 +0200 Subject: [PATCH] x86: Don't use explicitly aligned versions of SAD on AVX CPUs On modern CPUs movdqu isn't slower than movdqa when used on aligned data and using the same code in both cases saves cache. This was already done for the high bit-depth AVX2 implementation but the aligned version still exists as dead code so remove that. --- common/pixel.c | 2 ++ common/x86/pixel.h | 1 - common/x86/sad16-a.asm | 3 --- 3 files changed, 2 insertions(+), 4 deletions(-) diff --git a/common/pixel.c b/common/pixel.c index 145fac79..2b323cb4 100644 --- a/common/pixel.c +++ b/common/pixel.c @@ -966,6 +966,7 @@ void x264_pixel_init( int cpu, x264_pixel_function_t *pixf ) } if( cpu&X264_CPU_AVX ) { + INIT5_NAME( sad_aligned, sad, _ssse3 ); /* AVX-capable CPUs doesn't benefit from an aligned version */ INIT_ADS( _avx ); INIT6( satd, _avx ); pixf->satd[PIXEL_4x16] = x264_pixel_satd_4x16_avx; @@ -1234,6 +1235,7 @@ void x264_pixel_init( int cpu, x264_pixel_function_t *pixf ) if( cpu&X264_CPU_AVX ) { + INIT2_NAME( sad_aligned, sad, _sse2 ); /* AVX-capable CPUs doesn't benefit from an aligned version */ INIT8( satd, _avx ); INIT7( satd_x3, _avx ); INIT7( satd_x4, _avx ); diff --git a/common/x86/pixel.h b/common/x86/pixel.h index bddf528d..555c4ece 100644 --- a/common/x86/pixel.h +++ b/common/x86/pixel.h @@ -53,7 +53,6 @@ DECL_X1( sad, sse2_aligned ) DECL_X1( sad, ssse3 ) DECL_X1( sad, ssse3_aligned ) DECL_X1( sad, avx2 ) -DECL_X1( sad, avx2_aligned ) DECL_X4( sad, mmx2 ) DECL_X4( sad, sse2 ) DECL_X4( sad, sse3 ) diff --git a/common/x86/sad16-a.asm b/common/x86/sad16-a.asm index 8c48723a..7606da38 100644 --- a/common/x86/sad16-a.asm +++ b/common/x86/sad16-a.asm @@ -205,9 +205,6 @@ SAD 8, 8 INIT_YMM avx2 SAD 16, 16 SAD 16, 8 -INIT_YMM avx2, aligned -SAD 16, 16 -SAD 16, 8 ;============================================================================= ; SAD x3/x4 -- 2.47.3