more ices
[ICEs.git] / 287391 / svolume_mmx.i.4
1 f(short *samples, int *volumes, unsigned channels,
2 unsigned length)
3 {
4 long channel, temp;
5 asm volatile(" xor %3, %3\n"
6 "2:\n"
7 " sar $1, %2\n"
8 " test $1, %2\n"
9 " je 4f\n"
10 "3:\n"
11 " movq (%1, %3, 4), %%mm0\n"
12 " movd (%0), %%mm1\n"
13 " pxor %%mm4, %%mm4\n"
14 " punpcklwd %%mm4, %%mm1\n"
15 " pcmpgtw %%mm0, %%mm4\n"
16 " pand %%mm1, %%mm4\n"
17 " movq %%mm1, %%mm5\n"
18 " pmulhw %%mm0, %%mm1\n"
19 " paddw %%mm4, %%mm1\n"
20 " psrld $16, %%mm0\n"
21 " pmaddwd %%mm5, %%mm0\n"
22 " paddd %%mm1, %%mm0\n"
23 " packssdw %%mm0, %%mm0\n"
24 " movd %%mm0, (%0)\n"
25 " add $4, %0\n"
26 " add $2, %3\n"
27 " mov %3, %4\n"
28 " sub %5, %4\n"
29 " cmovae %4, %3\n"
30 "4:\n"
31 " sar $1, %2\n"
32 " cmp $0, %2\n"
33 " je 6f\n"
34 "5:\n"
35 " movq (%1, %3, 4), %%mm0\n"
36 " movq 8(%1, %3, 4), %%mm2\n"
37 " movd (%0), %%mm1\n"
38 " movd 4(%0), %%mm3\n"
39 " pxor %%mm4, %%mm4\n"
40 " punpcklwd %%mm4, %%mm1\n"
41 " pcmpgtw %%mm0, %%mm4\n"
42 " pand %%mm1, %%mm4\n"
43 " movq %%mm1, %%mm5\n"
44 " pmulhw %%mm0, %%mm1\n"
45 " paddw %%mm4, %%mm1\n"
46 " psrld $16, %%mm0\n"
47 " pmaddwd %%mm5, %%mm0\n"
48 " paddd %%mm1, %%mm0\n"
49 " packssdw %%mm0, %%mm0\n"
50 " pxor %%mm4, %%mm4\n"
51 " punpcklwd %%mm4, %%mm3\n"
52 " pcmpgtw %%mm2, %%mm4\n"
53 " pand %%mm3, %%mm4\n"
54 " movq %%mm3, %%mm5\n"
55 " pmulhw %%mm2, %%mm3\n"
56 " paddw %%mm4, %%mm3\n"
57 " psrld $16, %%mm2\n"
58 " pmaddwd %%mm5, %%mm2\n"
59 " paddd %%mm3, %%mm2\n"
60 " packssdw %%mm2, %%mm2\n"
61 " movd %%mm0, (%0)\n"
62 " movd %%mm2, 4(%0)\n"
63 " add $8, %0\n"
64 " add $4, %3\n"
65 " mov %3, %4\n"
66 " sub %5, %4\n"
67 " cmovae %4, %3\n"
68 " dec %2\n"
69 " jne 5b\n"
70 "6:\n"
71 " emms\n":"+r"
72 (samples), "+r"(volumes), "+r"(length),
73 "=D"((long) channel),
74 "=&r"(temp):"X"((long) channels):"cc");
75 }