comparison i386/flacdsp_mmx.c @ 6339:0ea2b97aa9f6 libavcodec

use fewer registers in apply_welch_window_sse2
author lorenm
date Sat, 09 Feb 2008 05:29:47 +0000
parents fb99890ee609
children 33896780c612
comparison
equal deleted inserted replaced
6338:47a97ef90720 6339:0ea2b97aa9f6
34 "movlhps %%xmm7, %%xmm7 \n\t" 34 "movlhps %%xmm7, %%xmm7 \n\t"
35 "subpd %%xmm5, %%xmm7 \n\t" 35 "subpd %%xmm5, %%xmm7 \n\t"
36 "addsd %%xmm6, %%xmm7 \n\t" 36 "addsd %%xmm6, %%xmm7 \n\t"
37 ::"m"(c), "m"(*ff_pd_1), "m"(*ff_pd_2) 37 ::"m"(c), "m"(*ff_pd_1), "m"(*ff_pd_2)
38 ); 38 );
39 #define WELCH(MOVPD)\ 39 #define WELCH(MOVPD, offset)\
40 asm volatile(\ 40 asm volatile(\
41 "1: \n\t"\ 41 "1: \n\t"\
42 "movapd %%xmm7, %%xmm1 \n\t"\ 42 "movapd %%xmm7, %%xmm1 \n\t"\
43 "mulpd %%xmm1, %%xmm1 \n\t"\ 43 "mulpd %%xmm1, %%xmm1 \n\t"\
44 "movapd %%xmm6, %%xmm0 \n\t"\ 44 "movapd %%xmm6, %%xmm0 \n\t"\
45 "subpd %%xmm1, %%xmm0 \n\t"\ 45 "subpd %%xmm1, %%xmm0 \n\t"\
46 "pshufd $0x4e, %%xmm0, %%xmm1 \n\t"\ 46 "pshufd $0x4e, %%xmm0, %%xmm1 \n\t"\
47 "cvtpi2pd (%4,%0), %%xmm2 \n\t"\ 47 "cvtpi2pd (%3,%0), %%xmm2 \n\t"\
48 "cvtpi2pd (%5,%1), %%xmm3 \n\t"\ 48 "cvtpi2pd "#offset"*4(%3,%1), %%xmm3 \n\t"\
49 "mulpd %%xmm0, %%xmm2 \n\t"\ 49 "mulpd %%xmm0, %%xmm2 \n\t"\
50 "mulpd %%xmm1, %%xmm3 \n\t"\ 50 "mulpd %%xmm1, %%xmm3 \n\t"\
51 "movapd %%xmm2, (%2,%0,2) \n\t"\ 51 "movapd %%xmm2, (%2,%0,2) \n\t"\
52 MOVPD" %%xmm3, (%3,%1,2) \n\t"\ 52 MOVPD" %%xmm3, "#offset"*8(%2,%1,2) \n\t"\
53 "subpd %%xmm5, %%xmm7 \n\t"\ 53 "subpd %%xmm5, %%xmm7 \n\t"\
54 "sub $8, %1 \n\t"\ 54 "sub $8, %1 \n\t"\
55 "add $8, %0 \n\t"\ 55 "add $8, %0 \n\t"\
56 "jl 1b \n\t"\ 56 "jl 1b \n\t"\
57 :"+&r"(i), "+&r"(j)\ 57 :"+&r"(i), "+&r"(j)\
58 :"r"(w_data+n2), "r"(w_data+len-2-n2),\ 58 :"r"(w_data+n2), "r"(data+n2)\
59 "r"(data+n2), "r"(data+len-2-n2)\
60 ); 59 );
61 if(len&1) 60 if(len&1)
62 WELCH("movupd") 61 WELCH("movupd", -1)
63 else 62 else
64 WELCH("movapd") 63 WELCH("movapd", -2)
65 #undef WELCH 64 #undef WELCH
66 } 65 }
67 66
68 void ff_flac_compute_autocorr_sse2(const int32_t *data, int len, int lag, 67 void ff_flac_compute_autocorr_sse2(const int32_t *data, int len, int lag,
69 double *autoc) 68 double *autoc)