VirtualBox

source: vbox/trunk/src/libs/openssl-1.1.1k/crypto/genasm-macosx/x86cpuid.S@ 91789

最後變更 在這個檔案從91789是 83531,由 vboxsync 提交於 5 年 前

setting svn:sync-process=export for openssl-1.1.1f, all files except tests

檔案大小: 6.7 KB
 
1.text
2.globl _OPENSSL_ia32_cpuid
3.align 4
4_OPENSSL_ia32_cpuid:
5L_OPENSSL_ia32_cpuid_begin:
6 pushl %ebp
7 pushl %ebx
8 pushl %esi
9 pushl %edi
10 xorl %edx,%edx
11 pushfl
12 popl %eax
13 movl %eax,%ecx
14 xorl $2097152,%eax
15 pushl %eax
16 popfl
17 pushfl
18 popl %eax
19 xorl %eax,%ecx
20 xorl %eax,%eax
21 movl 20(%esp),%esi
22 movl %eax,8(%esi)
23 btl $21,%ecx
24 jnc L000nocpuid
25 .byte 0x0f,0xa2
26 movl %eax,%edi
27 xorl %eax,%eax
28 cmpl $1970169159,%ebx
29 setne %al
30 movl %eax,%ebp
31 cmpl $1231384169,%edx
32 setne %al
33 orl %eax,%ebp
34 cmpl $1818588270,%ecx
35 setne %al
36 orl %eax,%ebp
37 jz L001intel
38 cmpl $1752462657,%ebx
39 setne %al
40 movl %eax,%esi
41 cmpl $1769238117,%edx
42 setne %al
43 orl %eax,%esi
44 cmpl $1145913699,%ecx
45 setne %al
46 orl %eax,%esi
47 jnz L001intel
48 movl $2147483648,%eax
49 .byte 0x0f,0xa2
50 cmpl $2147483649,%eax
51 jb L001intel
52 movl %eax,%esi
53 movl $2147483649,%eax
54 .byte 0x0f,0xa2
55 orl %ecx,%ebp
56 andl $2049,%ebp
57 cmpl $2147483656,%esi
58 jb L001intel
59 movl $2147483656,%eax
60 .byte 0x0f,0xa2
61 movzbl %cl,%esi
62 incl %esi
63 movl $1,%eax
64 xorl %ecx,%ecx
65 .byte 0x0f,0xa2
66 btl $28,%edx
67 jnc L002generic
68 shrl $16,%ebx
69 andl $255,%ebx
70 cmpl %esi,%ebx
71 ja L002generic
72 andl $4026531839,%edx
73 jmp L002generic
74L001intel:
75 cmpl $4,%edi
76 movl $-1,%esi
77 jb L003nocacheinfo
78 movl $4,%eax
79 movl $0,%ecx
80 .byte 0x0f,0xa2
81 movl %eax,%esi
82 shrl $14,%esi
83 andl $4095,%esi
84L003nocacheinfo:
85 movl $1,%eax
86 xorl %ecx,%ecx
87 .byte 0x0f,0xa2
88 andl $3220176895,%edx
89 cmpl $0,%ebp
90 jne L004notintel
91 orl $1073741824,%edx
92 andb $15,%ah
93 cmpb $15,%ah
94 jne L004notintel
95 orl $1048576,%edx
96L004notintel:
97 btl $28,%edx
98 jnc L002generic
99 andl $4026531839,%edx
100 cmpl $0,%esi
101 je L002generic
102 orl $268435456,%edx
103 shrl $16,%ebx
104 cmpb $1,%bl
105 ja L002generic
106 andl $4026531839,%edx
107L002generic:
108 andl $2048,%ebp
109 andl $4294965247,%ecx
110 movl %edx,%esi
111 orl %ecx,%ebp
112 cmpl $7,%edi
113 movl 20(%esp),%edi
114 jb L005no_extended_info
115 movl $7,%eax
116 xorl %ecx,%ecx
117 .byte 0x0f,0xa2
118 movl %ebx,8(%edi)
119L005no_extended_info:
120 btl $27,%ebp
121 jnc L006clear_avx
122 xorl %ecx,%ecx
123.byte 15,1,208
124 andl $6,%eax
125 cmpl $6,%eax
126 je L007done
127 cmpl $2,%eax
128 je L006clear_avx
129L008clear_xmm:
130 andl $4261412861,%ebp
131 andl $4278190079,%esi
132L006clear_avx:
133 andl $4026525695,%ebp
134 andl $4294967263,8(%edi)
135L007done:
136 movl %esi,%eax
137 movl %ebp,%edx
138L000nocpuid:
139 popl %edi
140 popl %esi
141 popl %ebx
142 popl %ebp
143 ret
144.globl _OPENSSL_rdtsc
145.align 4
146_OPENSSL_rdtsc:
147L_OPENSSL_rdtsc_begin:
148 xorl %eax,%eax
149 xorl %edx,%edx
150 call L009PIC_me_up
151L009PIC_me_up:
152 popl %ecx
153 movl L_OPENSSL_ia32cap_P$non_lazy_ptr-L009PIC_me_up(%ecx),%ecx
154 btl $4,(%ecx)
155 jnc L010notsc
156 .byte 0x0f,0x31
157L010notsc:
158 ret
159.globl _OPENSSL_instrument_halt
160.align 4
161_OPENSSL_instrument_halt:
162L_OPENSSL_instrument_halt_begin:
163 call L011PIC_me_up
164L011PIC_me_up:
165 popl %ecx
166 movl L_OPENSSL_ia32cap_P$non_lazy_ptr-L011PIC_me_up(%ecx),%ecx
167 btl $4,(%ecx)
168 jnc L012nohalt
169.long 2421723150
170 andl $3,%eax
171 jnz L012nohalt
172 pushfl
173 popl %eax
174 btl $9,%eax
175 jnc L012nohalt
176 .byte 0x0f,0x31
177 pushl %edx
178 pushl %eax
179 hlt
180 .byte 0x0f,0x31
181 subl (%esp),%eax
182 sbbl 4(%esp),%edx
183 addl $8,%esp
184 ret
185L012nohalt:
186 xorl %eax,%eax
187 xorl %edx,%edx
188 ret
189.globl _OPENSSL_far_spin
190.align 4
191_OPENSSL_far_spin:
192L_OPENSSL_far_spin_begin:
193 pushfl
194 popl %eax
195 btl $9,%eax
196 jnc L013nospin
197 movl 4(%esp),%eax
198 movl 8(%esp),%ecx
199.long 2430111262
200 xorl %eax,%eax
201 movl (%ecx),%edx
202 jmp L014spin
203.align 4,0x90
204L014spin:
205 incl %eax
206 cmpl (%ecx),%edx
207 je L014spin
208.long 529567888
209 ret
210L013nospin:
211 xorl %eax,%eax
212 xorl %edx,%edx
213 ret
214.globl _OPENSSL_wipe_cpu
215.align 4
216_OPENSSL_wipe_cpu:
217L_OPENSSL_wipe_cpu_begin:
218 xorl %eax,%eax
219 xorl %edx,%edx
220 call L015PIC_me_up
221L015PIC_me_up:
222 popl %ecx
223 movl L_OPENSSL_ia32cap_P$non_lazy_ptr-L015PIC_me_up(%ecx),%ecx
224 movl (%ecx),%ecx
225 btl $1,(%ecx)
226 jnc L016no_x87
227.long 4007259865,4007259865,4007259865,4007259865,2430851995
228L016no_x87:
229 leal 4(%esp),%eax
230 ret
231.globl _OPENSSL_atomic_add
232.align 4
233_OPENSSL_atomic_add:
234L_OPENSSL_atomic_add_begin:
235 movl 4(%esp),%edx
236 movl 8(%esp),%ecx
237 pushl %ebx
238 nop
239 movl (%edx),%eax
240L017spin:
241 leal (%eax,%ecx,1),%ebx
242 nop
243.long 447811568
244 jne L017spin
245 movl %ebx,%eax
246 popl %ebx
247 ret
248.globl _OPENSSL_cleanse
249.align 4
250_OPENSSL_cleanse:
251L_OPENSSL_cleanse_begin:
252 movl 4(%esp),%edx
253 movl 8(%esp),%ecx
254 xorl %eax,%eax
255 cmpl $7,%ecx
256 jae L018lot
257 cmpl $0,%ecx
258 je L019ret
259L020little:
260 movb %al,(%edx)
261 subl $1,%ecx
262 leal 1(%edx),%edx
263 jnz L020little
264L019ret:
265 ret
266.align 4,0x90
267L018lot:
268 testl $3,%edx
269 jz L021aligned
270 movb %al,(%edx)
271 leal -1(%ecx),%ecx
272 leal 1(%edx),%edx
273 jmp L018lot
274L021aligned:
275 movl %eax,(%edx)
276 leal -4(%ecx),%ecx
277 testl $-4,%ecx
278 leal 4(%edx),%edx
279 jnz L021aligned
280 cmpl $0,%ecx
281 jne L020little
282 ret
283.globl _CRYPTO_memcmp
284.align 4
285_CRYPTO_memcmp:
286L_CRYPTO_memcmp_begin:
287 pushl %esi
288 pushl %edi
289 movl 12(%esp),%esi
290 movl 16(%esp),%edi
291 movl 20(%esp),%ecx
292 xorl %eax,%eax
293 xorl %edx,%edx
294 cmpl $0,%ecx
295 je L022no_data
296L023loop:
297 movb (%esi),%dl
298 leal 1(%esi),%esi
299 xorb (%edi),%dl
300 leal 1(%edi),%edi
301 orb %dl,%al
302 decl %ecx
303 jnz L023loop
304 negl %eax
305 shrl $31,%eax
306L022no_data:
307 popl %edi
308 popl %esi
309 ret
310.globl _OPENSSL_instrument_bus
311.align 4
312_OPENSSL_instrument_bus:
313L_OPENSSL_instrument_bus_begin:
314 pushl %ebp
315 pushl %ebx
316 pushl %esi
317 pushl %edi
318 movl $0,%eax
319 popl %edi
320 popl %esi
321 popl %ebx
322 popl %ebp
323 ret
324.globl _OPENSSL_instrument_bus2
325.align 4
326_OPENSSL_instrument_bus2:
327L_OPENSSL_instrument_bus2_begin:
328 pushl %ebp
329 pushl %ebx
330 pushl %esi
331 pushl %edi
332 movl $0,%eax
333 popl %edi
334 popl %esi
335 popl %ebx
336 popl %ebp
337 ret
338.globl _OPENSSL_ia32_rdrand_bytes
339.align 4
340_OPENSSL_ia32_rdrand_bytes:
341L_OPENSSL_ia32_rdrand_bytes_begin:
342 pushl %edi
343 pushl %ebx
344 xorl %eax,%eax
345 movl 12(%esp),%edi
346 movl 16(%esp),%ebx
347 cmpl $0,%ebx
348 je L024done
349 movl $8,%ecx
350L025loop:
351.byte 15,199,242
352 jc L026break
353 loop L025loop
354 jmp L024done
355.align 4,0x90
356L026break:
357 cmpl $4,%ebx
358 jb L027tail
359 movl %edx,(%edi)
360 leal 4(%edi),%edi
361 addl $4,%eax
362 subl $4,%ebx
363 jz L024done
364 movl $8,%ecx
365 jmp L025loop
366.align 4,0x90
367L027tail:
368 movb %dl,(%edi)
369 leal 1(%edi),%edi
370 incl %eax
371 shrl $8,%edx
372 decl %ebx
373 jnz L027tail
374L024done:
375 xorl %edx,%edx
376 popl %ebx
377 popl %edi
378 ret
379.globl _OPENSSL_ia32_rdseed_bytes
380.align 4
381_OPENSSL_ia32_rdseed_bytes:
382L_OPENSSL_ia32_rdseed_bytes_begin:
383 pushl %edi
384 pushl %ebx
385 xorl %eax,%eax
386 movl 12(%esp),%edi
387 movl 16(%esp),%ebx
388 cmpl $0,%ebx
389 je L028done
390 movl $8,%ecx
391L029loop:
392.byte 15,199,250
393 jc L030break
394 loop L029loop
395 jmp L028done
396.align 4,0x90
397L030break:
398 cmpl $4,%ebx
399 jb L031tail
400 movl %edx,(%edi)
401 leal 4(%edi),%edi
402 addl $4,%eax
403 subl $4,%ebx
404 jz L028done
405 movl $8,%ecx
406 jmp L029loop
407.align 4,0x90
408L031tail:
409 movb %dl,(%edi)
410 leal 1(%edi),%edi
411 incl %eax
412 shrl $8,%edx
413 decl %ebx
414 jnz L031tail
415L028done:
416 xorl %edx,%edx
417 popl %ebx
418 popl %edi
419 ret
420.section __IMPORT,__pointers,non_lazy_symbol_pointers
421L_OPENSSL_ia32cap_P$non_lazy_ptr:
422.indirect_symbol _OPENSSL_ia32cap_P
423.long 0
424.comm _OPENSSL_ia32cap_P,16,2
425.mod_init_func
426.align 2
427.long _OPENSSL_cpuid_setup
注意: 瀏覽 TracBrowser 來幫助您使用儲存庫瀏覽器

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