1# This file is generated from a similarly-named Perl script in the BoringSSL
2# source tree. Do not edit by hand.
3
4#if defined(__has_feature)
5#if __has_feature(memory_sanitizer) && !defined(OPENSSL_NO_ASM)
6#define OPENSSL_NO_ASM
7#endif
8#endif
9
10#if defined(__x86_64__) && !defined(OPENSSL_NO_ASM)
11#if defined(BORINGSSL_PREFIX)
12#include <boringssl_prefix_symbols_asm.h>
13#endif
14.text
15
16
17
18
19
20.type gcm_gmult_ssse3, @function
21.globl gcm_gmult_ssse3
22.hidden gcm_gmult_ssse3
23.align 16
24gcm_gmult_ssse3:
25.cfi_startproc
26.Lgmult_seh_begin:
27 movdqu (%rdi),%xmm0
28 movdqa .Lreverse_bytes(%rip),%xmm10
29 movdqa .Llow4_mask(%rip),%xmm2
30
31
32.byte 102,65,15,56,0,194
33
34
35 movdqa %xmm2,%xmm1
36 pandn %xmm0,%xmm1
37 psrld $4,%xmm1
38 pand %xmm2,%xmm0
39
40
41
42
43 pxor %xmm2,%xmm2
44 pxor %xmm3,%xmm3
45 movq $5,%rax
46.Loop_row_1:
47 movdqa (%rsi),%xmm4
48 leaq 16(%rsi),%rsi
49
50
51 movdqa %xmm2,%xmm6
52.byte 102,15,58,15,243,1
53 movdqa %xmm6,%xmm3
54 psrldq $1,%xmm2
55
56
57
58
59 movdqa %xmm4,%xmm5
60.byte 102,15,56,0,224
61.byte 102,15,56,0,233
62
63
64 pxor %xmm5,%xmm2
65
66
67
68 movdqa %xmm4,%xmm5
69 psllq $60,%xmm5
70 movdqa %xmm5,%xmm6
71 pslldq $8,%xmm6
72 pxor %xmm6,%xmm3
73
74
75 psrldq $8,%xmm5
76 pxor %xmm5,%xmm2
77 psrlq $4,%xmm4
78 pxor %xmm4,%xmm2
79
80 subq $1,%rax
81 jnz .Loop_row_1
82
83
84
85 pxor %xmm3,%xmm2
86 psrlq $1,%xmm3
87 pxor %xmm3,%xmm2
88 psrlq $1,%xmm3
89 pxor %xmm3,%xmm2
90 psrlq $5,%xmm3
91 pxor %xmm3,%xmm2
92 pxor %xmm3,%xmm3
93 movq $5,%rax
94.Loop_row_2:
95 movdqa (%rsi),%xmm4
96 leaq 16(%rsi),%rsi
97
98
99 movdqa %xmm2,%xmm6
100.byte 102,15,58,15,243,1
101 movdqa %xmm6,%xmm3
102 psrldq $1,%xmm2
103
104
105
106
107 movdqa %xmm4,%xmm5
108.byte 102,15,56,0,224
109.byte 102,15,56,0,233
110
111
112 pxor %xmm5,%xmm2
113
114
115
116 movdqa %xmm4,%xmm5
117 psllq $60,%xmm5
118 movdqa %xmm5,%xmm6
119 pslldq $8,%xmm6
120 pxor %xmm6,%xmm3
121
122
123 psrldq $8,%xmm5
124 pxor %xmm5,%xmm2
125 psrlq $4,%xmm4
126 pxor %xmm4,%xmm2
127
128 subq $1,%rax
129 jnz .Loop_row_2
130
131
132
133 pxor %xmm3,%xmm2
134 psrlq $1,%xmm3
135 pxor %xmm3,%xmm2
136 psrlq $1,%xmm3
137 pxor %xmm3,%xmm2
138 psrlq $5,%xmm3
139 pxor %xmm3,%xmm2
140 pxor %xmm3,%xmm3
141 movq $6,%rax
142.Loop_row_3:
143 movdqa (%rsi),%xmm4
144 leaq 16(%rsi),%rsi
145
146
147 movdqa %xmm2,%xmm6
148.byte 102,15,58,15,243,1
149 movdqa %xmm6,%xmm3
150 psrldq $1,%xmm2
151
152
153
154
155 movdqa %xmm4,%xmm5
156.byte 102,15,56,0,224
157.byte 102,15,56,0,233
158
159
160 pxor %xmm5,%xmm2
161
162
163
164 movdqa %xmm4,%xmm5
165 psllq $60,%xmm5
166 movdqa %xmm5,%xmm6
167 pslldq $8,%xmm6
168 pxor %xmm6,%xmm3
169
170
171 psrldq $8,%xmm5
172 pxor %xmm5,%xmm2
173 psrlq $4,%xmm4
174 pxor %xmm4,%xmm2
175
176 subq $1,%rax
177 jnz .Loop_row_3
178
179
180
181 pxor %xmm3,%xmm2
182 psrlq $1,%xmm3
183 pxor %xmm3,%xmm2
184 psrlq $1,%xmm3
185 pxor %xmm3,%xmm2
186 psrlq $5,%xmm3
187 pxor %xmm3,%xmm2
188 pxor %xmm3,%xmm3
189
190.byte 102,65,15,56,0,210
191 movdqu %xmm2,(%rdi)
192
193
194 pxor %xmm0,%xmm0
195 pxor %xmm1,%xmm1
196 pxor %xmm2,%xmm2
197 pxor %xmm3,%xmm3
198 pxor %xmm4,%xmm4
199 pxor %xmm5,%xmm5
200 pxor %xmm6,%xmm6
201 .byte 0xf3,0xc3
202.Lgmult_seh_end:
203.cfi_endproc
204.size gcm_gmult_ssse3,.-gcm_gmult_ssse3
205
206
207
208
209
210.type gcm_ghash_ssse3, @function
211.globl gcm_ghash_ssse3
212.hidden gcm_ghash_ssse3
213.align 16
214gcm_ghash_ssse3:
215.Lghash_seh_begin:
216.cfi_startproc
217 movdqu (%rdi),%xmm0
218 movdqa .Lreverse_bytes(%rip),%xmm10
219 movdqa .Llow4_mask(%rip),%xmm11
220
221
222 andq $-16,%rcx
223
224
225
226.byte 102,65,15,56,0,194
227
228
229 pxor %xmm3,%xmm3
230.Loop_ghash:
231
232 movdqu (%rdx),%xmm1
233.byte 102,65,15,56,0,202
234 pxor %xmm1,%xmm0
235
236
237 movdqa %xmm11,%xmm1
238 pandn %xmm0,%xmm1
239 psrld $4,%xmm1
240 pand %xmm11,%xmm0
241
242
243
244
245 pxor %xmm2,%xmm2
246
247 movq $5,%rax
248.Loop_row_4:
249 movdqa (%rsi),%xmm4
250 leaq 16(%rsi),%rsi
251
252
253 movdqa %xmm2,%xmm6
254.byte 102,15,58,15,243,1
255 movdqa %xmm6,%xmm3
256 psrldq $1,%xmm2
257
258
259
260
261 movdqa %xmm4,%xmm5
262.byte 102,15,56,0,224
263.byte 102,15,56,0,233
264
265
266 pxor %xmm5,%xmm2
267
268
269
270 movdqa %xmm4,%xmm5
271 psllq $60,%xmm5
272 movdqa %xmm5,%xmm6
273 pslldq $8,%xmm6
274 pxor %xmm6,%xmm3
275
276
277 psrldq $8,%xmm5
278 pxor %xmm5,%xmm2
279 psrlq $4,%xmm4
280 pxor %xmm4,%xmm2
281
282 subq $1,%rax
283 jnz .Loop_row_4
284
285
286
287 pxor %xmm3,%xmm2
288 psrlq $1,%xmm3
289 pxor %xmm3,%xmm2
290 psrlq $1,%xmm3
291 pxor %xmm3,%xmm2
292 psrlq $5,%xmm3
293 pxor %xmm3,%xmm2
294 pxor %xmm3,%xmm3
295 movq $5,%rax
296.Loop_row_5:
297 movdqa (%rsi),%xmm4
298 leaq 16(%rsi),%rsi
299
300
301 movdqa %xmm2,%xmm6
302.byte 102,15,58,15,243,1
303 movdqa %xmm6,%xmm3
304 psrldq $1,%xmm2
305
306
307
308
309 movdqa %xmm4,%xmm5
310.byte 102,15,56,0,224
311.byte 102,15,56,0,233
312
313
314 pxor %xmm5,%xmm2
315
316
317
318 movdqa %xmm4,%xmm5
319 psllq $60,%xmm5
320 movdqa %xmm5,%xmm6
321 pslldq $8,%xmm6
322 pxor %xmm6,%xmm3
323
324
325 psrldq $8,%xmm5
326 pxor %xmm5,%xmm2
327 psrlq $4,%xmm4
328 pxor %xmm4,%xmm2
329
330 subq $1,%rax
331 jnz .Loop_row_5
332
333
334
335 pxor %xmm3,%xmm2
336 psrlq $1,%xmm3
337 pxor %xmm3,%xmm2
338 psrlq $1,%xmm3
339 pxor %xmm3,%xmm2
340 psrlq $5,%xmm3
341 pxor %xmm3,%xmm2
342 pxor %xmm3,%xmm3
343 movq $6,%rax
344.Loop_row_6:
345 movdqa (%rsi),%xmm4
346 leaq 16(%rsi),%rsi
347
348
349 movdqa %xmm2,%xmm6
350.byte 102,15,58,15,243,1
351 movdqa %xmm6,%xmm3
352 psrldq $1,%xmm2
353
354
355
356
357 movdqa %xmm4,%xmm5
358.byte 102,15,56,0,224
359.byte 102,15,56,0,233
360
361
362 pxor %xmm5,%xmm2
363
364
365
366 movdqa %xmm4,%xmm5
367 psllq $60,%xmm5
368 movdqa %xmm5,%xmm6
369 pslldq $8,%xmm6
370 pxor %xmm6,%xmm3
371
372
373 psrldq $8,%xmm5
374 pxor %xmm5,%xmm2
375 psrlq $4,%xmm4
376 pxor %xmm4,%xmm2
377
378 subq $1,%rax
379 jnz .Loop_row_6
380
381
382
383 pxor %xmm3,%xmm2
384 psrlq $1,%xmm3
385 pxor %xmm3,%xmm2
386 psrlq $1,%xmm3
387 pxor %xmm3,%xmm2
388 psrlq $5,%xmm3
389 pxor %xmm3,%xmm2
390 pxor %xmm3,%xmm3
391 movdqa %xmm2,%xmm0
392
393
394 leaq -256(%rsi),%rsi
395
396
397 leaq 16(%rdx),%rdx
398 subq $16,%rcx
399 jnz .Loop_ghash
400
401
402.byte 102,65,15,56,0,194
403 movdqu %xmm0,(%rdi)
404
405
406 pxor %xmm0,%xmm0
407 pxor %xmm1,%xmm1
408 pxor %xmm2,%xmm2
409 pxor %xmm3,%xmm3
410 pxor %xmm4,%xmm4
411 pxor %xmm5,%xmm5
412 pxor %xmm6,%xmm6
413 .byte 0xf3,0xc3
414.Lghash_seh_end:
415.cfi_endproc
416.size gcm_ghash_ssse3,.-gcm_ghash_ssse3
417
418.align 16
419
420
421.Lreverse_bytes:
422.byte 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0
423
424.Llow4_mask:
425.quad 0x0f0f0f0f0f0f0f0f, 0x0f0f0f0f0f0f0f0f
426#endif
427