]> git.proxmox.com Git - mirror_edk2.git/blob - CryptoPkg/Library/OpensslLib/IA32Gcc/crypto/x86cpuid.S
a1934cbc58961a85b5bda378c1e2e4f530bcf5e6
[mirror_edk2.git] / CryptoPkg / Library / OpensslLib / IA32Gcc / crypto / x86cpuid.S
1 # WARNING: do not edit!
2 # Generated from openssl/crypto/x86cpuid.pl
3 #
4 # Copyright 2004-2020 The OpenSSL Project Authors. All Rights Reserved.
5 #
6 # Licensed under the OpenSSL license (the "License"). You may not use
7 # this file except in compliance with the License. You can obtain a copy
8 # in the file LICENSE in the source distribution or at
9 # https://www.openssl.org/source/license.html
10
11 .text
12 .globl OPENSSL_ia32_cpuid
13 .type OPENSSL_ia32_cpuid,@function
14 .align 16
15 OPENSSL_ia32_cpuid:
16 .L_OPENSSL_ia32_cpuid_begin:
17 pushl %ebp
18 pushl %ebx
19 pushl %esi
20 pushl %edi
21 xorl %edx,%edx
22 pushfl
23 popl %eax
24 movl %eax,%ecx
25 xorl $2097152,%eax
26 pushl %eax
27 popfl
28 pushfl
29 popl %eax
30 xorl %eax,%ecx
31 xorl %eax,%eax
32 movl 20(%esp),%esi
33 movl %eax,8(%esi)
34 btl $21,%ecx
35 jnc .L000nocpuid
36 .byte 0x0f,0xa2
37 movl %eax,%edi
38 xorl %eax,%eax
39 cmpl $1970169159,%ebx
40 setne %al
41 movl %eax,%ebp
42 cmpl $1231384169,%edx
43 setne %al
44 orl %eax,%ebp
45 cmpl $1818588270,%ecx
46 setne %al
47 orl %eax,%ebp
48 jz .L001intel
49 cmpl $1752462657,%ebx
50 setne %al
51 movl %eax,%esi
52 cmpl $1769238117,%edx
53 setne %al
54 orl %eax,%esi
55 cmpl $1145913699,%ecx
56 setne %al
57 orl %eax,%esi
58 jnz .L001intel
59 movl $2147483648,%eax
60 .byte 0x0f,0xa2
61 cmpl $2147483649,%eax
62 jb .L001intel
63 movl %eax,%esi
64 movl $2147483649,%eax
65 .byte 0x0f,0xa2
66 orl %ecx,%ebp
67 andl $2049,%ebp
68 cmpl $2147483656,%esi
69 jb .L001intel
70 movl $2147483656,%eax
71 .byte 0x0f,0xa2
72 movzbl %cl,%esi
73 incl %esi
74 movl $1,%eax
75 xorl %ecx,%ecx
76 .byte 0x0f,0xa2
77 btl $28,%edx
78 jnc .L002generic
79 shrl $16,%ebx
80 andl $255,%ebx
81 cmpl %esi,%ebx
82 ja .L002generic
83 andl $4026531839,%edx
84 jmp .L002generic
85 .L001intel:
86 cmpl $4,%edi
87 movl $-1,%esi
88 jb .L003nocacheinfo
89 movl $4,%eax
90 movl $0,%ecx
91 .byte 0x0f,0xa2
92 movl %eax,%esi
93 shrl $14,%esi
94 andl $4095,%esi
95 .L003nocacheinfo:
96 movl $1,%eax
97 xorl %ecx,%ecx
98 .byte 0x0f,0xa2
99 andl $3220176895,%edx
100 cmpl $0,%ebp
101 jne .L004notintel
102 orl $1073741824,%edx
103 andb $15,%ah
104 cmpb $15,%ah
105 jne .L004notintel
106 orl $1048576,%edx
107 .L004notintel:
108 btl $28,%edx
109 jnc .L002generic
110 andl $4026531839,%edx
111 cmpl $0,%esi
112 je .L002generic
113 orl $268435456,%edx
114 shrl $16,%ebx
115 cmpb $1,%bl
116 ja .L002generic
117 andl $4026531839,%edx
118 .L002generic:
119 andl $2048,%ebp
120 andl $4294965247,%ecx
121 movl %edx,%esi
122 orl %ecx,%ebp
123 cmpl $7,%edi
124 movl 20(%esp),%edi
125 jb .L005no_extended_info
126 movl $7,%eax
127 xorl %ecx,%ecx
128 .byte 0x0f,0xa2
129 movl %ebx,8(%edi)
130 .L005no_extended_info:
131 btl $27,%ebp
132 jnc .L006clear_avx
133 xorl %ecx,%ecx
134 .byte 15,1,208
135 andl $6,%eax
136 cmpl $6,%eax
137 je .L007done
138 cmpl $2,%eax
139 je .L006clear_avx
140 .L008clear_xmm:
141 andl $4261412861,%ebp
142 andl $4278190079,%esi
143 .L006clear_avx:
144 andl $4026525695,%ebp
145 andl $4294967263,8(%edi)
146 .L007done:
147 movl %esi,%eax
148 movl %ebp,%edx
149 .L000nocpuid:
150 popl %edi
151 popl %esi
152 popl %ebx
153 popl %ebp
154 ret
155 .size OPENSSL_ia32_cpuid,.-.L_OPENSSL_ia32_cpuid_begin
156 .globl OPENSSL_rdtsc
157 .type OPENSSL_rdtsc,@function
158 .align 16
159 OPENSSL_rdtsc:
160 .L_OPENSSL_rdtsc_begin:
161 xorl %eax,%eax
162 xorl %edx,%edx
163 leal OPENSSL_ia32cap_P,%ecx
164 btl $4,(%ecx)
165 jnc .L009notsc
166 .byte 0x0f,0x31
167 .L009notsc:
168 ret
169 .size OPENSSL_rdtsc,.-.L_OPENSSL_rdtsc_begin
170 .globl OPENSSL_instrument_halt
171 .type OPENSSL_instrument_halt,@function
172 .align 16
173 OPENSSL_instrument_halt:
174 .L_OPENSSL_instrument_halt_begin:
175 leal OPENSSL_ia32cap_P,%ecx
176 btl $4,(%ecx)
177 jnc .L010nohalt
178 .long 2421723150
179 andl $3,%eax
180 jnz .L010nohalt
181 pushfl
182 popl %eax
183 btl $9,%eax
184 jnc .L010nohalt
185 .byte 0x0f,0x31
186 pushl %edx
187 pushl %eax
188 hlt
189 .byte 0x0f,0x31
190 subl (%esp),%eax
191 sbbl 4(%esp),%edx
192 addl $8,%esp
193 ret
194 .L010nohalt:
195 xorl %eax,%eax
196 xorl %edx,%edx
197 ret
198 .size OPENSSL_instrument_halt,.-.L_OPENSSL_instrument_halt_begin
199 .globl OPENSSL_far_spin
200 .type OPENSSL_far_spin,@function
201 .align 16
202 OPENSSL_far_spin:
203 .L_OPENSSL_far_spin_begin:
204 pushfl
205 popl %eax
206 btl $9,%eax
207 jnc .L011nospin
208 movl 4(%esp),%eax
209 movl 8(%esp),%ecx
210 .long 2430111262
211 xorl %eax,%eax
212 movl (%ecx),%edx
213 jmp .L012spin
214 .align 16
215 .L012spin:
216 incl %eax
217 cmpl (%ecx),%edx
218 je .L012spin
219 .long 529567888
220 ret
221 .L011nospin:
222 xorl %eax,%eax
223 xorl %edx,%edx
224 ret
225 .size OPENSSL_far_spin,.-.L_OPENSSL_far_spin_begin
226 .globl OPENSSL_wipe_cpu
227 .type OPENSSL_wipe_cpu,@function
228 .align 16
229 OPENSSL_wipe_cpu:
230 .L_OPENSSL_wipe_cpu_begin:
231 xorl %eax,%eax
232 xorl %edx,%edx
233 leal OPENSSL_ia32cap_P,%ecx
234 movl (%ecx),%ecx
235 btl $1,(%ecx)
236 jnc .L013no_x87
237 .long 4007259865,4007259865,4007259865,4007259865,2430851995
238 .L013no_x87:
239 leal 4(%esp),%eax
240 ret
241 .size OPENSSL_wipe_cpu,.-.L_OPENSSL_wipe_cpu_begin
242 .globl OPENSSL_atomic_add
243 .type OPENSSL_atomic_add,@function
244 .align 16
245 OPENSSL_atomic_add:
246 .L_OPENSSL_atomic_add_begin:
247 movl 4(%esp),%edx
248 movl 8(%esp),%ecx
249 pushl %ebx
250 nop
251 movl (%edx),%eax
252 .L014spin:
253 leal (%eax,%ecx,1),%ebx
254 nop
255 .long 447811568
256 jne .L014spin
257 movl %ebx,%eax
258 popl %ebx
259 ret
260 .size OPENSSL_atomic_add,.-.L_OPENSSL_atomic_add_begin
261 .globl OPENSSL_cleanse
262 .type OPENSSL_cleanse,@function
263 .align 16
264 OPENSSL_cleanse:
265 .L_OPENSSL_cleanse_begin:
266 movl 4(%esp),%edx
267 movl 8(%esp),%ecx
268 xorl %eax,%eax
269 cmpl $7,%ecx
270 jae .L015lot
271 cmpl $0,%ecx
272 je .L016ret
273 .L017little:
274 movb %al,(%edx)
275 subl $1,%ecx
276 leal 1(%edx),%edx
277 jnz .L017little
278 .L016ret:
279 ret
280 .align 16
281 .L015lot:
282 testl $3,%edx
283 jz .L018aligned
284 movb %al,(%edx)
285 leal -1(%ecx),%ecx
286 leal 1(%edx),%edx
287 jmp .L015lot
288 .L018aligned:
289 movl %eax,(%edx)
290 leal -4(%ecx),%ecx
291 testl $-4,%ecx
292 leal 4(%edx),%edx
293 jnz .L018aligned
294 cmpl $0,%ecx
295 jne .L017little
296 ret
297 .size OPENSSL_cleanse,.-.L_OPENSSL_cleanse_begin
298 .globl CRYPTO_memcmp
299 .type CRYPTO_memcmp,@function
300 .align 16
301 CRYPTO_memcmp:
302 .L_CRYPTO_memcmp_begin:
303 pushl %esi
304 pushl %edi
305 movl 12(%esp),%esi
306 movl 16(%esp),%edi
307 movl 20(%esp),%ecx
308 xorl %eax,%eax
309 xorl %edx,%edx
310 cmpl $0,%ecx
311 je .L019no_data
312 .L020loop:
313 movb (%esi),%dl
314 leal 1(%esi),%esi
315 xorb (%edi),%dl
316 leal 1(%edi),%edi
317 orb %dl,%al
318 decl %ecx
319 jnz .L020loop
320 negl %eax
321 shrl $31,%eax
322 .L019no_data:
323 popl %edi
324 popl %esi
325 ret
326 .size CRYPTO_memcmp,.-.L_CRYPTO_memcmp_begin
327 .globl OPENSSL_instrument_bus
328 .type OPENSSL_instrument_bus,@function
329 .align 16
330 OPENSSL_instrument_bus:
331 .L_OPENSSL_instrument_bus_begin:
332 pushl %ebp
333 pushl %ebx
334 pushl %esi
335 pushl %edi
336 movl $0,%eax
337 popl %edi
338 popl %esi
339 popl %ebx
340 popl %ebp
341 ret
342 .size OPENSSL_instrument_bus,.-.L_OPENSSL_instrument_bus_begin
343 .globl OPENSSL_instrument_bus2
344 .type OPENSSL_instrument_bus2,@function
345 .align 16
346 OPENSSL_instrument_bus2:
347 .L_OPENSSL_instrument_bus2_begin:
348 pushl %ebp
349 pushl %ebx
350 pushl %esi
351 pushl %edi
352 movl $0,%eax
353 popl %edi
354 popl %esi
355 popl %ebx
356 popl %ebp
357 ret
358 .size OPENSSL_instrument_bus2,.-.L_OPENSSL_instrument_bus2_begin
359 .globl OPENSSL_ia32_rdrand_bytes
360 .type OPENSSL_ia32_rdrand_bytes,@function
361 .align 16
362 OPENSSL_ia32_rdrand_bytes:
363 .L_OPENSSL_ia32_rdrand_bytes_begin:
364 pushl %edi
365 pushl %ebx
366 xorl %eax,%eax
367 movl 12(%esp),%edi
368 movl 16(%esp),%ebx
369 cmpl $0,%ebx
370 je .L021done
371 movl $8,%ecx
372 .L022loop:
373 .byte 15,199,242
374 jc .L023break
375 loop .L022loop
376 jmp .L021done
377 .align 16
378 .L023break:
379 cmpl $4,%ebx
380 jb .L024tail
381 movl %edx,(%edi)
382 leal 4(%edi),%edi
383 addl $4,%eax
384 subl $4,%ebx
385 jz .L021done
386 movl $8,%ecx
387 jmp .L022loop
388 .align 16
389 .L024tail:
390 movb %dl,(%edi)
391 leal 1(%edi),%edi
392 incl %eax
393 shrl $8,%edx
394 decl %ebx
395 jnz .L024tail
396 .L021done:
397 xorl %edx,%edx
398 popl %ebx
399 popl %edi
400 ret
401 .size OPENSSL_ia32_rdrand_bytes,.-.L_OPENSSL_ia32_rdrand_bytes_begin
402 .globl OPENSSL_ia32_rdseed_bytes
403 .type OPENSSL_ia32_rdseed_bytes,@function
404 .align 16
405 OPENSSL_ia32_rdseed_bytes:
406 .L_OPENSSL_ia32_rdseed_bytes_begin:
407 pushl %edi
408 pushl %ebx
409 xorl %eax,%eax
410 movl 12(%esp),%edi
411 movl 16(%esp),%ebx
412 cmpl $0,%ebx
413 je .L025done
414 movl $8,%ecx
415 .L026loop:
416 .byte 15,199,250
417 jc .L027break
418 loop .L026loop
419 jmp .L025done
420 .align 16
421 .L027break:
422 cmpl $4,%ebx
423 jb .L028tail
424 movl %edx,(%edi)
425 leal 4(%edi),%edi
426 addl $4,%eax
427 subl $4,%ebx
428 jz .L025done
429 movl $8,%ecx
430 jmp .L026loop
431 .align 16
432 .L028tail:
433 movb %dl,(%edi)
434 leal 1(%edi),%edi
435 incl %eax
436 shrl $8,%edx
437 decl %ebx
438 jnz .L028tail
439 .L025done:
440 xorl %edx,%edx
441 popl %ebx
442 popl %edi
443 ret
444 .size OPENSSL_ia32_rdseed_bytes,.-.L_OPENSSL_ia32_rdseed_bytes_begin
445 .hidden OPENSSL_cpuid_setup
446 .hidden OPENSSL_ia32cap_P
447 .comm OPENSSL_ia32cap_P,16,4
448 .section .init
449 call OPENSSL_cpuid_setup