xref: /freebsd/sys/crypto/openssl/powerpc64le/chacha-ppc.S (revision d0b2dbfa0ecf2bbc9709efc5e20baf8e4b44bbbf)
1/* Do not modify. This file is auto-generated from chacha-ppc.pl. */
2.machine	"any"
3.abiversion	2
4.text
5
6.globl	ChaCha20_ctr32_int
7.type	ChaCha20_ctr32_int,@function
8.align	5
9ChaCha20_ctr32_int:
10.localentry	ChaCha20_ctr32_int,0
11
12__ChaCha20_ctr32_int:
13	cmpldi	5,0
14	.long	0x4DC20020
15
16	stdu	1,-256(1)
17	mflr	0
18
19	std	14,112(1)
20	std	15,120(1)
21	std	16,128(1)
22	std	17,136(1)
23	std	18,144(1)
24	std	19,152(1)
25	std	20,160(1)
26	std	21,168(1)
27	std	22,176(1)
28	std	23,184(1)
29	std	24,192(1)
30	std	25,200(1)
31	std	26,208(1)
32	std	27,216(1)
33	std	28,224(1)
34	std	29,232(1)
35	std	30,240(1)
36	std	31,248(1)
37	std	0,272(1)
38
39	lwz	11,0(7)
40	lwz	12,4(7)
41	lwz	14,8(7)
42	lwz	15,12(7)
43
44	bl	__ChaCha20_1x
45
46	ld	0,272(1)
47	ld	14,112(1)
48	ld	15,120(1)
49	ld	16,128(1)
50	ld	17,136(1)
51	ld	18,144(1)
52	ld	19,152(1)
53	ld	20,160(1)
54	ld	21,168(1)
55	ld	22,176(1)
56	ld	23,184(1)
57	ld	24,192(1)
58	ld	25,200(1)
59	ld	26,208(1)
60	ld	27,216(1)
61	ld	28,224(1)
62	ld	29,232(1)
63	ld	30,240(1)
64	ld	31,248(1)
65	mtlr	0
66	addi	1,1,256
67	blr
68.long	0
69.byte	0,12,4,1,0x80,18,5,0
70.long	0
71.size	ChaCha20_ctr32_int,.-ChaCha20_ctr32_int
72
73.align	5
74__ChaCha20_1x:
75.Loop_outer:
76	lis	16,0x6170
77	lis	17,0x3320
78	lis	18,0x7962
79	lis	19,0x6b20
80	ori	16,16,0x7865
81	ori	17,17,0x646e
82	ori	18,18,0x2d32
83	ori	19,19,0x6574
84
85	li	0,10
86	lwz	20,0(6)
87	lwz	21,4(6)
88	lwz	22,8(6)
89	lwz	23,12(6)
90	lwz	24,16(6)
91	mr	28,11
92	lwz	25,20(6)
93	mr	29,12
94	lwz	26,24(6)
95	mr	30,14
96	lwz	27,28(6)
97	mr	31,15
98
99	mr	7,20
100	mr	8,21
101	mr	9,22
102	mr	10,23
103
104	mtctr	0
105.Loop:
106	add	16,16,20
107	add	17,17,21
108	add	18,18,22
109	add	19,19,23
110	xor	28,28,16
111	xor	29,29,17
112	xor	30,30,18
113	xor	31,31,19
114	rotlwi	28,28,16
115	rotlwi	29,29,16
116	rotlwi	30,30,16
117	rotlwi	31,31,16
118	add	24,24,28
119	add	25,25,29
120	add	26,26,30
121	add	27,27,31
122	xor	20,20,24
123	xor	21,21,25
124	xor	22,22,26
125	xor	23,23,27
126	rotlwi	20,20,12
127	rotlwi	21,21,12
128	rotlwi	22,22,12
129	rotlwi	23,23,12
130	add	16,16,20
131	add	17,17,21
132	add	18,18,22
133	add	19,19,23
134	xor	28,28,16
135	xor	29,29,17
136	xor	30,30,18
137	xor	31,31,19
138	rotlwi	28,28,8
139	rotlwi	29,29,8
140	rotlwi	30,30,8
141	rotlwi	31,31,8
142	add	24,24,28
143	add	25,25,29
144	add	26,26,30
145	add	27,27,31
146	xor	20,20,24
147	xor	21,21,25
148	xor	22,22,26
149	xor	23,23,27
150	rotlwi	20,20,7
151	rotlwi	21,21,7
152	rotlwi	22,22,7
153	rotlwi	23,23,7
154	add	16,16,21
155	add	17,17,22
156	add	18,18,23
157	add	19,19,20
158	xor	31,31,16
159	xor	28,28,17
160	xor	29,29,18
161	xor	30,30,19
162	rotlwi	31,31,16
163	rotlwi	28,28,16
164	rotlwi	29,29,16
165	rotlwi	30,30,16
166	add	26,26,31
167	add	27,27,28
168	add	24,24,29
169	add	25,25,30
170	xor	21,21,26
171	xor	22,22,27
172	xor	23,23,24
173	xor	20,20,25
174	rotlwi	21,21,12
175	rotlwi	22,22,12
176	rotlwi	23,23,12
177	rotlwi	20,20,12
178	add	16,16,21
179	add	17,17,22
180	add	18,18,23
181	add	19,19,20
182	xor	31,31,16
183	xor	28,28,17
184	xor	29,29,18
185	xor	30,30,19
186	rotlwi	31,31,8
187	rotlwi	28,28,8
188	rotlwi	29,29,8
189	rotlwi	30,30,8
190	add	26,26,31
191	add	27,27,28
192	add	24,24,29
193	add	25,25,30
194	xor	21,21,26
195	xor	22,22,27
196	xor	23,23,24
197	xor	20,20,25
198	rotlwi	21,21,7
199	rotlwi	22,22,7
200	rotlwi	23,23,7
201	rotlwi	20,20,7
202	bdnz	.Loop
203
204	subic	5,5,64
205	addi	16,16,0x7865
206	addi	17,17,0x646e
207	addi	18,18,0x2d32
208	addi	19,19,0x6574
209	addis	16,16,0x6170
210	addis	17,17,0x3320
211	addis	18,18,0x7962
212	addis	19,19,0x6b20
213
214	subfe.	0,0,0
215	add	20,20,7
216	lwz	7,16(6)
217	add	21,21,8
218	lwz	8,20(6)
219	add	22,22,9
220	lwz	9,24(6)
221	add	23,23,10
222	lwz	10,28(6)
223	add	24,24,7
224	add	25,25,8
225	add	26,26,9
226	add	27,27,10
227
228	add	28,28,11
229	add	29,29,12
230	add	30,30,14
231	add	31,31,15
232	addi	11,11,1
233	bne	.Ltail
234
235	lwz	7,0(4)
236	lwz	8,4(4)
237	cmpldi	5,0
238	lwz	9,8(4)
239	lwz	10,12(4)
240	xor	16,16,7
241	lwz	7,16(4)
242	xor	17,17,8
243	lwz	8,20(4)
244	xor	18,18,9
245	lwz	9,24(4)
246	xor	19,19,10
247	lwz	10,28(4)
248	xor	20,20,7
249	lwz	7,32(4)
250	xor	21,21,8
251	lwz	8,36(4)
252	xor	22,22,9
253	lwz	9,40(4)
254	xor	23,23,10
255	lwz	10,44(4)
256	xor	24,24,7
257	lwz	7,48(4)
258	xor	25,25,8
259	lwz	8,52(4)
260	xor	26,26,9
261	lwz	9,56(4)
262	xor	27,27,10
263	lwz	10,60(4)
264	xor	28,28,7
265	stw	16,0(3)
266	xor	29,29,8
267	stw	17,4(3)
268	xor	30,30,9
269	stw	18,8(3)
270	xor	31,31,10
271	stw	19,12(3)
272	stw	20,16(3)
273	stw	21,20(3)
274	stw	22,24(3)
275	stw	23,28(3)
276	stw	24,32(3)
277	stw	25,36(3)
278	stw	26,40(3)
279	stw	27,44(3)
280	stw	28,48(3)
281	stw	29,52(3)
282	stw	30,56(3)
283	addi	4,4,64
284	stw	31,60(3)
285	addi	3,3,64
286
287	bne	.Loop_outer
288
289	blr
290
291.align	4
292.Ltail:
293	addi	5,5,64
294	subi	4,4,1
295	subi	3,3,1
296	addi	7,1,48-1
297	mtctr	5
298
299	stw	16,48(1)
300	stw	17,52(1)
301	stw	18,56(1)
302	stw	19,60(1)
303	stw	20,64(1)
304	stw	21,68(1)
305	stw	22,72(1)
306	stw	23,76(1)
307	stw	24,80(1)
308	stw	25,84(1)
309	stw	26,88(1)
310	stw	27,92(1)
311	stw	28,96(1)
312	stw	29,100(1)
313	stw	30,104(1)
314	stw	31,108(1)
315
316.Loop_tail:
317	lbzu	11,1(4)
318	lbzu	16,1(7)
319	xor	12,11,16
320	stbu	12,1(3)
321	bdnz	.Loop_tail
322
323	stw	1,48(1)
324	stw	1,52(1)
325	stw	1,56(1)
326	stw	1,60(1)
327	stw	1,64(1)
328	stw	1,68(1)
329	stw	1,72(1)
330	stw	1,76(1)
331	stw	1,80(1)
332	stw	1,84(1)
333	stw	1,88(1)
334	stw	1,92(1)
335	stw	1,96(1)
336	stw	1,100(1)
337	stw	1,104(1)
338	stw	1,108(1)
339
340	blr
341.long	0
342.byte	0,12,0x14,0,0,0,0,0
343
344.globl	ChaCha20_ctr32_vmx
345.type	ChaCha20_ctr32_vmx,@function
346.align	5
347ChaCha20_ctr32_vmx:
348.localentry	ChaCha20_ctr32_vmx,0
349
350	cmpldi	5,256
351	blt	__ChaCha20_ctr32_int
352
353	stdu	1,-416(1)
354	mflr	0
355	li	10,127
356	li	11,143
357	li	12,-1
358	stvx	23,10,1
359	addi	10,10,32
360	stvx	24,11,1
361	addi	11,11,32
362	stvx	25,10,1
363	addi	10,10,32
364	stvx	26,11,1
365	addi	11,11,32
366	stvx	27,10,1
367	addi	10,10,32
368	stvx	28,11,1
369	addi	11,11,32
370	stvx	29,10,1
371	addi	10,10,32
372	stvx	30,11,1
373	stvx	31,10,1
374	stw	12,268(1)
375	std	14,272(1)
376	std	15,280(1)
377	std	16,288(1)
378	std	17,296(1)
379	std	18,304(1)
380	std	19,312(1)
381	std	20,320(1)
382	std	21,328(1)
383	std	22,336(1)
384	std	23,344(1)
385	std	24,352(1)
386	std	25,360(1)
387	std	26,368(1)
388	std	27,376(1)
389	std	28,384(1)
390	std	29,392(1)
391	std	30,400(1)
392	std	31,408(1)
393	li	12,-4096+511
394	std	0, 432(1)
395	or	12,12,12
396
397	bl	.Lconsts
398	li	16,16
399	li	17,32
400	li	18,48
401	li	19,64
402	li	20,31
403	li	21,15
404
405	lvx	13,0,6
406	lvsr	29,0,6
407	lvx	14,16,6
408	lvx	27,20,6
409
410	lvx	15,0,7
411	lvsr	30,0,7
412	lvx	28,21,7
413
414	lvx	12,0,12
415	lvx	17,16,12
416	lvx	18,17,12
417	lvx	19,18,12
418	lvx	23,19,12
419
420	vperm	13,14,13,29
421	vperm	14,27,14,29
422	vperm	15,28,15,30
423
424	lwz	11,0(7)
425	lwz	12,4(7)
426	vadduwm	15,15,17
427	lwz	14,8(7)
428	vadduwm	16,15,17
429	lwz	15,12(7)
430	vadduwm	17,16,17
431
432	vxor	29,29,29
433	vspltisw	26,-1
434	lvsr	24,0,4
435	lvsl	25,0,3
436	vperm	26,26,29,25
437
438
439
440
441
442
443
444	li	0,10
445	b	.Loop_outer_vmx
446
447.align	4
448.Loop_outer_vmx:
449	lis	16,0x6170
450	lis	17,0x3320
451	vor	0,12,12
452	lis	18,0x7962
453	lis	19,0x6b20
454	vor	4,12,12
455	ori	16,16,0x7865
456	ori	17,17,0x646e
457	vor	8,12,12
458	ori	18,18,0x2d32
459	ori	19,19,0x6574
460	vor	1,13,13
461
462	lwz	20,0(6)
463	vor	5,13,13
464	lwz	21,4(6)
465	vor	9,13,13
466	lwz	22,8(6)
467	vor	2,14,14
468	lwz	23,12(6)
469	vor	6,14,14
470	lwz	24,16(6)
471	vor	10,14,14
472	mr	28,11
473	lwz	25,20(6)
474	vor	3,15,15
475	mr	29,12
476	lwz	26,24(6)
477	vor	7,16,16
478	mr	30,14
479	lwz	27,28(6)
480	vor	11,17,17
481	mr	31,15
482
483	mr	7,20
484	mr	8,21
485	mr	9,22
486	mr	10,23
487
488	vspltisw	27,12
489	vspltisw	28,7
490
491	mtctr	0
492	nop
493.Loop_vmx:
494	vadduwm	0,0,1
495	vadduwm	4,4,5
496	vadduwm	8,8,9
497	add	16,16,20
498	add	17,17,21
499	add	18,18,22
500	vxor	3,3,0
501	vxor	7,7,4
502	vxor	11,11,8
503	add	19,19,23
504	xor	28,28,16
505	xor	29,29,17
506	vperm	3,3,3,19
507	vperm	7,7,7,19
508	vperm	11,11,11,19
509	xor	30,30,18
510	xor	31,31,19
511	rotlwi	28,28,16
512	vadduwm	2,2,3
513	vadduwm	6,6,7
514	vadduwm	10,10,11
515	rotlwi	29,29,16
516	rotlwi	30,30,16
517	rotlwi	31,31,16
518	vxor	1,1,2
519	vxor	5,5,6
520	vxor	9,9,10
521	add	24,24,28
522	add	25,25,29
523	add	26,26,30
524	vrlw	1,1,27
525	vrlw	5,5,27
526	vrlw	9,9,27
527	add	27,27,31
528	xor	20,20,24
529	xor	21,21,25
530	vadduwm	0,0,1
531	vadduwm	4,4,5
532	vadduwm	8,8,9
533	xor	22,22,26
534	xor	23,23,27
535	rotlwi	20,20,12
536	vxor	3,3,0
537	vxor	7,7,4
538	vxor	11,11,8
539	rotlwi	21,21,12
540	rotlwi	22,22,12
541	rotlwi	23,23,12
542	vperm	3,3,3,23
543	vperm	7,7,7,23
544	vperm	11,11,11,23
545	add	16,16,20
546	add	17,17,21
547	add	18,18,22
548	vadduwm	2,2,3
549	vadduwm	6,6,7
550	vadduwm	10,10,11
551	add	19,19,23
552	xor	28,28,16
553	xor	29,29,17
554	vxor	1,1,2
555	vxor	5,5,6
556	vxor	9,9,10
557	xor	30,30,18
558	xor	31,31,19
559	rotlwi	28,28,8
560	vrlw	1,1,28
561	vrlw	5,5,28
562	vrlw	9,9,28
563	rotlwi	29,29,8
564	rotlwi	30,30,8
565	rotlwi	31,31,8
566	vsldoi	2,2,2, 8
567	vsldoi	6,6,6, 8
568	vsldoi	10,10,10, 8
569	add	24,24,28
570	add	25,25,29
571	add	26,26,30
572	vsldoi	1,1,1, 12
573	vsldoi	5,5,5, 12
574	vsldoi	9,9,9, 12
575	add	27,27,31
576	xor	20,20,24
577	xor	21,21,25
578	vsldoi	3,3,3, 4
579	vsldoi	7,7,7, 4
580	vsldoi	11,11,11, 4
581	xor	22,22,26
582	xor	23,23,27
583	rotlwi	20,20,7
584	rotlwi	21,21,7
585	rotlwi	22,22,7
586	rotlwi	23,23,7
587	vadduwm	0,0,1
588	vadduwm	4,4,5
589	vadduwm	8,8,9
590	add	16,16,21
591	add	17,17,22
592	add	18,18,23
593	vxor	3,3,0
594	vxor	7,7,4
595	vxor	11,11,8
596	add	19,19,20
597	xor	31,31,16
598	xor	28,28,17
599	vperm	3,3,3,19
600	vperm	7,7,7,19
601	vperm	11,11,11,19
602	xor	29,29,18
603	xor	30,30,19
604	rotlwi	31,31,16
605	vadduwm	2,2,3
606	vadduwm	6,6,7
607	vadduwm	10,10,11
608	rotlwi	28,28,16
609	rotlwi	29,29,16
610	rotlwi	30,30,16
611	vxor	1,1,2
612	vxor	5,5,6
613	vxor	9,9,10
614	add	26,26,31
615	add	27,27,28
616	add	24,24,29
617	vrlw	1,1,27
618	vrlw	5,5,27
619	vrlw	9,9,27
620	add	25,25,30
621	xor	21,21,26
622	xor	22,22,27
623	vadduwm	0,0,1
624	vadduwm	4,4,5
625	vadduwm	8,8,9
626	xor	23,23,24
627	xor	20,20,25
628	rotlwi	21,21,12
629	vxor	3,3,0
630	vxor	7,7,4
631	vxor	11,11,8
632	rotlwi	22,22,12
633	rotlwi	23,23,12
634	rotlwi	20,20,12
635	vperm	3,3,3,23
636	vperm	7,7,7,23
637	vperm	11,11,11,23
638	add	16,16,21
639	add	17,17,22
640	add	18,18,23
641	vadduwm	2,2,3
642	vadduwm	6,6,7
643	vadduwm	10,10,11
644	add	19,19,20
645	xor	31,31,16
646	xor	28,28,17
647	vxor	1,1,2
648	vxor	5,5,6
649	vxor	9,9,10
650	xor	29,29,18
651	xor	30,30,19
652	rotlwi	31,31,8
653	vrlw	1,1,28
654	vrlw	5,5,28
655	vrlw	9,9,28
656	rotlwi	28,28,8
657	rotlwi	29,29,8
658	rotlwi	30,30,8
659	vsldoi	2,2,2, 8
660	vsldoi	6,6,6, 8
661	vsldoi	10,10,10, 8
662	add	26,26,31
663	add	27,27,28
664	add	24,24,29
665	vsldoi	1,1,1, 4
666	vsldoi	5,5,5, 4
667	vsldoi	9,9,9, 4
668	add	25,25,30
669	xor	21,21,26
670	xor	22,22,27
671	vsldoi	3,3,3, 12
672	vsldoi	7,7,7, 12
673	vsldoi	11,11,11, 12
674	xor	23,23,24
675	xor	20,20,25
676	rotlwi	21,21,7
677	rotlwi	22,22,7
678	rotlwi	23,23,7
679	rotlwi	20,20,7
680	bdnz	.Loop_vmx
681
682	subi	5,5,256
683	addi	16,16,0x7865
684	addi	17,17,0x646e
685	addi	18,18,0x2d32
686	addi	19,19,0x6574
687	addis	16,16,0x6170
688	addis	17,17,0x3320
689	addis	18,18,0x7962
690	addis	19,19,0x6b20
691	add	20,20,7
692	lwz	7,16(6)
693	add	21,21,8
694	lwz	8,20(6)
695	add	22,22,9
696	lwz	9,24(6)
697	add	23,23,10
698	lwz	10,28(6)
699	add	24,24,7
700	add	25,25,8
701	add	26,26,9
702	add	27,27,10
703	add	28,28,11
704	add	29,29,12
705	add	30,30,14
706	add	31,31,15
707
708	vadduwm	0,0,12
709	vadduwm	4,4,12
710	vadduwm	8,8,12
711	vadduwm	1,1,13
712	vadduwm	5,5,13
713	vadduwm	9,9,13
714	vadduwm	2,2,14
715	vadduwm	6,6,14
716	vadduwm	10,10,14
717	vadduwm	3,3,15
718	vadduwm	7,7,16
719	vadduwm	11,11,17
720
721	addi	11,11,4
722	vadduwm	15,15,18
723	vadduwm	16,16,18
724	vadduwm	17,17,18
725
726	lwz	7,0(4)
727	lwz	8,4(4)
728	lwz	9,8(4)
729	lwz	10,12(4)
730	xor	16,16,7
731	lwz	7,16(4)
732	xor	17,17,8
733	lwz	8,20(4)
734	xor	18,18,9
735	lwz	9,24(4)
736	xor	19,19,10
737	lwz	10,28(4)
738	xor	20,20,7
739	lwz	7,32(4)
740	xor	21,21,8
741	lwz	8,36(4)
742	xor	22,22,9
743	lwz	9,40(4)
744	xor	23,23,10
745	lwz	10,44(4)
746	xor	24,24,7
747	lwz	7,48(4)
748	xor	25,25,8
749	lwz	8,52(4)
750	xor	26,26,9
751	lwz	9,56(4)
752	xor	27,27,10
753	lwz	10,60(4)
754	xor	28,28,7
755	stw	16,0(3)
756	xor	29,29,8
757	stw	17,4(3)
758	xor	30,30,9
759	stw	18,8(3)
760	xor	31,31,10
761	stw	19,12(3)
762	addi	4,4,64
763	stw	20,16(3)
764	li	7,16
765	stw	21,20(3)
766	li	8,32
767	stw	22,24(3)
768	li	9,48
769	stw	23,28(3)
770	li	10,64
771	stw	24,32(3)
772	stw	25,36(3)
773	stw	26,40(3)
774	stw	27,44(3)
775	stw	28,48(3)
776	stw	29,52(3)
777	stw	30,56(3)
778	stw	31,60(3)
779	addi	3,3,64
780
781	lvx	27,0,4
782	lvx	28,7,4
783	lvx	29,8,4
784	lvx	30,9,4
785	lvx	31,10,4
786	addi	4,4,64
787
788	vperm	27,28,27,24
789	vperm	28,29,28,24
790	vperm	29,30,29,24
791	vperm	30,31,30,24
792	vxor	0,0,27
793	vxor	1,1,28
794	lvx	28,7,4
795	vxor	2,2,29
796	lvx	29,8,4
797	vxor	3,3,30
798	lvx	30,9,4
799	lvx	27,10,4
800	addi	4,4,64
801	li	10,63
802	vperm	0,0,0,25
803	vperm	1,1,1,25
804	vperm	2,2,2,25
805	vperm	3,3,3,25
806
807	vperm	31,28,31,24
808	vperm	28,29,28,24
809	vperm	29,30,29,24
810	vperm	30,27,30,24
811	vxor	4,4,31
812	vxor	5,5,28
813	lvx	28,7,4
814	vxor	6,6,29
815	lvx	29,8,4
816	vxor	7,7,30
817	lvx	30,9,4
818	lvx	31,10,4
819	addi	4,4,64
820	vperm	4,4,4,25
821	vperm	5,5,5,25
822	vperm	6,6,6,25
823	vperm	7,7,7,25
824
825	vperm	27,28,27,24
826	vperm	28,29,28,24
827	vperm	29,30,29,24
828	vperm	30,31,30,24
829	vxor	8,8,27
830	vxor	9,9,28
831	vxor	10,10,29
832	vxor	11,11,30
833	vperm	8,8,8,25
834	vperm	9,9,9,25
835	vperm	10,10,10,25
836	vperm	11,11,11,25
837
838	andi.	17,3,15
839	mr	16,3
840
841	vsel	27,0,1,26
842	vsel	28,1,2,26
843	vsel	29,2,3,26
844	vsel	30,3,4,26
845	vsel	1,4,5,26
846	vsel	2,5,6,26
847	vsel	3,6,7,26
848	vsel	4,7,8,26
849	vsel	5,8,9,26
850	vsel	6,9,10,26
851	vsel	7,10,11,26
852
853
854	stvx	27,7,3
855	stvx	28,8,3
856	stvx	29,9,3
857	addi	3,3,64
858	stvx	30,0,3
859	stvx	1,7,3
860	stvx	2,8,3
861	stvx	3,9,3
862	addi	3,3,64
863	stvx	4,0,3
864	stvx	5,7,3
865	stvx	6,8,3
866	stvx	7,9,3
867	addi	3,3,64
868
869	beq	.Laligned_vmx
870
871	sub	18,3,17
872	li	19,0
873.Lunaligned_tail_vmx:
874	stvebx	11,19,18
875	addi	19,19,1
876	cmpw	19,17
877	bne	.Lunaligned_tail_vmx
878
879	sub	18,16,17
880.Lunaligned_head_vmx:
881	stvebx	0,17,18
882	cmpwi	17,15
883	addi	17,17,1
884	bne	.Lunaligned_head_vmx
885
886	cmpldi	5,255
887	bgt	.Loop_outer_vmx
888
889	b	.Ldone_vmx
890
891.align	4
892.Laligned_vmx:
893	stvx	0,0,16
894
895	cmpldi	5,255
896	bgt	.Loop_outer_vmx
897	nop
898
899.Ldone_vmx:
900	cmpldi	5,0
901	bnel	__ChaCha20_1x
902
903	lwz	12,268(1)
904	li	10,127
905	li	11,143
906	or	12,12,12
907	lvx	23,10,1
908	addi	10,10,32
909	lvx	24,11,1
910	addi	11,11,32
911	lvx	25,10,1
912	addi	10,10,32
913	lvx	26,11,1
914	addi	11,11,32
915	lvx	27,10,1
916	addi	10,10,32
917	lvx	28,11,1
918	addi	11,11,32
919	lvx	29,10,1
920	addi	10,10,32
921	lvx	30,11,1
922	lvx	31,10,1
923	ld	0, 432(1)
924	ld	14,272(1)
925	ld	15,280(1)
926	ld	16,288(1)
927	ld	17,296(1)
928	ld	18,304(1)
929	ld	19,312(1)
930	ld	20,320(1)
931	ld	21,328(1)
932	ld	22,336(1)
933	ld	23,344(1)
934	ld	24,352(1)
935	ld	25,360(1)
936	ld	26,368(1)
937	ld	27,376(1)
938	ld	28,384(1)
939	ld	29,392(1)
940	ld	30,400(1)
941	ld	31,408(1)
942	mtlr	0
943	addi	1,1,416
944	blr
945.long	0
946.byte	0,12,0x04,1,0x80,18,5,0
947.long	0
948.size	ChaCha20_ctr32_vmx,.-ChaCha20_ctr32_vmx
949
950.globl	ChaCha20_ctr32_vsx
951.type	ChaCha20_ctr32_vsx,@function
952.align	5
953ChaCha20_ctr32_vsx:
954.localentry	ChaCha20_ctr32_vsx,0
955
956	stdu	1,-224(1)
957	mflr	0
958	li	10,127
959	li	11,143
960	li	12,-1
961	stvx	26,10,1
962	addi	10,10,32
963	stvx	27,11,1
964	addi	11,11,32
965	stvx	28,10,1
966	addi	10,10,32
967	stvx	29,11,1
968	addi	11,11,32
969	stvx	30,10,1
970	stvx	31,11,1
971	stw	12,220(1)
972	li	12,-4096+63
973	std	0, 240(1)
974	or	12,12,12
975
976	bl	.Lconsts
977	.long	0x7E006619
978	addi	12,12,0x50
979	li	8,16
980	li	9,32
981	li	10,48
982	li	11,64
983
984	.long	0x7E203619
985	.long	0x7E483619
986	.long	0x7E603E19
987
988	vxor	27,27,27
989	.long	0x7F8B6619
990	vspltw	26,19,0
991	vsldoi	19,19,27,4
992	vsldoi	19,27,19,12
993	vadduwm	26,26,28
994
995
996
997
998
999	li	0,10
1000	mtctr	0
1001	b	.Loop_outer_vsx
1002
1003.align	5
1004.Loop_outer_vsx:
1005	lvx	0,0,12
1006	lvx	1,8,12
1007	lvx	2,9,12
1008	lvx	3,10,12
1009
1010	vspltw	4,17,0
1011	vspltw	5,17,1
1012	vspltw	6,17,2
1013	vspltw	7,17,3
1014
1015	vspltw	8,18,0
1016	vspltw	9,18,1
1017	vspltw	10,18,2
1018	vspltw	11,18,3
1019
1020	vor	12,26,26
1021	vspltw	13,19,1
1022	vspltw	14,19,2
1023	vspltw	15,19,3
1024
1025	vspltisw	27,-16
1026	vspltisw	28,12
1027	vspltisw	29,8
1028	vspltisw	30,7
1029
1030.Loop_vsx:
1031	vadduwm	0,0,4
1032	vadduwm	1,1,5
1033	vadduwm	2,2,6
1034	vadduwm	3,3,7
1035	vxor	12,12,0
1036	vxor	13,13,1
1037	vxor	14,14,2
1038	vxor	15,15,3
1039	vrlw	12,12,27
1040	vrlw	13,13,27
1041	vrlw	14,14,27
1042	vrlw	15,15,27
1043	vadduwm	8,8,12
1044	vadduwm	9,9,13
1045	vadduwm	10,10,14
1046	vadduwm	11,11,15
1047	vxor	4,4,8
1048	vxor	5,5,9
1049	vxor	6,6,10
1050	vxor	7,7,11
1051	vrlw	4,4,28
1052	vrlw	5,5,28
1053	vrlw	6,6,28
1054	vrlw	7,7,28
1055	vadduwm	0,0,4
1056	vadduwm	1,1,5
1057	vadduwm	2,2,6
1058	vadduwm	3,3,7
1059	vxor	12,12,0
1060	vxor	13,13,1
1061	vxor	14,14,2
1062	vxor	15,15,3
1063	vrlw	12,12,29
1064	vrlw	13,13,29
1065	vrlw	14,14,29
1066	vrlw	15,15,29
1067	vadduwm	8,8,12
1068	vadduwm	9,9,13
1069	vadduwm	10,10,14
1070	vadduwm	11,11,15
1071	vxor	4,4,8
1072	vxor	5,5,9
1073	vxor	6,6,10
1074	vxor	7,7,11
1075	vrlw	4,4,30
1076	vrlw	5,5,30
1077	vrlw	6,6,30
1078	vrlw	7,7,30
1079	vadduwm	0,0,5
1080	vadduwm	1,1,6
1081	vadduwm	2,2,7
1082	vadduwm	3,3,4
1083	vxor	15,15,0
1084	vxor	12,12,1
1085	vxor	13,13,2
1086	vxor	14,14,3
1087	vrlw	15,15,27
1088	vrlw	12,12,27
1089	vrlw	13,13,27
1090	vrlw	14,14,27
1091	vadduwm	10,10,15
1092	vadduwm	11,11,12
1093	vadduwm	8,8,13
1094	vadduwm	9,9,14
1095	vxor	5,5,10
1096	vxor	6,6,11
1097	vxor	7,7,8
1098	vxor	4,4,9
1099	vrlw	5,5,28
1100	vrlw	6,6,28
1101	vrlw	7,7,28
1102	vrlw	4,4,28
1103	vadduwm	0,0,5
1104	vadduwm	1,1,6
1105	vadduwm	2,2,7
1106	vadduwm	3,3,4
1107	vxor	15,15,0
1108	vxor	12,12,1
1109	vxor	13,13,2
1110	vxor	14,14,3
1111	vrlw	15,15,29
1112	vrlw	12,12,29
1113	vrlw	13,13,29
1114	vrlw	14,14,29
1115	vadduwm	10,10,15
1116	vadduwm	11,11,12
1117	vadduwm	8,8,13
1118	vadduwm	9,9,14
1119	vxor	5,5,10
1120	vxor	6,6,11
1121	vxor	7,7,8
1122	vxor	4,4,9
1123	vrlw	5,5,30
1124	vrlw	6,6,30
1125	vrlw	7,7,30
1126	vrlw	4,4,30
1127	bdnz	.Loop_vsx
1128
1129	vadduwm	12,12,26
1130
1131	.long	0x13600F8C
1132	.long	0x13821F8C
1133	.long	0x10000E8C
1134	.long	0x10421E8C
1135	.long	0x13A42F8C
1136	.long	0x13C63F8C
1137	.long	0xF0201057
1138	.long	0xF0601357
1139	.long	0xF01BE057
1140	.long	0xF05BE357
1141
1142	.long	0x10842E8C
1143	.long	0x10C63E8C
1144	.long	0x13684F8C
1145	.long	0x138A5F8C
1146	.long	0xF0A43057
1147	.long	0xF0E43357
1148	.long	0xF09DF057
1149	.long	0xF0DDF357
1150
1151	.long	0x11084E8C
1152	.long	0x114A5E8C
1153	.long	0x13AC6F8C
1154	.long	0x13CE7F8C
1155	.long	0xF1285057
1156	.long	0xF1685357
1157	.long	0xF11BE057
1158	.long	0xF15BE357
1159
1160	.long	0x118C6E8C
1161	.long	0x11CE7E8C
1162	vspltisw	27,4
1163	vadduwm	26,26,27
1164	.long	0xF1AC7057
1165	.long	0xF1EC7357
1166	.long	0xF19DF057
1167	.long	0xF1DDF357
1168
1169	vadduwm	0,0,16
1170	vadduwm	4,4,17
1171	vadduwm	8,8,18
1172	vadduwm	12,12,19
1173
1174
1175
1176
1177
1178
1179	cmpldi	5,0x40
1180	blt	.Ltail_vsx
1181
1182	.long	0x7F602619
1183	.long	0x7F882619
1184	.long	0x7FA92619
1185	.long	0x7FCA2619
1186
1187	vxor	27,27,0
1188	vxor	28,28,4
1189	vxor	29,29,8
1190	vxor	30,30,12
1191
1192	.long	0x7F601F19
1193	.long	0x7F881F19
1194	addi	4,4,0x40
1195	.long	0x7FA91F19
1196	subi	5,5,0x40
1197	.long	0x7FCA1F19
1198	addi	3,3,0x40
1199	beq	.Ldone_vsx
1200
1201	vadduwm	0,1,16
1202	vadduwm	4,5,17
1203	vadduwm	8,9,18
1204	vadduwm	12,13,19
1205
1206
1207
1208
1209
1210
1211	cmpldi	5,0x40
1212	blt	.Ltail_vsx
1213
1214	.long	0x7F602619
1215	.long	0x7F882619
1216	.long	0x7FA92619
1217	.long	0x7FCA2619
1218
1219	vxor	27,27,0
1220	vxor	28,28,4
1221	vxor	29,29,8
1222	vxor	30,30,12
1223
1224	.long	0x7F601F19
1225	.long	0x7F881F19
1226	addi	4,4,0x40
1227	.long	0x7FA91F19
1228	subi	5,5,0x40
1229	.long	0x7FCA1F19
1230	addi	3,3,0x40
1231	beq	.Ldone_vsx
1232
1233	vadduwm	0,2,16
1234	vadduwm	4,6,17
1235	vadduwm	8,10,18
1236	vadduwm	12,14,19
1237
1238
1239
1240
1241
1242
1243	cmpldi	5,0x40
1244	blt	.Ltail_vsx
1245
1246	.long	0x7F602619
1247	.long	0x7F882619
1248	.long	0x7FA92619
1249	.long	0x7FCA2619
1250
1251	vxor	27,27,0
1252	vxor	28,28,4
1253	vxor	29,29,8
1254	vxor	30,30,12
1255
1256	.long	0x7F601F19
1257	.long	0x7F881F19
1258	addi	4,4,0x40
1259	.long	0x7FA91F19
1260	subi	5,5,0x40
1261	.long	0x7FCA1F19
1262	addi	3,3,0x40
1263	beq	.Ldone_vsx
1264
1265	vadduwm	0,3,16
1266	vadduwm	4,7,17
1267	vadduwm	8,11,18
1268	vadduwm	12,15,19
1269
1270
1271
1272
1273
1274
1275	cmpldi	5,0x40
1276	blt	.Ltail_vsx
1277
1278	.long	0x7F602619
1279	.long	0x7F882619
1280	.long	0x7FA92619
1281	.long	0x7FCA2619
1282
1283	vxor	27,27,0
1284	vxor	28,28,4
1285	vxor	29,29,8
1286	vxor	30,30,12
1287
1288	.long	0x7F601F19
1289	.long	0x7F881F19
1290	addi	4,4,0x40
1291	.long	0x7FA91F19
1292	subi	5,5,0x40
1293	.long	0x7FCA1F19
1294	addi	3,3,0x40
1295	mtctr	0
1296	bne	.Loop_outer_vsx
1297
1298.Ldone_vsx:
1299	lwz	12,220(1)
1300	li	10,127
1301	li	11,143
1302	ld	0, 240(1)
1303	or	12,12,12
1304	lvx	26,10,1
1305	addi	10,10,32
1306	lvx	27,11,1
1307	addi	11,11,32
1308	lvx	28,10,1
1309	addi	10,10,32
1310	lvx	29,11,1
1311	addi	11,11,32
1312	lvx	30,10,1
1313	lvx	31,11,1
1314	mtlr	0
1315	addi	1,1,224
1316	blr
1317
1318.align	4
1319.Ltail_vsx:
1320	addi	11,1,48
1321	mtctr	5
1322	.long	0x7C005F19
1323	.long	0x7C885F19
1324	.long	0x7D095F19
1325	.long	0x7D8A5F19
1326	subi	12,11,1
1327	subi	4,4,1
1328	subi	3,3,1
1329
1330.Loop_tail_vsx:
1331	lbzu	6,1(12)
1332	lbzu	7,1(4)
1333	xor	6,6,7
1334	stbu	6,1(3)
1335	bdnz	.Loop_tail_vsx
1336
1337	.long	0x7E005F19
1338	.long	0x7E085F19
1339	.long	0x7E095F19
1340	.long	0x7E0A5F19
1341
1342	b	.Ldone_vsx
1343.long	0
1344.byte	0,12,0x04,1,0x80,0,5,0
1345.long	0
1346.size	ChaCha20_ctr32_vsx,.-ChaCha20_ctr32_vsx
1347.align	5
1348.Lconsts:
1349	mflr	0
1350	bcl	20,31,$+4
1351	mflr	12
1352	addi	12,12,56
1353	mtlr	0
1354	blr
1355.long	0
1356.byte	0,12,0x14,0,0,0,0,0
1357.space	28
1358.Lsigma:
1359.long	0x61707865,0x3320646e,0x79622d32,0x6b206574
1360.long	1,0,0,0
1361.long	4,0,0,0
1362.long	0x0e0f0c0d,0x0a0b0809,0x06070405,0x02030001
1363.long	0x0d0e0f0c,0x090a0b08,0x05060704,0x01020300
1364.long	0x61707865,0x61707865,0x61707865,0x61707865
1365.long	0x3320646e,0x3320646e,0x3320646e,0x3320646e
1366.long	0x79622d32,0x79622d32,0x79622d32,0x79622d32
1367.long	0x6b206574,0x6b206574,0x6b206574,0x6b206574
1368.long	0,1,2,3
1369.byte	67,104,97,67,104,97,50,48,32,102,111,114,32,80,111,119,101,114,80,67,47,65,108,116,105,86,101,99,44,67,82,89,80,84,79,71,65,77,83,32,98,121,32,60,97,112,112,114,111,64,111,112,101,110,115,115,108,46,111,114,103,62,0
1370.align	2
1371.align	2
1372