1 .file "wm_shrx.S"
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 #include "fpu_asm.h"
18
19 .text
20 .align 2,144
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36 .globl _shrx
37
38 _shrx:
39 push %ebp
40 movl %esp,%ebp
41 pushl %esi
42 movl PARAM2,%ecx
43 movl PARAM1,%esi
44 cmpl $32,%ecx
45 jnc L_more_than_31
46
47
48 pushl %ebx
49 movl (%esi),%ebx
50 movl 4(%esi),%edx
51 xorl %eax,%eax
52 shrd %cl,%ebx,%eax
53 shrd %cl,%edx,%ebx
54 shr %cl,%edx
55 movl %ebx,(%esi)
56 movl %edx,4(%esi)
57 popl %ebx
58 popl %esi
59 leave
60 ret
61
62 L_more_than_31:
63 cmpl $64,%ecx
64 jnc L_more_than_63
65
66 subb $32,%cl
67 movl (%esi),%eax
68 movl 4(%esi),%edx
69 shrd %cl,%edx,%eax
70 shr %cl,%edx
71 movl %edx,(%esi)
72 movl $0,4(%esi)
73 popl %esi
74 leave
75 ret
76
77 L_more_than_63:
78 cmpl $96,%ecx
79 jnc L_more_than_95
80
81 subb $64,%cl
82 movl 4(%esi),%eax
83 shr %cl,%eax
84 xorl %edx,%edx
85 movl %edx,(%esi)
86 movl %edx,4(%esi)
87 popl %esi
88 leave
89 ret
90
91 L_more_than_95:
92 xorl %eax,%eax
93 movl %eax,(%esi)
94 movl %eax,4(%esi)
95 popl %esi
96 leave
97 ret
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116 .globl _shrxs
117 _shrxs:
118 push %ebp
119 movl %esp,%ebp
120 pushl %esi
121 pushl %ebx
122 movl PARAM2,%ecx
123 movl PARAM1,%esi
124 cmpl $64,%ecx
125 jnc Ls_more_than_63
126
127 cmpl $32,%ecx
128 jc Ls_less_than_32
129
130
131
132
133 subb $32,%cl
134 movl (%esi),%eax
135 movl 4(%esi),%edx
136 xorl %ebx,%ebx
137 shrd %cl,%eax,%ebx
138 shrd %cl,%edx,%eax
139 shr %cl,%edx
140 orl %ebx,%ebx
141 setne %bl
142 test $0x7fffffff,%eax
143 setne %bh
144 orw %bx,%bx
145 setne %al
146 movl %edx,(%esi)
147 movl $0,4(%esi)
148 popl %ebx
149 popl %esi
150 leave
151 ret
152
153
154 Ls_less_than_32:
155 movl (%esi),%ebx
156 movl 4(%esi),%edx
157 xorl %eax,%eax
158 shrd %cl,%ebx,%eax
159 shrd %cl,%edx,%ebx
160 shr %cl,%edx
161 test $0x7fffffff,%eax
162 setne %al
163 movl %ebx,(%esi)
164 movl %edx,4(%esi)
165 popl %ebx
166 popl %esi
167 leave
168 ret
169
170
171 Ls_more_than_63:
172 cmpl $96,%ecx
173 jnc Ls_more_than_95
174
175 subb $64,%cl
176 movl (%esi),%ebx
177 movl 4(%esi),%eax
178 xorl %edx,%edx
179 shrd %cl,%ebx,%edx
180 shrd %cl,%eax,%ebx
181 shr %cl,%eax
182 orl %ebx,%edx
183 setne %bl
184 test $0x7fffffff,%eax
185 setne %bh
186 orw %bx,%bx
187 setne %al
188 xorl %edx,%edx
189 movl %edx,(%esi)
190 movl %edx,4(%esi)
191 popl %ebx
192 popl %esi
193 leave
194 ret
195
196 Ls_more_than_95:
197
198 xorl %eax,%eax
199 movl (%esi),%ebx
200 orl 4(%esi),%ebx
201 setne %al
202 xorl %ebx,%ebx
203 movl %ebx,(%esi)
204 movl %ebx,4(%esi)
205 popl %ebx
206 popl %esi
207 leave
208 ret