diff options
author | Ramiro Polla <ramiro.polla@gmail.com> | 2010-10-31 23:36:26 +0000 |
---|---|---|
committer | Ramiro Polla <ramiro.polla@gmail.com> | 2010-10-31 23:36:26 +0000 |
commit | e5d5407e263228349597f44ab06fa0d362867f84 (patch) | |
tree | a224cd9c1f4d2530e05872ad60a400ceb2e918f7 /libavcodec | |
parent | 2839dc974d8cf4155b0a8ddd8983f17abcff405e (diff) | |
download | ffmpeg-e5d5407e263228349597f44ab06fa0d362867f84.tar.gz |
lpc_mmx: merge some asm blocks
These blocks depended on the compiler keeping xmm registers untouched between
them.
Originally committed as revision 25619 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec')
-rw-r--r-- | libavcodec/x86/lpc_mmx.c | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/libavcodec/x86/lpc_mmx.c b/libavcodec/x86/lpc_mmx.c index 2ef5fa6de3..cbdb239718 100644 --- a/libavcodec/x86/lpc_mmx.c +++ b/libavcodec/x86/lpc_mmx.c @@ -29,16 +29,15 @@ static void apply_welch_window_sse2(const int32_t *data, int len, double *w_data x86_reg i = -n2*sizeof(int32_t); x86_reg j = n2*sizeof(int32_t); __asm__ volatile( - "movsd %0, %%xmm7 \n\t" + "movsd %4, %%xmm7 \n\t" "movapd "MANGLE(ff_pd_1)", %%xmm6 \n\t" "movapd "MANGLE(ff_pd_2)", %%xmm5 \n\t" "movlhps %%xmm7, %%xmm7 \n\t" "subpd %%xmm5, %%xmm7 \n\t" "addsd %%xmm6, %%xmm7 \n\t" - ::"m"(c) - ); + "test $1, %5 \n\t" + "jz 2f \n\t" #define WELCH(MOVPD, offset)\ - __asm__ volatile(\ "1: \n\t"\ "movapd %%xmm7, %%xmm1 \n\t"\ "mulpd %%xmm1, %%xmm1 \n\t"\ @@ -55,13 +54,15 @@ static void apply_welch_window_sse2(const int32_t *data, int len, double *w_data "sub $8, %1 \n\t"\ "add $8, %0 \n\t"\ "jl 1b \n\t"\ - :"+&r"(i), "+&r"(j)\ - :"r"(w_data+n2), "r"(data+n2)\ - ); - if(len&1) + WELCH("movupd", -1) - else + "jmp 3f \n\t" + "2: \n\t" WELCH("movapd", -2) + "3: \n\t" + :"+&r"(i), "+&r"(j) + :"r"(w_data+n2), "r"(data+n2), "m"(c), "r"(len) + ); #undef WELCH } |