OLD | NEW |
| (Empty) |
1 .file "x86cpuid.s" | |
2 .text | |
3 .globl _OPENSSL_ia32_cpuid | |
4 .align 4 | |
5 _OPENSSL_ia32_cpuid: | |
6 L_OPENSSL_ia32_cpuid_begin: | |
7 pushl %ebp | |
8 pushl %ebx | |
9 pushl %esi | |
10 pushl %edi | |
11 xorl %edx,%edx | |
12 pushfl | |
13 popl %eax | |
14 movl %eax,%ecx | |
15 xorl $2097152,%eax | |
16 pushl %eax | |
17 popfl | |
18 pushfl | |
19 popl %eax | |
20 xorl %eax,%ecx | |
21 xorl %eax,%eax | |
22 btl $21,%ecx | |
23 jnc L000nocpuid | |
24 .byte 0x0f,0xa2 | |
25 movl %eax,%edi | |
26 xorl %eax,%eax | |
27 cmpl $1970169159,%ebx | |
28 setne %al | |
29 movl %eax,%ebp | |
30 cmpl $1231384169,%edx | |
31 setne %al | |
32 orl %eax,%ebp | |
33 cmpl $1818588270,%ecx | |
34 setne %al | |
35 orl %eax,%ebp | |
36 jz L001intel | |
37 cmpl $1752462657,%ebx | |
38 setne %al | |
39 movl %eax,%esi | |
40 cmpl $1769238117,%edx | |
41 setne %al | |
42 orl %eax,%esi | |
43 cmpl $1145913699,%ecx | |
44 setne %al | |
45 orl %eax,%esi | |
46 jnz L001intel | |
47 movl $2147483648,%eax | |
48 .byte 0x0f,0xa2 | |
49 cmpl $2147483649,%eax | |
50 jb L001intel | |
51 movl %eax,%esi | |
52 movl $2147483649,%eax | |
53 .byte 0x0f,0xa2 | |
54 orl %ecx,%ebp | |
55 andl $2049,%ebp | |
56 cmpl $2147483656,%esi | |
57 jb L001intel | |
58 movl $2147483656,%eax | |
59 .byte 0x0f,0xa2 | |
60 movzbl %cl,%esi | |
61 incl %esi | |
62 movl $1,%eax | |
63 .byte 0x0f,0xa2 | |
64 btl $28,%edx | |
65 jnc L002generic | |
66 shrl $16,%ebx | |
67 andl $255,%ebx | |
68 cmpl %esi,%ebx | |
69 ja L002generic | |
70 andl $4026531839,%edx | |
71 jmp L002generic | |
72 L001intel: | |
73 cmpl $4,%edi | |
74 movl $-1,%edi | |
75 jb L003nocacheinfo | |
76 movl $4,%eax | |
77 movl $0,%ecx | |
78 .byte 0x0f,0xa2 | |
79 movl %eax,%edi | |
80 shrl $14,%edi | |
81 andl $4095,%edi | |
82 L003nocacheinfo: | |
83 movl $1,%eax | |
84 .byte 0x0f,0xa2 | |
85 andl $3220176895,%edx | |
86 cmpl $0,%ebp | |
87 jne L004notintel | |
88 orl $1073741824,%edx | |
89 andb $15,%ah | |
90 cmpb $15,%ah | |
91 jne L004notintel | |
92 orl $1048576,%edx | |
93 L004notintel: | |
94 btl $28,%edx | |
95 jnc L002generic | |
96 andl $4026531839,%edx | |
97 cmpl $0,%edi | |
98 je L002generic | |
99 orl $268435456,%edx | |
100 shrl $16,%ebx | |
101 cmpb $1,%bl | |
102 ja L002generic | |
103 andl $4026531839,%edx | |
104 L002generic: | |
105 andl $2048,%ebp | |
106 andl $4294965247,%ecx | |
107 movl %edx,%esi | |
108 orl %ecx,%ebp | |
109 btl $27,%ecx | |
110 jnc L005clear_avx | |
111 xorl %ecx,%ecx | |
112 .byte 15,1,208 | |
113 andl $6,%eax | |
114 cmpl $6,%eax | |
115 je L006done | |
116 cmpl $2,%eax | |
117 je L005clear_avx | |
118 L007clear_xmm: | |
119 andl $4261412861,%ebp | |
120 andl $4278190079,%esi | |
121 L005clear_avx: | |
122 andl $4026525695,%ebp | |
123 L006done: | |
124 movl %esi,%eax | |
125 movl %ebp,%edx | |
126 L000nocpuid: | |
127 popl %edi | |
128 popl %esi | |
129 popl %ebx | |
130 popl %ebp | |
131 ret | |
132 .globl _OPENSSL_rdtsc | |
133 .align 4 | |
134 _OPENSSL_rdtsc: | |
135 L_OPENSSL_rdtsc_begin: | |
136 xorl %eax,%eax | |
137 xorl %edx,%edx | |
138 call L008PIC_me_up | |
139 L008PIC_me_up: | |
140 popl %ecx | |
141 movl L_OPENSSL_ia32cap_P$non_lazy_ptr-L008PIC_me_up(%ecx),%ecx | |
142 btl $4,(%ecx) | |
143 jnc L009notsc | |
144 .byte 0x0f,0x31 | |
145 L009notsc: | |
146 ret | |
147 .globl _OPENSSL_instrument_halt | |
148 .align 4 | |
149 _OPENSSL_instrument_halt: | |
150 L_OPENSSL_instrument_halt_begin: | |
151 call L010PIC_me_up | |
152 L010PIC_me_up: | |
153 popl %ecx | |
154 movl L_OPENSSL_ia32cap_P$non_lazy_ptr-L010PIC_me_up(%ecx),%ecx | |
155 btl $4,(%ecx) | |
156 jnc L011nohalt | |
157 .long 2421723150 | |
158 andl $3,%eax | |
159 jnz L011nohalt | |
160 pushfl | |
161 popl %eax | |
162 btl $9,%eax | |
163 jnc L011nohalt | |
164 .byte 0x0f,0x31 | |
165 pushl %edx | |
166 pushl %eax | |
167 hlt | |
168 .byte 0x0f,0x31 | |
169 subl (%esp),%eax | |
170 sbbl 4(%esp),%edx | |
171 addl $8,%esp | |
172 ret | |
173 L011nohalt: | |
174 xorl %eax,%eax | |
175 xorl %edx,%edx | |
176 ret | |
177 .globl _OPENSSL_far_spin | |
178 .align 4 | |
179 _OPENSSL_far_spin: | |
180 L_OPENSSL_far_spin_begin: | |
181 pushfl | |
182 popl %eax | |
183 btl $9,%eax | |
184 jnc L012nospin | |
185 movl 4(%esp),%eax | |
186 movl 8(%esp),%ecx | |
187 .long 2430111262 | |
188 xorl %eax,%eax | |
189 movl (%ecx),%edx | |
190 jmp L013spin | |
191 .align 4,0x90 | |
192 L013spin: | |
193 incl %eax | |
194 cmpl (%ecx),%edx | |
195 je L013spin | |
196 .long 529567888 | |
197 ret | |
198 L012nospin: | |
199 xorl %eax,%eax | |
200 xorl %edx,%edx | |
201 ret | |
202 .globl _OPENSSL_wipe_cpu | |
203 .align 4 | |
204 _OPENSSL_wipe_cpu: | |
205 L_OPENSSL_wipe_cpu_begin: | |
206 xorl %eax,%eax | |
207 xorl %edx,%edx | |
208 call L014PIC_me_up | |
209 L014PIC_me_up: | |
210 popl %ecx | |
211 movl L_OPENSSL_ia32cap_P$non_lazy_ptr-L014PIC_me_up(%ecx),%ecx | |
212 movl (%ecx),%ecx | |
213 btl $1,(%ecx) | |
214 jnc L015no_x87 | |
215 .long 4007259865,4007259865,4007259865,4007259865,2430851995 | |
216 L015no_x87: | |
217 leal 4(%esp),%eax | |
218 ret | |
219 .globl _OPENSSL_atomic_add | |
220 .align 4 | |
221 _OPENSSL_atomic_add: | |
222 L_OPENSSL_atomic_add_begin: | |
223 movl 4(%esp),%edx | |
224 movl 8(%esp),%ecx | |
225 pushl %ebx | |
226 nop | |
227 movl (%edx),%eax | |
228 L016spin: | |
229 leal (%eax,%ecx,1),%ebx | |
230 nop | |
231 .long 447811568 | |
232 jne L016spin | |
233 movl %ebx,%eax | |
234 popl %ebx | |
235 ret | |
236 .globl _OPENSSL_indirect_call | |
237 .align 4 | |
238 _OPENSSL_indirect_call: | |
239 L_OPENSSL_indirect_call_begin: | |
240 pushl %ebp | |
241 movl %esp,%ebp | |
242 subl $28,%esp | |
243 movl 12(%ebp),%ecx | |
244 movl %ecx,(%esp) | |
245 movl 16(%ebp),%edx | |
246 movl %edx,4(%esp) | |
247 movl 20(%ebp),%eax | |
248 movl %eax,8(%esp) | |
249 movl 24(%ebp),%eax | |
250 movl %eax,12(%esp) | |
251 movl 28(%ebp),%eax | |
252 movl %eax,16(%esp) | |
253 movl 32(%ebp),%eax | |
254 movl %eax,20(%esp) | |
255 movl 36(%ebp),%eax | |
256 movl %eax,24(%esp) | |
257 call *8(%ebp) | |
258 movl %ebp,%esp | |
259 popl %ebp | |
260 ret | |
261 .globl _OPENSSL_cleanse | |
262 .align 4 | |
263 _OPENSSL_cleanse: | |
264 L_OPENSSL_cleanse_begin: | |
265 movl 4(%esp),%edx | |
266 movl 8(%esp),%ecx | |
267 xorl %eax,%eax | |
268 cmpl $7,%ecx | |
269 jae L017lot | |
270 cmpl $0,%ecx | |
271 je L018ret | |
272 L019little: | |
273 movb %al,(%edx) | |
274 subl $1,%ecx | |
275 leal 1(%edx),%edx | |
276 jnz L019little | |
277 L018ret: | |
278 ret | |
279 .align 4,0x90 | |
280 L017lot: | |
281 testl $3,%edx | |
282 jz L020aligned | |
283 movb %al,(%edx) | |
284 leal -1(%ecx),%ecx | |
285 leal 1(%edx),%edx | |
286 jmp L017lot | |
287 L020aligned: | |
288 movl %eax,(%edx) | |
289 leal -4(%ecx),%ecx | |
290 testl $-4,%ecx | |
291 leal 4(%edx),%edx | |
292 jnz L020aligned | |
293 cmpl $0,%ecx | |
294 jne L019little | |
295 ret | |
296 .globl _OPENSSL_ia32_rdrand | |
297 .align 4 | |
298 _OPENSSL_ia32_rdrand: | |
299 L_OPENSSL_ia32_rdrand_begin: | |
300 movl $8,%ecx | |
301 L021loop: | |
302 .byte 15,199,240 | |
303 jc L022break | |
304 loop L021loop | |
305 L022break: | |
306 cmpl $0,%eax | |
307 cmovel %ecx,%eax | |
308 ret | |
309 .section __IMPORT,__pointers,non_lazy_symbol_pointers | |
310 L_OPENSSL_ia32cap_P$non_lazy_ptr: | |
311 .indirect_symbol _OPENSSL_ia32cap_P | |
312 .long 0 | |
313 .comm _OPENSSL_ia32cap_P,8,2 | |
314 .mod_init_func | |
315 .align 2 | |
316 .long _OPENSSL_cpuid_setup | |
OLD | NEW |