• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1.text
2.globl	OPENSSL_ia32_cpuid
3.type	OPENSSL_ia32_cpuid,@function
4.align	16
5OPENSSL_ia32_cpuid:
6.L_OPENSSL_ia32_cpuid_begin:
7	%ifdef __CET__
8
9.byte	243,15,30,251
10	%endif
11
12	pushl	%ebp
13	pushl	%ebx
14	pushl	%esi
15	pushl	%edi
16	xorl	%edx,%edx
17	pushfl
18	popl	%eax
19	movl	%eax,%ecx
20	xorl	$2097152,%eax
21	pushl	%eax
22	popfl
23	pushfl
24	popl	%eax
25	xorl	%eax,%ecx
26	xorl	%eax,%eax
27	movl	20(%esp),%esi
28	movl	%eax,8(%esi)
29	btl	$21,%ecx
30	jnc	.L000nocpuid
31	.byte	0x0f,0xa2
32	movl	%eax,%edi
33	xorl	%eax,%eax
34	cmpl	$1970169159,%ebx
35	setne	%al
36	movl	%eax,%ebp
37	cmpl	$1231384169,%edx
38	setne	%al
39	orl	%eax,%ebp
40	cmpl	$1818588270,%ecx
41	setne	%al
42	orl	%eax,%ebp
43	jz	.L001intel
44	cmpl	$1752462657,%ebx
45	setne	%al
46	movl	%eax,%esi
47	cmpl	$1769238117,%edx
48	setne	%al
49	orl	%eax,%esi
50	cmpl	$1145913699,%ecx
51	setne	%al
52	orl	%eax,%esi
53	jnz	.L001intel
54	movl	$2147483648,%eax
55	.byte	0x0f,0xa2
56	cmpl	$2147483649,%eax
57	jb	.L001intel
58	movl	%eax,%esi
59	movl	$2147483649,%eax
60	.byte	0x0f,0xa2
61	orl	%ecx,%ebp
62	andl	$2049,%ebp
63	cmpl	$2147483656,%esi
64	jb	.L001intel
65	movl	$2147483656,%eax
66	.byte	0x0f,0xa2
67	movzbl	%cl,%esi
68	incl	%esi
69	movl	$1,%eax
70	xorl	%ecx,%ecx
71	.byte	0x0f,0xa2
72	btl	$28,%edx
73	jnc	.L002generic
74	shrl	$16,%ebx
75	andl	$255,%ebx
76	cmpl	%esi,%ebx
77	ja	.L002generic
78	andl	$4026531839,%edx
79	jmp	.L002generic
80.L001intel:
81	cmpl	$4,%edi
82	movl	$-1,%esi
83	jb	.L003nocacheinfo
84	movl	$4,%eax
85	movl	$0,%ecx
86	.byte	0x0f,0xa2
87	movl	%eax,%esi
88	shrl	$14,%esi
89	andl	$4095,%esi
90.L003nocacheinfo:
91	movl	$1,%eax
92	xorl	%ecx,%ecx
93	.byte	0x0f,0xa2
94	andl	$3220176895,%edx
95	cmpl	$0,%ebp
96	jne	.L004notintel
97	orl	$1073741824,%edx
98	andb	$15,%ah
99	cmpb	$15,%ah
100	jne	.L004notintel
101	orl	$1048576,%edx
102.L004notintel:
103	btl	$28,%edx
104	jnc	.L002generic
105	andl	$4026531839,%edx
106	cmpl	$0,%esi
107	je	.L002generic
108	orl	$268435456,%edx
109	shrl	$16,%ebx
110	cmpb	$1,%bl
111	ja	.L002generic
112	andl	$4026531839,%edx
113.L002generic:
114	andl	$2048,%ebp
115	andl	$4294965247,%ecx
116	movl	%edx,%esi
117	orl	%ecx,%ebp
118	cmpl	$7,%edi
119	movl	20(%esp),%edi
120	jb	.L005no_extended_info
121	movl	$7,%eax
122	xorl	%ecx,%ecx
123	.byte	0x0f,0xa2
124	movl	%ebx,8(%edi)
125.L005no_extended_info:
126	btl	$27,%ebp
127	jnc	.L006clear_avx
128	xorl	%ecx,%ecx
129.byte	15,1,208
130	andl	$6,%eax
131	cmpl	$6,%eax
132	je	.L007done
133	cmpl	$2,%eax
134	je	.L006clear_avx
135.L008clear_xmm:
136	andl	$4261412861,%ebp
137	andl	$4278190079,%esi
138.L006clear_avx:
139	andl	$4026525695,%ebp
140	andl	$4294967263,8(%edi)
141.L007done:
142	movl	%esi,%eax
143	movl	%ebp,%edx
144.L000nocpuid:
145	popl	%edi
146	popl	%esi
147	popl	%ebx
148	popl	%ebp
149	ret
150.size	OPENSSL_ia32_cpuid,.-.L_OPENSSL_ia32_cpuid_begin
151.globl	OPENSSL_rdtsc
152.type	OPENSSL_rdtsc,@function
153.align	16
154OPENSSL_rdtsc:
155.L_OPENSSL_rdtsc_begin:
156	%ifdef __CET__
157
158.byte	243,15,30,251
159	%endif
160
161	xorl	%eax,%eax
162	xorl	%edx,%edx
163	call	.L009PIC_me_up
164.L009PIC_me_up:
165	popl	%ecx
166	leal	OPENSSL_ia32cap_P-.L009PIC_me_up(%ecx),%ecx
167	btl	$4,(%ecx)
168	jnc	.L010notsc
169	.byte	0x0f,0x31
170.L010notsc:
171	ret
172.size	OPENSSL_rdtsc,.-.L_OPENSSL_rdtsc_begin
173.globl	OPENSSL_instrument_halt
174.type	OPENSSL_instrument_halt,@function
175.align	16
176OPENSSL_instrument_halt:
177.L_OPENSSL_instrument_halt_begin:
178	%ifdef __CET__
179
180.byte	243,15,30,251
181	%endif
182
183	call	.L011PIC_me_up
184.L011PIC_me_up:
185	popl	%ecx
186	leal	OPENSSL_ia32cap_P-.L011PIC_me_up(%ecx),%ecx
187	btl	$4,(%ecx)
188	jnc	.L012nohalt
189.long	2421723150
190	andl	$3,%eax
191	jnz	.L012nohalt
192	pushfl
193	popl	%eax
194	btl	$9,%eax
195	jnc	.L012nohalt
196	.byte	0x0f,0x31
197	pushl	%edx
198	pushl	%eax
199	hlt
200	.byte	0x0f,0x31
201	subl	(%esp),%eax
202	sbbl	4(%esp),%edx
203	addl	$8,%esp
204	ret
205.L012nohalt:
206	xorl	%eax,%eax
207	xorl	%edx,%edx
208	ret
209.size	OPENSSL_instrument_halt,.-.L_OPENSSL_instrument_halt_begin
210.globl	OPENSSL_far_spin
211.type	OPENSSL_far_spin,@function
212.align	16
213OPENSSL_far_spin:
214.L_OPENSSL_far_spin_begin:
215	%ifdef __CET__
216
217.byte	243,15,30,251
218	%endif
219
220	pushfl
221	popl	%eax
222	btl	$9,%eax
223	jnc	.L013nospin
224	movl	4(%esp),%eax
225	movl	8(%esp),%ecx
226.long	2430111262
227	xorl	%eax,%eax
228	movl	(%ecx),%edx
229	jmp	.L014spin
230.align	16
231.L014spin:
232	incl	%eax
233	cmpl	(%ecx),%edx
234	je	.L014spin
235.long	529567888
236	ret
237.L013nospin:
238	xorl	%eax,%eax
239	xorl	%edx,%edx
240	ret
241.size	OPENSSL_far_spin,.-.L_OPENSSL_far_spin_begin
242.globl	OPENSSL_wipe_cpu
243.type	OPENSSL_wipe_cpu,@function
244.align	16
245OPENSSL_wipe_cpu:
246.L_OPENSSL_wipe_cpu_begin:
247	%ifdef __CET__
248
249.byte	243,15,30,251
250	%endif
251
252	xorl	%eax,%eax
253	xorl	%edx,%edx
254	call	.L015PIC_me_up
255.L015PIC_me_up:
256	popl	%ecx
257	leal	OPENSSL_ia32cap_P-.L015PIC_me_up(%ecx),%ecx
258	movl	(%ecx),%ecx
259	btl	$1,(%ecx)
260	jnc	.L016no_x87
261	andl	$83886080,%ecx
262	cmpl	$83886080,%ecx
263	jne	.L017no_sse2
264	pxor	%xmm0,%xmm0
265	pxor	%xmm1,%xmm1
266	pxor	%xmm2,%xmm2
267	pxor	%xmm3,%xmm3
268	pxor	%xmm4,%xmm4
269	pxor	%xmm5,%xmm5
270	pxor	%xmm6,%xmm6
271	pxor	%xmm7,%xmm7
272.L017no_sse2:
273.long	4007259865,4007259865,4007259865,4007259865,2430851995
274.L016no_x87:
275	leal	4(%esp),%eax
276	ret
277.size	OPENSSL_wipe_cpu,.-.L_OPENSSL_wipe_cpu_begin
278.globl	OPENSSL_atomic_add
279.type	OPENSSL_atomic_add,@function
280.align	16
281OPENSSL_atomic_add:
282.L_OPENSSL_atomic_add_begin:
283	%ifdef __CET__
284
285.byte	243,15,30,251
286	%endif
287
288	movl	4(%esp),%edx
289	movl	8(%esp),%ecx
290	pushl	%ebx
291	nop
292	movl	(%edx),%eax
293.L018spin:
294	leal	(%eax,%ecx,1),%ebx
295	nop
296.long	447811568
297	jne	.L018spin
298	movl	%ebx,%eax
299	popl	%ebx
300	ret
301.size	OPENSSL_atomic_add,.-.L_OPENSSL_atomic_add_begin
302.globl	OPENSSL_cleanse
303.type	OPENSSL_cleanse,@function
304.align	16
305OPENSSL_cleanse:
306.L_OPENSSL_cleanse_begin:
307	%ifdef __CET__
308
309.byte	243,15,30,251
310	%endif
311
312	movl	4(%esp),%edx
313	movl	8(%esp),%ecx
314	xorl	%eax,%eax
315	cmpl	$7,%ecx
316	jae	.L019lot
317	cmpl	$0,%ecx
318	je	.L020ret
319.L021little:
320	movb	%al,(%edx)
321	subl	$1,%ecx
322	leal	1(%edx),%edx
323	jnz	.L021little
324.L020ret:
325	ret
326.align	16
327.L019lot:
328	testl	$3,%edx
329	jz	.L022aligned
330	movb	%al,(%edx)
331	leal	-1(%ecx),%ecx
332	leal	1(%edx),%edx
333	jmp	.L019lot
334.L022aligned:
335	movl	%eax,(%edx)
336	leal	-4(%ecx),%ecx
337	testl	$-4,%ecx
338	leal	4(%edx),%edx
339	jnz	.L022aligned
340	cmpl	$0,%ecx
341	jne	.L021little
342	ret
343.size	OPENSSL_cleanse,.-.L_OPENSSL_cleanse_begin
344.globl	CRYPTO_memcmp
345.type	CRYPTO_memcmp,@function
346.align	16
347CRYPTO_memcmp:
348.L_CRYPTO_memcmp_begin:
349	%ifdef __CET__
350
351.byte	243,15,30,251
352	%endif
353
354	pushl	%esi
355	pushl	%edi
356	movl	12(%esp),%esi
357	movl	16(%esp),%edi
358	movl	20(%esp),%ecx
359	xorl	%eax,%eax
360	xorl	%edx,%edx
361	cmpl	$0,%ecx
362	je	.L023no_data
363.L024loop:
364	movb	(%esi),%dl
365	leal	1(%esi),%esi
366	xorb	(%edi),%dl
367	leal	1(%edi),%edi
368	orb	%dl,%al
369	decl	%ecx
370	jnz	.L024loop
371	negl	%eax
372	shrl	$31,%eax
373.L023no_data:
374	popl	%edi
375	popl	%esi
376	ret
377.size	CRYPTO_memcmp,.-.L_CRYPTO_memcmp_begin
378.globl	OPENSSL_instrument_bus
379.type	OPENSSL_instrument_bus,@function
380.align	16
381OPENSSL_instrument_bus:
382.L_OPENSSL_instrument_bus_begin:
383	%ifdef __CET__
384
385.byte	243,15,30,251
386	%endif
387
388	pushl	%ebp
389	pushl	%ebx
390	pushl	%esi
391	pushl	%edi
392	movl	$0,%eax
393	call	.L025PIC_me_up
394.L025PIC_me_up:
395	popl	%edx
396	leal	OPENSSL_ia32cap_P-.L025PIC_me_up(%edx),%edx
397	btl	$4,(%edx)
398	jnc	.L026nogo
399	btl	$19,(%edx)
400	jnc	.L026nogo
401	movl	20(%esp),%edi
402	movl	24(%esp),%ecx
403	.byte	0x0f,0x31
404	movl	%eax,%esi
405	movl	$0,%ebx
406	clflush	(%edi)
407.byte	240
408	addl	%ebx,(%edi)
409	jmp	.L027loop
410.align	16
411.L027loop:
412	.byte	0x0f,0x31
413	movl	%eax,%edx
414	subl	%esi,%eax
415	movl	%edx,%esi
416	movl	%eax,%ebx
417	clflush	(%edi)
418.byte	240
419	addl	%eax,(%edi)
420	leal	4(%edi),%edi
421	subl	$1,%ecx
422	jnz	.L027loop
423	movl	24(%esp),%eax
424.L026nogo:
425	popl	%edi
426	popl	%esi
427	popl	%ebx
428	popl	%ebp
429	ret
430.size	OPENSSL_instrument_bus,.-.L_OPENSSL_instrument_bus_begin
431.globl	OPENSSL_instrument_bus2
432.type	OPENSSL_instrument_bus2,@function
433.align	16
434OPENSSL_instrument_bus2:
435.L_OPENSSL_instrument_bus2_begin:
436	%ifdef __CET__
437
438.byte	243,15,30,251
439	%endif
440
441	pushl	%ebp
442	pushl	%ebx
443	pushl	%esi
444	pushl	%edi
445	movl	$0,%eax
446	call	.L028PIC_me_up
447.L028PIC_me_up:
448	popl	%edx
449	leal	OPENSSL_ia32cap_P-.L028PIC_me_up(%edx),%edx
450	btl	$4,(%edx)
451	jnc	.L029nogo
452	btl	$19,(%edx)
453	jnc	.L029nogo
454	movl	20(%esp),%edi
455	movl	24(%esp),%ecx
456	movl	28(%esp),%ebp
457	.byte	0x0f,0x31
458	movl	%eax,%esi
459	movl	$0,%ebx
460	clflush	(%edi)
461.byte	240
462	addl	%ebx,(%edi)
463	.byte	0x0f,0x31
464	movl	%eax,%edx
465	subl	%esi,%eax
466	movl	%edx,%esi
467	movl	%eax,%ebx
468	jmp	.L030loop2
469.align	16
470.L030loop2:
471	clflush	(%edi)
472.byte	240
473	addl	%eax,(%edi)
474	subl	$1,%ebp
475	jz	.L031done2
476	.byte	0x0f,0x31
477	movl	%eax,%edx
478	subl	%esi,%eax
479	movl	%edx,%esi
480	cmpl	%ebx,%eax
481	movl	%eax,%ebx
482	movl	$0,%edx
483	setne	%dl
484	subl	%edx,%ecx
485	leal	(%edi,%edx,4),%edi
486	jnz	.L030loop2
487.L031done2:
488	movl	24(%esp),%eax
489	subl	%ecx,%eax
490.L029nogo:
491	popl	%edi
492	popl	%esi
493	popl	%ebx
494	popl	%ebp
495	ret
496.size	OPENSSL_instrument_bus2,.-.L_OPENSSL_instrument_bus2_begin
497.globl	OPENSSL_ia32_rdrand_bytes
498.type	OPENSSL_ia32_rdrand_bytes,@function
499.align	16
500OPENSSL_ia32_rdrand_bytes:
501.L_OPENSSL_ia32_rdrand_bytes_begin:
502	%ifdef __CET__
503
504.byte	243,15,30,251
505	%endif
506
507	pushl	%edi
508	pushl	%ebx
509	xorl	%eax,%eax
510	movl	12(%esp),%edi
511	movl	16(%esp),%ebx
512	cmpl	$0,%ebx
513	je	.L032done
514	movl	$8,%ecx
515.L033loop:
516.byte	15,199,242
517	jc	.L034break
518	loop	.L033loop
519	jmp	.L032done
520.align	16
521.L034break:
522	cmpl	$4,%ebx
523	jb	.L035tail
524	movl	%edx,(%edi)
525	leal	4(%edi),%edi
526	addl	$4,%eax
527	subl	$4,%ebx
528	jz	.L032done
529	movl	$8,%ecx
530	jmp	.L033loop
531.align	16
532.L035tail:
533	movb	%dl,(%edi)
534	leal	1(%edi),%edi
535	incl	%eax
536	shrl	$8,%edx
537	decl	%ebx
538	jnz	.L035tail
539.L032done:
540	xorl	%edx,%edx
541	popl	%ebx
542	popl	%edi
543	ret
544.size	OPENSSL_ia32_rdrand_bytes,.-.L_OPENSSL_ia32_rdrand_bytes_begin
545.globl	OPENSSL_ia32_rdseed_bytes
546.type	OPENSSL_ia32_rdseed_bytes,@function
547.align	16
548OPENSSL_ia32_rdseed_bytes:
549.L_OPENSSL_ia32_rdseed_bytes_begin:
550	%ifdef __CET__
551
552.byte	243,15,30,251
553	%endif
554
555	pushl	%edi
556	pushl	%ebx
557	xorl	%eax,%eax
558	movl	12(%esp),%edi
559	movl	16(%esp),%ebx
560	cmpl	$0,%ebx
561	je	.L036done
562	movl	$8,%ecx
563.L037loop:
564.byte	15,199,250
565	jc	.L038break
566	loop	.L037loop
567	jmp	.L036done
568.align	16
569.L038break:
570	cmpl	$4,%ebx
571	jb	.L039tail
572	movl	%edx,(%edi)
573	leal	4(%edi),%edi
574	addl	$4,%eax
575	subl	$4,%ebx
576	jz	.L036done
577	movl	$8,%ecx
578	jmp	.L037loop
579.align	16
580.L039tail:
581	movb	%dl,(%edi)
582	leal	1(%edi),%edi
583	incl	%eax
584	shrl	$8,%edx
585	decl	%ebx
586	jnz	.L039tail
587.L036done:
588	xorl	%edx,%edx
589	popl	%ebx
590	popl	%edi
591	ret
592.size	OPENSSL_ia32_rdseed_bytes,.-.L_OPENSSL_ia32_rdseed_bytes_begin
593.hidden	OPENSSL_cpuid_setup
594.hidden	OPENSSL_ia32cap_P
595.comm	OPENSSL_ia32cap_P,16,4
596.section	.init
597	call	OPENSSL_cpuid_setup
598
599	.section ".note.gnu.property", "a"
600	.p2align 2
601	.long 1f - 0f
602	.long 4f - 1f
603	.long 5
6040:
605	.asciz "GNU"
6061:
607	.p2align 2
608	.long 0xc0000002
609	.long 3f - 2f
6102:
611	.long 3
6123:
613	.p2align 2
6144:
615