Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(182)

Side by Side Diff: third_party/boringssl/mac-x86/crypto/cpu-x86-asm.S

Issue 377783004: Add BoringSSL GYP files. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Final Python fix. Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 #if defined(__i386__)
2 .file "crypto/cpu-x86-asm.S"
3 .text
4 .globl _OPENSSL_ia32_cpuid
5 .align 4
6 _OPENSSL_ia32_cpuid:
7 L_OPENSSL_ia32_cpuid_begin:
8 pushl %ebp
9 pushl %ebx
10 pushl %esi
11 pushl %edi
12 xorl %edx,%edx
13 pushfl
14 popl %eax
15 movl %eax,%ecx
16 xorl $2097152,%eax
17 pushl %eax
18 popfl
19 pushfl
20 popl %eax
21 xorl %eax,%ecx
22 xorl %eax,%eax
23 btl $21,%ecx
24 jnc L000nocpuid
25 movl 20(%esp),%esi
26 movl %eax,8(%esi)
27 .byte 0x0f,0xa2
28 movl %eax,%edi
29 xorl %eax,%eax
30 cmpl $1970169159,%ebx
31 setne %al
32 movl %eax,%ebp
33 cmpl $1231384169,%edx
34 setne %al
35 orl %eax,%ebp
36 cmpl $1818588270,%ecx
37 setne %al
38 orl %eax,%ebp
39 jz L001intel
40 cmpl $1752462657,%ebx
41 setne %al
42 movl %eax,%esi
43 cmpl $1769238117,%edx
44 setne %al
45 orl %eax,%esi
46 cmpl $1145913699,%ecx
47 setne %al
48 orl %eax,%esi
49 jnz L001intel
50 movl $2147483648,%eax
51 .byte 0x0f,0xa2
52 cmpl $2147483649,%eax
53 jb L001intel
54 movl %eax,%esi
55 movl $2147483649,%eax
56 .byte 0x0f,0xa2
57 orl %ecx,%ebp
58 andl $2049,%ebp
59 cmpl $2147483656,%esi
60 jb L001intel
61 movl $2147483656,%eax
62 .byte 0x0f,0xa2
63 movzbl %cl,%esi
64 incl %esi
65 movl $1,%eax
66 xorl %ecx,%ecx
67 .byte 0x0f,0xa2
68 btl $28,%edx
69 jnc L002generic
70 shrl $16,%ebx
71 andl $255,%ebx
72 cmpl %esi,%ebx
73 ja L002generic
74 andl $4026531839,%edx
75 jmp L002generic
76 L001intel:
77 cmpl $7,%edi
78 jb L003cacheinfo
79 movl 20(%esp),%esi
80 movl $7,%eax
81 xorl %ecx,%ecx
82 .byte 0x0f,0xa2
83 movl %ebx,8(%esi)
84 L003cacheinfo:
85 cmpl $4,%edi
86 movl $-1,%edi
87 jb L004nocacheinfo
88 movl $4,%eax
89 movl $0,%ecx
90 .byte 0x0f,0xa2
91 movl %eax,%edi
92 shrl $14,%edi
93 andl $4095,%edi
94 L004nocacheinfo:
95 movl $1,%eax
96 xorl %ecx,%ecx
97 .byte 0x0f,0xa2
98 andl $3220176895,%edx
99 cmpl $0,%ebp
100 jne L005notintel
101 orl $1073741824,%edx
102 andb $15,%ah
103 cmpb $15,%ah
104 jne L005notintel
105 orl $1048576,%edx
106 L005notintel:
107 btl $28,%edx
108 jnc L002generic
109 andl $4026531839,%edx
110 cmpl $0,%edi
111 je L002generic
112 orl $268435456,%edx
113 shrl $16,%ebx
114 cmpb $1,%bl
115 ja L002generic
116 andl $4026531839,%edx
117 L002generic:
118 andl $2048,%ebp
119 andl $4294965247,%ecx
120 movl %edx,%esi
121 orl %ecx,%ebp
122 btl $27,%ecx
123 jnc L006clear_avx
124 xorl %ecx,%ecx
125 .byte 15,1,208
126 andl $6,%eax
127 cmpl $6,%eax
128 je L007done
129 cmpl $2,%eax
130 je L006clear_avx
131 L008clear_xmm:
132 andl $4261412861,%ebp
133 andl $4278190079,%esi
134 L006clear_avx:
135 andl $4026525695,%ebp
136 movl 20(%esp),%edi
137 andl $4294967263,8(%edi)
138 L007done:
139 movl %esi,%eax
140 movl %ebp,%edx
141 L000nocpuid:
142 popl %edi
143 popl %esi
144 popl %ebx
145 popl %ebp
146 ret
147 .globl _OPENSSL_rdtsc
148 .align 4
149 _OPENSSL_rdtsc:
150 L_OPENSSL_rdtsc_begin:
151 xorl %eax,%eax
152 xorl %edx,%edx
153 call L009PIC_me_up
154 L009PIC_me_up:
155 popl %ecx
156 movl L_OPENSSL_ia32cap_P$non_lazy_ptr-L009PIC_me_up(%ecx),%ecx
157 btl $4,(%ecx)
158 jnc L010notsc
159 .byte 0x0f,0x31
160 L010notsc:
161 ret
162 .globl _OPENSSL_instrument_halt
163 .align 4
164 _OPENSSL_instrument_halt:
165 L_OPENSSL_instrument_halt_begin:
166 call L011PIC_me_up
167 L011PIC_me_up:
168 popl %ecx
169 movl L_OPENSSL_ia32cap_P$non_lazy_ptr-L011PIC_me_up(%ecx),%ecx
170 btl $4,(%ecx)
171 jnc L012nohalt
172 .long 2421723150
173 andl $3,%eax
174 jnz L012nohalt
175 pushfl
176 popl %eax
177 btl $9,%eax
178 jnc L012nohalt
179 .byte 0x0f,0x31
180 pushl %edx
181 pushl %eax
182 hlt
183 .byte 0x0f,0x31
184 subl (%esp),%eax
185 sbbl 4(%esp),%edx
186 addl $8,%esp
187 ret
188 L012nohalt:
189 xorl %eax,%eax
190 xorl %edx,%edx
191 ret
192 .globl _OPENSSL_far_spin
193 .align 4
194 _OPENSSL_far_spin:
195 L_OPENSSL_far_spin_begin:
196 pushfl
197 popl %eax
198 btl $9,%eax
199 jnc L013nospin
200 movl 4(%esp),%eax
201 movl 8(%esp),%ecx
202 .long 2430111262
203 xorl %eax,%eax
204 movl (%ecx),%edx
205 jmp L014spin
206 .align 4,0x90
207 L014spin:
208 incl %eax
209 cmpl (%ecx),%edx
210 je L014spin
211 .long 529567888
212 ret
213 L013nospin:
214 xorl %eax,%eax
215 xorl %edx,%edx
216 ret
217 .globl _OPENSSL_wipe_cpu
218 .align 4
219 _OPENSSL_wipe_cpu:
220 L_OPENSSL_wipe_cpu_begin:
221 xorl %eax,%eax
222 xorl %edx,%edx
223 call L015PIC_me_up
224 L015PIC_me_up:
225 popl %ecx
226 movl L_OPENSSL_ia32cap_P$non_lazy_ptr-L015PIC_me_up(%ecx),%ecx
227 movl (%ecx),%ecx
228 btl $1,(%ecx)
229 jnc L016no_x87
230 .long 4007259865,4007259865,4007259865,4007259865,2430851995
231 L016no_x87:
232 leal 4(%esp),%eax
233 ret
234 .globl _OPENSSL_atomic_add
235 .align 4
236 _OPENSSL_atomic_add:
237 L_OPENSSL_atomic_add_begin:
238 movl 4(%esp),%edx
239 movl 8(%esp),%ecx
240 pushl %ebx
241 nop
242 movl (%edx),%eax
243 L017spin:
244 leal (%eax,%ecx,1),%ebx
245 nop
246 .long 447811568
247 jne L017spin
248 movl %ebx,%eax
249 popl %ebx
250 ret
251 .globl _OPENSSL_indirect_call
252 .align 4
253 _OPENSSL_indirect_call:
254 L_OPENSSL_indirect_call_begin:
255 pushl %ebp
256 movl %esp,%ebp
257 subl $28,%esp
258 movl 12(%ebp),%ecx
259 movl %ecx,(%esp)
260 movl 16(%ebp),%edx
261 movl %edx,4(%esp)
262 movl 20(%ebp),%eax
263 movl %eax,8(%esp)
264 movl 24(%ebp),%eax
265 movl %eax,12(%esp)
266 movl 28(%ebp),%eax
267 movl %eax,16(%esp)
268 movl 32(%ebp),%eax
269 movl %eax,20(%esp)
270 movl 36(%ebp),%eax
271 movl %eax,24(%esp)
272 call *8(%ebp)
273 movl %ebp,%esp
274 popl %ebp
275 ret
276 .globl _OPENSSL_cleanse
277 .align 4
278 _OPENSSL_cleanse:
279 L_OPENSSL_cleanse_begin:
280 movl 4(%esp),%edx
281 movl 8(%esp),%ecx
282 xorl %eax,%eax
283 cmpl $7,%ecx
284 jae L018lot
285 cmpl $0,%ecx
286 je L019ret
287 L020little:
288 movb %al,(%edx)
289 subl $1,%ecx
290 leal 1(%edx),%edx
291 jnz L020little
292 L019ret:
293 ret
294 .align 4,0x90
295 L018lot:
296 testl $3,%edx
297 jz L021aligned
298 movb %al,(%edx)
299 leal -1(%ecx),%ecx
300 leal 1(%edx),%edx
301 jmp L018lot
302 L021aligned:
303 movl %eax,(%edx)
304 leal -4(%ecx),%ecx
305 testl $-4,%ecx
306 leal 4(%edx),%edx
307 jnz L021aligned
308 cmpl $0,%ecx
309 jne L020little
310 ret
311 .globl _OPENSSL_ia32_rdrand
312 .align 4
313 _OPENSSL_ia32_rdrand:
314 L_OPENSSL_ia32_rdrand_begin:
315 movl $8,%ecx
316 L022loop:
317 .byte 15,199,240
318 jc L023break
319 loop L022loop
320 L023break:
321 cmpl $0,%eax
322 cmovel %ecx,%eax
323 ret
324 .section __IMPORT,__pointers,non_lazy_symbol_pointers
325 L_OPENSSL_ia32cap_P$non_lazy_ptr:
326 .indirect_symbol _OPENSSL_ia32cap_P
327 .long 0
328 #endif
OLDNEW
« no previous file with comments | « third_party/boringssl/mac-x86/crypto/bn/x86-mont.S ('k') | third_party/boringssl/mac-x86/crypto/modes/ghash-x86.S » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698