Mercurial > libavcodec.hg
comparison i386/flacdsp_mmx.c @ 8031:eebc7209c47f libavcodec
Convert asm keyword into __asm__.
Neither the asm() nor the __asm__() keyword is part of the C99
standard, but while GCC accepts the former in C89 syntax, it is not
accepted in C99 unless GNU extensions are turned on (with -fasm). The
latter form is accepted in any syntax as an extension (without
requiring further command-line options).
Sun Studio C99 compiler also does not accept asm() while accepting
__asm__(), albeit reporting warnings that it's not valid C99 syntax.
author | flameeyes |
---|---|
date | Thu, 16 Oct 2008 13:34:09 +0000 |
parents | b76ee34ea184 |
children |
comparison
equal
deleted
inserted
replaced
8030:a512ac8fa540 | 8031:eebc7209c47f |
---|---|
26 { | 26 { |
27 double c = 2.0 / (len-1.0); | 27 double c = 2.0 / (len-1.0); |
28 int n2 = len>>1; | 28 int n2 = len>>1; |
29 x86_reg i = -n2*sizeof(int32_t); | 29 x86_reg i = -n2*sizeof(int32_t); |
30 x86_reg j = n2*sizeof(int32_t); | 30 x86_reg j = n2*sizeof(int32_t); |
31 asm volatile( | 31 __asm__ volatile( |
32 "movsd %0, %%xmm7 \n\t" | 32 "movsd %0, %%xmm7 \n\t" |
33 "movapd "MANGLE(ff_pd_1)", %%xmm6 \n\t" | 33 "movapd "MANGLE(ff_pd_1)", %%xmm6 \n\t" |
34 "movapd "MANGLE(ff_pd_2)", %%xmm5 \n\t" | 34 "movapd "MANGLE(ff_pd_2)", %%xmm5 \n\t" |
35 "movlhps %%xmm7, %%xmm7 \n\t" | 35 "movlhps %%xmm7, %%xmm7 \n\t" |
36 "subpd %%xmm5, %%xmm7 \n\t" | 36 "subpd %%xmm5, %%xmm7 \n\t" |
37 "addsd %%xmm6, %%xmm7 \n\t" | 37 "addsd %%xmm6, %%xmm7 \n\t" |
38 ::"m"(c) | 38 ::"m"(c) |
39 ); | 39 ); |
40 #define WELCH(MOVPD, offset)\ | 40 #define WELCH(MOVPD, offset)\ |
41 asm volatile(\ | 41 __asm__ volatile(\ |
42 "1: \n\t"\ | 42 "1: \n\t"\ |
43 "movapd %%xmm7, %%xmm1 \n\t"\ | 43 "movapd %%xmm7, %%xmm1 \n\t"\ |
44 "mulpd %%xmm1, %%xmm1 \n\t"\ | 44 "mulpd %%xmm1, %%xmm1 \n\t"\ |
45 "movapd %%xmm6, %%xmm0 \n\t"\ | 45 "movapd %%xmm6, %%xmm0 \n\t"\ |
46 "subpd %%xmm1, %%xmm0 \n\t"\ | 46 "subpd %%xmm1, %%xmm0 \n\t"\ |
82 data1[len] = 0.0; | 82 data1[len] = 0.0; |
83 | 83 |
84 for(j=0; j<lag; j+=2){ | 84 for(j=0; j<lag; j+=2){ |
85 x86_reg i = -len*sizeof(double); | 85 x86_reg i = -len*sizeof(double); |
86 if(j == lag-2) { | 86 if(j == lag-2) { |
87 asm volatile( | 87 __asm__ volatile( |
88 "movsd "MANGLE(ff_pd_1)", %%xmm0 \n\t" | 88 "movsd "MANGLE(ff_pd_1)", %%xmm0 \n\t" |
89 "movsd "MANGLE(ff_pd_1)", %%xmm1 \n\t" | 89 "movsd "MANGLE(ff_pd_1)", %%xmm1 \n\t" |
90 "movsd "MANGLE(ff_pd_1)", %%xmm2 \n\t" | 90 "movsd "MANGLE(ff_pd_1)", %%xmm2 \n\t" |
91 "1: \n\t" | 91 "1: \n\t" |
92 "movapd (%4,%0), %%xmm3 \n\t" | 92 "movapd (%4,%0), %%xmm3 \n\t" |
111 "movsd %%xmm2, %3 \n\t" | 111 "movsd %%xmm2, %3 \n\t" |
112 :"+&r"(i), "=m"(autoc[j]), "=m"(autoc[j+1]), "=m"(autoc[j+2]) | 112 :"+&r"(i), "=m"(autoc[j]), "=m"(autoc[j+1]), "=m"(autoc[j+2]) |
113 :"r"(data1+len), "r"(data1+len-j) | 113 :"r"(data1+len), "r"(data1+len-j) |
114 ); | 114 ); |
115 } else { | 115 } else { |
116 asm volatile( | 116 __asm__ volatile( |
117 "movsd "MANGLE(ff_pd_1)", %%xmm0 \n\t" | 117 "movsd "MANGLE(ff_pd_1)", %%xmm0 \n\t" |
118 "movsd "MANGLE(ff_pd_1)", %%xmm1 \n\t" | 118 "movsd "MANGLE(ff_pd_1)", %%xmm1 \n\t" |
119 "1: \n\t" | 119 "1: \n\t" |
120 "movapd (%3,%0), %%xmm3 \n\t" | 120 "movapd (%3,%0), %%xmm3 \n\t" |
121 "movupd -8(%4,%0), %%xmm4 \n\t" | 121 "movupd -8(%4,%0), %%xmm4 \n\t" |