annotate liba52/imdct_3dnow.h @ 28904:69590d5c32cf

Fix compilation with --charset=noconv
author reimar
date Fri, 13 Mar 2009 16:42:42 +0000
parents 31287e75b5d8
children e83eef58b30a
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
4497
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
1 /*
25323
8855a2568281 Relicense as GPL v2 or later like the rest of liba52.
diego
parents: 18720
diff changeset
2 * 3DNOW and 3DNOWEX optimized IMDCT
8855a2568281 Relicense as GPL v2 or later like the rest of liba52.
diego
parents: 18720
diff changeset
3 * Copyright (C) 2002 Nick Kurshev
8855a2568281 Relicense as GPL v2 or later like the rest of liba52.
diego
parents: 18720
diff changeset
4 *
8855a2568281 Relicense as GPL v2 or later like the rest of liba52.
diego
parents: 18720
diff changeset
5 * This file is part of a52dec, a free ATSC A-52 stream decoder.
8855a2568281 Relicense as GPL v2 or later like the rest of liba52.
diego
parents: 18720
diff changeset
6 * See http://liba52.sourceforge.net/ for updates.
8855a2568281 Relicense as GPL v2 or later like the rest of liba52.
diego
parents: 18720
diff changeset
7 *
8855a2568281 Relicense as GPL v2 or later like the rest of liba52.
diego
parents: 18720
diff changeset
8 * a52dec is free software; you can redistribute it and/or modify
8855a2568281 Relicense as GPL v2 or later like the rest of liba52.
diego
parents: 18720
diff changeset
9 * it under the terms of the GNU General Public License as published by
8855a2568281 Relicense as GPL v2 or later like the rest of liba52.
diego
parents: 18720
diff changeset
10 * the Free Software Foundation; either version 2 of the License, or
8855a2568281 Relicense as GPL v2 or later like the rest of liba52.
diego
parents: 18720
diff changeset
11 * (at your option) any later version.
8855a2568281 Relicense as GPL v2 or later like the rest of liba52.
diego
parents: 18720
diff changeset
12 *
8855a2568281 Relicense as GPL v2 or later like the rest of liba52.
diego
parents: 18720
diff changeset
13 * a52dec is distributed in the hope that it will be useful,
8855a2568281 Relicense as GPL v2 or later like the rest of liba52.
diego
parents: 18720
diff changeset
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
8855a2568281 Relicense as GPL v2 or later like the rest of liba52.
diego
parents: 18720
diff changeset
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
8855a2568281 Relicense as GPL v2 or later like the rest of liba52.
diego
parents: 18720
diff changeset
16 * GNU General Public License for more details.
8855a2568281 Relicense as GPL v2 or later like the rest of liba52.
diego
parents: 18720
diff changeset
17 *
8855a2568281 Relicense as GPL v2 or later like the rest of liba52.
diego
parents: 18720
diff changeset
18 * You should have received a copy of the GNU General Public License
8855a2568281 Relicense as GPL v2 or later like the rest of liba52.
diego
parents: 18720
diff changeset
19 * along with this program; if not, write to the Free Software
8855a2568281 Relicense as GPL v2 or later like the rest of liba52.
diego
parents: 18720
diff changeset
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
8855a2568281 Relicense as GPL v2 or later like the rest of liba52.
diego
parents: 18720
diff changeset
21 */
4497
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
22
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
23 #undef FFT_4_3DNOW
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
24 #undef FFT_8_3DNOW
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
25 #undef FFT_ASMB_3DNOW
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
26 #undef FFT_ASMB16_3DNOW
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
27 #undef FFT_128P_3DNOW
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
28
28335
31287e75b5d8 HAVE_3DNOW --> HAVE_AMD3DNOW
diego
parents: 28326
diff changeset
29 #if HAVE_AMD3DNOWEXT
4497
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
30 #define FFT_4_3DNOW fft_4_3dnowex
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
31 #define FFT_8_3DNOW fft_8_3dnowex
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
32 #define FFT_ASMB_3DNOW fft_asmb_3dnowex
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
33 #define FFT_ASMB16_3DNOW fft_asmb16_3dnowex
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
34 #define FFT_128P_3DNOW fft_128p_3dnowex
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
35 #else
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
36 #define FFT_4_3DNOW fft_4_3dnow
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
37 #define FFT_8_3DNOW fft_8_3dnow
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
38 #define FFT_ASMB_3DNOW fft_asmb_3dnow
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
39 #define FFT_ASMB16_3DNOW fft_asmb16_3dnow
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
40 #define FFT_128P_3DNOW fft_128p_3dnow
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
41 #endif
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
42
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
43 static void FFT_4_3DNOW(complex_t *x)
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
44 {
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
45 /* delta_p = 1 here */
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
46 /* x[k] = sum_{i=0..3} x[i] * w^{i*k}, w=e^{-2*pi/4}
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
47 */
27757
b5a46071062a Replace all occurrences of '__volatile__' and '__volatile' by plain 'volatile'.
diego
parents: 27754
diff changeset
48 __asm__ volatile(
4497
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
49 "movq 24(%1), %%mm3\n\t"
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
50 "movq 8(%1), %%mm1\n\t"
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
51 "pxor %2, %%mm3\n\t" /* mm3.re | -mm3.im */
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
52 "pxor %3, %%mm1\n\t" /* -mm1.re | mm1.im */
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
53 "pfadd %%mm1, %%mm3\n\t" /* vi.im = x[3].re - x[1].re; */
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
54 "movq %%mm3, %%mm4\n\t" /* vi.re =-x[3].im + x[1].im; mm4 = vi */
28335
31287e75b5d8 HAVE_3DNOW --> HAVE_AMD3DNOW
diego
parents: 28326
diff changeset
55 #if HAVE_AMD3DNOWEXT
4497
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
56 "pswapd %%mm4, %%mm4\n\t"
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
57 #else
8230
330086b89d8f minor optimization & gcc-CVS fix/workaround patch by (Glen Nakamura <glen at imodulo dot com>)
michael
parents: 4497
diff changeset
58 "punpckldq %%mm4, %%mm5\n\t"
330086b89d8f minor optimization & gcc-CVS fix/workaround patch by (Glen Nakamura <glen at imodulo dot com>)
michael
parents: 4497
diff changeset
59 "punpckhdq %%mm5, %%mm4\n\t"
4497
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
60 #endif
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
61 "movq (%1), %%mm5\n\t" /* yb.re = x[0].re - x[2].re; */
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
62 "movq (%1), %%mm6\n\t" /* yt.re = x[0].re + x[2].re; */
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
63 "movq 24(%1), %%mm7\n\t" /* u.re = x[3].re + x[1].re; */
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
64 "pfsub 16(%1), %%mm5\n\t" /* yb.im = x[0].im - x[2].im; mm5 = yb */
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
65 "pfadd 16(%1), %%mm6\n\t" /* yt.im = x[0].im + x[2].im; mm6 = yt */
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
66 "pfadd 8(%1), %%mm7\n\t" /* u.im = x[3].im + x[1].im; mm7 = u */
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
67
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
68 "movq %%mm6, %%mm0\n\t" /* x[0].re = yt.re + u.re; */
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
69 "movq %%mm5, %%mm1\n\t" /* x[1].re = yb.re + vi.re; */
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
70 "pfadd %%mm7, %%mm0\n\t" /*x[0].im = yt.im + u.im; */
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
71 "pfadd %%mm4, %%mm1\n\t" /* x[1].im = yb.im + vi.im; */
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
72 "movq %%mm0, (%0)\n\t"
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
73 "movq %%mm1, 8(%0)\n\t"
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
74
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
75 "pfsub %%mm7, %%mm6\n\t" /* x[2].re = yt.re - u.re; */
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
76 "pfsub %%mm4, %%mm5\n\t" /* x[3].re = yb.re - vi.re; */
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
77 "movq %%mm6, 16(%0)\n\t" /* x[2].im = yt.im - u.im; */
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
78 "movq %%mm5, 24(%0)" /* x[3].im = yb.im - vi.im; */
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
79 :"=r"(x)
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
80 :"0"(x),
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
81 "m"(x_plus_minus_3dnow),
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
82 "m"(x_minus_plus_3dnow)
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
83 :"memory");
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
84 }
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
85
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
86 static void FFT_8_3DNOW(complex_t *x)
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
87 {
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
88 /* delta_p = diag{1, sqrt(i)} here */
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
89 /* x[k] = sum_{i=0..7} x[i] * w^{i*k}, w=e^{-2*pi/8}
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
90 */
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
91 complex_t wT1, wB1, wB2;
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
92
27757
b5a46071062a Replace all occurrences of '__volatile__' and '__volatile' by plain 'volatile'.
diego
parents: 27754
diff changeset
93 __asm__ volatile(
4497
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
94 "movq 8(%2), %%mm0\n\t"
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
95 "movq 24(%2), %%mm1\n\t"
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
96 "movq %%mm0, %0\n\t" /* wT1 = x[1]; */
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
97 "movq %%mm1, %1\n\t" /* wB1 = x[3]; */
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
98 :"=m"(wT1), "=m"(wB1)
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
99 :"r"(x)
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
100 :"memory");
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
101
27757
b5a46071062a Replace all occurrences of '__volatile__' and '__volatile' by plain 'volatile'.
diego
parents: 27754
diff changeset
102 __asm__ volatile(
4497
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
103 "movq 16(%0), %%mm2\n\t"
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
104 "movq 32(%0), %%mm3\n\t"
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
105 "movq %%mm2, 8(%0)\n\t" /* x[1] = x[2]; */
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
106 "movq 48(%0), %%mm4\n\t"
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
107 "movq %%mm3, 16(%0)\n\t" /* x[2] = x[4]; */
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
108 "movq %%mm4, 24(%0)\n\t" /* x[3] = x[6]; */
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
109 :"=r"(x)
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
110 :"0"(x)
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
111 :"memory");
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
112
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
113 fft_4_3dnow(&x[0]);
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
114
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
115 /* x[0] x[4] x[2] x[6] */
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
116
27757
b5a46071062a Replace all occurrences of '__volatile__' and '__volatile' by plain 'volatile'.
diego
parents: 27754
diff changeset
117 __asm__ volatile(
4497
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
118 "movq 40(%1), %%mm0\n\t"
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
119 "movq %%mm0, %%mm3\n\t"
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
120 "movq 56(%1), %%mm1\n\t"
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
121 "pfadd %%mm1, %%mm0\n\t"
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
122 "pfsub %%mm1, %%mm3\n\t"
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
123 "movq (%2), %%mm2\n\t"
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
124 "pfadd %%mm2, %%mm0\n\t"
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
125 "pfadd %%mm2, %%mm3\n\t"
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
126 "movq (%3), %%mm1\n\t"
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
127 "pfadd %%mm1, %%mm0\n\t"
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
128 "pfsub %%mm1, %%mm3\n\t"
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
129 "movq (%1), %%mm1\n\t"
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
130 "movq 16(%1), %%mm4\n\t"
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
131 "movq %%mm1, %%mm2\n\t"
28335
31287e75b5d8 HAVE_3DNOW --> HAVE_AMD3DNOW
diego
parents: 28326
diff changeset
132 #if HAVE_AMD3DNOWEXT
4497
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
133 "pswapd %%mm3, %%mm3\n\t"
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
134 #else
8230
330086b89d8f minor optimization & gcc-CVS fix/workaround patch by (Glen Nakamura <glen at imodulo dot com>)
michael
parents: 4497
diff changeset
135 "punpckldq %%mm3, %%mm6\n\t"
330086b89d8f minor optimization & gcc-CVS fix/workaround patch by (Glen Nakamura <glen at imodulo dot com>)
michael
parents: 4497
diff changeset
136 "punpckhdq %%mm6, %%mm3\n\t"
4497
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
137 #endif
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
138 "pfadd %%mm0, %%mm1\n\t"
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
139 "movq %%mm4, %%mm5\n\t"
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
140 "pfsub %%mm0, %%mm2\n\t"
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
141 "pfadd %%mm3, %%mm4\n\t"
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
142 "movq %%mm1, (%0)\n\t"
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
143 "pfsub %%mm3, %%mm5\n\t"
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
144 "movq %%mm2, 32(%0)\n\t"
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
145 "movd %%mm4, 16(%0)\n\t"
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
146 "movd %%mm5, 48(%0)\n\t"
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
147 "psrlq $32, %%mm4\n\t"
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
148 "psrlq $32, %%mm5\n\t"
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
149 "movd %%mm4, 52(%0)\n\t"
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
150 "movd %%mm5, 20(%0)"
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
151 :"=r"(x)
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
152 :"0"(x), "r"(&wT1), "r"(&wB1)
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
153 :"memory");
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
154
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
155 /* x[1] x[5] */
27757
b5a46071062a Replace all occurrences of '__volatile__' and '__volatile' by plain 'volatile'.
diego
parents: 27754
diff changeset
156 __asm__ volatile (
4497
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
157 "movq %6, %%mm6\n\t"
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
158 "movq %5, %%mm7\n\t"
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
159 "movq %1, %%mm0\n\t"
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
160 "movq %2, %%mm1\n\t"
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
161 "movq 56(%3), %%mm3\n\t"
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
162 "pfsub 40(%3), %%mm0\n\t"
28335
31287e75b5d8 HAVE_3DNOW --> HAVE_AMD3DNOW
diego
parents: 28326
diff changeset
163 #if HAVE_AMD3DNOWEXT
4497
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
164 "pswapd %%mm1, %%mm1\n\t"
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
165 #else
8230
330086b89d8f minor optimization & gcc-CVS fix/workaround patch by (Glen Nakamura <glen at imodulo dot com>)
michael
parents: 4497
diff changeset
166 "punpckldq %%mm1, %%mm2\n\t"
330086b89d8f minor optimization & gcc-CVS fix/workaround patch by (Glen Nakamura <glen at imodulo dot com>)
michael
parents: 4497
diff changeset
167 "punpckhdq %%mm2, %%mm1\n\t"
4497
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
168 #endif
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
169 "pxor %%mm7, %%mm1\n\t"
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
170 "pfadd %%mm1, %%mm0\n\t"
28335
31287e75b5d8 HAVE_3DNOW --> HAVE_AMD3DNOW
diego
parents: 28326
diff changeset
171 #if HAVE_AMD3DNOWEXT
4497
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
172 "pswapd %%mm3, %%mm3\n\t"
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
173 #else
8230
330086b89d8f minor optimization & gcc-CVS fix/workaround patch by (Glen Nakamura <glen at imodulo dot com>)
michael
parents: 4497
diff changeset
174 "punpckldq %%mm3, %%mm2\n\t"
330086b89d8f minor optimization & gcc-CVS fix/workaround patch by (Glen Nakamura <glen at imodulo dot com>)
michael
parents: 4497
diff changeset
175 "punpckhdq %%mm2, %%mm3\n\t"
4497
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
176 #endif
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
177 "pxor %%mm6, %%mm3\n\t"
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
178 "pfadd %%mm3, %%mm0\n\t"
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
179 "movq %%mm0, %%mm1\n\t"
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
180 "pxor %%mm6, %%mm1\n\t"
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
181 "pfacc %%mm1, %%mm0\n\t"
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
182 "pfmul %4, %%mm0\n\t"
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
183
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
184 "movq 40(%3), %%mm5\n\t"
28335
31287e75b5d8 HAVE_3DNOW --> HAVE_AMD3DNOW
diego
parents: 28326
diff changeset
185 #if HAVE_AMD3DNOWEXT
4497
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
186 "pswapd %%mm5, %%mm5\n\t"
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
187 #else
8230
330086b89d8f minor optimization & gcc-CVS fix/workaround patch by (Glen Nakamura <glen at imodulo dot com>)
michael
parents: 4497
diff changeset
188 "punpckldq %%mm5, %%mm1\n\t"
330086b89d8f minor optimization & gcc-CVS fix/workaround patch by (Glen Nakamura <glen at imodulo dot com>)
michael
parents: 4497
diff changeset
189 "punpckhdq %%mm1, %%mm5\n\t"
4497
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
190 #endif
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
191 "movq %%mm5, %0\n\t"
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
192
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
193 "movq 8(%3), %%mm1\n\t"
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
194 "movq %%mm1, %%mm2\n\t"
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
195 "pfsub %%mm0, %%mm1\n\t"
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
196 "pfadd %%mm0, %%mm2\n\t"
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
197 "movq %%mm1, 40(%3)\n\t"
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
198 "movq %%mm2, 8(%3)\n\t"
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
199 :"=m"(wB2)
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
200 :"m"(wT1), "m"(wB1), "r"(x), "m"(HSQRT2_3DNOW),
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
201 "m"(x_plus_minus_3dnow), "m"(x_minus_plus_3dnow)
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
202 :"memory");
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
203
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
204
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
205 /* x[3] x[7] */
27757
b5a46071062a Replace all occurrences of '__volatile__' and '__volatile' by plain 'volatile'.
diego
parents: 27754
diff changeset
206 __asm__ volatile(
4497
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
207 "movq %1, %%mm0\n\t"
28335
31287e75b5d8 HAVE_3DNOW --> HAVE_AMD3DNOW
diego
parents: 28326
diff changeset
208 #if HAVE_AMD3DNOWEXT
4497
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
209 "pswapd %3, %%mm1\n\t"
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
210 #else
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
211 "movq %3, %%mm1\n\t"
8230
330086b89d8f minor optimization & gcc-CVS fix/workaround patch by (Glen Nakamura <glen at imodulo dot com>)
michael
parents: 4497
diff changeset
212 "punpckldq %%mm1, %%mm2\n\t"
330086b89d8f minor optimization & gcc-CVS fix/workaround patch by (Glen Nakamura <glen at imodulo dot com>)
michael
parents: 4497
diff changeset
213 "punpckhdq %%mm2, %%mm1\n\t"
4497
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
214 #endif
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
215 "pxor %%mm6, %%mm1\n\t"
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
216 "pfadd %%mm1, %%mm0\n\t"
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
217 "movq %2, %%mm2\n\t"
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
218 "movq 56(%4), %%mm3\n\t"
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
219 "pxor %%mm7, %%mm3\n\t"
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
220 "pfadd %%mm3, %%mm2\n\t"
28335
31287e75b5d8 HAVE_3DNOW --> HAVE_AMD3DNOW
diego
parents: 28326
diff changeset
221 #if HAVE_AMD3DNOWEXT
4497
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
222 "pswapd %%mm2, %%mm2\n\t"
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
223 #else
8230
330086b89d8f minor optimization & gcc-CVS fix/workaround patch by (Glen Nakamura <glen at imodulo dot com>)
michael
parents: 4497
diff changeset
224 "punpckldq %%mm2, %%mm5\n\t"
330086b89d8f minor optimization & gcc-CVS fix/workaround patch by (Glen Nakamura <glen at imodulo dot com>)
michael
parents: 4497
diff changeset
225 "punpckhdq %%mm5, %%mm2\n\t"
4497
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
226 #endif
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
227 "movq 24(%4), %%mm3\n\t"
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
228 "pfsub %%mm2, %%mm0\n\t"
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
229 "movq %%mm3, %%mm4\n\t"
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
230 "movq %%mm0, %%mm1\n\t"
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
231 "pxor %%mm6, %%mm0\n\t"
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
232 "pfacc %%mm1, %%mm0\n\t"
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
233 "pfmul %5, %%mm0\n\t"
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
234 "movq %%mm0, %%mm1\n\t"
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
235 "pxor %%mm6, %%mm1\n\t"
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
236 "pxor %%mm7, %%mm0\n\t"
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
237 "pfadd %%mm1, %%mm3\n\t"
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
238 "pfadd %%mm0, %%mm4\n\t"
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
239 "movq %%mm4, 24(%0)\n\t"
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
240 "movq %%mm3, 56(%0)\n\t"
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
241 :"=r"(x)
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
242 :"m"(wT1), "m"(wB2), "m"(wB1), "0"(x), "m"(HSQRT2_3DNOW)
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
243 :"memory");
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
244 }
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
245
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
246 static void FFT_ASMB_3DNOW(int k, complex_t *x, complex_t *wTB,
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
247 const complex_t *d, const complex_t *d_3)
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
248 {
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
249 register complex_t *x2k, *x3k, *x4k, *wB;
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
250
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
251 TRANS_FILL_MM6_MM7_3DNOW();
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
252 x2k = x + 2 * k;
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
253 x3k = x2k + 2 * k;
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
254 x4k = x3k + 2 * k;
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
255 wB = wTB + 2 * k;
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
256
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
257 TRANSZERO_3DNOW(x[0],x2k[0],x3k[0],x4k[0]);
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
258 TRANS_3DNOW(x[1],x2k[1],x3k[1],x4k[1],wTB[1],wB[1],d[1],d_3[1]);
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
259
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
260 --k;
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
261 for(;;) {
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
262 TRANS_3DNOW(x[2],x2k[2],x3k[2],x4k[2],wTB[2],wB[2],d[2],d_3[2]);
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
263 TRANS_3DNOW(x[3],x2k[3],x3k[3],x4k[3],wTB[3],wB[3],d[3],d_3[3]);
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
264 if (!--k) break;
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
265 x += 2;
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
266 x2k += 2;
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
267 x3k += 2;
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
268 x4k += 2;
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
269 d += 2;
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
270 d_3 += 2;
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
271 wTB += 2;
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
272 wB += 2;
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
273 }
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
274
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
275 }
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
276
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
277 void FFT_ASMB16_3DNOW(complex_t *x, complex_t *wTB)
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
278 {
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
279 int k = 2;
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
280
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
281 TRANS_FILL_MM6_MM7_3DNOW();
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
282 /* transform x[0], x[8], x[4], x[12] */
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
283 TRANSZERO_3DNOW(x[0],x[4],x[8],x[12]);
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
284
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
285 /* transform x[1], x[9], x[5], x[13] */
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
286 TRANS_3DNOW(x[1],x[5],x[9],x[13],wTB[1],wTB[5],delta16[1],delta16_3[1]);
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
287
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
288 /* transform x[2], x[10], x[6], x[14] */
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
289 TRANSHALF_16_3DNOW(x[2],x[6],x[10],x[14]);
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
290
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
291 /* transform x[3], x[11], x[7], x[15] */
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
292 TRANS_3DNOW(x[3],x[7],x[11],x[15],wTB[3],wTB[7],delta16[3],delta16_3[3]);
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
293
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
294 }
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
295
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
296 static void FFT_128P_3DNOW(complex_t *a)
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
297 {
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
298 FFT_8_3DNOW(&a[0]); FFT_4_3DNOW(&a[8]); FFT_4_3DNOW(&a[12]);
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
299 FFT_ASMB16_3DNOW(&a[0], &a[8]);
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
300
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
301 FFT_8_3DNOW(&a[16]), FFT_8_3DNOW(&a[24]);
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
302 FFT_ASMB_3DNOW(4, &a[0], &a[16],&delta32[0], &delta32_3[0]);
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
303
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
304 FFT_8_3DNOW(&a[32]); FFT_4_3DNOW(&a[40]); FFT_4_3DNOW(&a[44]);
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
305 FFT_ASMB16_3DNOW(&a[32], &a[40]);
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
306
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
307 FFT_8_3DNOW(&a[48]); FFT_4_3DNOW(&a[56]); FFT_4_3DNOW(&a[60]);
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
308 FFT_ASMB16_3DNOW(&a[48], &a[56]);
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
309
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
310 FFT_ASMB_3DNOW(8, &a[0], &a[32],&delta64[0], &delta64_3[0]);
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
311
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
312 FFT_8_3DNOW(&a[64]); FFT_4_3DNOW(&a[72]); FFT_4_3DNOW(&a[76]);
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
313 /* FFT_16(&a[64]); */
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
314 FFT_ASMB16_3DNOW(&a[64], &a[72]);
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
315
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
316 FFT_8_3DNOW(&a[80]); FFT_8_3DNOW(&a[88]);
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
317
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
318 /* FFT_32(&a[64]); */
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
319 FFT_ASMB_3DNOW(4, &a[64], &a[80],&delta32[0], &delta32_3[0]);
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
320
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
321 FFT_8_3DNOW(&a[96]); FFT_4_3DNOW(&a[104]), FFT_4_3DNOW(&a[108]);
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
322 /* FFT_16(&a[96]); */
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
323 FFT_ASMB16_3DNOW(&a[96], &a[104]);
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
324
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
325 FFT_8_3DNOW(&a[112]), FFT_8_3DNOW(&a[120]);
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
326 /* FFT_32(&a[96]); */
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
327 FFT_ASMB_3DNOW(4, &a[96], &a[112], &delta32[0], &delta32_3[0]);
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
328
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
329 /* FFT_128(&a[0]); */
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
330 FFT_ASMB_3DNOW(16, &a[0], &a[64], &delta128[0], &delta128_3[0]);
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
331 }
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
332
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
333 static void
28335
31287e75b5d8 HAVE_3DNOW --> HAVE_AMD3DNOW
diego
parents: 28326
diff changeset
334 #if HAVE_AMD3DNOWEXT
4497
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
335 imdct_do_512_3dnowex
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
336 #else
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
337 imdct_do_512_3dnow
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
338 #endif
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
339 (sample_t data[],sample_t delay[], sample_t bias)
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
340 {
8254
772d6d27fd66 warning patch by (Dominik Mierzejewski <dominik at rangers dot eu dot org>)
michael
parents: 8230
diff changeset
341 int i;
772d6d27fd66 warning patch by (Dominik Mierzejewski <dominik at rangers dot eu dot org>)
michael
parents: 8230
diff changeset
342 /* int k;
4497
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
343 int p,q;
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
344 int m;
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
345 int two_m;
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
346 int two_m_plus_one;
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
347
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
348 sample_t tmp_a_i;
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
349 sample_t tmp_a_r;
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
350 sample_t tmp_b_i;
8254
772d6d27fd66 warning patch by (Dominik Mierzejewski <dominik at rangers dot eu dot org>)
michael
parents: 8230
diff changeset
351 sample_t tmp_b_r;*/
4497
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
352
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
353 sample_t *data_ptr;
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
354 sample_t *delay_ptr;
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
355 sample_t *window_ptr;
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
356
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
357 /* 512 IMDCT with source and dest data in 'data' */
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
358
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
359 /* Pre IFFT complex multiply plus IFFT cmplx conjugate & reordering*/
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
360 #if 1
27757
b5a46071062a Replace all occurrences of '__volatile__' and '__volatile' by plain 'volatile'.
diego
parents: 27754
diff changeset
361 __asm__ volatile (
4497
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
362 "movq %0, %%mm7\n\t"
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
363 ::"m"(x_plus_minus_3dnow)
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
364 :"memory");
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
365 for( i=0; i < 128; i++) {
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
366 int j = pm128[i];
27757
b5a46071062a Replace all occurrences of '__volatile__' and '__volatile' by plain 'volatile'.
diego
parents: 27754
diff changeset
367 __asm__ volatile (
4497
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
368 "movd %1, %%mm0\n\t"
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
369 "movd %3, %%mm1\n\t"
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
370 "punpckldq %2, %%mm0\n\t" /* mm0 = data[256-2*j-1] | data[2*j]*/
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
371 "punpckldq %4, %%mm1\n\t" /* mm1 = xcos[j] | xsin[j] */
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
372 "movq %%mm0, %%mm2\n\t"
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
373 "pfmul %%mm1, %%mm0\n\t"
28335
31287e75b5d8 HAVE_3DNOW --> HAVE_AMD3DNOW
diego
parents: 28326
diff changeset
374 #if HAVE_AMD3DNOWEXT
4497
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
375 "pswapd %%mm1, %%mm1\n\t"
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
376 #else
8230
330086b89d8f minor optimization & gcc-CVS fix/workaround patch by (Glen Nakamura <glen at imodulo dot com>)
michael
parents: 4497
diff changeset
377 "punpckldq %%mm1, %%mm5\n\t"
330086b89d8f minor optimization & gcc-CVS fix/workaround patch by (Glen Nakamura <glen at imodulo dot com>)
michael
parents: 4497
diff changeset
378 "punpckhdq %%mm5, %%mm1\n\t"
4497
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
379 #endif
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
380 "pfmul %%mm1, %%mm2\n\t"
28335
31287e75b5d8 HAVE_3DNOW --> HAVE_AMD3DNOW
diego
parents: 28326
diff changeset
381 #if HAVE_AMD3DNOWEXT
4497
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
382 "pfpnacc %%mm2, %%mm0\n\t"
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
383 #else
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
384 "pxor %%mm7, %%mm0\n\t"
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
385 "pfacc %%mm2, %%mm0\n\t"
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
386 #endif
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
387 "pxor %%mm7, %%mm0\n\t"
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
388 "movq %%mm0, %0"
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
389 :"=m"(buf[i])
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
390 :"m"(data[256-2*j-1]), "m"(data[2*j]), "m"(xcos1[j]), "m"(xsin1[j])
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
391 :"memory"
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
392 );
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
393 /* buf[i].re = (data[256-2*j-1] * xcos1[j] - data[2*j] * xsin1[j]);
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
394 buf[i].im = (data[256-2*j-1] * xsin1[j] + data[2*j] * xcos1[j])*(-1.0);*/
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
395 }
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
396 #else
27757
b5a46071062a Replace all occurrences of '__volatile__' and '__volatile' by plain 'volatile'.
diego
parents: 27754
diff changeset
397 __asm__ volatile ("femms":::"memory");
4497
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
398 for( i=0; i < 128; i++) {
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
399 /* z[i] = (X[256-2*i-1] + j * X[2*i]) * (xcos1[i] + j * xsin1[i]) ; */
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
400 int j= pm128[i];
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
401 buf[i].real = (data[256-2*j-1] * xcos1[j]) - (data[2*j] * xsin1[j]);
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
402 buf[i].imag = -1.0 * ((data[2*j] * xcos1[j]) + (data[256-2*j-1] * xsin1[j]));
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
403 }
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
404 #endif
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
405
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
406 /* FFT Merge */
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
407 /* unoptimized variant
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
408 for (m=1; m < 7; m++) {
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
409 if(m)
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
410 two_m = (1 << m);
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
411 else
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
412 two_m = 1;
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
413
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
414 two_m_plus_one = (1 << (m+1));
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
415
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
416 for(i = 0; i < 128; i += two_m_plus_one) {
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
417 for(k = 0; k < two_m; k++) {
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
418 p = k + i;
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
419 q = p + two_m;
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
420 tmp_a_r = buf[p].real;
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
421 tmp_a_i = buf[p].imag;
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
422 tmp_b_r = buf[q].real * w[m][k].real - buf[q].imag * w[m][k].imag;
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
423 tmp_b_i = buf[q].imag * w[m][k].real + buf[q].real * w[m][k].imag;
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
424 buf[p].real = tmp_a_r + tmp_b_r;
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
425 buf[p].imag = tmp_a_i + tmp_b_i;
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
426 buf[q].real = tmp_a_r - tmp_b_r;
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
427 buf[q].imag = tmp_a_i - tmp_b_i;
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
428 }
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
429 }
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
430 }
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
431 */
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
432
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
433 FFT_128P_3DNOW (&buf[0]);
27754
08d18fe9da52 Change all occurrences of asm and __asm to __asm__, same as was done for FFmpeg.
diego
parents: 25323
diff changeset
434 // __asm__ volatile ("femms \n\t":::"memory");
4497
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
435
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
436 /* Post IFFT complex multiply plus IFFT complex conjugate*/
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
437 #if 1
27757
b5a46071062a Replace all occurrences of '__volatile__' and '__volatile' by plain 'volatile'.
diego
parents: 27754
diff changeset
438 __asm__ volatile (
4497
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
439 "movq %0, %%mm7\n\t"
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
440 "movq %1, %%mm6\n\t"
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
441 ::"m"(x_plus_minus_3dnow),
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
442 "m"(x_minus_plus_3dnow)
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
443 :"eax","memory");
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
444 for (i=0; i < 128; i++) {
27757
b5a46071062a Replace all occurrences of '__volatile__' and '__volatile' by plain 'volatile'.
diego
parents: 27754
diff changeset
445 __asm__ volatile (
4497
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
446 "movq %1, %%mm0\n\t" /* ac3_buf[i].re | ac3_buf[i].im */
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
447 "movq %%mm0, %%mm1\n\t" /* ac3_buf[i].re | ac3_buf[i].im */
28335
31287e75b5d8 HAVE_3DNOW --> HAVE_AMD3DNOW
diego
parents: 28326
diff changeset
448 #if !HAVE_AMD3DNOWEXT
8230
330086b89d8f minor optimization & gcc-CVS fix/workaround patch by (Glen Nakamura <glen at imodulo dot com>)
michael
parents: 4497
diff changeset
449 "punpckldq %%mm1, %%mm2\n\t"
330086b89d8f minor optimization & gcc-CVS fix/workaround patch by (Glen Nakamura <glen at imodulo dot com>)
michael
parents: 4497
diff changeset
450 "punpckhdq %%mm2, %%mm1\n\t"
4497
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
451 #else
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
452 "pswapd %%mm1, %%mm1\n\t" /* ac3_buf[i].re | ac3_buf[i].im */
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
453 #endif
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
454 "movd %3, %%mm3\n\t" /* ac3_xsin[i] */
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
455 "punpckldq %2, %%mm3\n\t" /* ac3_xsin[i] | ac3_xcos[i] */
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
456 "pfmul %%mm3, %%mm0\n\t"
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
457 "pfmul %%mm3, %%mm1\n\t"
28335
31287e75b5d8 HAVE_3DNOW --> HAVE_AMD3DNOW
diego
parents: 28326
diff changeset
458 #if !HAVE_AMD3DNOWEXT
4497
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
459 "pxor %%mm7, %%mm0\n\t"
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
460 "pfacc %%mm1, %%mm0\n\t"
8230
330086b89d8f minor optimization & gcc-CVS fix/workaround patch by (Glen Nakamura <glen at imodulo dot com>)
michael
parents: 4497
diff changeset
461 "punpckldq %%mm0, %%mm1\n\t"
330086b89d8f minor optimization & gcc-CVS fix/workaround patch by (Glen Nakamura <glen at imodulo dot com>)
michael
parents: 4497
diff changeset
462 "punpckhdq %%mm1, %%mm0\n\t"
330086b89d8f minor optimization & gcc-CVS fix/workaround patch by (Glen Nakamura <glen at imodulo dot com>)
michael
parents: 4497
diff changeset
463 "movq %%mm0, %0\n\t"
4497
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
464 #else
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
465 "pfpnacc %%mm1, %%mm0\n\t" /* mm0 = mm0[0] - mm0[1] | mm1[0] + mm1[1] */
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
466 "pswapd %%mm0, %%mm0\n\t"
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
467 "movq %%mm0, %0"
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
468 #endif
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
469 :"=m"(buf[i])
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
470 :"m"(buf[i]),"m"(xcos1[i]),"m"(xsin1[i])
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
471 :"memory");
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
472 /* ac3_buf[i].re =(tmp_a_r * ac3_xcos1[i]) + (tmp_a_i * ac3_xsin1[i]);
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
473 ac3_buf[i].im =(tmp_a_r * ac3_xsin1[i]) - (tmp_a_i * ac3_xcos1[i]);*/
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
474 }
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
475 #else
27757
b5a46071062a Replace all occurrences of '__volatile__' and '__volatile' by plain 'volatile'.
diego
parents: 27754
diff changeset
476 __asm__ volatile ("femms":::"memory");
4497
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
477 for( i=0; i < 128; i++) {
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
478 /* y[n] = z[n] * (xcos1[n] + j * xsin1[n]) ; */
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
479 tmp_a_r = buf[i].real;
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
480 tmp_a_i = -1.0 * buf[i].imag;
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
481 buf[i].real =(tmp_a_r * xcos1[i]) - (tmp_a_i * xsin1[i]);
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
482 buf[i].imag =(tmp_a_r * xsin1[i]) + (tmp_a_i * xcos1[i]);
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
483 }
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
484 #endif
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
485
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
486 data_ptr = data;
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
487 delay_ptr = delay;
18720
4bad7f00556e sync with liba52 0.7.4, patch by Emanuele Giaquinta >emanuele.giaquinta ! gmail * com<
rathann
parents: 8254
diff changeset
488 window_ptr = a52_imdct_window;
4497
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
489
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
490 /* Window and convert to real valued signal */
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
491 #if 1
27754
08d18fe9da52 Change all occurrences of asm and __asm to __asm__, same as was done for FFmpeg.
diego
parents: 25323
diff changeset
492 __asm__ volatile (
4497
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
493 "movd (%0), %%mm3 \n\t"
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
494 "punpckldq %%mm3, %%mm3 \n\t"
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
495 :: "r" (&bias)
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
496 );
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
497 for (i=0; i< 64; i++) {
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
498 /* merge two loops in one to enable working of 2 decoders */
27757
b5a46071062a Replace all occurrences of '__volatile__' and '__volatile' by plain 'volatile'.
diego
parents: 27754
diff changeset
499 __asm__ volatile (
4497
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
500 "movd 516(%1), %%mm0\n\t"
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
501 "movd (%1), %%mm1\n\t" /**data_ptr++=-buf[64+i].im**window_ptr+++*delay_ptr++;*/
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
502 "punpckldq (%2), %%mm0\n\t"/*data_ptr[128]=-buf[i].re*window_ptr[128]+delay_ptr[128];*/
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
503 "punpckldq 516(%2), %%mm1\n\t"
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
504 "pfmul (%3), %%mm0\n\t"/**data_ptr++=buf[64-i-1].re**window_ptr+++*delay_ptr++;*/
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
505 "pfmul 512(%3), %%mm1\n\t"
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
506 "pxor %%mm6, %%mm0\n\t"/*data_ptr[128]=buf[128-i-1].im*window_ptr[128]+delay_ptr[128];*/
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
507 "pxor %%mm6, %%mm1\n\t"
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
508 "pfadd (%4), %%mm0\n\t"
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
509 "pfadd 512(%4), %%mm1\n\t"
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
510 "pfadd %%mm3, %%mm0\n\t"
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
511 "pfadd %%mm3, %%mm1\n\t"
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
512 "movq %%mm0, (%0)\n\t"
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
513 "movq %%mm1, 512(%0)"
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
514 :"=r"(data_ptr)
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
515 :"r"(&buf[i].real), "r"(&buf[64-i-1].real), "r"(window_ptr), "r"(delay_ptr), "0"(data_ptr)
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
516 :"memory");
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
517 data_ptr += 2;
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
518 window_ptr += 2;
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
519 delay_ptr += 2;
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
520 }
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
521 window_ptr += 128;
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
522 #else
27757
b5a46071062a Replace all occurrences of '__volatile__' and '__volatile' by plain 'volatile'.
diego
parents: 27754
diff changeset
523 __asm__ volatile ("femms":::"memory");
4497
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
524 for(i=0; i< 64; i++) {
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
525 *data_ptr++ = -buf[64+i].imag * *window_ptr++ + *delay_ptr++ + bias;
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
526 *data_ptr++ = buf[64-i-1].real * *window_ptr++ + *delay_ptr++ + bias;
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
527 }
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
528
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
529 for(i=0; i< 64; i++) {
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
530 *data_ptr++ = -buf[i].real * *window_ptr++ + *delay_ptr++ + bias;
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
531 *data_ptr++ = buf[128-i-1].imag * *window_ptr++ + *delay_ptr++ + bias;
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
532 }
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
533 #endif
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
534
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
535 /* The trailing edge of the window goes into the delay line */
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
536 delay_ptr = delay;
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
537 #if 1
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
538 for(i=0; i< 64; i++) {
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
539 /* merge two loops in one to enable working of 2 decoders */
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
540 window_ptr -=2;
27757
b5a46071062a Replace all occurrences of '__volatile__' and '__volatile' by plain 'volatile'.
diego
parents: 27754
diff changeset
541 __asm__ volatile(
4497
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
542 "movd 508(%1), %%mm0\n\t"
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
543 "movd (%1), %%mm1\n\t"
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
544 "punpckldq (%2), %%mm0\n\t"
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
545 "punpckldq 508(%2), %%mm1\n\t"
28335
31287e75b5d8 HAVE_3DNOW --> HAVE_AMD3DNOW
diego
parents: 28326
diff changeset
546 #if HAVE_AMD3DNOWEXT
4497
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
547 "pswapd (%3), %%mm3\n\t"
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
548 "pswapd -512(%3), %%mm4\n\t"
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
549 #else
8230
330086b89d8f minor optimization & gcc-CVS fix/workaround patch by (Glen Nakamura <glen at imodulo dot com>)
michael
parents: 4497
diff changeset
550 "movq (%3), %%mm3\n\t"
330086b89d8f minor optimization & gcc-CVS fix/workaround patch by (Glen Nakamura <glen at imodulo dot com>)
michael
parents: 4497
diff changeset
551 "punpckldq %%mm3, %%mm2\n\t"
330086b89d8f minor optimization & gcc-CVS fix/workaround patch by (Glen Nakamura <glen at imodulo dot com>)
michael
parents: 4497
diff changeset
552 "punpckhdq %%mm2, %%mm3\n\t"
4497
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
553 "movq -512(%3), %%mm4\n\t"
8230
330086b89d8f minor optimization & gcc-CVS fix/workaround patch by (Glen Nakamura <glen at imodulo dot com>)
michael
parents: 4497
diff changeset
554 "punpckldq %%mm4, %%mm2\n\t"
330086b89d8f minor optimization & gcc-CVS fix/workaround patch by (Glen Nakamura <glen at imodulo dot com>)
michael
parents: 4497
diff changeset
555 "punpckhdq %%mm2, %%mm4\n\t"
4497
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
556 #endif
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
557 "pfmul %%mm3, %%mm0\n\t"
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
558 "pfmul %%mm4, %%mm1\n\t"
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
559 "pxor %%mm6, %%mm0\n\t"
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
560 "pxor %%mm7, %%mm1\n\t"
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
561 "movq %%mm0, (%0)\n\t"
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
562 "movq %%mm1, 512(%0)"
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
563 :"=r"(delay_ptr)
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
564 :"r"(&buf[i].imag), "r"(&buf[64-i-1].imag), "r"(window_ptr), "0"(delay_ptr)
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
565 :"memory");
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
566 delay_ptr += 2;
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
567 }
27757
b5a46071062a Replace all occurrences of '__volatile__' and '__volatile' by plain 'volatile'.
diego
parents: 27754
diff changeset
568 __asm__ volatile ("femms":::"memory");
4497
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
569 #else
27757
b5a46071062a Replace all occurrences of '__volatile__' and '__volatile' by plain 'volatile'.
diego
parents: 27754
diff changeset
570 __asm__ volatile ("femms":::"memory");
4497
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
571 for(i=0; i< 64; i++) {
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
572 *delay_ptr++ = -buf[64+i].real * *--window_ptr;
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
573 *delay_ptr++ = buf[64-i-1].imag * *--window_ptr;
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
574 }
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
575
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
576 for(i=0; i<64; i++) {
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
577 *delay_ptr++ = buf[i].imag * *--window_ptr;
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
578 *delay_ptr++ = -buf[128-i-1].real * *--window_ptr;
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
579 }
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
580 #endif
d3aedd7db02c Restore K7 support
nick
parents:
diff changeset
581 }