2 * This code was taken from http://www.mpg123.org
3 * See ChangeLog of mpg123-0.59s-pre.1 for detail
4 * Applied to mplayer by Nick Kurshev <nickols_k@mail.ru>
8 long __attribute__((aligned(8))) mp3lib_decwins
[544];
11 extern real mp3lib_decwin
[(512+32)];
12 // static long decwin [544];
14 static short intwinbase_MMX
[] =
16 0, -1, -1, -1, -1, -1, -1, -2,
17 -2, -2, -2, -3, -3, -4, -4, -5,
18 -5, -6, -7, -7, -8, -9, -10, -11,
19 -13, -14, -16, -17, -19, -21, -24, -26,
20 -29, -31, -35, -38, -41, -45, -49, -53,
21 -58, -63, -68, -73, -79, -85, -91, -97,
22 -104, -111, -117, -125, -132, -139, -147, -154,
23 -161, -169, -176, -183, -190, -196, -202, -208,
24 -213, -218, -222, -225, -227, -228, -228, -227,
25 -224, -221, -215, -208, -200, -189, -177, -163,
26 -146, -127, -106, -83, -57, -29, 2, 36,
27 72, 111, 153, 197, 244, 294, 347, 401,
28 459, 519, 581, 645, 711, 779, 848, 919,
29 991, 1064, 1137, 1210, 1283, 1356, 1428, 1498,
30 1567, 1634, 1698, 1759, 1817, 1870, 1919, 1962,
31 2001, 2032, 2057, 2075, 2085, 2087, 2080, 2063,
32 2037, 2000, 1952, 1893, 1822, 1739, 1644, 1535,
33 1414, 1280, 1131, 970, 794, 605, 402, 185,
34 -45, -288, -545, -814, -1095, -1388, -1692, -2006,
35 -2330, -2663, -3004, -3351, -3705, -4063, -4425, -4788,
36 -5153, -5517, -5879, -6237, -6589, -6935, -7271, -7597,
37 -7910, -8209, -8491, -8755, -8998, -9219, -9416, -9585,
38 -9727, -9838, -9916, -9959, -9966, -9935, -9863, -9750,
39 -9592, -9389, -9139, -8840, -8492, -8092, -7640, -7134,
40 -6574, -5959, -5288, -4561, -3776, -2935, -2037, -1082,
41 -70, 998, 2122, 3300, 4533, 5818, 7154, 8540,
42 9975, 11455, 12980, 14548, 16155, 17799, 19478, 21189,
43 22929, 24694, 26482, 28289, 30112, 31947,-26209,-24360,
44 -22511,-20664,-18824,-16994,-15179,-13383,-11610, -9863,
45 -8147, -6466, -4822, -3222, -1667, -162, 1289, 2684,
46 4019, 5290, 6494, 7629, 8692, 9679, 10590, 11420,
47 12169, 12835, 13415, 13908, 14313, 14630, 14856, 14992,
51 static long intwindiv
= 0x47800000;
53 void make_decode_tables_MMX(long scaleval
)
59 "xorl %%ecx,%%ecx\n\t"
60 "xorl %%ebx,%%ebx\n\t"
66 "movswl (%%edi),%%eax\n\t"
67 "cmpl %0+444,%%edi\n\t"
69 "addl $60000,%%eax\n\t"
73 "fdivs "MANGLE(intwindiv
)"\n\t"
76 "fsts %1(,%%ecx,4)\n\t"
77 "fstps %1+64(,%%ecx,4)\n\t"
79 "leal -1(%%esi),%%edx\n\t"
83 "addl $-1023,%%ecx\n\t"
84 "test %%esi,%%ebx\n\t"
88 "addl %%esi,%%ecx\n\t"
98 ::"g"(intwinbase_MMX
),"m"(mp3lib_decwin
[0]),"m"(scaleval
),"m"(intwinbase_step
)
99 :"memory","%ebx","%esi","%edi");
102 "xorl %%ecx,%%ecx\n\t"
103 "xorl %%ebx,%%ebx\n\t"
105 "cmpl $528,%%ecx\n\t"
107 "movswl (%%edi),%%eax\n\t"
108 "cmpl %0+444,%%edi\n\t"
110 "addl $60000,%%eax\n\t"
114 "shrdl $17,%%edx,%%eax\n\t"
115 "cmpl $32767,%%eax\n\t"
116 "movl $1055,%%edx\n\t"
118 "movl $32767,%%eax\n\t"
121 "cmpl $-32767,%%eax\n\t"
123 "movl $-32767,%%eax\n\t"
125 "cmpl $512,%%ecx\n\t"
127 "subl %%ecx,%%edx\n\t"
128 "movw %%ax,%1(,%%edx,2)\n\t"
129 "movw %%ax,%1-32(,%%edx,2)\n\t"
135 "movw %%ax,%1(,%%ecx,2)\n\t"
136 "movw %%ax,%1+32(,%%ecx,2)\n\t"
138 "leal -1(%%esi),%%edx\n\t"
139 "and %%ebx,%%edx\n\t"
142 "addl $-1023,%%ecx\n\t"
143 "test %%esi,%%ebx\n\t"
147 "addl %%esi,%%ecx\n\t"
157 ::"g"(intwinbase_MMX
),"m"(mp3lib_decwins
[0]),"m"(scaleval
),"m"(intwinbase_step
)
158 :"memory","%ebx","%esi","%edi");