~ubuntu-branches/ubuntu/lucid/mpg123/lucid

« back to all changes in this revision

Viewing changes to src/tabinit_mmx.s

Tags: upstream-0.66
ImportĀ upstreamĀ versionĀ 0.66

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/       tabinit_MMX.s: ...
2
 
 
3
 
/       copyright ?-2006 by the mpg123 project - free software under the terms of the LGPL 2.1
4
 
/       see COPYING and AUTHORS files in distribution or http://mpg123.de
5
 
/       initially written by the mysterious higway (apparently)
6
 
 
7
 
.bss
8
 
        .align 32
9
 
        .comm   decwin,2176,32
10
 
        .align 32
11
 
        .comm   decwins,2176,32
12
 
 
13
 
.data
14
 
        .align 32
15
 
intwinbase:
16
 
        .value      0,    -1,    -1,    -1,    -1,    -1,    -1,    -2
17
 
        .value     -2,    -2,    -2,    -3,    -3,    -4,    -4,    -5
18
 
        .value     -5,    -6,    -7,    -7,    -8,    -9,   -10,   -11
19
 
        .value    -13,   -14,   -16,   -17,   -19,   -21,   -24,   -26
20
 
        .value    -29,   -31,   -35,   -38,   -41,   -45,   -49,   -53
21
 
        .value    -58,   -63,   -68,   -73,   -79,   -85,   -91,   -97
22
 
        .value   -104,  -111,  -117,  -125,  -132,  -139,  -147,  -154
23
 
        .value   -161,  -169,  -176,  -183,  -190,  -196,  -202,  -208
24
 
        .value   -213,  -218,  -222,  -225,  -227,  -228,  -228,  -227
25
 
        .value   -224,  -221,  -215,  -208,  -200,  -189,  -177,  -163
26
 
        .value   -146,  -127,  -106,   -83,   -57,   -29,     2,    36
27
 
        .value     72,   111,   153,   197,   244,   294,   347,   401
28
 
        .value    459,   519,   581,   645,   711,   779,   848,   919
29
 
        .value    991,  1064,  1137,  1210,  1283,  1356,  1428,  1498
30
 
        .value   1567,  1634,  1698,  1759,  1817,  1870,  1919,  1962
31
 
        .value   2001,  2032,  2057,  2075,  2085,  2087,  2080,  2063
32
 
        .value   2037,  2000,  1952,  1893,  1822,  1739,  1644,  1535
33
 
        .value   1414,  1280,  1131,   970,   794,   605,   402,   185
34
 
        .value    -45,  -288,  -545,  -814, -1095, -1388, -1692, -2006
35
 
        .value  -2330, -2663, -3004, -3351, -3705, -4063, -4425, -4788
36
 
        .value  -5153, -5517, -5879, -6237, -6589, -6935, -7271, -7597
37
 
        .value  -7910, -8209, -8491, -8755, -8998, -9219, -9416, -9585
38
 
        .value  -9727, -9838, -9916, -9959, -9966, -9935, -9863, -9750
39
 
        .value  -9592, -9389, -9139, -8840, -8492, -8092, -7640, -7134
40
 
        .value  -6574, -5959, -5288, -4561, -3776, -2935, -2037, -1082
41
 
        .value    -70,   998,  2122,  3300,  4533,  5818,  7154,  8540
42
 
        .value   9975, 11455, 12980, 14548, 16155, 17799, 19478, 21189
43
 
        .value  22929, 24694, 26482, 28289, 30112, 31947,-26209,-24360
44
 
        .value -22511,-20664,-18824,-16994,-15179,-13383,-11610, -9863
45
 
        .value  -8147, -6466, -4822, -3222, -1667,  -162,  1289,  2684
46
 
        .value   4019,  5290,  6494,  7629,  8692,  9679, 10590, 11420
47
 
        .value  12169, 12835, 13415, 13908, 14313, 14630, 14856, 14992
48
 
        .value  15038
49
 
 
50
 
intwindiv:
51
 
        .long 0x47800000                        # 65536.0
52
 
.text
53
 
        .align 32
54
 
.globl make_decode_tables
55
 
 
56
 
make_decode_tables:
57
 
        pushl %edi
58
 
        pushl %esi
59
 
        pushl %ebx
60
 
 
61
 
        xorl %ecx,%ecx
62
 
        xorl %ebx,%ebx
63
 
        movl $32,%esi
64
 
        movl $intwinbase,%edi
65
 
        negl 16(%esp)                           # scaleval
66
 
        pushl $2                                # intwinbase step
67
 
.L00:
68
 
        cmpl $528,%ecx
69
 
        jnc .L02
70
 
        movswl (%edi),%eax
71
 
        cmpl $intwinbase+444,%edi
72
 
        jc .L01
73
 
        addl $60000,%eax
74
 
.L01:
75
 
        pushl %eax
76
 
        fildl (%esp)
77
 
        fdivs intwindiv
78
 
        fimull 24(%esp)
79
 
        popl %eax
80
 
        fsts  decwin(,%ecx,4)
81
 
        fstps decwin+64(,%ecx,4)
82
 
.L02:
83
 
        leal -1(%esi),%edx
84
 
        and %ebx,%edx
85
 
        cmp $31,%edx
86
 
        jnz .L03
87
 
        addl $-1023,%ecx
88
 
        test %esi,%ebx
89
 
        jz  .L03
90
 
        negl 20(%esp)
91
 
.L03:
92
 
        addl %esi,%ecx
93
 
        addl (%esp),%edi
94
 
        incl %ebx
95
 
        cmpl $intwinbase,%edi
96
 
        jz .L04
97
 
        cmp $256,%ebx
98
 
        jnz .L00
99
 
        negl (%esp)
100
 
        jmp .L00
101
 
.L04:
102
 
        popl %eax
103
 
 
104
 
        xorl %ecx,%ecx
105
 
        xorl %ebx,%ebx
106
 
        pushl $2
107
 
.L05:
108
 
        cmpl $528,%ecx
109
 
        jnc .L11
110
 
        movswl (%edi),%eax
111
 
        cmpl $intwinbase+444,%edi
112
 
        jc .L06
113
 
        addl $60000,%eax
114
 
.L06:
115
 
        cltd
116
 
        imull 20(%esp)
117
 
        shrdl $17,%edx,%eax
118
 
        cmpl $32767,%eax
119
 
        movl $1055,%edx
120
 
        jle .L07
121
 
        movl $32767,%eax
122
 
        jmp .L08
123
 
.L07:
124
 
        cmpl $-32767,%eax
125
 
        jge .L08
126
 
        movl $-32767,%eax
127
 
.L08:
128
 
        cmpl $512,%ecx
129
 
        jnc .L09
130
 
        subl %ecx,%edx
131
 
        movw %ax,decwins(,%edx,2)
132
 
        movw %ax,decwins-32(,%edx,2)
133
 
.L09:
134
 
        testl $1,%ecx
135
 
        jnz .L10
136
 
        negl %eax
137
 
.L10:
138
 
        movw %ax,decwins(,%ecx,2)
139
 
        movw %ax,decwins+32(,%ecx,2)
140
 
.L11:
141
 
        leal -1(%esi),%edx
142
 
        and %ebx,%edx
143
 
        cmp $31,%edx
144
 
        jnz .L12
145
 
        addl $-1023,%ecx
146
 
        test %esi,%ebx
147
 
        jz  .L12
148
 
        negl 20(%esp)
149
 
.L12:
150
 
        addl %esi,%ecx
151
 
        addl (%esp),%edi
152
 
        incl %ebx
153
 
        cmpl $intwinbase,%edi
154
 
        jz .L13
155
 
        cmp $256,%ebx
156
 
        jnz .L05
157
 
        negl (%esp)
158
 
        jmp .L05
159
 
.L13:
160
 
        popl %eax
161
 
        
162
 
        popl %ebx
163
 
        popl %esi
164
 
        popl %edi
165
 
        ret
166