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(__i386__)
5#if defined(BORINGSSL_PREFIX)
6#include <boringssl_prefix_symbols_asm.h>
7#endif
8.text
9.globl	_GFp_gcm_init_clmul
10.private_extern	_GFp_gcm_init_clmul
11.align	4
12_GFp_gcm_init_clmul:
13L_GFp_gcm_init_clmul_begin:
14	movl	4(%esp),%edx
15	movl	8(%esp),%eax
16	call	L000pic
17L000pic:
18	popl	%ecx
19	leal	Lbswap-L000pic(%ecx),%ecx
20	movdqu	(%eax),%xmm2
21	pshufd	$78,%xmm2,%xmm2
22	pshufd	$255,%xmm2,%xmm4
23	movdqa	%xmm2,%xmm3
24	psllq	$1,%xmm2
25	pxor	%xmm5,%xmm5
26	psrlq	$63,%xmm3
27	pcmpgtd	%xmm4,%xmm5
28	pslldq	$8,%xmm3
29	por	%xmm3,%xmm2
30	pand	16(%ecx),%xmm5
31	pxor	%xmm5,%xmm2
32	movdqa	%xmm2,%xmm0
33	movdqa	%xmm0,%xmm1
34	pshufd	$78,%xmm0,%xmm3
35	pshufd	$78,%xmm2,%xmm4
36	pxor	%xmm0,%xmm3
37	pxor	%xmm2,%xmm4
38.byte	102,15,58,68,194,0
39.byte	102,15,58,68,202,17
40.byte	102,15,58,68,220,0
41	xorps	%xmm0,%xmm3
42	xorps	%xmm1,%xmm3
43	movdqa	%xmm3,%xmm4
44	psrldq	$8,%xmm3
45	pslldq	$8,%xmm4
46	pxor	%xmm3,%xmm1
47	pxor	%xmm4,%xmm0
48	movdqa	%xmm0,%xmm4
49	movdqa	%xmm0,%xmm3
50	psllq	$5,%xmm0
51	pxor	%xmm0,%xmm3
52	psllq	$1,%xmm0
53	pxor	%xmm3,%xmm0
54	psllq	$57,%xmm0
55	movdqa	%xmm0,%xmm3
56	pslldq	$8,%xmm0
57	psrldq	$8,%xmm3
58	pxor	%xmm4,%xmm0
59	pxor	%xmm3,%xmm1
60	movdqa	%xmm0,%xmm4
61	psrlq	$1,%xmm0
62	pxor	%xmm4,%xmm1
63	pxor	%xmm0,%xmm4
64	psrlq	$5,%xmm0
65	pxor	%xmm4,%xmm0
66	psrlq	$1,%xmm0
67	pxor	%xmm1,%xmm0
68	pshufd	$78,%xmm2,%xmm3
69	pshufd	$78,%xmm0,%xmm4
70	pxor	%xmm2,%xmm3
71	movdqu	%xmm2,(%edx)
72	pxor	%xmm0,%xmm4
73	movdqu	%xmm0,16(%edx)
74.byte	102,15,58,15,227,8
75	movdqu	%xmm4,32(%edx)
76	ret
77.globl	_GFp_gcm_gmult_clmul
78.private_extern	_GFp_gcm_gmult_clmul
79.align	4
80_GFp_gcm_gmult_clmul:
81L_GFp_gcm_gmult_clmul_begin:
82	movl	4(%esp),%eax
83	movl	8(%esp),%edx
84	call	L001pic
85L001pic:
86	popl	%ecx
87	leal	Lbswap-L001pic(%ecx),%ecx
88	movdqu	(%eax),%xmm0
89	movdqa	(%ecx),%xmm5
90	movups	(%edx),%xmm2
91.byte	102,15,56,0,197
92	movups	32(%edx),%xmm4
93	movdqa	%xmm0,%xmm1
94	pshufd	$78,%xmm0,%xmm3
95	pxor	%xmm0,%xmm3
96.byte	102,15,58,68,194,0
97.byte	102,15,58,68,202,17
98.byte	102,15,58,68,220,0
99	xorps	%xmm0,%xmm3
100	xorps	%xmm1,%xmm3
101	movdqa	%xmm3,%xmm4
102	psrldq	$8,%xmm3
103	pslldq	$8,%xmm4
104	pxor	%xmm3,%xmm1
105	pxor	%xmm4,%xmm0
106	movdqa	%xmm0,%xmm4
107	movdqa	%xmm0,%xmm3
108	psllq	$5,%xmm0
109	pxor	%xmm0,%xmm3
110	psllq	$1,%xmm0
111	pxor	%xmm3,%xmm0
112	psllq	$57,%xmm0
113	movdqa	%xmm0,%xmm3
114	pslldq	$8,%xmm0
115	psrldq	$8,%xmm3
116	pxor	%xmm4,%xmm0
117	pxor	%xmm3,%xmm1
118	movdqa	%xmm0,%xmm4
119	psrlq	$1,%xmm0
120	pxor	%xmm4,%xmm1
121	pxor	%xmm0,%xmm4
122	psrlq	$5,%xmm0
123	pxor	%xmm4,%xmm0
124	psrlq	$1,%xmm0
125	pxor	%xmm1,%xmm0
126.byte	102,15,56,0,197
127	movdqu	%xmm0,(%eax)
128	ret
129.globl	_GFp_gcm_ghash_clmul
130.private_extern	_GFp_gcm_ghash_clmul
131.align	4
132_GFp_gcm_ghash_clmul:
133L_GFp_gcm_ghash_clmul_begin:
134	pushl	%ebp
135	pushl	%ebx
136	pushl	%esi
137	pushl	%edi
138	movl	20(%esp),%eax
139	movl	24(%esp),%edx
140	movl	28(%esp),%esi
141	movl	32(%esp),%ebx
142	call	L002pic
143L002pic:
144	popl	%ecx
145	leal	Lbswap-L002pic(%ecx),%ecx
146	movdqu	(%eax),%xmm0
147	movdqa	(%ecx),%xmm5
148	movdqu	(%edx),%xmm2
149.byte	102,15,56,0,197
150	subl	$16,%ebx
151	jz	L003odd_tail
152	movdqu	(%esi),%xmm3
153	movdqu	16(%esi),%xmm6
154.byte	102,15,56,0,221
155.byte	102,15,56,0,245
156	movdqu	32(%edx),%xmm5
157	pxor	%xmm3,%xmm0
158	pshufd	$78,%xmm6,%xmm3
159	movdqa	%xmm6,%xmm7
160	pxor	%xmm6,%xmm3
161	leal	32(%esi),%esi
162.byte	102,15,58,68,242,0
163.byte	102,15,58,68,250,17
164.byte	102,15,58,68,221,0
165	movups	16(%edx),%xmm2
166	nop
167	subl	$32,%ebx
168	jbe	L004even_tail
169	jmp	L005mod_loop
170.align	5,0x90
171L005mod_loop:
172	pshufd	$78,%xmm0,%xmm4
173	movdqa	%xmm0,%xmm1
174	pxor	%xmm0,%xmm4
175	nop
176.byte	102,15,58,68,194,0
177.byte	102,15,58,68,202,17
178.byte	102,15,58,68,229,16
179	movups	(%edx),%xmm2
180	xorps	%xmm6,%xmm0
181	movdqa	(%ecx),%xmm5
182	xorps	%xmm7,%xmm1
183	movdqu	(%esi),%xmm7
184	pxor	%xmm0,%xmm3
185	movdqu	16(%esi),%xmm6
186	pxor	%xmm1,%xmm3
187.byte	102,15,56,0,253
188	pxor	%xmm3,%xmm4
189	movdqa	%xmm4,%xmm3
190	psrldq	$8,%xmm4
191	pslldq	$8,%xmm3
192	pxor	%xmm4,%xmm1
193	pxor	%xmm3,%xmm0
194.byte	102,15,56,0,245
195	pxor	%xmm7,%xmm1
196	movdqa	%xmm6,%xmm7
197	movdqa	%xmm0,%xmm4
198	movdqa	%xmm0,%xmm3
199	psllq	$5,%xmm0
200	pxor	%xmm0,%xmm3
201	psllq	$1,%xmm0
202	pxor	%xmm3,%xmm0
203.byte	102,15,58,68,242,0
204	movups	32(%edx),%xmm5
205	psllq	$57,%xmm0
206	movdqa	%xmm0,%xmm3
207	pslldq	$8,%xmm0
208	psrldq	$8,%xmm3
209	pxor	%xmm4,%xmm0
210	pxor	%xmm3,%xmm1
211	pshufd	$78,%xmm7,%xmm3
212	movdqa	%xmm0,%xmm4
213	psrlq	$1,%xmm0
214	pxor	%xmm7,%xmm3
215	pxor	%xmm4,%xmm1
216.byte	102,15,58,68,250,17
217	movups	16(%edx),%xmm2
218	pxor	%xmm0,%xmm4
219	psrlq	$5,%xmm0
220	pxor	%xmm4,%xmm0
221	psrlq	$1,%xmm0
222	pxor	%xmm1,%xmm0
223.byte	102,15,58,68,221,0
224	leal	32(%esi),%esi
225	subl	$32,%ebx
226	ja	L005mod_loop
227L004even_tail:
228	pshufd	$78,%xmm0,%xmm4
229	movdqa	%xmm0,%xmm1
230	pxor	%xmm0,%xmm4
231.byte	102,15,58,68,194,0
232.byte	102,15,58,68,202,17
233.byte	102,15,58,68,229,16
234	movdqa	(%ecx),%xmm5
235	xorps	%xmm6,%xmm0
236	xorps	%xmm7,%xmm1
237	pxor	%xmm0,%xmm3
238	pxor	%xmm1,%xmm3
239	pxor	%xmm3,%xmm4
240	movdqa	%xmm4,%xmm3
241	psrldq	$8,%xmm4
242	pslldq	$8,%xmm3
243	pxor	%xmm4,%xmm1
244	pxor	%xmm3,%xmm0
245	movdqa	%xmm0,%xmm4
246	movdqa	%xmm0,%xmm3
247	psllq	$5,%xmm0
248	pxor	%xmm0,%xmm3
249	psllq	$1,%xmm0
250	pxor	%xmm3,%xmm0
251	psllq	$57,%xmm0
252	movdqa	%xmm0,%xmm3
253	pslldq	$8,%xmm0
254	psrldq	$8,%xmm3
255	pxor	%xmm4,%xmm0
256	pxor	%xmm3,%xmm1
257	movdqa	%xmm0,%xmm4
258	psrlq	$1,%xmm0
259	pxor	%xmm4,%xmm1
260	pxor	%xmm0,%xmm4
261	psrlq	$5,%xmm0
262	pxor	%xmm4,%xmm0
263	psrlq	$1,%xmm0
264	pxor	%xmm1,%xmm0
265	testl	%ebx,%ebx
266	jnz	L006done
267	movups	(%edx),%xmm2
268L003odd_tail:
269	movdqu	(%esi),%xmm3
270.byte	102,15,56,0,221
271	pxor	%xmm3,%xmm0
272	movdqa	%xmm0,%xmm1
273	pshufd	$78,%xmm0,%xmm3
274	pshufd	$78,%xmm2,%xmm4
275	pxor	%xmm0,%xmm3
276	pxor	%xmm2,%xmm4
277.byte	102,15,58,68,194,0
278.byte	102,15,58,68,202,17
279.byte	102,15,58,68,220,0
280	xorps	%xmm0,%xmm3
281	xorps	%xmm1,%xmm3
282	movdqa	%xmm3,%xmm4
283	psrldq	$8,%xmm3
284	pslldq	$8,%xmm4
285	pxor	%xmm3,%xmm1
286	pxor	%xmm4,%xmm0
287	movdqa	%xmm0,%xmm4
288	movdqa	%xmm0,%xmm3
289	psllq	$5,%xmm0
290	pxor	%xmm0,%xmm3
291	psllq	$1,%xmm0
292	pxor	%xmm3,%xmm0
293	psllq	$57,%xmm0
294	movdqa	%xmm0,%xmm3
295	pslldq	$8,%xmm0
296	psrldq	$8,%xmm3
297	pxor	%xmm4,%xmm0
298	pxor	%xmm3,%xmm1
299	movdqa	%xmm0,%xmm4
300	psrlq	$1,%xmm0
301	pxor	%xmm4,%xmm1
302	pxor	%xmm0,%xmm4
303	psrlq	$5,%xmm0
304	pxor	%xmm4,%xmm0
305	psrlq	$1,%xmm0
306	pxor	%xmm1,%xmm0
307L006done:
308.byte	102,15,56,0,197
309	movdqu	%xmm0,(%eax)
310	popl	%edi
311	popl	%esi
312	popl	%ebx
313	popl	%ebp
314	ret
315.align	6,0x90
316Lbswap:
317.byte	15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0
318.byte	1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,194
319.align	6,0x90
320L007rem_8bit:
321.value	0,450,900,582,1800,1738,1164,1358
322.value	3600,4050,3476,3158,2328,2266,2716,2910
323.value	7200,7650,8100,7782,6952,6890,6316,6510
324.value	4656,5106,4532,4214,5432,5370,5820,6014
325.value	14400,14722,15300,14854,16200,16010,15564,15630
326.value	13904,14226,13780,13334,12632,12442,13020,13086
327.value	9312,9634,10212,9766,9064,8874,8428,8494
328.value	10864,11186,10740,10294,11640,11450,12028,12094
329.value	28800,28994,29444,29382,30600,30282,29708,30158
330.value	32400,32594,32020,31958,31128,30810,31260,31710
331.value	27808,28002,28452,28390,27560,27242,26668,27118
332.value	25264,25458,24884,24822,26040,25722,26172,26622
333.value	18624,18690,19268,19078,20424,19978,19532,19854
334.value	18128,18194,17748,17558,16856,16410,16988,17310
335.value	21728,21794,22372,22182,21480,21034,20588,20910
336.value	23280,23346,22900,22710,24056,23610,24188,24510
337.value	57600,57538,57988,58182,58888,59338,58764,58446
338.value	61200,61138,60564,60758,59416,59866,60316,59998
339.value	64800,64738,65188,65382,64040,64490,63916,63598
340.value	62256,62194,61620,61814,62520,62970,63420,63102
341.value	55616,55426,56004,56070,56904,57226,56780,56334
342.value	55120,54930,54484,54550,53336,53658,54236,53790
343.value	50528,50338,50916,50982,49768,50090,49644,49198
344.value	52080,51890,51444,51510,52344,52666,53244,52798
345.value	37248,36930,37380,37830,38536,38730,38156,38094
346.value	40848,40530,39956,40406,39064,39258,39708,39646
347.value	36256,35938,36388,36838,35496,35690,35116,35054
348.value	33712,33394,32820,33270,33976,34170,34620,34558
349.value	43456,43010,43588,43910,44744,44810,44364,44174
350.value	42960,42514,42068,42390,41176,41242,41820,41630
351.value	46560,46114,46692,47014,45800,45866,45420,45230
352.value	48112,47666,47220,47542,48376,48442,49020,48830
353.byte	71,72,65,83,72,32,102,111,114,32,120,56,54,44,32,67
354.byte	82,89,80,84,79,71,65,77,83,32,98,121,32,60,97,112
355.byte	112,114,111,64,111,112,101,110,115,115,108,46,111,114,103,62
356.byte	0
357#endif
358