From adfa53b91f675e71d4b6049db91b357ed51fff12 Mon Sep 17 00:00:00 2001 From: Michael Niedermayer Date: Sun, 6 May 2012 12:59:59 +0200 Subject: [PATCH] swr-x86-SIMD: 3 instructions less for stereo planar->packed s32/flt->s16 Signed-off-by: Michael Niedermayer --- libswresample/x86/audio_convert.asm | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/libswresample/x86/audio_convert.asm b/libswresample/x86/audio_convert.asm index 0f2d503fb0..f72e4ff199 100644 --- a/libswresample/x86/audio_convert.asm +++ b/libswresample/x86/audio_convert.asm @@ -52,6 +52,7 @@ pack_2ch_%2_to_%1_u_int %+ SUFFIX neg lenq %7 .next: +%if %4 >= %5 mov%3 m0, [ srcq +(1<<%5)*lenq] mova m1, m0 mov%3 m2, [ src2q+(1<<%5)*lenq] @@ -61,15 +62,19 @@ pack_2ch_%2_to_%1_u_int %+ SUFFIX %else punpckldq m0, m2 punpckhdq m1, m2 -%endif -%if %4 < %5 - mov%3 m2, [mmsize + srcq +(1<<%5)*lenq] - mova m3, m2 - mov%3 m4, [mmsize + src2q+(1<<%5)*lenq] - punpckldq m2, m4 - punpckhdq m3, m4 %endif %6 +%else + mov%3 m0, [ srcq +(1<<%5)*lenq] + mov%3 m1, [mmsize + srcq +(1<<%5)*lenq] + mov%3 m2, [ src2q+(1<<%5)*lenq] + mov%3 m3, [mmsize + src2q+(1<<%5)*lenq] + %6 + mova m2, m0 + punpcklwd m0, m1 + punpckhwd m2, m1 + SWAP 1,2 +%endif mov%3 [ dstq+(2<<%4)*lenq], m0 mov%3 [ mmsize + dstq+(2<<%4)*lenq], m1 %if %4 > %5