VirtualBox

source: vbox/trunk/src/libs/openssl-3.1.7/crypto/genasm-elf/x86_64cpuid.S@ 105945

最後變更 在這個檔案從105945是 94096,由 vboxsync 提交於 3 年 前

libs/openssl-3.0.1: Fix for gnu assemblers and recreate asm files, ​bugref:10128

檔案大小: 8.0 KB
 
1
2.hidden OPENSSL_cpuid_setup
3.section .init
4 call OPENSSL_cpuid_setup
5
6.hidden OPENSSL_ia32cap_P
7.comm OPENSSL_ia32cap_P,16,4
8
9.text
10
11.globl OPENSSL_atomic_add
12.type OPENSSL_atomic_add,@function
13.align 16
14OPENSSL_atomic_add:
15.cfi_startproc
16.byte 243,15,30,250
17 movl (%rdi),%eax
18.Lspin: leaq (%rsi,%rax,1),%r8
19.byte 0xf0
20 cmpxchgl %r8d,(%rdi)
21 jne .Lspin
22 movl %r8d,%eax
23.byte 0x48,0x98
24 .byte 0xf3,0xc3
25.cfi_endproc
26.size OPENSSL_atomic_add,.-OPENSSL_atomic_add
27
28.globl OPENSSL_rdtsc
29.type OPENSSL_rdtsc,@function
30.align 16
31OPENSSL_rdtsc:
32.cfi_startproc
33.byte 243,15,30,250
34 rdtsc
35 shlq $32,%rdx
36 orq %rdx,%rax
37 .byte 0xf3,0xc3
38.cfi_endproc
39.size OPENSSL_rdtsc,.-OPENSSL_rdtsc
40
41.globl OPENSSL_ia32_cpuid
42.type OPENSSL_ia32_cpuid,@function
43.align 16
44OPENSSL_ia32_cpuid:
45.cfi_startproc
46.byte 243,15,30,250
47 movq %rbx,%r8
48.cfi_register %rbx,%r8
49
50 xorl %eax,%eax
51 movq %rax,8(%rdi)
52 cpuid
53 movl %eax,%r11d
54
55 xorl %eax,%eax
56 cmpl $0x756e6547,%ebx
57 setne %al
58 movl %eax,%r9d
59 cmpl $0x49656e69,%edx
60 setne %al
61 orl %eax,%r9d
62 cmpl $0x6c65746e,%ecx
63 setne %al
64 orl %eax,%r9d
65 jz .Lintel
66
67 cmpl $0x68747541,%ebx
68 setne %al
69 movl %eax,%r10d
70 cmpl $0x69746E65,%edx
71 setne %al
72 orl %eax,%r10d
73 cmpl $0x444D4163,%ecx
74 setne %al
75 orl %eax,%r10d
76 jnz .Lintel
77
78
79 movl $0x80000000,%eax
80 cpuid
81 cmpl $0x80000001,%eax
82 jb .Lintel
83 movl %eax,%r10d
84 movl $0x80000001,%eax
85 cpuid
86 orl %ecx,%r9d
87 andl $0x00000801,%r9d
88
89 cmpl $0x80000008,%r10d
90 jb .Lintel
91
92 movl $0x80000008,%eax
93 cpuid
94 movzbq %cl,%r10
95 incq %r10
96
97 movl $1,%eax
98 cpuid
99 btl $28,%edx
100 jnc .Lgeneric
101 shrl $16,%ebx
102 cmpb %r10b,%bl
103 ja .Lgeneric
104 andl $0xefffffff,%edx
105 jmp .Lgeneric
106
107.Lintel:
108 cmpl $4,%r11d
109 movl $-1,%r10d
110 jb .Lnocacheinfo
111
112 movl $4,%eax
113 movl $0,%ecx
114 cpuid
115 movl %eax,%r10d
116 shrl $14,%r10d
117 andl $0xfff,%r10d
118
119.Lnocacheinfo:
120 movl $1,%eax
121 cpuid
122 movd %eax,%xmm0
123 andl $0xbfefffff,%edx
124 cmpl $0,%r9d
125 jne .Lnotintel
126 orl $0x40000000,%edx
127 andb $15,%ah
128 cmpb $15,%ah
129 jne .LnotP4
130 orl $0x00100000,%edx
131.LnotP4:
132 cmpb $6,%ah
133 jne .Lnotintel
134 andl $0x0fff0ff0,%eax
135 cmpl $0x00050670,%eax
136 je .Lknights
137 cmpl $0x00080650,%eax
138 jne .Lnotintel
139.Lknights:
140 andl $0xfbffffff,%ecx
141
142.Lnotintel:
143 btl $28,%edx
144 jnc .Lgeneric
145 andl $0xefffffff,%edx
146 cmpl $0,%r10d
147 je .Lgeneric
148
149 orl $0x10000000,%edx
150 shrl $16,%ebx
151 cmpb $1,%bl
152 ja .Lgeneric
153 andl $0xefffffff,%edx
154.Lgeneric:
155 andl $0x00000800,%r9d
156 andl $0xfffff7ff,%ecx
157 orl %ecx,%r9d
158
159 movl %edx,%r10d
160
161 cmpl $7,%r11d
162 jb .Lno_extended_info
163 movl $7,%eax
164 xorl %ecx,%ecx
165 cpuid
166 btl $26,%r9d
167 jc .Lnotknights
168 andl $0xfff7ffff,%ebx
169.Lnotknights:
170 movd %xmm0,%eax
171 andl $0x0fff0ff0,%eax
172 cmpl $0x00050650,%eax
173 jne .Lnotskylakex
174 andl $0xfffeffff,%ebx
175
176.Lnotskylakex:
177 movl %ebx,8(%rdi)
178 movl %ecx,12(%rdi)
179.Lno_extended_info:
180
181 btl $27,%r9d
182 jnc .Lclear_avx
183 xorl %ecx,%ecx
184.byte 0x0f,0x01,0xd0
185 andl $0xe6,%eax
186 cmpl $0xe6,%eax
187 je .Ldone
188 andl $0x3fdeffff,8(%rdi)
189
190
191
192
193 andl $6,%eax
194 cmpl $6,%eax
195 je .Ldone
196.Lclear_avx:
197 movl $0xefffe7ff,%eax
198 andl %eax,%r9d
199 movl $0x3fdeffdf,%eax
200 andl %eax,8(%rdi)
201.Ldone:
202 shlq $32,%r9
203 movl %r10d,%eax
204 movq %r8,%rbx
205.cfi_restore %rbx
206 orq %r9,%rax
207 .byte 0xf3,0xc3
208.cfi_endproc
209.size OPENSSL_ia32_cpuid,.-OPENSSL_ia32_cpuid
210
211.globl OPENSSL_cleanse
212.type OPENSSL_cleanse,@function
213.align 16
214OPENSSL_cleanse:
215.cfi_startproc
216.byte 243,15,30,250
217 xorq %rax,%rax
218 cmpq $15,%rsi
219 jae .Lot
220 cmpq $0,%rsi
221 je .Lret
222.Little:
223 movb %al,(%rdi)
224 subq $1,%rsi
225 leaq 1(%rdi),%rdi
226 jnz .Little
227.Lret:
228 .byte 0xf3,0xc3
229.align 16
230.Lot:
231 testq $7,%rdi
232 jz .Laligned
233 movb %al,(%rdi)
234 leaq -1(%rsi),%rsi
235 leaq 1(%rdi),%rdi
236 jmp .Lot
237.Laligned:
238 movq %rax,(%rdi)
239 leaq -8(%rsi),%rsi
240 testq $-8,%rsi
241 leaq 8(%rdi),%rdi
242 jnz .Laligned
243 cmpq $0,%rsi
244 jne .Little
245 .byte 0xf3,0xc3
246.cfi_endproc
247.size OPENSSL_cleanse,.-OPENSSL_cleanse
248
249.globl CRYPTO_memcmp
250.type CRYPTO_memcmp,@function
251.align 16
252CRYPTO_memcmp:
253.cfi_startproc
254.byte 243,15,30,250
255 xorq %rax,%rax
256 xorq %r10,%r10
257 cmpq $0,%rdx
258 je .Lno_data
259 cmpq $16,%rdx
260 jne .Loop_cmp
261 movq (%rdi),%r10
262 movq 8(%rdi),%r11
263 movq $1,%rdx
264 xorq (%rsi),%r10
265 xorq 8(%rsi),%r11
266 orq %r11,%r10
267 cmovnzq %rdx,%rax
268 .byte 0xf3,0xc3
269
270.align 16
271.Loop_cmp:
272 movb (%rdi),%r10b
273 leaq 1(%rdi),%rdi
274 xorb (%rsi),%r10b
275 leaq 1(%rsi),%rsi
276 orb %r10b,%al
277 decq %rdx
278 jnz .Loop_cmp
279 negq %rax
280 shrq $63,%rax
281.Lno_data:
282 .byte 0xf3,0xc3
283.cfi_endproc
284.size CRYPTO_memcmp,.-CRYPTO_memcmp
285.globl OPENSSL_wipe_cpu
286.type OPENSSL_wipe_cpu,@function
287.align 16
288OPENSSL_wipe_cpu:
289.cfi_startproc
290.byte 243,15,30,250
291 pxor %xmm0,%xmm0
292 pxor %xmm1,%xmm1
293 pxor %xmm2,%xmm2
294 pxor %xmm3,%xmm3
295 pxor %xmm4,%xmm4
296 pxor %xmm5,%xmm5
297 pxor %xmm6,%xmm6
298 pxor %xmm7,%xmm7
299 pxor %xmm8,%xmm8
300 pxor %xmm9,%xmm9
301 pxor %xmm10,%xmm10
302 pxor %xmm11,%xmm11
303 pxor %xmm12,%xmm12
304 pxor %xmm13,%xmm13
305 pxor %xmm14,%xmm14
306 pxor %xmm15,%xmm15
307 xorq %rcx,%rcx
308 xorq %rdx,%rdx
309 xorq %rsi,%rsi
310 xorq %rdi,%rdi
311 xorq %r8,%r8
312 xorq %r9,%r9
313 xorq %r10,%r10
314 xorq %r11,%r11
315 leaq 8(%rsp),%rax
316 .byte 0xf3,0xc3
317.cfi_endproc
318.size OPENSSL_wipe_cpu,.-OPENSSL_wipe_cpu
319.globl OPENSSL_instrument_bus
320.type OPENSSL_instrument_bus,@function
321.align 16
322OPENSSL_instrument_bus:
323.cfi_startproc
324.byte 243,15,30,250
325 movq %rdi,%r10
326 movq %rsi,%rcx
327 movq %rsi,%r11
328
329 rdtsc
330 movl %eax,%r8d
331 movl $0,%r9d
332 clflush (%r10)
333.byte 0xf0
334 addl %r9d,(%r10)
335 jmp .Loop
336.align 16
337.Loop: rdtsc
338 movl %eax,%edx
339 subl %r8d,%eax
340 movl %edx,%r8d
341 movl %eax,%r9d
342 clflush (%r10)
343.byte 0xf0
344 addl %eax,(%r10)
345 leaq 4(%r10),%r10
346 subq $1,%rcx
347 jnz .Loop
348
349 movq %r11,%rax
350 .byte 0xf3,0xc3
351.cfi_endproc
352.size OPENSSL_instrument_bus,.-OPENSSL_instrument_bus
353
354.globl OPENSSL_instrument_bus2
355.type OPENSSL_instrument_bus2,@function
356.align 16
357OPENSSL_instrument_bus2:
358.cfi_startproc
359.byte 243,15,30,250
360 movq %rdi,%r10
361 movq %rsi,%rcx
362 movq %rdx,%r11
363 movq %rcx,8(%rsp)
364
365 rdtsc
366 movl %eax,%r8d
367 movl $0,%r9d
368
369 clflush (%r10)
370.byte 0xf0
371 addl %r9d,(%r10)
372
373 rdtsc
374 movl %eax,%edx
375 subl %r8d,%eax
376 movl %edx,%r8d
377 movl %eax,%r9d
378.Loop2:
379 clflush (%r10)
380.byte 0xf0
381 addl %eax,(%r10)
382
383 subq $1,%r11
384 jz .Ldone2
385
386 rdtsc
387 movl %eax,%edx
388 subl %r8d,%eax
389 movl %edx,%r8d
390 cmpl %r9d,%eax
391 movl %eax,%r9d
392 movl $0,%edx
393 setne %dl
394 subq %rdx,%rcx
395 leaq (%r10,%rdx,4),%r10
396 jnz .Loop2
397
398.Ldone2:
399 movq 8(%rsp),%rax
400 subq %rcx,%rax
401 .byte 0xf3,0xc3
402.cfi_endproc
403.size OPENSSL_instrument_bus2,.-OPENSSL_instrument_bus2
404.globl OPENSSL_ia32_rdrand_bytes
405.type OPENSSL_ia32_rdrand_bytes,@function
406.align 16
407OPENSSL_ia32_rdrand_bytes:
408.cfi_startproc
409.byte 243,15,30,250
410 xorq %rax,%rax
411 cmpq $0,%rsi
412 je .Ldone_rdrand_bytes
413
414 movq $8,%r11
415.Loop_rdrand_bytes:
416.byte 73,15,199,242
417 jc .Lbreak_rdrand_bytes
418 decq %r11
419 jnz .Loop_rdrand_bytes
420 jmp .Ldone_rdrand_bytes
421
422.align 16
423.Lbreak_rdrand_bytes:
424 cmpq $8,%rsi
425 jb .Ltail_rdrand_bytes
426 movq %r10,(%rdi)
427 leaq 8(%rdi),%rdi
428 addq $8,%rax
429 subq $8,%rsi
430 jz .Ldone_rdrand_bytes
431 movq $8,%r11
432 jmp .Loop_rdrand_bytes
433
434.align 16
435.Ltail_rdrand_bytes:
436 movb %r10b,(%rdi)
437 leaq 1(%rdi),%rdi
438 incq %rax
439 shrq $8,%r10
440 decq %rsi
441 jnz .Ltail_rdrand_bytes
442
443.Ldone_rdrand_bytes:
444 xorq %r10,%r10
445 .byte 0xf3,0xc3
446.cfi_endproc
447.size OPENSSL_ia32_rdrand_bytes,.-OPENSSL_ia32_rdrand_bytes
448.globl OPENSSL_ia32_rdseed_bytes
449.type OPENSSL_ia32_rdseed_bytes,@function
450.align 16
451OPENSSL_ia32_rdseed_bytes:
452.cfi_startproc
453.byte 243,15,30,250
454 xorq %rax,%rax
455 cmpq $0,%rsi
456 je .Ldone_rdseed_bytes
457
458 movq $8,%r11
459.Loop_rdseed_bytes:
460.byte 73,15,199,250
461 jc .Lbreak_rdseed_bytes
462 decq %r11
463 jnz .Loop_rdseed_bytes
464 jmp .Ldone_rdseed_bytes
465
466.align 16
467.Lbreak_rdseed_bytes:
468 cmpq $8,%rsi
469 jb .Ltail_rdseed_bytes
470 movq %r10,(%rdi)
471 leaq 8(%rdi),%rdi
472 addq $8,%rax
473 subq $8,%rsi
474 jz .Ldone_rdseed_bytes
475 movq $8,%r11
476 jmp .Loop_rdseed_bytes
477
478.align 16
479.Ltail_rdseed_bytes:
480 movb %r10b,(%rdi)
481 leaq 1(%rdi),%rdi
482 incq %rax
483 shrq $8,%r10
484 decq %rsi
485 jnz .Ltail_rdseed_bytes
486
487.Ldone_rdseed_bytes:
488 xorq %r10,%r10
489 .byte 0xf3,0xc3
490.cfi_endproc
491.size OPENSSL_ia32_rdseed_bytes,.-OPENSSL_ia32_rdseed_bytes
492 .section ".note.gnu.property", "a"
493 .p2align 3
494 .long 1f - 0f
495 .long 4f - 1f
496 .long 5
4970:
498 # "GNU" encoded with .byte, since .asciz isn't supported
499 # on Solaris.
500 .byte 0x47
501 .byte 0x4e
502 .byte 0x55
503 .byte 0
5041:
505 .p2align 3
506 .long 0xc0000002
507 .long 3f - 2f
5082:
509 .long 3
5103:
511 .p2align 3
5124:
注意: 瀏覽 TracBrowser 來幫助您使用儲存庫瀏覽器

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette