Debian Codegraph @

src/libmpg123/tabinit_mmx.S

raw
1 /*
2 tabinit_mmx: make_decode_tables_mmx
3
4 copyright ?-2006 by the mpg123 project - free software under the terms of the LGPL 2.1
5 see COPYING and AUTHORS files in distribution or http://mpg123.org
6 initially written by the mysterious higway (apparently)
7
8 See synth_mmx.S about license history.
9 */
10
11 #include "mangle.h"
12
13 RODATA
14 ALIGN32
15 .globl ASM_NAME(INT123_costab_mmxsse)
16 ASM_NAME(INT123_costab_mmxsse):
17 .long 1056974725
18 .long 1057056395
19 .long 1057223771
20 .long 1057485416
21 .long 1057855544
22 .long 1058356026
23 .long 1059019886
24 .long 1059897405
25 .long 1061067246
26 .long 1062657950
27 .long 1064892987
28 .long 1066774581
29 .long 1069414683
30 .long 1073984175
31 .long 1079645762
32 .long 1092815430
33 .long 1057005197
34 .long 1057342072
35 .long 1058087743
36 .long 1059427869
37 .long 1061799040
38 .long 1065862217
39 .long 1071413542
40 .long 1084439708
41 .long 1057128951
42 .long 1058664893
43 .long 1063675095
44 .long 1076102863
45 .long 1057655764
46 .long 1067924853
47 .long 1060439283
48 ALIGN32
49 intwinbase:
50 .short 0, -1, -1, -1, -1, -1, -1, -2
51 .short -2, -2, -2, -3, -3, -4, -4, -5
52 .short -5, -6, -7, -7, -8, -9, -10, -11
53 .short -13, -14, -16, -17, -19, -21, -24, -26
54 .short -29, -31, -35, -38, -41, -45, -49, -53
55 .short -58, -63, -68, -73, -79, -85, -91, -97
56 .short -104, -111, -117, -125, -132, -139, -147, -154
57 .short -161, -169, -176, -183, -190, -196, -202, -208
58 .short -213, -218, -222, -225, -227, -228, -228, -227
59 .short -224, -221, -215, -208, -200, -189, -177, -163
60 .short -146, -127, -106, -83, -57, -29, 2, 36
61 .short 72, 111, 153, 197, 244, 294, 347, 401
62 .short 459, 519, 581, 645, 711, 779, 848, 919
63 .short 991, 1064, 1137, 1210, 1283, 1356, 1428, 1498
64 .short 1567, 1634, 1698, 1759, 1817, 1870, 1919, 1962
65 .short 2001, 2032, 2057, 2075, 2085, 2087, 2080, 2063
66 .short 2037, 2000, 1952, 1893, 1822, 1739, 1644, 1535
67 .short 1414, 1280, 1131, 970, 794, 605, 402, 185
68 .short -45, -288, -545, -814, -1095, -1388, -1692, -2006
69 .short -2330, -2663, -3004, -3351, -3705, -4063, -4425, -4788
70 .short -5153, -5517, -5879, -6237, -6589, -6935, -7271, -7597
71 .short -7910, -8209, -8491, -8755, -8998, -9219, -9416, -9585
72 .short -9727, -9838, -9916, -9959, -9966, -9935, -9863, -9750
73 .short -9592, -9389, -9139, -8840, -8492, -8092, -7640, -7134
74 .short -6574, -5959, -5288, -4561, -3776, -2935, -2037, -1082
75 .short -70, 998, 2122, 3300, 4533, 5818, 7154, 8540
76 .short 9975, 11455, 12980, 14548, 16155, 17799, 19478, 21189
77 .short 22929, 24694, 26482, 28289, 30112, 31947,-26209,-24360
78 .short -22511,-20664,-18824,-16994,-15179,-13383,-11610, -9863
79 .short -8147, -6466, -4822, -3222, -1667, -162, 1289, 2684
80 .short 4019, 5290, 6494, 7629, 8692, 9679, 10590, 11420
81 .short 12169, 12835, 13415, 13908, 14313, 14630, 14856, 14992
82 .short 15038
83
84 intwindiv:
85 .long 0x47800000 # 65536.0
86 .text
87 ALIGN32
88 /* void make_decode_tables_mmx_asm(long scaleval, float* decwin_mmx, float *decwins); */
89 .globl ASM_NAME(INT123_make_decode_tables_mmx_asm)
90 ASM_NAME(INT123_make_decode_tables_mmx_asm):
91 pushl %ebp
92 mov %esp,%ebp
93 sub $12,%esp
94 pushl %edi
95 pushl %esi
96 pushl %ebx
97
98 GET_GOT
99 lea LOCAL_VAR(intwinbase),%edi
100 mov LOCAL_VAR(intwindiv),%ecx
101 mov %edi,-4(%ebp)
102 lea 444(%edi),%eax
103 mov %eax,-8(%ebp)
104 mov %ecx,-12(%ebp)
105
106 /* stack: -12(%ebp)=*intwindiv, -8(%ebp)=intwinbase+444, -4(%ebp)=intwinbase, ... ,
107 4(%ebp)=back, 8(%ebp)=scaleval, 12(%ebp)=decwin_mmx, 16(%ebp)=decwins */
108 #define INTWINDIV -12(%ebp)
109 #define INTWINBASE_PLUS_444 -8(%ebp)
110 #define INTWINBASE -4(%ebp)
111 #define SCALEVAL 8(%ebp)
112 #define DECWIN_MMX 12(%ebp)
113 #define DECWINS 16(%ebp)
114
115 xorl %ecx,%ecx
116 xorl %ebx,%ebx
117 movl $32,%esi
118
119 negl SCALEVAL /* scaleval */
120 pushl $2 /* intwinbase step */
121 .L00:
122 cmpl $528,%ecx
123 jnc .L02
124 movswl (%edi),%eax
125 cmpl INTWINBASE_PLUS_444,%edi
126 jc .L01
127 addl $60000,%eax
128 .L01:
129 pushl %eax
130 fildl (%esp)
131 fdivs INTWINDIV
132 fimull SCALEVAL /* scaleval */
133 /* eax used to be popped the line before... I'll just use it here a bit */
134 movl DECWIN_MMX,%eax /* decwin_mmx */
135 fsts (%eax,%ecx,4)
136 fstps 64(%eax,%ecx,4)
137 popl %eax
138 .L02:
139 leal -1(%esi),%edx
140 andl %ebx,%edx
141 cmpl $31,%edx
142 jnz .L03
143 addl $-1023,%ecx
144 testl %esi,%ebx
145 jz .L03
146 negl SCALEVAL
147 .L03:
148 addl %esi,%ecx
149 addl (%esp),%edi
150 incl %ebx
151 cmpl INTWINBASE,%edi
152 jz .L04
153 cmpl $256,%ebx
154 jnz .L00
155 negl (%esp)
156 jmp .L00
157 .L04:
158 popl %eax
159
160 xorl %ecx,%ecx
161 xorl %ebx,%ebx
162 pushl $2 /* paired with popl above */
163 .L05:
164 cmpl $528,%ecx
165 jnc .L11
166 movswl (%edi),%eax
167 cmpl INTWINBASE_PLUS_444,%edi
168 jc .L06
169 addl $60000,%eax
170 .L06:
171 cltd
172 imull SCALEVAL
173 shrdl $17,%edx,%eax
174 cmpl $32767,%eax
175 movl $1055,%edx
176 jle .L07
177 movl $32767,%eax
178 jmp .L08
179 .L07:
180 cmpl $-32767,%eax
181 jge .L08
182 movl $-32767,%eax
183 .L08:
184 /* going to use ebx for decwins, watch the jumps */
185 pushl %ebx
186 movl DECWINS,%ebx
187 cmpl $512,%ecx
188 jnc .L09
189 subl %ecx,%edx
190 movw %ax,(%ebx,%edx,2) /* decwins */
191 movw %ax,-32(%ebx,%edx,2)
192 .L09:
193 testl $1,%ecx
194 jnz .L10
195 negl %eax
196 .L10:
197 movw %ax,(%ebx,%ecx,2)
198 movw %ax,32(%ebx,%ecx,2)
199 popl %ebx /* that has to match the pushl before */
200 .L11:
201 leal -1(%esi),%edx
202 andl %ebx,%edx
203 cmpl $31,%edx
204 jnz .L12
205 addl $-1023,%ecx
206 testl %esi,%ebx
207 jz .L12
208 negl SCALEVAL
209 .L12:
210 addl %esi,%ecx
211 addl (%esp),%edi
212 incl %ebx
213 cmpl INTWINBASE,%edi
214 jz .L13
215 cmpl $256,%ebx
216 jnz .L05
217 negl (%esp)
218 jmp .L05
219 .L13:
220 popl %eax
221
222 popl %ebx
223 popl %esi
224 popl %edi
225 mov %ebp,%esp
226 pop %ebp
227 ret
228
229 NONEXEC_STACK