more ices
[ICEs.git] / 287391 / svolume_mmx.i.3
1 typedef long int int64_t;
2 typedef int64_t pa_reg_x86;
3 void pa_volume_s16ne_mmx(short *samples, int *volumes, unsigned channels,
4 unsigned length)
5 {
6 long int channel;
7 long int temp;
8 __asm__ __volatile__(" xor %3, %3 \n\t"
9 " sar $1, %2 \n\t"
10 " test $1, %2 \n\t"
11 " je 2f \n\t"
12 " movd (%1, %3, 4), %%mm0 \n\t"
13 " movw (%0), %w4 \n\t"
14 " movd %4, %%mm1 \n\t"
15 " pxor %%mm4, %%mm4 \n\t"
16 " punpcklwd %%mm4, " "%%mm1" " \n\t"
17 " pcmpgtw " "%%mm0" ", %%mm4 \n\t"
18 " pand " "%%mm1" ", %%mm4 \n\t"
19 " movq " "%%mm1" ", %%mm5 \n\t"
20 " pmulhw " "%%mm0" ", " "%%mm1" " \n\t"
21 " paddw %%mm4, " "%%mm1" " \n\t"
22 " psrld $16, " "%%mm0" " \n\t"
23 " pmaddwd %%mm5, " "%%mm0" " \n\t"
24 " paddd " "%%mm1" ", " "%%mm0" " \n\t"
25 " packssdw " "%%mm0" ", " "%%mm0" " \n\t"
26 " movd %%mm0, %4 \n\t"
27 " movw %w4, (%0) \n\t"
28 " add $2, %0 \n\t" " add " "$1"
29 ", %3 \n\t"
30 " mov %3, %4 \n\t" " sub " "%5"
31 ", %4 \n\t"
32 " cmovae %4, %3 \n\t"
33 "2: \n\t"
34 " sar $1, %2 \n\t"
35 " test $1, %2 \n\t"
36 " je 4f \n\t"
37 "3: \n\t"
38 " movq (%1, %3, 4), %%mm0 \n\t"
39 " movd (%0), %%mm1 \n\t"
40 " pxor %%mm4, %%mm4 \n\t"
41 " punpcklwd %%mm4, " "%%mm1" " \n\t"
42 " pcmpgtw " "%%mm0" ", %%mm4 \n\t"
43 " pand " "%%mm1" ", %%mm4 \n\t"
44 " movq " "%%mm1" ", %%mm5 \n\t"
45 " pmulhw " "%%mm0" ", " "%%mm1" " \n\t"
46 " paddw %%mm4, " "%%mm1" " \n\t"
47 " psrld $16, " "%%mm0" " \n\t"
48 " pmaddwd %%mm5, " "%%mm0" " \n\t"
49 " paddd " "%%mm1" ", " "%%mm0" " \n\t"
50 " packssdw " "%%mm0" ", " "%%mm0" " \n\t"
51 " movd %%mm0, (%0) \n\t"
52 " add $4, %0 \n\t" " add " "$2"
53 ", %3 \n\t"
54 " mov %3, %4 \n\t" " sub " "%5"
55 ", %4 \n\t"
56 " cmovae %4, %3 \n\t"
57 "4: \n\t"
58 " sar $1, %2 \n\t"
59 " cmp $0, %2 \n\t"
60 " je 6f \n\t"
61 "5: \n\t"
62 " movq (%1, %3, 4), %%mm0 \n\t"
63 " movq 8(%1, %3, 4), %%mm2 \n\t"
64 " movd (%0), %%mm1 \n\t"
65 " movd 4(%0), %%mm3 \n\t"
66 " pxor %%mm4, %%mm4 \n\t"
67 " punpcklwd %%mm4, " "%%mm1" " \n\t"
68 " pcmpgtw " "%%mm0" ", %%mm4 \n\t"
69 " pand " "%%mm1" ", %%mm4 \n\t"
70 " movq " "%%mm1" ", %%mm5 \n\t"
71 " pmulhw " "%%mm0" ", " "%%mm1" " \n\t"
72 " paddw %%mm4, " "%%mm1" " \n\t"
73 " psrld $16, " "%%mm0" " \n\t"
74 " pmaddwd %%mm5, " "%%mm0" " \n\t"
75 " paddd " "%%mm1" ", " "%%mm0" " \n\t"
76 " packssdw " "%%mm0" ", " "%%mm0" " \n\t"
77 " pxor %%mm4, %%mm4 \n\t"
78 " punpcklwd %%mm4, " "%%mm3" " \n\t"
79 " pcmpgtw " "%%mm2" ", %%mm4 \n\t"
80 " pand " "%%mm3" ", %%mm4 \n\t"
81 " movq " "%%mm3" ", %%mm5 \n\t"
82 " pmulhw " "%%mm2" ", " "%%mm3" " \n\t"
83 " paddw %%mm4, " "%%mm3" " \n\t"
84 " psrld $16, " "%%mm2" " \n\t"
85 " pmaddwd %%mm5, " "%%mm2" " \n\t"
86 " paddd " "%%mm3" ", " "%%mm2" " \n\t"
87 " packssdw " "%%mm2" ", " "%%mm2" " \n\t"
88 " movd %%mm0, (%0) \n\t"
89 " movd %%mm2, 4(%0) \n\t"
90 " add $8, %0 \n\t" " add " "$4"
91 ", %3 \n\t"
92 " mov %3, %4 \n\t" " sub " "%5"
93 ", %4 \n\t"
94 " cmovae %4, %3 \n\t"
95 " dec %2 \n\t"
96 " jne 5b \n\t"
97 "6: \n\t"
98 " emms \n\t":"+r"
99 (samples), "+r"(volumes), "+r"(length),
100 "=D"((pa_reg_x86) channel),
101 "=&r"(temp):"X"((pa_reg_x86) channels):"cc");
102 }