annotate liba52/resample_mmx.c @ 1423:2e590fee59bd libavcodec

mpeg2 regression test add mpeg2video_decoder, thats more consistant with the encoders, note, both mpeg1video and mpeg2video decoder will happily decode both mpeg1 and 2
author michaelni
date Tue, 26 Aug 2003 07:42:25 +0000
parents 6a6dbba3da95
children 06e1d7d44d19
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1193
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
1
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
2 // MMX optimizations from Michael Niedermayer (michaelni@gmx.at) (under GPL)
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
3
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
4 /* optimization TODO / NOTES
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
5 movntq is slightly faster (0.5% with the current test.c benchmark)
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
6 (but thats just test.c so that needs to be testd in reallity)
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
7 and it would mean (C / MMX2 / MMX / 3DNOW) versions
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
8 */
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
9
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
10 static uint64_t __attribute__((aligned(8))) magicF2W= 0x43c0000043c00000LL;
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
11 static uint64_t __attribute__((aligned(8))) wm1010= 0xFFFF0000FFFF0000LL;
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
12 static uint64_t __attribute__((aligned(8))) wm0101= 0x0000FFFF0000FFFFLL;
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
13 static uint64_t __attribute__((aligned(8))) wm1100= 0xFFFFFFFF00000000LL;
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
14
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
15 static int a52_resample_MONO_to_5_MMX(float * _f, int16_t * s16){
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
16 int32_t * f = (int32_t *) _f;
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
17 asm volatile(
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
18 "movl $-512, %%esi \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
19 "movq "MANGLE(magicF2W)", %%mm7 \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
20 "movq "MANGLE(wm1100)", %%mm3 \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
21 "movq "MANGLE(wm0101)", %%mm4 \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
22 "movq "MANGLE(wm1010)", %%mm5 \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
23 "pxor %%mm6, %%mm6 \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
24 "1: \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
25 "movq (%1, %%esi, 2), %%mm0 \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
26 "movq 8(%1, %%esi, 2), %%mm1 \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
27 "leal (%%esi, %%esi, 4), %%edi \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
28 "psubd %%mm7, %%mm0 \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
29 "psubd %%mm7, %%mm1 \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
30 "packssdw %%mm1, %%mm0 \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
31 "movq %%mm0, %%mm1 \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
32 "pand %%mm4, %%mm0 \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
33 "pand %%mm5, %%mm1 \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
34 "movq %%mm6, (%0, %%edi) \n\t" // 0 0 0 0
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
35 "movd %%mm0, 8(%0, %%edi) \n\t" // A 0
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
36 "pand %%mm3, %%mm0 \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
37 "movd %%mm6, 12(%0, %%edi) \n\t" // 0 0
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
38 "movd %%mm1, 16(%0, %%edi) \n\t" // 0 B
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
39 "pand %%mm3, %%mm1 \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
40 "movd %%mm6, 20(%0, %%edi) \n\t" // 0 0
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
41 "movq %%mm0, 24(%0, %%edi) \n\t" // 0 0 C 0
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
42 "movq %%mm1, 32(%0, %%edi) \n\t" // 0 0 0 B
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
43 "addl $8, %%esi \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
44 " jnz 1b \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
45 "emms \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
46 :: "r" (s16+1280), "r" (f+256)
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
47 :"%esi", "%edi", "memory"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
48 );
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
49 return 5*256;
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
50 }
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
51
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
52 static int a52_resample_STEREO_to_2_MMX(float * _f, int16_t * s16){
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
53 int32_t * f = (int32_t *) _f;
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
54 /* benchmark scores are 0.3% better with SSE but we would need to set bias=0 and premultiply it
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
55 #ifdef HAVE_SSE
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
56 asm volatile(
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
57 "movl $-1024, %%esi \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
58 "1: \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
59 "cvtps2pi (%1, %%esi), %%mm0 \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
60 "cvtps2pi 1024(%1, %%esi), %%mm2\n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
61 "movq %%mm0, %%mm1 \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
62 "punpcklwd %%mm2, %%mm0 \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
63 "punpckhwd %%mm2, %%mm1 \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
64 "movq %%mm0, (%0, %%esi) \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
65 "movq %%mm1, 8(%0, %%esi) \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
66 "addl $16, %%esi \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
67 " jnz 1b \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
68 "emms \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
69 :: "r" (s16+512), "r" (f+256)
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
70 :"%esi", "memory"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
71 );*/
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
72 asm volatile(
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
73 "movl $-1024, %%esi \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
74 "movq "MANGLE(magicF2W)", %%mm7 \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
75 "1: \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
76 "movq (%1, %%esi), %%mm0 \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
77 "movq 8(%1, %%esi), %%mm1 \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
78 "movq 1024(%1, %%esi), %%mm2 \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
79 "movq 1032(%1, %%esi), %%mm3 \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
80 "psubd %%mm7, %%mm0 \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
81 "psubd %%mm7, %%mm1 \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
82 "psubd %%mm7, %%mm2 \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
83 "psubd %%mm7, %%mm3 \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
84 "packssdw %%mm1, %%mm0 \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
85 "packssdw %%mm3, %%mm2 \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
86 "movq %%mm0, %%mm1 \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
87 "punpcklwd %%mm2, %%mm0 \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
88 "punpckhwd %%mm2, %%mm1 \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
89 "movq %%mm0, (%0, %%esi) \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
90 "movq %%mm1, 8(%0, %%esi) \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
91 "addl $16, %%esi \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
92 " jnz 1b \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
93 "emms \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
94 :: "r" (s16+512), "r" (f+256)
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
95 :"%esi", "memory"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
96 );
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
97 return 2*256;
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
98 }
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
99
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
100 static int a52_resample_3F_to_5_MMX(float * _f, int16_t * s16){
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
101 int32_t * f = (int32_t *) _f;
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
102 asm volatile(
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
103 "movl $-1024, %%esi \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
104 "movq "MANGLE(magicF2W)", %%mm7 \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
105 "pxor %%mm6, %%mm6 \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
106 "movq %%mm7, %%mm5 \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
107 "punpckldq %%mm6, %%mm5 \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
108 "1: \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
109 "movd (%1, %%esi), %%mm0 \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
110 "punpckldq 2048(%1, %%esi), %%mm0\n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
111 "movd 1024(%1, %%esi), %%mm1 \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
112 "punpckldq 4(%1, %%esi), %%mm1 \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
113 "movd 2052(%1, %%esi), %%mm2 \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
114 "movq %%mm7, %%mm3 \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
115 "punpckldq 1028(%1, %%esi), %%mm3\n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
116 "movd 8(%1, %%esi), %%mm4 \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
117 "punpckldq 2056(%1, %%esi), %%mm4\n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
118 "leal (%%esi, %%esi, 4), %%edi \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
119 "sarl $1, %%edi \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
120 "psubd %%mm7, %%mm0 \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
121 "psubd %%mm7, %%mm1 \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
122 "psubd %%mm5, %%mm2 \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
123 "psubd %%mm7, %%mm3 \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
124 "psubd %%mm7, %%mm4 \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
125 "packssdw %%mm6, %%mm0 \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
126 "packssdw %%mm2, %%mm1 \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
127 "packssdw %%mm4, %%mm3 \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
128 "movq %%mm0, (%0, %%edi) \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
129 "movq %%mm1, 8(%0, %%edi) \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
130 "movq %%mm3, 16(%0, %%edi) \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
131
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
132 "movd 1032(%1, %%esi), %%mm1 \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
133 "punpckldq 12(%1, %%esi), %%mm1\n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
134 "movd 2060(%1, %%esi), %%mm2 \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
135 "movq %%mm7, %%mm3 \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
136 "punpckldq 1036(%1, %%esi), %%mm3\n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
137 "pxor %%mm0, %%mm0 \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
138 "psubd %%mm7, %%mm1 \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
139 "psubd %%mm5, %%mm2 \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
140 "psubd %%mm7, %%mm3 \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
141 "packssdw %%mm1, %%mm0 \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
142 "packssdw %%mm3, %%mm2 \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
143 "movq %%mm0, 24(%0, %%edi) \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
144 "movq %%mm2, 32(%0, %%edi) \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
145
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
146 "addl $16, %%esi \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
147 " jnz 1b \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
148 "emms \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
149 :: "r" (s16+1280), "r" (f+256)
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
150 :"%esi", "%edi", "memory"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
151 );
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
152 return 5*256;
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
153 }
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
154
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
155 static int a52_resample_2F_2R_to_4_MMX(float * _f, int16_t * s16){
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
156 int32_t * f = (int32_t *) _f;
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
157 asm volatile(
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
158 "movl $-1024, %%esi \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
159 "movq "MANGLE(magicF2W)", %%mm7 \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
160 "1: \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
161 "movq (%1, %%esi), %%mm0 \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
162 "movq 8(%1, %%esi), %%mm1 \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
163 "movq 1024(%1, %%esi), %%mm2 \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
164 "movq 1032(%1, %%esi), %%mm3 \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
165 "psubd %%mm7, %%mm0 \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
166 "psubd %%mm7, %%mm1 \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
167 "psubd %%mm7, %%mm2 \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
168 "psubd %%mm7, %%mm3 \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
169 "packssdw %%mm1, %%mm0 \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
170 "packssdw %%mm3, %%mm2 \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
171 "movq 2048(%1, %%esi), %%mm3 \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
172 "movq 2056(%1, %%esi), %%mm4 \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
173 "movq 3072(%1, %%esi), %%mm5 \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
174 "movq 3080(%1, %%esi), %%mm6 \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
175 "psubd %%mm7, %%mm3 \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
176 "psubd %%mm7, %%mm4 \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
177 "psubd %%mm7, %%mm5 \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
178 "psubd %%mm7, %%mm6 \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
179 "packssdw %%mm4, %%mm3 \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
180 "packssdw %%mm6, %%mm5 \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
181 "movq %%mm0, %%mm1 \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
182 "movq %%mm3, %%mm4 \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
183 "punpcklwd %%mm2, %%mm0 \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
184 "punpckhwd %%mm2, %%mm1 \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
185 "punpcklwd %%mm5, %%mm3 \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
186 "punpckhwd %%mm5, %%mm4 \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
187 "movq %%mm0, %%mm2 \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
188 "movq %%mm1, %%mm5 \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
189 "punpckldq %%mm3, %%mm0 \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
190 "punpckhdq %%mm3, %%mm2 \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
191 "punpckldq %%mm4, %%mm1 \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
192 "punpckhdq %%mm4, %%mm5 \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
193 "movq %%mm0, (%0, %%esi,2) \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
194 "movq %%mm2, 8(%0, %%esi,2) \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
195 "movq %%mm1, 16(%0, %%esi,2) \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
196 "movq %%mm5, 24(%0, %%esi,2) \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
197 "addl $16, %%esi \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
198 " jnz 1b \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
199 "emms \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
200 :: "r" (s16+1024), "r" (f+256)
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
201 :"%esi", "memory"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
202 );
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
203 return 4*256;
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
204 }
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
205
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
206 static int a52_resample_3F_2R_to_5_MMX(float * _f, int16_t * s16){
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
207 int32_t * f = (int32_t *) _f;
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
208 asm volatile(
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
209 "movl $-1024, %%esi \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
210 "movq "MANGLE(magicF2W)", %%mm7 \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
211 "1: \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
212 "movd (%1, %%esi), %%mm0 \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
213 "punpckldq 2048(%1, %%esi), %%mm0\n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
214 "movd 3072(%1, %%esi), %%mm1 \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
215 "punpckldq 4096(%1, %%esi), %%mm1\n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
216 "movd 1024(%1, %%esi), %%mm2 \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
217 "punpckldq 4(%1, %%esi), %%mm2 \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
218 "movd 2052(%1, %%esi), %%mm3 \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
219 "punpckldq 3076(%1, %%esi), %%mm3\n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
220 "movd 4100(%1, %%esi), %%mm4 \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
221 "punpckldq 1028(%1, %%esi), %%mm4\n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
222 "movd 8(%1, %%esi), %%mm5 \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
223 "punpckldq 2056(%1, %%esi), %%mm5\n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
224 "leal (%%esi, %%esi, 4), %%edi \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
225 "sarl $1, %%edi \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
226 "psubd %%mm7, %%mm0 \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
227 "psubd %%mm7, %%mm1 \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
228 "psubd %%mm7, %%mm2 \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
229 "psubd %%mm7, %%mm3 \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
230 "psubd %%mm7, %%mm4 \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
231 "psubd %%mm7, %%mm5 \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
232 "packssdw %%mm1, %%mm0 \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
233 "packssdw %%mm3, %%mm2 \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
234 "packssdw %%mm5, %%mm4 \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
235 "movq %%mm0, (%0, %%edi) \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
236 "movq %%mm2, 8(%0, %%edi) \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
237 "movq %%mm4, 16(%0, %%edi) \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
238
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
239 "movd 3080(%1, %%esi), %%mm0 \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
240 "punpckldq 4104(%1, %%esi), %%mm0\n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
241 "movd 1032(%1, %%esi), %%mm1 \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
242 "punpckldq 12(%1, %%esi), %%mm1\n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
243 "movd 2060(%1, %%esi), %%mm2 \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
244 "punpckldq 3084(%1, %%esi), %%mm2\n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
245 "movd 4108(%1, %%esi), %%mm3 \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
246 "punpckldq 1036(%1, %%esi), %%mm3\n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
247 "psubd %%mm7, %%mm0 \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
248 "psubd %%mm7, %%mm1 \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
249 "psubd %%mm7, %%mm2 \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
250 "psubd %%mm7, %%mm3 \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
251 "packssdw %%mm1, %%mm0 \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
252 "packssdw %%mm3, %%mm2 \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
253 "movq %%mm0, 24(%0, %%edi) \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
254 "movq %%mm2, 32(%0, %%edi) \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
255
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
256 "addl $16, %%esi \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
257 " jnz 1b \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
258 "emms \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
259 :: "r" (s16+1280), "r" (f+256)
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
260 :"%esi", "%edi", "memory"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
261 );
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
262 return 5*256;
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
263 }
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
264
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
265 static int a52_resample_MONO_LFE_to_6_MMX(float * _f, int16_t * s16){
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
266 int32_t * f = (int32_t *) _f;
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
267 asm volatile(
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
268 "movl $-1024, %%esi \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
269 "movq "MANGLE(magicF2W)", %%mm7 \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
270 "pxor %%mm6, %%mm6 \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
271 "1: \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
272 "movq 1024(%1, %%esi), %%mm0 \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
273 "movq 1032(%1, %%esi), %%mm1 \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
274 "movq (%1, %%esi), %%mm2 \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
275 "movq 8(%1, %%esi), %%mm3 \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
276 "psubd %%mm7, %%mm0 \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
277 "psubd %%mm7, %%mm1 \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
278 "psubd %%mm7, %%mm2 \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
279 "psubd %%mm7, %%mm3 \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
280 "packssdw %%mm1, %%mm0 \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
281 "packssdw %%mm3, %%mm2 \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
282 "movq %%mm0, %%mm1 \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
283 "punpcklwd %%mm2, %%mm0 \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
284 "punpckhwd %%mm2, %%mm1 \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
285 "leal (%%esi, %%esi, 2), %%edi \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
286 "movq %%mm6, (%0, %%edi) \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
287 "movd %%mm0, 8(%0, %%edi) \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
288 "punpckhdq %%mm0, %%mm0 \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
289 "movq %%mm6, 12(%0, %%edi) \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
290 "movd %%mm0, 20(%0, %%edi) \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
291 "movq %%mm6, 24(%0, %%edi) \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
292 "movd %%mm1, 32(%0, %%edi) \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
293 "punpckhdq %%mm1, %%mm1 \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
294 "movq %%mm6, 36(%0, %%edi) \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
295 "movd %%mm1, 44(%0, %%edi) \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
296 "addl $16, %%esi \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
297 " jnz 1b \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
298 "emms \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
299 :: "r" (s16+1536), "r" (f+256)
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
300 :"%esi", "%edi", "memory"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
301 );
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
302 return 6*256;
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
303 }
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
304
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
305 static int a52_resample_STEREO_LFE_to_6_MMX(float * _f, int16_t * s16){
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
306 int32_t * f = (int32_t *) _f;
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
307 asm volatile(
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
308 "movl $-1024, %%esi \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
309 "movq "MANGLE(magicF2W)", %%mm7 \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
310 "pxor %%mm6, %%mm6 \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
311 "1: \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
312 "movq 1024(%1, %%esi), %%mm0 \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
313 "movq 2048(%1, %%esi), %%mm1 \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
314 "movq (%1, %%esi), %%mm5 \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
315 "psubd %%mm7, %%mm0 \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
316 "psubd %%mm7, %%mm1 \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
317 "psubd %%mm7, %%mm5 \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
318 "leal (%%esi, %%esi, 2), %%edi \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
319
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
320 "pxor %%mm4, %%mm4 \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
321 "packssdw %%mm5, %%mm0 \n\t" // FfAa
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
322 "packssdw %%mm4, %%mm1 \n\t" // 00Bb
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
323 "punpckhwd %%mm0, %%mm4 \n\t" // F0f0
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
324 "punpcklwd %%mm1, %%mm0 \n\t" // BAba
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
325 "movq %%mm0, %%mm1 \n\t" // BAba
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
326 "punpckldq %%mm4, %%mm3 \n\t" // f0XX
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
327 "punpckldq %%mm6, %%mm0 \n\t" // 00ba
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
328 "punpckhdq %%mm1, %%mm3 \n\t" // BAf0
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
329
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
330 "movq %%mm0, (%0, %%edi) \n\t" // 00ba
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
331 "punpckhdq %%mm4, %%mm0 \n\t" // F000
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
332 "movq %%mm3, 8(%0, %%edi) \n\t" // BAf0
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
333 "movq %%mm0, 16(%0, %%edi) \n\t" // F000
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
334 "addl $8, %%esi \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
335 " jnz 1b \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
336 "emms \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
337 :: "r" (s16+1536), "r" (f+256)
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
338 :"%esi", "%edi", "memory"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
339 );
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
340 return 6*256;
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
341 }
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
342
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
343 static int a52_resample_3F_LFE_to_6_MMX(float * _f, int16_t * s16){
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
344 int32_t * f = (int32_t *) _f;
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
345 asm volatile(
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
346 "movl $-1024, %%esi \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
347 "movq "MANGLE(magicF2W)", %%mm7 \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
348 "pxor %%mm6, %%mm6 \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
349 "1: \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
350 "movq 1024(%1, %%esi), %%mm0 \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
351 "movq 3072(%1, %%esi), %%mm1 \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
352 "movq 2048(%1, %%esi), %%mm4 \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
353 "movq (%1, %%esi), %%mm5 \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
354 "psubd %%mm7, %%mm0 \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
355 "psubd %%mm7, %%mm1 \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
356 "psubd %%mm7, %%mm4 \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
357 "psubd %%mm7, %%mm5 \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
358 "leal (%%esi, %%esi, 2), %%edi \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
359
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
360 "packssdw %%mm4, %%mm0 \n\t" // EeAa
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
361 "packssdw %%mm5, %%mm1 \n\t" // FfBb
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
362 "movq %%mm0, %%mm2 \n\t" // EeAa
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
363 "punpcklwd %%mm1, %%mm0 \n\t" // BAba
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
364 "punpckhwd %%mm1, %%mm2 \n\t" // FEfe
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
365 "movq %%mm0, %%mm1 \n\t" // BAba
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
366 "punpckldq %%mm6, %%mm0 \n\t" // 00ba
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
367 "punpckhdq %%mm1, %%mm1 \n\t" // BABA
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
368
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
369 "movq %%mm0, (%0, %%edi) \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
370 "punpckhdq %%mm2, %%mm0 \n\t" // FE00
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
371 "punpckldq %%mm1, %%mm2 \n\t" // BAfe
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
372 "movq %%mm2, 8(%0, %%edi) \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
373 "movq %%mm0, 16(%0, %%edi) \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
374 "addl $8, %%esi \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
375 " jnz 1b \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
376 "emms \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
377 :: "r" (s16+1536), "r" (f+256)
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
378 :"%esi", "%edi", "memory"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
379 );
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
380 return 6*256;
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
381 }
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
382
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
383 static int a52_resample_2F_2R_LFE_to_6_MMX(float * _f, int16_t * s16){
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
384 int32_t * f = (int32_t *) _f;
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
385 asm volatile(
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
386 "movl $-1024, %%esi \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
387 "movq "MANGLE(magicF2W)", %%mm7 \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
388 // "pxor %%mm6, %%mm6 \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
389 "1: \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
390 "movq 1024(%1, %%esi), %%mm0 \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
391 "movq 2048(%1, %%esi), %%mm1 \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
392 "movq 3072(%1, %%esi), %%mm2 \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
393 "movq 4096(%1, %%esi), %%mm3 \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
394 "movq (%1, %%esi), %%mm5 \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
395 "psubd %%mm7, %%mm0 \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
396 "psubd %%mm7, %%mm1 \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
397 "psubd %%mm7, %%mm2 \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
398 "psubd %%mm7, %%mm3 \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
399 "psubd %%mm7, %%mm5 \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
400 "leal (%%esi, %%esi, 2), %%edi \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
401
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
402 "packssdw %%mm2, %%mm0 \n\t" // CcAa
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
403 "packssdw %%mm3, %%mm1 \n\t" // DdBb
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
404 "packssdw %%mm5, %%mm5 \n\t" // FfFf
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
405 "movq %%mm0, %%mm2 \n\t" // CcAa
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
406 "punpcklwd %%mm1, %%mm0 \n\t" // BAba
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
407 "punpckhwd %%mm1, %%mm2 \n\t" // DCdc
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
408 "pxor %%mm4, %%mm4 \n\t" // 0000
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
409 "punpcklwd %%mm5, %%mm4 \n\t" // F0f0
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
410 "movq %%mm0, %%mm1 \n\t" // BAba
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
411 "movq %%mm4, %%mm3 \n\t" // F0f0
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
412 "punpckldq %%mm2, %%mm0 \n\t" // dcba
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
413 "punpckhdq %%mm1, %%mm1 \n\t" // BABA
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
414 "punpckldq %%mm1, %%mm4 \n\t" // BAf0
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
415 "punpckhdq %%mm3, %%mm2 \n\t" // F0DC
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
416
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
417 "movq %%mm0, (%0, %%edi) \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
418 "movq %%mm4, 8(%0, %%edi) \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
419 "movq %%mm2, 16(%0, %%edi) \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
420 "addl $8, %%esi \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
421 " jnz 1b \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
422 "emms \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
423 :: "r" (s16+1536), "r" (f+256)
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
424 :"%esi", "%edi", "memory"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
425 );
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
426 return 6*256;
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
427 }
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
428
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
429 static int a52_resample_3F_2R_LFE_to_6_MMX(float * _f, int16_t * s16){
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
430 int32_t * f = (int32_t *) _f;
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
431 asm volatile(
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
432 "movl $-1024, %%esi \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
433 "movq "MANGLE(magicF2W)", %%mm7 \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
434 // "pxor %%mm6, %%mm6 \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
435 "1: \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
436 "movq 1024(%1, %%esi), %%mm0 \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
437 "movq 3072(%1, %%esi), %%mm1 \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
438 "movq 4096(%1, %%esi), %%mm2 \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
439 "movq 5120(%1, %%esi), %%mm3 \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
440 "movq 2048(%1, %%esi), %%mm4 \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
441 "movq (%1, %%esi), %%mm5 \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
442 "psubd %%mm7, %%mm0 \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
443 "psubd %%mm7, %%mm1 \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
444 "psubd %%mm7, %%mm2 \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
445 "psubd %%mm7, %%mm3 \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
446 "psubd %%mm7, %%mm4 \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
447 "psubd %%mm7, %%mm5 \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
448 "leal (%%esi, %%esi, 2), %%edi \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
449
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
450 "packssdw %%mm2, %%mm0 \n\t" // CcAa
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
451 "packssdw %%mm3, %%mm1 \n\t" // DdBb
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
452 "packssdw %%mm4, %%mm4 \n\t" // EeEe
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
453 "packssdw %%mm5, %%mm5 \n\t" // FfFf
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
454 "movq %%mm0, %%mm2 \n\t" // CcAa
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
455 "punpcklwd %%mm1, %%mm0 \n\t" // BAba
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
456 "punpckhwd %%mm1, %%mm2 \n\t" // DCdc
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
457 "punpcklwd %%mm5, %%mm4 \n\t" // FEfe
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
458 "movq %%mm0, %%mm1 \n\t" // BAba
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
459 "movq %%mm4, %%mm3 \n\t" // FEfe
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
460 "punpckldq %%mm2, %%mm0 \n\t" // dcba
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
461 "punpckhdq %%mm1, %%mm1 \n\t" // BABA
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
462 "punpckldq %%mm1, %%mm4 \n\t" // BAfe
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
463 "punpckhdq %%mm3, %%mm2 \n\t" // FEDC
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
464
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
465 "movq %%mm0, (%0, %%edi) \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
466 "movq %%mm4, 8(%0, %%edi) \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
467 "movq %%mm2, 16(%0, %%edi) \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
468 "addl $8, %%esi \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
469 " jnz 1b \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
470 "emms \n\t"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
471 :: "r" (s16+1536), "r" (f+256)
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
472 :"%esi", "%edi", "memory"
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
473 );
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
474 return 6*256;
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
475 }
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
476
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
477
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
478 static void* a52_resample_MMX(int flags, int ch){
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
479 switch (flags) {
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
480 case A52_MONO:
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
481 if(ch==5) return a52_resample_MONO_to_5_MMX;
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
482 break;
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
483 case A52_CHANNEL:
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
484 case A52_STEREO:
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
485 case A52_DOLBY:
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
486 if(ch==2) return a52_resample_STEREO_to_2_MMX;
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
487 break;
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
488 case A52_3F:
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
489 if(ch==5) return a52_resample_3F_to_5_MMX;
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
490 break;
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
491 case A52_2F2R:
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
492 if(ch==4) return a52_resample_2F_2R_to_4_MMX;
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
493 break;
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
494 case A52_3F2R:
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
495 if(ch==5) return a52_resample_3F_2R_to_5_MMX;
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
496 break;
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
497 case A52_MONO | A52_LFE:
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
498 if(ch==6) return a52_resample_MONO_LFE_to_6_MMX;
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
499 break;
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
500 case A52_CHANNEL | A52_LFE:
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
501 case A52_STEREO | A52_LFE:
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
502 case A52_DOLBY | A52_LFE:
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
503 if(ch==6) return a52_resample_STEREO_LFE_to_6_MMX;
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
504 break;
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
505 case A52_3F | A52_LFE:
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
506 if(ch==6) return a52_resample_3F_LFE_to_6_MMX;
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
507 break;
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
508 case A52_2F2R | A52_LFE:
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
509 if(ch==6) return a52_resample_2F_2R_LFE_to_6_MMX;
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
510 break;
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
511 case A52_3F2R | A52_LFE:
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
512 if(ch==6) return a52_resample_3F_2R_LFE_to_6_MMX;
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
513 break;
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
514 }
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
515 return NULL;
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
516 }
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
517
6a6dbba3da95 Utility functions (CRC calc & float->int converters)
arpi_esp
parents:
diff changeset
518