Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
freebsd
GitHub Repository: freebsd/freebsd-src
Path: blob/main/sys/crypto/openssl/i386/x86cpuid.S
39483 views
1
/* Do not modify. This file is auto-generated from x86cpuid.pl. */
2
#ifdef PIC
3
.text
4
.globl OPENSSL_ia32_cpuid
5
.type OPENSSL_ia32_cpuid,@function
6
.align 16
7
OPENSSL_ia32_cpuid:
8
.L_OPENSSL_ia32_cpuid_begin:
9
#ifdef __CET__
10
11
.byte 243,15,30,251
12
#endif
13
14
pushl %ebp
15
pushl %ebx
16
pushl %esi
17
pushl %edi
18
xorl %edx,%edx
19
pushfl
20
popl %eax
21
movl %eax,%ecx
22
xorl $2097152,%eax
23
pushl %eax
24
popfl
25
pushfl
26
popl %eax
27
xorl %eax,%ecx
28
xorl %eax,%eax
29
movl 20(%esp),%esi
30
movl %eax,8(%esi)
31
btl $21,%ecx
32
jnc .L000nocpuid
33
.byte 0x0f,0xa2
34
movl %eax,%edi
35
xorl %eax,%eax
36
cmpl $1970169159,%ebx
37
setne %al
38
movl %eax,%ebp
39
cmpl $1231384169,%edx
40
setne %al
41
orl %eax,%ebp
42
cmpl $1818588270,%ecx
43
setne %al
44
orl %eax,%ebp
45
jz .L001intel
46
cmpl $1752462657,%ebx
47
setne %al
48
movl %eax,%esi
49
cmpl $1769238117,%edx
50
setne %al
51
orl %eax,%esi
52
cmpl $1145913699,%ecx
53
setne %al
54
orl %eax,%esi
55
jnz .L001intel
56
movl $2147483648,%eax
57
.byte 0x0f,0xa2
58
cmpl $2147483649,%eax
59
jb .L001intel
60
movl %eax,%esi
61
movl $2147483649,%eax
62
.byte 0x0f,0xa2
63
orl %ecx,%ebp
64
andl $2049,%ebp
65
cmpl $2147483656,%esi
66
jb .L001intel
67
movl $2147483656,%eax
68
.byte 0x0f,0xa2
69
movzbl %cl,%esi
70
incl %esi
71
movl $1,%eax
72
xorl %ecx,%ecx
73
.byte 0x0f,0xa2
74
btl $28,%edx
75
jnc .L002generic
76
shrl $16,%ebx
77
andl $255,%ebx
78
cmpl %esi,%ebx
79
ja .L002generic
80
andl $4026531839,%edx
81
jmp .L002generic
82
.L001intel:
83
cmpl $4,%edi
84
movl $-1,%esi
85
jb .L003nocacheinfo
86
movl $4,%eax
87
movl $0,%ecx
88
.byte 0x0f,0xa2
89
movl %eax,%esi
90
shrl $14,%esi
91
andl $4095,%esi
92
.L003nocacheinfo:
93
movl $1,%eax
94
xorl %ecx,%ecx
95
.byte 0x0f,0xa2
96
andl $3220176895,%edx
97
cmpl $0,%ebp
98
jne .L004notintel
99
orl $1073741824,%edx
100
andb $15,%ah
101
cmpb $15,%ah
102
jne .L004notintel
103
orl $1048576,%edx
104
.L004notintel:
105
btl $28,%edx
106
jnc .L002generic
107
andl $4026531839,%edx
108
cmpl $0,%esi
109
je .L002generic
110
orl $268435456,%edx
111
shrl $16,%ebx
112
cmpb $1,%bl
113
ja .L002generic
114
andl $4026531839,%edx
115
.L002generic:
116
andl $2048,%ebp
117
andl $4294965247,%ecx
118
movl %edx,%esi
119
orl %ecx,%ebp
120
cmpl $7,%edi
121
movl 20(%esp),%edi
122
jb .L005no_extended_info
123
movl $7,%eax
124
xorl %ecx,%ecx
125
.byte 0x0f,0xa2
126
movl %ebx,8(%edi)
127
movl %ecx,12(%edi)
128
movl %edx,16(%edi)
129
cmpl $1,%eax
130
jb .L005no_extended_info
131
movl $7,%eax
132
movl $1,%ecx
133
.byte 0x0f,0xa2
134
movl %eax,20(%edi)
135
movl %edx,24(%edi)
136
movl %ebx,28(%edi)
137
movl %ecx,32(%edi)
138
andl $524288,%edx
139
cmpl $0,%edx
140
je .L005no_extended_info
141
movl $36,%eax
142
movl $0,%ecx
143
.byte 0x0f,0xa2
144
movl %ebx,36(%edi)
145
.L005no_extended_info:
146
btl $27,%ebp
147
jnc .L006clear_avx
148
xorl %ecx,%ecx
149
.byte 15,1,208
150
andl $6,%eax
151
cmpl $6,%eax
152
je .L007done
153
cmpl $2,%eax
154
je .L006clear_avx
155
.L008clear_xmm:
156
andl $4261412861,%ebp
157
andl $4278190079,%esi
158
.L006clear_avx:
159
andl $4026525695,%ebp
160
andl $4286578687,20(%edi)
161
andl $4294967263,8(%edi)
162
.L007done:
163
movl %esi,%eax
164
movl %ebp,%edx
165
.L000nocpuid:
166
popl %edi
167
popl %esi
168
popl %ebx
169
popl %ebp
170
ret
171
.size OPENSSL_ia32_cpuid,.-.L_OPENSSL_ia32_cpuid_begin
172
.globl OPENSSL_rdtsc
173
.type OPENSSL_rdtsc,@function
174
.align 16
175
OPENSSL_rdtsc:
176
.L_OPENSSL_rdtsc_begin:
177
#ifdef __CET__
178
179
.byte 243,15,30,251
180
#endif
181
182
xorl %eax,%eax
183
xorl %edx,%edx
184
call .L009PIC_me_up
185
.L009PIC_me_up:
186
popl %ecx
187
leal OPENSSL_ia32cap_P-.L009PIC_me_up(%ecx),%ecx
188
btl $4,(%ecx)
189
jnc .L010notsc
190
.byte 0x0f,0x31
191
.L010notsc:
192
ret
193
.size OPENSSL_rdtsc,.-.L_OPENSSL_rdtsc_begin
194
.globl OPENSSL_instrument_halt
195
.type OPENSSL_instrument_halt,@function
196
.align 16
197
OPENSSL_instrument_halt:
198
.L_OPENSSL_instrument_halt_begin:
199
#ifdef __CET__
200
201
.byte 243,15,30,251
202
#endif
203
204
call .L011PIC_me_up
205
.L011PIC_me_up:
206
popl %ecx
207
leal OPENSSL_ia32cap_P-.L011PIC_me_up(%ecx),%ecx
208
btl $4,(%ecx)
209
jnc .L012nohalt
210
.long 2421723150
211
andl $3,%eax
212
jnz .L012nohalt
213
pushfl
214
popl %eax
215
btl $9,%eax
216
jnc .L012nohalt
217
.byte 0x0f,0x31
218
pushl %edx
219
pushl %eax
220
hlt
221
.byte 0x0f,0x31
222
subl (%esp),%eax
223
sbbl 4(%esp),%edx
224
addl $8,%esp
225
ret
226
.L012nohalt:
227
xorl %eax,%eax
228
xorl %edx,%edx
229
ret
230
.size OPENSSL_instrument_halt,.-.L_OPENSSL_instrument_halt_begin
231
.globl OPENSSL_far_spin
232
.type OPENSSL_far_spin,@function
233
.align 16
234
OPENSSL_far_spin:
235
.L_OPENSSL_far_spin_begin:
236
#ifdef __CET__
237
238
.byte 243,15,30,251
239
#endif
240
241
pushfl
242
popl %eax
243
btl $9,%eax
244
jnc .L013nospin
245
movl 4(%esp),%eax
246
movl 8(%esp),%ecx
247
.long 2430111262
248
xorl %eax,%eax
249
movl (%ecx),%edx
250
jmp .L014spin
251
.align 16
252
.L014spin:
253
incl %eax
254
cmpl (%ecx),%edx
255
je .L014spin
256
.long 529567888
257
ret
258
.L013nospin:
259
xorl %eax,%eax
260
xorl %edx,%edx
261
ret
262
.size OPENSSL_far_spin,.-.L_OPENSSL_far_spin_begin
263
.globl OPENSSL_wipe_cpu
264
.type OPENSSL_wipe_cpu,@function
265
.align 16
266
OPENSSL_wipe_cpu:
267
.L_OPENSSL_wipe_cpu_begin:
268
#ifdef __CET__
269
270
.byte 243,15,30,251
271
#endif
272
273
xorl %eax,%eax
274
xorl %edx,%edx
275
call .L015PIC_me_up
276
.L015PIC_me_up:
277
popl %ecx
278
leal OPENSSL_ia32cap_P-.L015PIC_me_up(%ecx),%ecx
279
movl (%ecx),%ecx
280
btl $1,(%ecx)
281
jnc .L016no_x87
282
andl $83886080,%ecx
283
cmpl $83886080,%ecx
284
jne .L017no_sse2
285
pxor %xmm0,%xmm0
286
pxor %xmm1,%xmm1
287
pxor %xmm2,%xmm2
288
pxor %xmm3,%xmm3
289
pxor %xmm4,%xmm4
290
pxor %xmm5,%xmm5
291
pxor %xmm6,%xmm6
292
pxor %xmm7,%xmm7
293
.L017no_sse2:
294
.long 4007259865,4007259865,4007259865,4007259865,2430851995
295
.L016no_x87:
296
leal 4(%esp),%eax
297
ret
298
.size OPENSSL_wipe_cpu,.-.L_OPENSSL_wipe_cpu_begin
299
.globl OPENSSL_atomic_add
300
.type OPENSSL_atomic_add,@function
301
.align 16
302
OPENSSL_atomic_add:
303
.L_OPENSSL_atomic_add_begin:
304
#ifdef __CET__
305
306
.byte 243,15,30,251
307
#endif
308
309
movl 4(%esp),%edx
310
movl 8(%esp),%ecx
311
pushl %ebx
312
nop
313
movl (%edx),%eax
314
.L018spin:
315
leal (%eax,%ecx,1),%ebx
316
nop
317
.long 447811568
318
jne .L018spin
319
movl %ebx,%eax
320
popl %ebx
321
ret
322
.size OPENSSL_atomic_add,.-.L_OPENSSL_atomic_add_begin
323
.globl OPENSSL_cleanse
324
.type OPENSSL_cleanse,@function
325
.align 16
326
OPENSSL_cleanse:
327
.L_OPENSSL_cleanse_begin:
328
#ifdef __CET__
329
330
.byte 243,15,30,251
331
#endif
332
333
movl 4(%esp),%edx
334
movl 8(%esp),%ecx
335
xorl %eax,%eax
336
cmpl $7,%ecx
337
jae .L019lot
338
cmpl $0,%ecx
339
je .L020ret
340
.L021little:
341
movb %al,(%edx)
342
subl $1,%ecx
343
leal 1(%edx),%edx
344
jnz .L021little
345
.L020ret:
346
ret
347
.align 16
348
.L019lot:
349
testl $3,%edx
350
jz .L022aligned
351
movb %al,(%edx)
352
leal -1(%ecx),%ecx
353
leal 1(%edx),%edx
354
jmp .L019lot
355
.L022aligned:
356
movl %eax,(%edx)
357
leal -4(%ecx),%ecx
358
testl $-4,%ecx
359
leal 4(%edx),%edx
360
jnz .L022aligned
361
cmpl $0,%ecx
362
jne .L021little
363
ret
364
.size OPENSSL_cleanse,.-.L_OPENSSL_cleanse_begin
365
.globl CRYPTO_memcmp
366
.type CRYPTO_memcmp,@function
367
.align 16
368
CRYPTO_memcmp:
369
.L_CRYPTO_memcmp_begin:
370
#ifdef __CET__
371
372
.byte 243,15,30,251
373
#endif
374
375
pushl %esi
376
pushl %edi
377
movl 12(%esp),%esi
378
movl 16(%esp),%edi
379
movl 20(%esp),%ecx
380
xorl %eax,%eax
381
xorl %edx,%edx
382
cmpl $0,%ecx
383
je .L023no_data
384
.L024loop:
385
movb (%esi),%dl
386
leal 1(%esi),%esi
387
xorb (%edi),%dl
388
leal 1(%edi),%edi
389
orb %dl,%al
390
decl %ecx
391
jnz .L024loop
392
negl %eax
393
shrl $31,%eax
394
.L023no_data:
395
popl %edi
396
popl %esi
397
ret
398
.size CRYPTO_memcmp,.-.L_CRYPTO_memcmp_begin
399
.globl OPENSSL_instrument_bus
400
.type OPENSSL_instrument_bus,@function
401
.align 16
402
OPENSSL_instrument_bus:
403
.L_OPENSSL_instrument_bus_begin:
404
#ifdef __CET__
405
406
.byte 243,15,30,251
407
#endif
408
409
pushl %ebp
410
pushl %ebx
411
pushl %esi
412
pushl %edi
413
movl $0,%eax
414
call .L025PIC_me_up
415
.L025PIC_me_up:
416
popl %edx
417
leal OPENSSL_ia32cap_P-.L025PIC_me_up(%edx),%edx
418
btl $4,(%edx)
419
jnc .L026nogo
420
btl $19,(%edx)
421
jnc .L026nogo
422
movl 20(%esp),%edi
423
movl 24(%esp),%ecx
424
.byte 0x0f,0x31
425
movl %eax,%esi
426
movl $0,%ebx
427
clflush (%edi)
428
.byte 240
429
addl %ebx,(%edi)
430
jmp .L027loop
431
.align 16
432
.L027loop:
433
.byte 0x0f,0x31
434
movl %eax,%edx
435
subl %esi,%eax
436
movl %edx,%esi
437
movl %eax,%ebx
438
clflush (%edi)
439
.byte 240
440
addl %eax,(%edi)
441
leal 4(%edi),%edi
442
subl $1,%ecx
443
jnz .L027loop
444
movl 24(%esp),%eax
445
.L026nogo:
446
popl %edi
447
popl %esi
448
popl %ebx
449
popl %ebp
450
ret
451
.size OPENSSL_instrument_bus,.-.L_OPENSSL_instrument_bus_begin
452
.globl OPENSSL_instrument_bus2
453
.type OPENSSL_instrument_bus2,@function
454
.align 16
455
OPENSSL_instrument_bus2:
456
.L_OPENSSL_instrument_bus2_begin:
457
#ifdef __CET__
458
459
.byte 243,15,30,251
460
#endif
461
462
pushl %ebp
463
pushl %ebx
464
pushl %esi
465
pushl %edi
466
movl $0,%eax
467
call .L028PIC_me_up
468
.L028PIC_me_up:
469
popl %edx
470
leal OPENSSL_ia32cap_P-.L028PIC_me_up(%edx),%edx
471
btl $4,(%edx)
472
jnc .L029nogo
473
btl $19,(%edx)
474
jnc .L029nogo
475
movl 20(%esp),%edi
476
movl 24(%esp),%ecx
477
movl 28(%esp),%ebp
478
.byte 0x0f,0x31
479
movl %eax,%esi
480
movl $0,%ebx
481
clflush (%edi)
482
.byte 240
483
addl %ebx,(%edi)
484
.byte 0x0f,0x31
485
movl %eax,%edx
486
subl %esi,%eax
487
movl %edx,%esi
488
movl %eax,%ebx
489
jmp .L030loop2
490
.align 16
491
.L030loop2:
492
clflush (%edi)
493
.byte 240
494
addl %eax,(%edi)
495
subl $1,%ebp
496
jz .L031done2
497
.byte 0x0f,0x31
498
movl %eax,%edx
499
subl %esi,%eax
500
movl %edx,%esi
501
cmpl %ebx,%eax
502
movl %eax,%ebx
503
movl $0,%edx
504
setne %dl
505
subl %edx,%ecx
506
leal (%edi,%edx,4),%edi
507
jnz .L030loop2
508
.L031done2:
509
movl 24(%esp),%eax
510
subl %ecx,%eax
511
.L029nogo:
512
popl %edi
513
popl %esi
514
popl %ebx
515
popl %ebp
516
ret
517
.size OPENSSL_instrument_bus2,.-.L_OPENSSL_instrument_bus2_begin
518
.globl OPENSSL_ia32_rdrand_bytes
519
.type OPENSSL_ia32_rdrand_bytes,@function
520
.align 16
521
OPENSSL_ia32_rdrand_bytes:
522
.L_OPENSSL_ia32_rdrand_bytes_begin:
523
#ifdef __CET__
524
525
.byte 243,15,30,251
526
#endif
527
528
pushl %edi
529
pushl %ebx
530
xorl %eax,%eax
531
movl 12(%esp),%edi
532
movl 16(%esp),%ebx
533
cmpl $0,%ebx
534
je .L032done
535
movl $8,%ecx
536
.L033loop:
537
.byte 15,199,242
538
jc .L034break
539
loop .L033loop
540
jmp .L032done
541
.align 16
542
.L034break:
543
cmpl $4,%ebx
544
jb .L035tail
545
movl %edx,(%edi)
546
leal 4(%edi),%edi
547
addl $4,%eax
548
subl $4,%ebx
549
jz .L032done
550
movl $8,%ecx
551
jmp .L033loop
552
.align 16
553
.L035tail:
554
movb %dl,(%edi)
555
leal 1(%edi),%edi
556
incl %eax
557
shrl $8,%edx
558
decl %ebx
559
jnz .L035tail
560
.L032done:
561
xorl %edx,%edx
562
popl %ebx
563
popl %edi
564
ret
565
.size OPENSSL_ia32_rdrand_bytes,.-.L_OPENSSL_ia32_rdrand_bytes_begin
566
.globl OPENSSL_ia32_rdseed_bytes
567
.type OPENSSL_ia32_rdseed_bytes,@function
568
.align 16
569
OPENSSL_ia32_rdseed_bytes:
570
.L_OPENSSL_ia32_rdseed_bytes_begin:
571
#ifdef __CET__
572
573
.byte 243,15,30,251
574
#endif
575
576
pushl %edi
577
pushl %ebx
578
xorl %eax,%eax
579
movl 12(%esp),%edi
580
movl 16(%esp),%ebx
581
cmpl $0,%ebx
582
je .L036done
583
movl $8,%ecx
584
.L037loop:
585
.byte 15,199,250
586
jc .L038break
587
loop .L037loop
588
jmp .L036done
589
.align 16
590
.L038break:
591
cmpl $4,%ebx
592
jb .L039tail
593
movl %edx,(%edi)
594
leal 4(%edi),%edi
595
addl $4,%eax
596
subl $4,%ebx
597
jz .L036done
598
movl $8,%ecx
599
jmp .L037loop
600
.align 16
601
.L039tail:
602
movb %dl,(%edi)
603
leal 1(%edi),%edi
604
incl %eax
605
shrl $8,%edx
606
decl %ebx
607
jnz .L039tail
608
.L036done:
609
xorl %edx,%edx
610
popl %ebx
611
popl %edi
612
ret
613
.size OPENSSL_ia32_rdseed_bytes,.-.L_OPENSSL_ia32_rdseed_bytes_begin
614
.hidden OPENSSL_cpuid_setup
615
.hidden OPENSSL_ia32cap_P
616
.comm OPENSSL_ia32cap_P,40,4
617
.section .init
618
call OPENSSL_cpuid_setup
619
620
.section ".note.gnu.property", "a"
621
.p2align 2
622
.long 1f - 0f
623
.long 4f - 1f
624
.long 5
625
0:
626
.asciz "GNU"
627
1:
628
.p2align 2
629
.long 0xc0000002
630
.long 3f - 2f
631
2:
632
.long 3
633
3:
634
.p2align 2
635
4:
636
#else
637
.text
638
.globl OPENSSL_ia32_cpuid
639
.type OPENSSL_ia32_cpuid,@function
640
.align 16
641
OPENSSL_ia32_cpuid:
642
.L_OPENSSL_ia32_cpuid_begin:
643
#ifdef __CET__
644
645
.byte 243,15,30,251
646
#endif
647
648
pushl %ebp
649
pushl %ebx
650
pushl %esi
651
pushl %edi
652
xorl %edx,%edx
653
pushfl
654
popl %eax
655
movl %eax,%ecx
656
xorl $2097152,%eax
657
pushl %eax
658
popfl
659
pushfl
660
popl %eax
661
xorl %eax,%ecx
662
xorl %eax,%eax
663
movl 20(%esp),%esi
664
movl %eax,8(%esi)
665
btl $21,%ecx
666
jnc .L000nocpuid
667
.byte 0x0f,0xa2
668
movl %eax,%edi
669
xorl %eax,%eax
670
cmpl $1970169159,%ebx
671
setne %al
672
movl %eax,%ebp
673
cmpl $1231384169,%edx
674
setne %al
675
orl %eax,%ebp
676
cmpl $1818588270,%ecx
677
setne %al
678
orl %eax,%ebp
679
jz .L001intel
680
cmpl $1752462657,%ebx
681
setne %al
682
movl %eax,%esi
683
cmpl $1769238117,%edx
684
setne %al
685
orl %eax,%esi
686
cmpl $1145913699,%ecx
687
setne %al
688
orl %eax,%esi
689
jnz .L001intel
690
movl $2147483648,%eax
691
.byte 0x0f,0xa2
692
cmpl $2147483649,%eax
693
jb .L001intel
694
movl %eax,%esi
695
movl $2147483649,%eax
696
.byte 0x0f,0xa2
697
orl %ecx,%ebp
698
andl $2049,%ebp
699
cmpl $2147483656,%esi
700
jb .L001intel
701
movl $2147483656,%eax
702
.byte 0x0f,0xa2
703
movzbl %cl,%esi
704
incl %esi
705
movl $1,%eax
706
xorl %ecx,%ecx
707
.byte 0x0f,0xa2
708
btl $28,%edx
709
jnc .L002generic
710
shrl $16,%ebx
711
andl $255,%ebx
712
cmpl %esi,%ebx
713
ja .L002generic
714
andl $4026531839,%edx
715
jmp .L002generic
716
.L001intel:
717
cmpl $4,%edi
718
movl $-1,%esi
719
jb .L003nocacheinfo
720
movl $4,%eax
721
movl $0,%ecx
722
.byte 0x0f,0xa2
723
movl %eax,%esi
724
shrl $14,%esi
725
andl $4095,%esi
726
.L003nocacheinfo:
727
movl $1,%eax
728
xorl %ecx,%ecx
729
.byte 0x0f,0xa2
730
andl $3220176895,%edx
731
cmpl $0,%ebp
732
jne .L004notintel
733
orl $1073741824,%edx
734
andb $15,%ah
735
cmpb $15,%ah
736
jne .L004notintel
737
orl $1048576,%edx
738
.L004notintel:
739
btl $28,%edx
740
jnc .L002generic
741
andl $4026531839,%edx
742
cmpl $0,%esi
743
je .L002generic
744
orl $268435456,%edx
745
shrl $16,%ebx
746
cmpb $1,%bl
747
ja .L002generic
748
andl $4026531839,%edx
749
.L002generic:
750
andl $2048,%ebp
751
andl $4294965247,%ecx
752
movl %edx,%esi
753
orl %ecx,%ebp
754
cmpl $7,%edi
755
movl 20(%esp),%edi
756
jb .L005no_extended_info
757
movl $7,%eax
758
xorl %ecx,%ecx
759
.byte 0x0f,0xa2
760
movl %ebx,8(%edi)
761
movl %ecx,12(%edi)
762
movl %edx,16(%edi)
763
cmpl $1,%eax
764
jb .L005no_extended_info
765
movl $7,%eax
766
movl $1,%ecx
767
.byte 0x0f,0xa2
768
movl %eax,20(%edi)
769
movl %edx,24(%edi)
770
movl %ebx,28(%edi)
771
movl %ecx,32(%edi)
772
andl $524288,%edx
773
cmpl $0,%edx
774
je .L005no_extended_info
775
movl $36,%eax
776
movl $0,%ecx
777
.byte 0x0f,0xa2
778
movl %ebx,36(%edi)
779
.L005no_extended_info:
780
btl $27,%ebp
781
jnc .L006clear_avx
782
xorl %ecx,%ecx
783
.byte 15,1,208
784
andl $6,%eax
785
cmpl $6,%eax
786
je .L007done
787
cmpl $2,%eax
788
je .L006clear_avx
789
.L008clear_xmm:
790
andl $4261412861,%ebp
791
andl $4278190079,%esi
792
.L006clear_avx:
793
andl $4026525695,%ebp
794
andl $4286578687,20(%edi)
795
andl $4294967263,8(%edi)
796
.L007done:
797
movl %esi,%eax
798
movl %ebp,%edx
799
.L000nocpuid:
800
popl %edi
801
popl %esi
802
popl %ebx
803
popl %ebp
804
ret
805
.size OPENSSL_ia32_cpuid,.-.L_OPENSSL_ia32_cpuid_begin
806
.globl OPENSSL_rdtsc
807
.type OPENSSL_rdtsc,@function
808
.align 16
809
OPENSSL_rdtsc:
810
.L_OPENSSL_rdtsc_begin:
811
#ifdef __CET__
812
813
.byte 243,15,30,251
814
#endif
815
816
xorl %eax,%eax
817
xorl %edx,%edx
818
leal OPENSSL_ia32cap_P,%ecx
819
btl $4,(%ecx)
820
jnc .L009notsc
821
.byte 0x0f,0x31
822
.L009notsc:
823
ret
824
.size OPENSSL_rdtsc,.-.L_OPENSSL_rdtsc_begin
825
.globl OPENSSL_instrument_halt
826
.type OPENSSL_instrument_halt,@function
827
.align 16
828
OPENSSL_instrument_halt:
829
.L_OPENSSL_instrument_halt_begin:
830
#ifdef __CET__
831
832
.byte 243,15,30,251
833
#endif
834
835
leal OPENSSL_ia32cap_P,%ecx
836
btl $4,(%ecx)
837
jnc .L010nohalt
838
.long 2421723150
839
andl $3,%eax
840
jnz .L010nohalt
841
pushfl
842
popl %eax
843
btl $9,%eax
844
jnc .L010nohalt
845
.byte 0x0f,0x31
846
pushl %edx
847
pushl %eax
848
hlt
849
.byte 0x0f,0x31
850
subl (%esp),%eax
851
sbbl 4(%esp),%edx
852
addl $8,%esp
853
ret
854
.L010nohalt:
855
xorl %eax,%eax
856
xorl %edx,%edx
857
ret
858
.size OPENSSL_instrument_halt,.-.L_OPENSSL_instrument_halt_begin
859
.globl OPENSSL_far_spin
860
.type OPENSSL_far_spin,@function
861
.align 16
862
OPENSSL_far_spin:
863
.L_OPENSSL_far_spin_begin:
864
#ifdef __CET__
865
866
.byte 243,15,30,251
867
#endif
868
869
pushfl
870
popl %eax
871
btl $9,%eax
872
jnc .L011nospin
873
movl 4(%esp),%eax
874
movl 8(%esp),%ecx
875
.long 2430111262
876
xorl %eax,%eax
877
movl (%ecx),%edx
878
jmp .L012spin
879
.align 16
880
.L012spin:
881
incl %eax
882
cmpl (%ecx),%edx
883
je .L012spin
884
.long 529567888
885
ret
886
.L011nospin:
887
xorl %eax,%eax
888
xorl %edx,%edx
889
ret
890
.size OPENSSL_far_spin,.-.L_OPENSSL_far_spin_begin
891
.globl OPENSSL_wipe_cpu
892
.type OPENSSL_wipe_cpu,@function
893
.align 16
894
OPENSSL_wipe_cpu:
895
.L_OPENSSL_wipe_cpu_begin:
896
#ifdef __CET__
897
898
.byte 243,15,30,251
899
#endif
900
901
xorl %eax,%eax
902
xorl %edx,%edx
903
leal OPENSSL_ia32cap_P,%ecx
904
movl (%ecx),%ecx
905
btl $1,(%ecx)
906
jnc .L013no_x87
907
andl $83886080,%ecx
908
cmpl $83886080,%ecx
909
jne .L014no_sse2
910
pxor %xmm0,%xmm0
911
pxor %xmm1,%xmm1
912
pxor %xmm2,%xmm2
913
pxor %xmm3,%xmm3
914
pxor %xmm4,%xmm4
915
pxor %xmm5,%xmm5
916
pxor %xmm6,%xmm6
917
pxor %xmm7,%xmm7
918
.L014no_sse2:
919
.long 4007259865,4007259865,4007259865,4007259865,2430851995
920
.L013no_x87:
921
leal 4(%esp),%eax
922
ret
923
.size OPENSSL_wipe_cpu,.-.L_OPENSSL_wipe_cpu_begin
924
.globl OPENSSL_atomic_add
925
.type OPENSSL_atomic_add,@function
926
.align 16
927
OPENSSL_atomic_add:
928
.L_OPENSSL_atomic_add_begin:
929
#ifdef __CET__
930
931
.byte 243,15,30,251
932
#endif
933
934
movl 4(%esp),%edx
935
movl 8(%esp),%ecx
936
pushl %ebx
937
nop
938
movl (%edx),%eax
939
.L015spin:
940
leal (%eax,%ecx,1),%ebx
941
nop
942
.long 447811568
943
jne .L015spin
944
movl %ebx,%eax
945
popl %ebx
946
ret
947
.size OPENSSL_atomic_add,.-.L_OPENSSL_atomic_add_begin
948
.globl OPENSSL_cleanse
949
.type OPENSSL_cleanse,@function
950
.align 16
951
OPENSSL_cleanse:
952
.L_OPENSSL_cleanse_begin:
953
#ifdef __CET__
954
955
.byte 243,15,30,251
956
#endif
957
958
movl 4(%esp),%edx
959
movl 8(%esp),%ecx
960
xorl %eax,%eax
961
cmpl $7,%ecx
962
jae .L016lot
963
cmpl $0,%ecx
964
je .L017ret
965
.L018little:
966
movb %al,(%edx)
967
subl $1,%ecx
968
leal 1(%edx),%edx
969
jnz .L018little
970
.L017ret:
971
ret
972
.align 16
973
.L016lot:
974
testl $3,%edx
975
jz .L019aligned
976
movb %al,(%edx)
977
leal -1(%ecx),%ecx
978
leal 1(%edx),%edx
979
jmp .L016lot
980
.L019aligned:
981
movl %eax,(%edx)
982
leal -4(%ecx),%ecx
983
testl $-4,%ecx
984
leal 4(%edx),%edx
985
jnz .L019aligned
986
cmpl $0,%ecx
987
jne .L018little
988
ret
989
.size OPENSSL_cleanse,.-.L_OPENSSL_cleanse_begin
990
.globl CRYPTO_memcmp
991
.type CRYPTO_memcmp,@function
992
.align 16
993
CRYPTO_memcmp:
994
.L_CRYPTO_memcmp_begin:
995
#ifdef __CET__
996
997
.byte 243,15,30,251
998
#endif
999
1000
pushl %esi
1001
pushl %edi
1002
movl 12(%esp),%esi
1003
movl 16(%esp),%edi
1004
movl 20(%esp),%ecx
1005
xorl %eax,%eax
1006
xorl %edx,%edx
1007
cmpl $0,%ecx
1008
je .L020no_data
1009
.L021loop:
1010
movb (%esi),%dl
1011
leal 1(%esi),%esi
1012
xorb (%edi),%dl
1013
leal 1(%edi),%edi
1014
orb %dl,%al
1015
decl %ecx
1016
jnz .L021loop
1017
negl %eax
1018
shrl $31,%eax
1019
.L020no_data:
1020
popl %edi
1021
popl %esi
1022
ret
1023
.size CRYPTO_memcmp,.-.L_CRYPTO_memcmp_begin
1024
.globl OPENSSL_instrument_bus
1025
.type OPENSSL_instrument_bus,@function
1026
.align 16
1027
OPENSSL_instrument_bus:
1028
.L_OPENSSL_instrument_bus_begin:
1029
#ifdef __CET__
1030
1031
.byte 243,15,30,251
1032
#endif
1033
1034
pushl %ebp
1035
pushl %ebx
1036
pushl %esi
1037
pushl %edi
1038
movl $0,%eax
1039
leal OPENSSL_ia32cap_P,%edx
1040
btl $4,(%edx)
1041
jnc .L022nogo
1042
btl $19,(%edx)
1043
jnc .L022nogo
1044
movl 20(%esp),%edi
1045
movl 24(%esp),%ecx
1046
.byte 0x0f,0x31
1047
movl %eax,%esi
1048
movl $0,%ebx
1049
clflush (%edi)
1050
.byte 240
1051
addl %ebx,(%edi)
1052
jmp .L023loop
1053
.align 16
1054
.L023loop:
1055
.byte 0x0f,0x31
1056
movl %eax,%edx
1057
subl %esi,%eax
1058
movl %edx,%esi
1059
movl %eax,%ebx
1060
clflush (%edi)
1061
.byte 240
1062
addl %eax,(%edi)
1063
leal 4(%edi),%edi
1064
subl $1,%ecx
1065
jnz .L023loop
1066
movl 24(%esp),%eax
1067
.L022nogo:
1068
popl %edi
1069
popl %esi
1070
popl %ebx
1071
popl %ebp
1072
ret
1073
.size OPENSSL_instrument_bus,.-.L_OPENSSL_instrument_bus_begin
1074
.globl OPENSSL_instrument_bus2
1075
.type OPENSSL_instrument_bus2,@function
1076
.align 16
1077
OPENSSL_instrument_bus2:
1078
.L_OPENSSL_instrument_bus2_begin:
1079
#ifdef __CET__
1080
1081
.byte 243,15,30,251
1082
#endif
1083
1084
pushl %ebp
1085
pushl %ebx
1086
pushl %esi
1087
pushl %edi
1088
movl $0,%eax
1089
leal OPENSSL_ia32cap_P,%edx
1090
btl $4,(%edx)
1091
jnc .L024nogo
1092
btl $19,(%edx)
1093
jnc .L024nogo
1094
movl 20(%esp),%edi
1095
movl 24(%esp),%ecx
1096
movl 28(%esp),%ebp
1097
.byte 0x0f,0x31
1098
movl %eax,%esi
1099
movl $0,%ebx
1100
clflush (%edi)
1101
.byte 240
1102
addl %ebx,(%edi)
1103
.byte 0x0f,0x31
1104
movl %eax,%edx
1105
subl %esi,%eax
1106
movl %edx,%esi
1107
movl %eax,%ebx
1108
jmp .L025loop2
1109
.align 16
1110
.L025loop2:
1111
clflush (%edi)
1112
.byte 240
1113
addl %eax,(%edi)
1114
subl $1,%ebp
1115
jz .L026done2
1116
.byte 0x0f,0x31
1117
movl %eax,%edx
1118
subl %esi,%eax
1119
movl %edx,%esi
1120
cmpl %ebx,%eax
1121
movl %eax,%ebx
1122
movl $0,%edx
1123
setne %dl
1124
subl %edx,%ecx
1125
leal (%edi,%edx,4),%edi
1126
jnz .L025loop2
1127
.L026done2:
1128
movl 24(%esp),%eax
1129
subl %ecx,%eax
1130
.L024nogo:
1131
popl %edi
1132
popl %esi
1133
popl %ebx
1134
popl %ebp
1135
ret
1136
.size OPENSSL_instrument_bus2,.-.L_OPENSSL_instrument_bus2_begin
1137
.globl OPENSSL_ia32_rdrand_bytes
1138
.type OPENSSL_ia32_rdrand_bytes,@function
1139
.align 16
1140
OPENSSL_ia32_rdrand_bytes:
1141
.L_OPENSSL_ia32_rdrand_bytes_begin:
1142
#ifdef __CET__
1143
1144
.byte 243,15,30,251
1145
#endif
1146
1147
pushl %edi
1148
pushl %ebx
1149
xorl %eax,%eax
1150
movl 12(%esp),%edi
1151
movl 16(%esp),%ebx
1152
cmpl $0,%ebx
1153
je .L027done
1154
movl $8,%ecx
1155
.L028loop:
1156
.byte 15,199,242
1157
jc .L029break
1158
loop .L028loop
1159
jmp .L027done
1160
.align 16
1161
.L029break:
1162
cmpl $4,%ebx
1163
jb .L030tail
1164
movl %edx,(%edi)
1165
leal 4(%edi),%edi
1166
addl $4,%eax
1167
subl $4,%ebx
1168
jz .L027done
1169
movl $8,%ecx
1170
jmp .L028loop
1171
.align 16
1172
.L030tail:
1173
movb %dl,(%edi)
1174
leal 1(%edi),%edi
1175
incl %eax
1176
shrl $8,%edx
1177
decl %ebx
1178
jnz .L030tail
1179
.L027done:
1180
xorl %edx,%edx
1181
popl %ebx
1182
popl %edi
1183
ret
1184
.size OPENSSL_ia32_rdrand_bytes,.-.L_OPENSSL_ia32_rdrand_bytes_begin
1185
.globl OPENSSL_ia32_rdseed_bytes
1186
.type OPENSSL_ia32_rdseed_bytes,@function
1187
.align 16
1188
OPENSSL_ia32_rdseed_bytes:
1189
.L_OPENSSL_ia32_rdseed_bytes_begin:
1190
#ifdef __CET__
1191
1192
.byte 243,15,30,251
1193
#endif
1194
1195
pushl %edi
1196
pushl %ebx
1197
xorl %eax,%eax
1198
movl 12(%esp),%edi
1199
movl 16(%esp),%ebx
1200
cmpl $0,%ebx
1201
je .L031done
1202
movl $8,%ecx
1203
.L032loop:
1204
.byte 15,199,250
1205
jc .L033break
1206
loop .L032loop
1207
jmp .L031done
1208
.align 16
1209
.L033break:
1210
cmpl $4,%ebx
1211
jb .L034tail
1212
movl %edx,(%edi)
1213
leal 4(%edi),%edi
1214
addl $4,%eax
1215
subl $4,%ebx
1216
jz .L031done
1217
movl $8,%ecx
1218
jmp .L032loop
1219
.align 16
1220
.L034tail:
1221
movb %dl,(%edi)
1222
leal 1(%edi),%edi
1223
incl %eax
1224
shrl $8,%edx
1225
decl %ebx
1226
jnz .L034tail
1227
.L031done:
1228
xorl %edx,%edx
1229
popl %ebx
1230
popl %edi
1231
ret
1232
.size OPENSSL_ia32_rdseed_bytes,.-.L_OPENSSL_ia32_rdseed_bytes_begin
1233
.hidden OPENSSL_cpuid_setup
1234
.hidden OPENSSL_ia32cap_P
1235
.comm OPENSSL_ia32cap_P,40,4
1236
.section .init
1237
call OPENSSL_cpuid_setup
1238
1239
.section ".note.gnu.property", "a"
1240
.p2align 2
1241
.long 1f - 0f
1242
.long 4f - 1f
1243
.long 5
1244
0:
1245
.asciz "GNU"
1246
1:
1247
.p2align 2
1248
.long 0xc0000002
1249
.long 3f - 2f
1250
2:
1251
.long 3
1252
3:
1253
.p2align 2
1254
4:
1255
#endif
1256
1257