1e1051a39Sopenharmony_ci#! /usr/bin/env perl
2e1051a39Sopenharmony_ci# Copyright 2010-2020 The OpenSSL Project Authors. All Rights Reserved.
3e1051a39Sopenharmony_ci#
4e1051a39Sopenharmony_ci# Licensed under the Apache License 2.0 (the "License").  You may not use
5e1051a39Sopenharmony_ci# this file except in compliance with the License.  You can obtain a copy
6e1051a39Sopenharmony_ci# in the file LICENSE in the source distribution or at
7e1051a39Sopenharmony_ci# https://www.openssl.org/source/license.html
8e1051a39Sopenharmony_ci
9e1051a39Sopenharmony_ci
10e1051a39Sopenharmony_ci# ====================================================================
11e1051a39Sopenharmony_ci# Written by Andy Polyakov <appro@openssl.org> for the OpenSSL
12e1051a39Sopenharmony_ci# project. The module is, however, dual licensed under OpenSSL and
13e1051a39Sopenharmony_ci# CRYPTOGAMS licenses depending on where you obtain it. For further
14e1051a39Sopenharmony_ci# details see http://www.openssl.org/~appro/cryptogams/.
15e1051a39Sopenharmony_ci# ====================================================================
16e1051a39Sopenharmony_ci#
17e1051a39Sopenharmony_ci# March 2010
18e1051a39Sopenharmony_ci#
19e1051a39Sopenharmony_ci# The module implements "4-bit" GCM GHASH function and underlying
20e1051a39Sopenharmony_ci# single multiplication operation in GF(2^128). "4-bit" means that it
21e1051a39Sopenharmony_ci# uses 256 bytes per-key table [+128 bytes shared table]. Streamed
22e1051a39Sopenharmony_ci# GHASH performance was measured to be 6.67 cycles per processed byte
23e1051a39Sopenharmony_ci# on Itanium 2, which is >90% better than Microsoft compiler generated
24e1051a39Sopenharmony_ci# code. To anchor to something else sha1-ia64.pl module processes one
25e1051a39Sopenharmony_ci# byte in 5.7 cycles. On Itanium GHASH should run at ~8.5 cycles per
26e1051a39Sopenharmony_ci# byte.
27e1051a39Sopenharmony_ci
28e1051a39Sopenharmony_ci# September 2010
29e1051a39Sopenharmony_ci#
30e1051a39Sopenharmony_ci# It was originally thought that it makes lesser sense to implement
31e1051a39Sopenharmony_ci# "528B" variant on Itanium 2 for following reason. Because number of
32e1051a39Sopenharmony_ci# functional units is naturally limited, it appeared impossible to
33e1051a39Sopenharmony_ci# implement "528B" loop in 4 cycles, only in 5. This would mean that
34e1051a39Sopenharmony_ci# theoretically performance improvement couldn't be more than 20%.
35e1051a39Sopenharmony_ci# But occasionally you prove yourself wrong:-) I figured out a way to
36e1051a39Sopenharmony_ci# fold couple of instructions and having freed yet another instruction
37e1051a39Sopenharmony_ci# slot by unrolling the loop... Resulting performance is 4.45 cycles
38e1051a39Sopenharmony_ci# per processed byte and 50% better than "256B" version. On original
39e1051a39Sopenharmony_ci# Itanium performance should remain the same as the "256B" version,
40e1051a39Sopenharmony_ci# i.e. ~8.5 cycles.
41e1051a39Sopenharmony_ci
42e1051a39Sopenharmony_ci$output=pop and (open STDOUT,">$output" or die "can't open $output: $!");
43e1051a39Sopenharmony_ci
44e1051a39Sopenharmony_ciif ($^O eq "hpux") {
45e1051a39Sopenharmony_ci    $ADDP="addp4";
46e1051a39Sopenharmony_ci    for (@ARGV) { $ADDP="add" if (/[\+DD|\-mlp]64/); }
47e1051a39Sopenharmony_ci} else { $ADDP="add"; }
48e1051a39Sopenharmony_cifor (@ARGV)  {  $big_endian=1 if (/\-DB_ENDIAN/);
49e1051a39Sopenharmony_ci                $big_endian=0 if (/\-DL_ENDIAN/);  }
50e1051a39Sopenharmony_ciif (!defined($big_endian))
51e1051a39Sopenharmony_ci             {  $big_endian=(unpack('L',pack('N',1))==1);  }
52e1051a39Sopenharmony_ci
53e1051a39Sopenharmony_cisub loop() {
54e1051a39Sopenharmony_cimy $label=shift;
55e1051a39Sopenharmony_cimy ($p16,$p17)=(shift)?("p63","p63"):("p16","p17"); # mask references to inp
56e1051a39Sopenharmony_ci
57e1051a39Sopenharmony_ci# Loop is scheduled for 6 ticks on Itanium 2 and 8 on Itanium, i.e.
58e1051a39Sopenharmony_ci# in scalable manner;-) Naturally assuming data in L1 cache...
59e1051a39Sopenharmony_ci# Special note about 'dep' instruction, which is used to construct
60e1051a39Sopenharmony_ci# &rem_4bit[Zlo&0xf]. It works, because rem_4bit is aligned at 128
61e1051a39Sopenharmony_ci# bytes boundary and lower 7 bits of its address are guaranteed to
62e1051a39Sopenharmony_ci# be zero.
63e1051a39Sopenharmony_ci$code.=<<___;
64e1051a39Sopenharmony_ci$label:
65e1051a39Sopenharmony_ci{ .mfi;	(p18)	ld8	Hlo=[Hi[1]],-8
66e1051a39Sopenharmony_ci	(p19)	dep	rem=Zlo,rem_4bitp,3,4	}
67e1051a39Sopenharmony_ci{ .mfi;	(p19)	xor	Zhi=Zhi,Hhi
68e1051a39Sopenharmony_ci	($p17)	xor	xi[1]=xi[1],in[1]	};;
69e1051a39Sopenharmony_ci{ .mfi;	(p18)	ld8	Hhi=[Hi[1]]
70e1051a39Sopenharmony_ci	(p19)	shrp	Zlo=Zhi,Zlo,4		}
71e1051a39Sopenharmony_ci{ .mfi;	(p19)	ld8	rem=[rem]
72e1051a39Sopenharmony_ci	(p18)	and	Hi[1]=mask0xf0,xi[2]	};;
73e1051a39Sopenharmony_ci{ .mmi;	($p16)	ld1	in[0]=[inp],-1
74e1051a39Sopenharmony_ci	(p18)	xor	Zlo=Zlo,Hlo
75e1051a39Sopenharmony_ci	(p19)	shr.u	Zhi=Zhi,4		}
76e1051a39Sopenharmony_ci{ .mib;	(p19)	xor	Hhi=Hhi,rem
77e1051a39Sopenharmony_ci	(p18)	add	Hi[1]=Htbl,Hi[1]	};;
78e1051a39Sopenharmony_ci
79e1051a39Sopenharmony_ci{ .mfi;	(p18)	ld8	Hlo=[Hi[1]],-8
80e1051a39Sopenharmony_ci	(p18)	dep	rem=Zlo,rem_4bitp,3,4	}
81e1051a39Sopenharmony_ci{ .mfi;	(p17)	shladd	Hi[0]=xi[1],4,r0
82e1051a39Sopenharmony_ci	(p18)	xor	Zhi=Zhi,Hhi		};;
83e1051a39Sopenharmony_ci{ .mfi;	(p18)	ld8	Hhi=[Hi[1]]
84e1051a39Sopenharmony_ci	(p18)	shrp	Zlo=Zhi,Zlo,4		}
85e1051a39Sopenharmony_ci{ .mfi;	(p18)	ld8	rem=[rem]
86e1051a39Sopenharmony_ci	(p17)	and	Hi[0]=mask0xf0,Hi[0]	};;
87e1051a39Sopenharmony_ci{ .mmi;	(p16)	ld1	xi[0]=[Xi],-1
88e1051a39Sopenharmony_ci	(p18)	xor	Zlo=Zlo,Hlo
89e1051a39Sopenharmony_ci	(p18)	shr.u	Zhi=Zhi,4		}
90e1051a39Sopenharmony_ci{ .mib;	(p18)	xor	Hhi=Hhi,rem
91e1051a39Sopenharmony_ci	(p17)	add	Hi[0]=Htbl,Hi[0]
92e1051a39Sopenharmony_ci	br.ctop.sptk	$label			};;
93e1051a39Sopenharmony_ci___
94e1051a39Sopenharmony_ci}
95e1051a39Sopenharmony_ci
96e1051a39Sopenharmony_ci$code=<<___;
97e1051a39Sopenharmony_ci.explicit
98e1051a39Sopenharmony_ci.text
99e1051a39Sopenharmony_ci
100e1051a39Sopenharmony_ciprevfs=r2;	prevlc=r3;	prevpr=r8;
101e1051a39Sopenharmony_cimask0xf0=r21;
102e1051a39Sopenharmony_cirem=r22;	rem_4bitp=r23;
103e1051a39Sopenharmony_ciXi=r24;		Htbl=r25;
104e1051a39Sopenharmony_ciinp=r26;	end=r27;
105e1051a39Sopenharmony_ciHhi=r28;	Hlo=r29;
106e1051a39Sopenharmony_ciZhi=r30;	Zlo=r31;
107e1051a39Sopenharmony_ci
108e1051a39Sopenharmony_ci.align	128
109e1051a39Sopenharmony_ci.skip	16					// aligns loop body
110e1051a39Sopenharmony_ci.global	gcm_gmult_4bit#
111e1051a39Sopenharmony_ci.proc	gcm_gmult_4bit#
112e1051a39Sopenharmony_cigcm_gmult_4bit:
113e1051a39Sopenharmony_ci	.prologue
114e1051a39Sopenharmony_ci{ .mmi;	.save	ar.pfs,prevfs
115e1051a39Sopenharmony_ci	alloc	prevfs=ar.pfs,2,6,0,8
116e1051a39Sopenharmony_ci	$ADDP	Xi=15,in0			// &Xi[15]
117e1051a39Sopenharmony_ci	mov	rem_4bitp=ip		}
118e1051a39Sopenharmony_ci{ .mii;	$ADDP	Htbl=8,in1			// &Htbl[0].lo
119e1051a39Sopenharmony_ci	.save	ar.lc,prevlc
120e1051a39Sopenharmony_ci	mov	prevlc=ar.lc
121e1051a39Sopenharmony_ci	.save	pr,prevpr
122e1051a39Sopenharmony_ci	mov	prevpr=pr		};;
123e1051a39Sopenharmony_ci
124e1051a39Sopenharmony_ci	.body
125e1051a39Sopenharmony_ci	.rotr	in[3],xi[3],Hi[2]
126e1051a39Sopenharmony_ci
127e1051a39Sopenharmony_ci{ .mib;	ld1	xi[2]=[Xi],-1			// Xi[15]
128e1051a39Sopenharmony_ci	mov	mask0xf0=0xf0
129e1051a39Sopenharmony_ci	brp.loop.imp	.Loop1,.Lend1-16};;
130e1051a39Sopenharmony_ci{ .mmi;	ld1	xi[1]=[Xi],-1			// Xi[14]
131e1051a39Sopenharmony_ci					};;
132e1051a39Sopenharmony_ci{ .mii;	shladd	Hi[1]=xi[2],4,r0
133e1051a39Sopenharmony_ci	mov	pr.rot=0x7<<16
134e1051a39Sopenharmony_ci	mov	ar.lc=13		};;
135e1051a39Sopenharmony_ci{ .mii;	and	Hi[1]=mask0xf0,Hi[1]
136e1051a39Sopenharmony_ci	mov	ar.ec=3
137e1051a39Sopenharmony_ci	xor	Zlo=Zlo,Zlo		};;
138e1051a39Sopenharmony_ci{ .mii;	add	Hi[1]=Htbl,Hi[1]		// &Htbl[nlo].lo
139e1051a39Sopenharmony_ci	add	rem_4bitp=rem_4bit#-gcm_gmult_4bit#,rem_4bitp
140e1051a39Sopenharmony_ci	xor	Zhi=Zhi,Zhi		};;
141e1051a39Sopenharmony_ci___
142e1051a39Sopenharmony_ci	&loop	(".Loop1",1);
143e1051a39Sopenharmony_ci$code.=<<___;
144e1051a39Sopenharmony_ci.Lend1:
145e1051a39Sopenharmony_ci{ .mib;	xor	Zhi=Zhi,Hhi		};;	// modulo-scheduling artefact
146e1051a39Sopenharmony_ci{ .mib;	mux1	Zlo=Zlo,\@rev		};;
147e1051a39Sopenharmony_ci{ .mib;	mux1	Zhi=Zhi,\@rev		};;
148e1051a39Sopenharmony_ci{ .mmi;	add	Hlo=9,Xi;;			// ;; is here to prevent
149e1051a39Sopenharmony_ci	add	Hhi=1,Xi		};;	// pipeline flush on Itanium
150e1051a39Sopenharmony_ci{ .mib;	st8	[Hlo]=Zlo
151e1051a39Sopenharmony_ci	mov	pr=prevpr,0x1ffff	};;
152e1051a39Sopenharmony_ci{ .mib;	st8	[Hhi]=Zhi
153e1051a39Sopenharmony_ci	mov	ar.lc=prevlc
154e1051a39Sopenharmony_ci	br.ret.sptk.many	b0	};;
155e1051a39Sopenharmony_ci.endp	gcm_gmult_4bit#
156e1051a39Sopenharmony_ci___
157e1051a39Sopenharmony_ci
158e1051a39Sopenharmony_ci######################################################################
159e1051a39Sopenharmony_ci# "528B" (well, "512B" actually) streamed GHASH
160e1051a39Sopenharmony_ci#
161e1051a39Sopenharmony_ci$Xip="in0";
162e1051a39Sopenharmony_ci$Htbl="in1";
163e1051a39Sopenharmony_ci$inp="in2";
164e1051a39Sopenharmony_ci$len="in3";
165e1051a39Sopenharmony_ci$rem_8bit="loc0";
166e1051a39Sopenharmony_ci$mask0xff="loc1";
167e1051a39Sopenharmony_ci($sum,$rum) = $big_endian ? ("nop.m","nop.m") : ("sum","rum");
168e1051a39Sopenharmony_ci
169e1051a39Sopenharmony_cisub load_htable() {
170e1051a39Sopenharmony_ci    for (my $i=0;$i<8;$i++) {
171e1051a39Sopenharmony_ci	$code.=<<___;
172e1051a39Sopenharmony_ci{ .mmi;	ld8	r`16+2*$i+1`=[r8],16		// Htable[$i].hi
173e1051a39Sopenharmony_ci	ld8	r`16+2*$i`=[r9],16	}	// Htable[$i].lo
174e1051a39Sopenharmony_ci{ .mmi;	ldf8	f`32+2*$i+1`=[r10],16		// Htable[`8+$i`].hi
175e1051a39Sopenharmony_ci	ldf8	f`32+2*$i`=[r11],16		// Htable[`8+$i`].lo
176e1051a39Sopenharmony_ci___
177e1051a39Sopenharmony_ci	$code.=shift	if (($i+$#_)==7);
178e1051a39Sopenharmony_ci	$code.="\t};;\n"
179e1051a39Sopenharmony_ci    }
180e1051a39Sopenharmony_ci}
181e1051a39Sopenharmony_ci
182e1051a39Sopenharmony_ci$code.=<<___;
183e1051a39Sopenharmony_ciprevsp=r3;
184e1051a39Sopenharmony_ci
185e1051a39Sopenharmony_ci.align	32
186e1051a39Sopenharmony_ci.skip	16					// aligns loop body
187e1051a39Sopenharmony_ci.global	gcm_ghash_4bit#
188e1051a39Sopenharmony_ci.proc	gcm_ghash_4bit#
189e1051a39Sopenharmony_cigcm_ghash_4bit:
190e1051a39Sopenharmony_ci	.prologue
191e1051a39Sopenharmony_ci{ .mmi;	.save	ar.pfs,prevfs
192e1051a39Sopenharmony_ci	alloc	prevfs=ar.pfs,4,2,0,0
193e1051a39Sopenharmony_ci	.vframe	prevsp
194e1051a39Sopenharmony_ci	mov	prevsp=sp
195e1051a39Sopenharmony_ci	mov	$rem_8bit=ip		};;
196e1051a39Sopenharmony_ci	.body
197e1051a39Sopenharmony_ci{ .mfi;	$ADDP	r8=0+0,$Htbl
198e1051a39Sopenharmony_ci	$ADDP	r9=0+8,$Htbl		}
199e1051a39Sopenharmony_ci{ .mfi;	$ADDP	r10=128+0,$Htbl
200e1051a39Sopenharmony_ci	$ADDP	r11=128+8,$Htbl		};;
201e1051a39Sopenharmony_ci___
202e1051a39Sopenharmony_ci	&load_htable(
203e1051a39Sopenharmony_ci	"	$ADDP	$Xip=15,$Xip",		# &Xi[15]
204e1051a39Sopenharmony_ci	"	$ADDP	$len=$len,$inp",	# &inp[len]
205e1051a39Sopenharmony_ci	"	$ADDP	$inp=15,$inp",		# &inp[15]
206e1051a39Sopenharmony_ci	"	mov	$mask0xff=0xff",
207e1051a39Sopenharmony_ci	"	add	sp=-512,sp",
208e1051a39Sopenharmony_ci	"	andcm	sp=sp,$mask0xff",	# align stack frame
209e1051a39Sopenharmony_ci	"	add	r14=0,sp",
210e1051a39Sopenharmony_ci	"	add	r15=8,sp");
211e1051a39Sopenharmony_ci$code.=<<___;
212e1051a39Sopenharmony_ci{ .mmi;	$sum	1<<1				// go big-endian
213e1051a39Sopenharmony_ci	add	r8=256+0,sp
214e1051a39Sopenharmony_ci	add	r9=256+8,sp		}
215e1051a39Sopenharmony_ci{ .mmi;	add	r10=256+128+0,sp
216e1051a39Sopenharmony_ci	add	r11=256+128+8,sp
217e1051a39Sopenharmony_ci	add	$len=-17,$len		};;
218e1051a39Sopenharmony_ci___
219e1051a39Sopenharmony_cifor($i=0;$i<8;$i++) {	# generate first half of Hshr4[]
220e1051a39Sopenharmony_cimy ($rlo,$rhi)=("r".eval(16+2*$i),"r".eval(16+2*$i+1));
221e1051a39Sopenharmony_ci$code.=<<___;
222e1051a39Sopenharmony_ci{ .mmi;	st8	[r8]=$rlo,16			// Htable[$i].lo
223e1051a39Sopenharmony_ci	st8	[r9]=$rhi,16			// Htable[$i].hi
224e1051a39Sopenharmony_ci	shrp	$rlo=$rhi,$rlo,4	}//;;
225e1051a39Sopenharmony_ci{ .mmi;	stf8	[r10]=f`32+2*$i`,16		// Htable[`8+$i`].lo
226e1051a39Sopenharmony_ci	stf8	[r11]=f`32+2*$i+1`,16		// Htable[`8+$i`].hi
227e1051a39Sopenharmony_ci	shr.u	$rhi=$rhi,4		};;
228e1051a39Sopenharmony_ci{ .mmi;	st8	[r14]=$rlo,16			// Htable[$i].lo>>4
229e1051a39Sopenharmony_ci	st8	[r15]=$rhi,16		}//;;	// Htable[$i].hi>>4
230e1051a39Sopenharmony_ci___
231e1051a39Sopenharmony_ci}
232e1051a39Sopenharmony_ci$code.=<<___;
233e1051a39Sopenharmony_ci{ .mmi;	ld8	r16=[r8],16			// Htable[8].lo
234e1051a39Sopenharmony_ci	ld8	r17=[r9],16		};;	// Htable[8].hi
235e1051a39Sopenharmony_ci{ .mmi;	ld8	r18=[r8],16			// Htable[9].lo
236e1051a39Sopenharmony_ci	ld8	r19=[r9],16		}	// Htable[9].hi
237e1051a39Sopenharmony_ci{ .mmi;	rum	1<<5				// clear um.mfh
238e1051a39Sopenharmony_ci	shrp	r16=r17,r16,4		};;
239e1051a39Sopenharmony_ci___
240e1051a39Sopenharmony_cifor($i=0;$i<6;$i++) {	# generate second half of Hshr4[]
241e1051a39Sopenharmony_ci$code.=<<___;
242e1051a39Sopenharmony_ci{ .mmi;	ld8	r`20+2*$i`=[r8],16		// Htable[`10+$i`].lo
243e1051a39Sopenharmony_ci	ld8	r`20+2*$i+1`=[r9],16		// Htable[`10+$i`].hi
244e1051a39Sopenharmony_ci	shr.u	r`16+2*$i+1`=r`16+2*$i+1`,4	};;
245e1051a39Sopenharmony_ci{ .mmi;	st8	[r14]=r`16+2*$i`,16		// Htable[`8+$i`].lo>>4
246e1051a39Sopenharmony_ci	st8	[r15]=r`16+2*$i+1`,16		// Htable[`8+$i`].hi>>4
247e1051a39Sopenharmony_ci	shrp	r`18+2*$i`=r`18+2*$i+1`,r`18+2*$i`,4	}
248e1051a39Sopenharmony_ci___
249e1051a39Sopenharmony_ci}
250e1051a39Sopenharmony_ci$code.=<<___;
251e1051a39Sopenharmony_ci{ .mmi;	shr.u	r`16+2*$i+1`=r`16+2*$i+1`,4	};;
252e1051a39Sopenharmony_ci{ .mmi;	st8	[r14]=r`16+2*$i`,16		// Htable[`8+$i`].lo>>4
253e1051a39Sopenharmony_ci	st8	[r15]=r`16+2*$i+1`,16		// Htable[`8+$i`].hi>>4
254e1051a39Sopenharmony_ci	shrp	r`18+2*$i`=r`18+2*$i+1`,r`18+2*$i`,4	}
255e1051a39Sopenharmony_ci{ .mmi;	add	$Htbl=256,sp			// &Htable[0]
256e1051a39Sopenharmony_ci	add	$rem_8bit=rem_8bit#-gcm_ghash_4bit#,$rem_8bit
257e1051a39Sopenharmony_ci	shr.u	r`18+2*$i+1`=r`18+2*$i+1`,4	};;
258e1051a39Sopenharmony_ci{ .mmi;	st8	[r14]=r`18+2*$i`		// Htable[`8+$i`].lo>>4
259e1051a39Sopenharmony_ci	st8	[r15]=r`18+2*$i+1`	}	// Htable[`8+$i`].hi>>4
260e1051a39Sopenharmony_ci___
261e1051a39Sopenharmony_ci
262e1051a39Sopenharmony_ci$in="r15";
263e1051a39Sopenharmony_ci@xi=("r16","r17");
264e1051a39Sopenharmony_ci@rem=("r18","r19");
265e1051a39Sopenharmony_ci($Alo,$Ahi,$Blo,$Bhi,$Zlo,$Zhi)=("r20","r21","r22","r23","r24","r25");
266e1051a39Sopenharmony_ci($Atbl,$Btbl)=("r26","r27");
267e1051a39Sopenharmony_ci
268e1051a39Sopenharmony_ci$code.=<<___;	# (p16)
269e1051a39Sopenharmony_ci{ .mmi;	ld1	$in=[$inp],-1			//(p16) *inp--
270e1051a39Sopenharmony_ci	ld1	$xi[0]=[$Xip],-1		//(p16) *Xi--
271e1051a39Sopenharmony_ci	cmp.eq	p0,p6=r0,r0		};;	//	clear p6
272e1051a39Sopenharmony_ci___
273e1051a39Sopenharmony_cipush (@xi,shift(@xi)); push (@rem,shift(@rem));	# "rotate" registers
274e1051a39Sopenharmony_ci
275e1051a39Sopenharmony_ci$code.=<<___;	# (p16),(p17)
276e1051a39Sopenharmony_ci{ .mmi;	ld1	$xi[0]=[$Xip],-1		//(p16) *Xi--
277e1051a39Sopenharmony_ci	xor	$xi[1]=$xi[1],$in	};;	//(p17) xi=$xi[i]^inp[i]
278e1051a39Sopenharmony_ci{ .mii;	ld1	$in=[$inp],-1			//(p16) *inp--
279e1051a39Sopenharmony_ci	dep	$Atbl=$xi[1],$Htbl,4,4		//(p17) &Htable[nlo].lo
280e1051a39Sopenharmony_ci	and	$xi[1]=-16,$xi[1]	};;	//(p17) nhi=xi&0xf0
281e1051a39Sopenharmony_ci.align	32
282e1051a39Sopenharmony_ci.LOOP:
283e1051a39Sopenharmony_ci{ .mmi;
284e1051a39Sopenharmony_ci(p6)	st8	[$Xip]=$Zhi,13
285e1051a39Sopenharmony_ci	xor	$Zlo=$Zlo,$Zlo
286e1051a39Sopenharmony_ci	add	$Btbl=$xi[1],$Htbl	};;	//(p17) &Htable[nhi].lo
287e1051a39Sopenharmony_ci___
288e1051a39Sopenharmony_cipush (@xi,shift(@xi)); push (@rem,shift(@rem));	# "rotate" registers
289e1051a39Sopenharmony_ci
290e1051a39Sopenharmony_ci$code.=<<___;	# (p16),(p17),(p18)
291e1051a39Sopenharmony_ci{ .mmi;	ld8	$Alo=[$Atbl],8			//(p18) Htable[nlo].lo,&Htable[nlo].hi
292e1051a39Sopenharmony_ci	ld8	$rem[0]=[$Btbl],-256		//(p18) Htable[nhi].lo,&Hshr4[nhi].lo
293e1051a39Sopenharmony_ci	xor	$xi[1]=$xi[1],$in	};;	//(p17) xi=$xi[i]^inp[i]
294e1051a39Sopenharmony_ci{ .mfi;	ld8	$Ahi=[$Atbl]			//(p18) Htable[nlo].hi
295e1051a39Sopenharmony_ci	dep	$Atbl=$xi[1],$Htbl,4,4	}	//(p17) &Htable[nlo].lo
296e1051a39Sopenharmony_ci{ .mfi;	shladd	$rem[0]=$rem[0],4,r0		//(p18) Htable[nhi].lo<<4
297e1051a39Sopenharmony_ci	xor	$Zlo=$Zlo,$Alo		};;	//(p18) Z.lo^=Htable[nlo].lo
298e1051a39Sopenharmony_ci{ .mmi;	ld8	$Blo=[$Btbl],8			//(p18) Hshr4[nhi].lo,&Hshr4[nhi].hi
299e1051a39Sopenharmony_ci	ld1	$in=[$inp],-1		}	//(p16) *inp--
300e1051a39Sopenharmony_ci{ .mmi;	xor	$rem[0]=$rem[0],$Zlo		//(p18) Z.lo^(Htable[nhi].lo<<4)
301e1051a39Sopenharmony_ci	mov	$Zhi=$Ahi			//(p18) Z.hi^=Htable[nlo].hi
302e1051a39Sopenharmony_ci	and	$xi[1]=-16,$xi[1]	};;	//(p17) nhi=xi&0xf0
303e1051a39Sopenharmony_ci{ .mmi;	ld8	$Bhi=[$Btbl]			//(p18) Hshr4[nhi].hi
304e1051a39Sopenharmony_ci	ld1	$xi[0]=[$Xip],-1		//(p16) *Xi--
305e1051a39Sopenharmony_ci	shrp	$Zlo=$Zhi,$Zlo,8	}	//(p18) Z.lo=(Z.hi<<56)|(Z.lo>>8)
306e1051a39Sopenharmony_ci{ .mmi;	and	$rem[0]=$rem[0],$mask0xff	//(p18) rem=($Zlo^(Htable[nhi].lo<<4))&0xff
307e1051a39Sopenharmony_ci	add	$Btbl=$xi[1],$Htbl	};;	//(p17) &Htable[nhi]
308e1051a39Sopenharmony_ci___
309e1051a39Sopenharmony_cipush (@xi,shift(@xi)); push (@rem,shift(@rem));	# "rotate" registers
310e1051a39Sopenharmony_ci
311e1051a39Sopenharmony_cifor ($i=1;$i<14;$i++) {
312e1051a39Sopenharmony_ci# Above and below fragments are derived from this one by removing
313e1051a39Sopenharmony_ci# unsuitable (p??) instructions.
314e1051a39Sopenharmony_ci$code.=<<___;	# (p16),(p17),(p18),(p19)
315e1051a39Sopenharmony_ci{ .mmi;	ld8	$Alo=[$Atbl],8			//(p18) Htable[nlo].lo,&Htable[nlo].hi
316e1051a39Sopenharmony_ci	ld8	$rem[0]=[$Btbl],-256		//(p18) Htable[nhi].lo,&Hshr4[nhi].lo
317e1051a39Sopenharmony_ci	shr.u	$Zhi=$Zhi,8		}	//(p19) Z.hi>>=8
318e1051a39Sopenharmony_ci{ .mmi;	shladd	$rem[1]=$rem[1],1,$rem_8bit	//(p19) &rem_8bit[rem]
319e1051a39Sopenharmony_ci	xor	$Zlo=$Zlo,$Blo			//(p19) Z.lo^=Hshr4[nhi].lo
320e1051a39Sopenharmony_ci	xor	$xi[1]=$xi[1],$in	};;	//(p17) xi=$xi[i]^inp[i]
321e1051a39Sopenharmony_ci{ .mmi;	ld8	$Ahi=[$Atbl]			//(p18) Htable[nlo].hi
322e1051a39Sopenharmony_ci	ld2	$rem[1]=[$rem[1]]		//(p19) rem_8bit[rem]
323e1051a39Sopenharmony_ci	dep	$Atbl=$xi[1],$Htbl,4,4	}	//(p17) &Htable[nlo].lo
324e1051a39Sopenharmony_ci{ .mmi;	shladd	$rem[0]=$rem[0],4,r0		//(p18) Htable[nhi].lo<<4
325e1051a39Sopenharmony_ci	xor	$Zlo=$Zlo,$Alo			//(p18) Z.lo^=Htable[nlo].lo
326e1051a39Sopenharmony_ci	xor	$Zhi=$Zhi,$Bhi		};;	//(p19) Z.hi^=Hshr4[nhi].hi
327e1051a39Sopenharmony_ci{ .mmi;	ld8	$Blo=[$Btbl],8			//(p18) Hshr4[nhi].lo,&Hshr4[nhi].hi
328e1051a39Sopenharmony_ci	ld1	$in=[$inp],-1			//(p16) *inp--
329e1051a39Sopenharmony_ci	shl	$rem[1]=$rem[1],48	}	//(p19) rem_8bit[rem]<<48
330e1051a39Sopenharmony_ci{ .mmi;	xor	$rem[0]=$rem[0],$Zlo		//(p18) Z.lo^(Htable[nhi].lo<<4)
331e1051a39Sopenharmony_ci	xor	$Zhi=$Zhi,$Ahi			//(p18) Z.hi^=Htable[nlo].hi
332e1051a39Sopenharmony_ci	and	$xi[1]=-16,$xi[1]	};;	//(p17) nhi=xi&0xf0
333e1051a39Sopenharmony_ci{ .mmi;	ld8	$Bhi=[$Btbl]			//(p18) Hshr4[nhi].hi
334e1051a39Sopenharmony_ci	ld1	$xi[0]=[$Xip],-1		//(p16) *Xi--
335e1051a39Sopenharmony_ci	shrp	$Zlo=$Zhi,$Zlo,8	}	//(p18) Z.lo=(Z.hi<<56)|(Z.lo>>8)
336e1051a39Sopenharmony_ci{ .mmi;	and	$rem[0]=$rem[0],$mask0xff	//(p18) rem=($Zlo^(Htable[nhi].lo<<4))&0xff
337e1051a39Sopenharmony_ci	xor	$Zhi=$Zhi,$rem[1]		//(p19) Z.hi^=rem_8bit[rem]<<48
338e1051a39Sopenharmony_ci	add	$Btbl=$xi[1],$Htbl	};;	//(p17) &Htable[nhi]
339e1051a39Sopenharmony_ci___
340e1051a39Sopenharmony_cipush (@xi,shift(@xi)); push (@rem,shift(@rem));	# "rotate" registers
341e1051a39Sopenharmony_ci}
342e1051a39Sopenharmony_ci
343e1051a39Sopenharmony_ci$code.=<<___;	# (p17),(p18),(p19)
344e1051a39Sopenharmony_ci{ .mmi;	ld8	$Alo=[$Atbl],8			//(p18) Htable[nlo].lo,&Htable[nlo].hi
345e1051a39Sopenharmony_ci	ld8	$rem[0]=[$Btbl],-256		//(p18) Htable[nhi].lo,&Hshr4[nhi].lo
346e1051a39Sopenharmony_ci	shr.u	$Zhi=$Zhi,8		}	//(p19) Z.hi>>=8
347e1051a39Sopenharmony_ci{ .mmi;	shladd	$rem[1]=$rem[1],1,$rem_8bit	//(p19) &rem_8bit[rem]
348e1051a39Sopenharmony_ci	xor	$Zlo=$Zlo,$Blo			//(p19) Z.lo^=Hshr4[nhi].lo
349e1051a39Sopenharmony_ci	xor	$xi[1]=$xi[1],$in	};;	//(p17) xi=$xi[i]^inp[i]
350e1051a39Sopenharmony_ci{ .mmi;	ld8	$Ahi=[$Atbl]			//(p18) Htable[nlo].hi
351e1051a39Sopenharmony_ci	ld2	$rem[1]=[$rem[1]]		//(p19) rem_8bit[rem]
352e1051a39Sopenharmony_ci	dep	$Atbl=$xi[1],$Htbl,4,4	};;	//(p17) &Htable[nlo].lo
353e1051a39Sopenharmony_ci{ .mmi;	shladd	$rem[0]=$rem[0],4,r0		//(p18) Htable[nhi].lo<<4
354e1051a39Sopenharmony_ci	xor	$Zlo=$Zlo,$Alo			//(p18) Z.lo^=Htable[nlo].lo
355e1051a39Sopenharmony_ci	xor	$Zhi=$Zhi,$Bhi		};;	//(p19) Z.hi^=Hshr4[nhi].hi
356e1051a39Sopenharmony_ci{ .mmi;	ld8	$Blo=[$Btbl],8			//(p18) Hshr4[nhi].lo,&Hshr4[nhi].hi
357e1051a39Sopenharmony_ci	shl	$rem[1]=$rem[1],48	}	//(p19) rem_8bit[rem]<<48
358e1051a39Sopenharmony_ci{ .mmi;	xor	$rem[0]=$rem[0],$Zlo		//(p18) Z.lo^(Htable[nhi].lo<<4)
359e1051a39Sopenharmony_ci	xor	$Zhi=$Zhi,$Ahi			//(p18) Z.hi^=Htable[nlo].hi
360e1051a39Sopenharmony_ci	and	$xi[1]=-16,$xi[1]	};;	//(p17) nhi=xi&0xf0
361e1051a39Sopenharmony_ci{ .mmi;	ld8	$Bhi=[$Btbl]			//(p18) Hshr4[nhi].hi
362e1051a39Sopenharmony_ci	shrp	$Zlo=$Zhi,$Zlo,8	}	//(p18) Z.lo=(Z.hi<<56)|(Z.lo>>8)
363e1051a39Sopenharmony_ci{ .mmi;	and	$rem[0]=$rem[0],$mask0xff	//(p18) rem=($Zlo^(Htable[nhi].lo<<4))&0xff
364e1051a39Sopenharmony_ci	xor	$Zhi=$Zhi,$rem[1]		//(p19) Z.hi^=rem_8bit[rem]<<48
365e1051a39Sopenharmony_ci	add	$Btbl=$xi[1],$Htbl	};;	//(p17) &Htable[nhi]
366e1051a39Sopenharmony_ci___
367e1051a39Sopenharmony_cipush (@xi,shift(@xi)); push (@rem,shift(@rem));	# "rotate" registers
368e1051a39Sopenharmony_ci
369e1051a39Sopenharmony_ci$code.=<<___;	# (p18),(p19)
370e1051a39Sopenharmony_ci{ .mfi;	ld8	$Alo=[$Atbl],8			//(p18) Htable[nlo].lo,&Htable[nlo].hi
371e1051a39Sopenharmony_ci	shr.u	$Zhi=$Zhi,8		}	//(p19) Z.hi>>=8
372e1051a39Sopenharmony_ci{ .mfi;	shladd	$rem[1]=$rem[1],1,$rem_8bit	//(p19) &rem_8bit[rem]
373e1051a39Sopenharmony_ci	xor	$Zlo=$Zlo,$Blo		};;	//(p19) Z.lo^=Hshr4[nhi].lo
374e1051a39Sopenharmony_ci{ .mfi;	ld8	$Ahi=[$Atbl]			//(p18) Htable[nlo].hi
375e1051a39Sopenharmony_ci	xor	$Zlo=$Zlo,$Alo		}	//(p18) Z.lo^=Htable[nlo].lo
376e1051a39Sopenharmony_ci{ .mfi;	ld2	$rem[1]=[$rem[1]]		//(p19) rem_8bit[rem]
377e1051a39Sopenharmony_ci	xor	$Zhi=$Zhi,$Bhi		};;	//(p19) Z.hi^=Hshr4[nhi].hi
378e1051a39Sopenharmony_ci{ .mfi;	ld8	$Blo=[$Btbl],8			//(p18) Htable[nhi].lo,&Htable[nhi].hi
379e1051a39Sopenharmony_ci	shl	$rem[1]=$rem[1],48	}	//(p19) rem_8bit[rem]<<48
380e1051a39Sopenharmony_ci{ .mfi;	shladd	$rem[0]=$Zlo,4,r0		//(p18) Z.lo<<4
381e1051a39Sopenharmony_ci	xor	$Zhi=$Zhi,$Ahi		};;	//(p18) Z.hi^=Htable[nlo].hi
382e1051a39Sopenharmony_ci{ .mfi;	ld8	$Bhi=[$Btbl]			//(p18) Htable[nhi].hi
383e1051a39Sopenharmony_ci	shrp	$Zlo=$Zhi,$Zlo,4	}	//(p18) Z.lo=(Z.hi<<60)|(Z.lo>>4)
384e1051a39Sopenharmony_ci{ .mfi;	and	$rem[0]=$rem[0],$mask0xff	//(p18) rem=($Zlo^(Htable[nhi].lo<<4))&0xff
385e1051a39Sopenharmony_ci	xor	$Zhi=$Zhi,$rem[1]	};;	//(p19) Z.hi^=rem_8bit[rem]<<48
386e1051a39Sopenharmony_ci___
387e1051a39Sopenharmony_cipush (@xi,shift(@xi)); push (@rem,shift(@rem));	# "rotate" registers
388e1051a39Sopenharmony_ci
389e1051a39Sopenharmony_ci$code.=<<___;	# (p19)
390e1051a39Sopenharmony_ci{ .mmi;	cmp.ltu	p6,p0=$inp,$len
391e1051a39Sopenharmony_ci	add	$inp=32,$inp
392e1051a39Sopenharmony_ci	shr.u	$Zhi=$Zhi,4		}	//(p19) Z.hi>>=4
393e1051a39Sopenharmony_ci{ .mmi;	shladd	$rem[1]=$rem[1],1,$rem_8bit	//(p19) &rem_8bit[rem]
394e1051a39Sopenharmony_ci	xor	$Zlo=$Zlo,$Blo			//(p19) Z.lo^=Hshr4[nhi].lo
395e1051a39Sopenharmony_ci	add	$Xip=9,$Xip		};;	//	&Xi.lo
396e1051a39Sopenharmony_ci{ .mmi;	ld2	$rem[1]=[$rem[1]]		//(p19) rem_8bit[rem]
397e1051a39Sopenharmony_ci(p6)	ld1	$in=[$inp],-1			//[p16] *inp--
398e1051a39Sopenharmony_ci(p6)	extr.u	$xi[1]=$Zlo,8,8		}	//[p17] Xi[14]
399e1051a39Sopenharmony_ci{ .mmi;	xor	$Zhi=$Zhi,$Bhi			//(p19) Z.hi^=Hshr4[nhi].hi
400e1051a39Sopenharmony_ci(p6)	and	$xi[0]=$Zlo,$mask0xff	};;	//[p16] Xi[15]
401e1051a39Sopenharmony_ci{ .mmi;	st8	[$Xip]=$Zlo,-8
402e1051a39Sopenharmony_ci(p6)	xor	$xi[0]=$xi[0],$in		//[p17] xi=$xi[i]^inp[i]
403e1051a39Sopenharmony_ci	shl	$rem[1]=$rem[1],48	};;	//(p19) rem_8bit[rem]<<48
404e1051a39Sopenharmony_ci{ .mmi;
405e1051a39Sopenharmony_ci(p6)	ld1	$in=[$inp],-1			//[p16] *inp--
406e1051a39Sopenharmony_ci	xor	$Zhi=$Zhi,$rem[1]		//(p19) Z.hi^=rem_8bit[rem]<<48
407e1051a39Sopenharmony_ci(p6)	dep	$Atbl=$xi[0],$Htbl,4,4	}	//[p17] &Htable[nlo].lo
408e1051a39Sopenharmony_ci{ .mib;
409e1051a39Sopenharmony_ci(p6)	and	$xi[0]=-16,$xi[0]		//[p17] nhi=xi&0xf0
410e1051a39Sopenharmony_ci(p6)	br.cond.dptk.many	.LOOP	};;
411e1051a39Sopenharmony_ci
412e1051a39Sopenharmony_ci{ .mib;	st8	[$Xip]=$Zhi		};;
413e1051a39Sopenharmony_ci{ .mib;	$rum	1<<1				// return to little-endian
414e1051a39Sopenharmony_ci	.restore	sp
415e1051a39Sopenharmony_ci	mov	sp=prevsp
416e1051a39Sopenharmony_ci	br.ret.sptk.many	b0	};;
417e1051a39Sopenharmony_ci.endp	gcm_ghash_4bit#
418e1051a39Sopenharmony_ci___
419e1051a39Sopenharmony_ci$code.=<<___;
420e1051a39Sopenharmony_ci.align	128
421e1051a39Sopenharmony_ci.type	rem_4bit#,\@object
422e1051a39Sopenharmony_cirem_4bit:
423e1051a39Sopenharmony_ci        data8	0x0000<<48, 0x1C20<<48, 0x3840<<48, 0x2460<<48
424e1051a39Sopenharmony_ci        data8	0x7080<<48, 0x6CA0<<48, 0x48C0<<48, 0x54E0<<48
425e1051a39Sopenharmony_ci        data8	0xE100<<48, 0xFD20<<48, 0xD940<<48, 0xC560<<48
426e1051a39Sopenharmony_ci        data8	0x9180<<48, 0x8DA0<<48, 0xA9C0<<48, 0xB5E0<<48
427e1051a39Sopenharmony_ci.size	rem_4bit#,128
428e1051a39Sopenharmony_ci.type	rem_8bit#,\@object
429e1051a39Sopenharmony_cirem_8bit:
430e1051a39Sopenharmony_ci	data1	0x00,0x00, 0x01,0xC2, 0x03,0x84, 0x02,0x46, 0x07,0x08, 0x06,0xCA, 0x04,0x8C, 0x05,0x4E
431e1051a39Sopenharmony_ci	data1	0x0E,0x10, 0x0F,0xD2, 0x0D,0x94, 0x0C,0x56, 0x09,0x18, 0x08,0xDA, 0x0A,0x9C, 0x0B,0x5E
432e1051a39Sopenharmony_ci	data1	0x1C,0x20, 0x1D,0xE2, 0x1F,0xA4, 0x1E,0x66, 0x1B,0x28, 0x1A,0xEA, 0x18,0xAC, 0x19,0x6E
433e1051a39Sopenharmony_ci	data1	0x12,0x30, 0x13,0xF2, 0x11,0xB4, 0x10,0x76, 0x15,0x38, 0x14,0xFA, 0x16,0xBC, 0x17,0x7E
434e1051a39Sopenharmony_ci	data1	0x38,0x40, 0x39,0x82, 0x3B,0xC4, 0x3A,0x06, 0x3F,0x48, 0x3E,0x8A, 0x3C,0xCC, 0x3D,0x0E
435e1051a39Sopenharmony_ci	data1	0x36,0x50, 0x37,0x92, 0x35,0xD4, 0x34,0x16, 0x31,0x58, 0x30,0x9A, 0x32,0xDC, 0x33,0x1E
436e1051a39Sopenharmony_ci	data1	0x24,0x60, 0x25,0xA2, 0x27,0xE4, 0x26,0x26, 0x23,0x68, 0x22,0xAA, 0x20,0xEC, 0x21,0x2E
437e1051a39Sopenharmony_ci	data1	0x2A,0x70, 0x2B,0xB2, 0x29,0xF4, 0x28,0x36, 0x2D,0x78, 0x2C,0xBA, 0x2E,0xFC, 0x2F,0x3E
438e1051a39Sopenharmony_ci	data1	0x70,0x80, 0x71,0x42, 0x73,0x04, 0x72,0xC6, 0x77,0x88, 0x76,0x4A, 0x74,0x0C, 0x75,0xCE
439e1051a39Sopenharmony_ci	data1	0x7E,0x90, 0x7F,0x52, 0x7D,0x14, 0x7C,0xD6, 0x79,0x98, 0x78,0x5A, 0x7A,0x1C, 0x7B,0xDE
440e1051a39Sopenharmony_ci	data1	0x6C,0xA0, 0x6D,0x62, 0x6F,0x24, 0x6E,0xE6, 0x6B,0xA8, 0x6A,0x6A, 0x68,0x2C, 0x69,0xEE
441e1051a39Sopenharmony_ci	data1	0x62,0xB0, 0x63,0x72, 0x61,0x34, 0x60,0xF6, 0x65,0xB8, 0x64,0x7A, 0x66,0x3C, 0x67,0xFE
442e1051a39Sopenharmony_ci	data1	0x48,0xC0, 0x49,0x02, 0x4B,0x44, 0x4A,0x86, 0x4F,0xC8, 0x4E,0x0A, 0x4C,0x4C, 0x4D,0x8E
443e1051a39Sopenharmony_ci	data1	0x46,0xD0, 0x47,0x12, 0x45,0x54, 0x44,0x96, 0x41,0xD8, 0x40,0x1A, 0x42,0x5C, 0x43,0x9E
444e1051a39Sopenharmony_ci	data1	0x54,0xE0, 0x55,0x22, 0x57,0x64, 0x56,0xA6, 0x53,0xE8, 0x52,0x2A, 0x50,0x6C, 0x51,0xAE
445e1051a39Sopenharmony_ci	data1	0x5A,0xF0, 0x5B,0x32, 0x59,0x74, 0x58,0xB6, 0x5D,0xF8, 0x5C,0x3A, 0x5E,0x7C, 0x5F,0xBE
446e1051a39Sopenharmony_ci	data1	0xE1,0x00, 0xE0,0xC2, 0xE2,0x84, 0xE3,0x46, 0xE6,0x08, 0xE7,0xCA, 0xE5,0x8C, 0xE4,0x4E
447e1051a39Sopenharmony_ci	data1	0xEF,0x10, 0xEE,0xD2, 0xEC,0x94, 0xED,0x56, 0xE8,0x18, 0xE9,0xDA, 0xEB,0x9C, 0xEA,0x5E
448e1051a39Sopenharmony_ci	data1	0xFD,0x20, 0xFC,0xE2, 0xFE,0xA4, 0xFF,0x66, 0xFA,0x28, 0xFB,0xEA, 0xF9,0xAC, 0xF8,0x6E
449e1051a39Sopenharmony_ci	data1	0xF3,0x30, 0xF2,0xF2, 0xF0,0xB4, 0xF1,0x76, 0xF4,0x38, 0xF5,0xFA, 0xF7,0xBC, 0xF6,0x7E
450e1051a39Sopenharmony_ci	data1	0xD9,0x40, 0xD8,0x82, 0xDA,0xC4, 0xDB,0x06, 0xDE,0x48, 0xDF,0x8A, 0xDD,0xCC, 0xDC,0x0E
451e1051a39Sopenharmony_ci	data1	0xD7,0x50, 0xD6,0x92, 0xD4,0xD4, 0xD5,0x16, 0xD0,0x58, 0xD1,0x9A, 0xD3,0xDC, 0xD2,0x1E
452e1051a39Sopenharmony_ci	data1	0xC5,0x60, 0xC4,0xA2, 0xC6,0xE4, 0xC7,0x26, 0xC2,0x68, 0xC3,0xAA, 0xC1,0xEC, 0xC0,0x2E
453e1051a39Sopenharmony_ci	data1	0xCB,0x70, 0xCA,0xB2, 0xC8,0xF4, 0xC9,0x36, 0xCC,0x78, 0xCD,0xBA, 0xCF,0xFC, 0xCE,0x3E
454e1051a39Sopenharmony_ci	data1	0x91,0x80, 0x90,0x42, 0x92,0x04, 0x93,0xC6, 0x96,0x88, 0x97,0x4A, 0x95,0x0C, 0x94,0xCE
455e1051a39Sopenharmony_ci	data1	0x9F,0x90, 0x9E,0x52, 0x9C,0x14, 0x9D,0xD6, 0x98,0x98, 0x99,0x5A, 0x9B,0x1C, 0x9A,0xDE
456e1051a39Sopenharmony_ci	data1	0x8D,0xA0, 0x8C,0x62, 0x8E,0x24, 0x8F,0xE6, 0x8A,0xA8, 0x8B,0x6A, 0x89,0x2C, 0x88,0xEE
457e1051a39Sopenharmony_ci	data1	0x83,0xB0, 0x82,0x72, 0x80,0x34, 0x81,0xF6, 0x84,0xB8, 0x85,0x7A, 0x87,0x3C, 0x86,0xFE
458e1051a39Sopenharmony_ci	data1	0xA9,0xC0, 0xA8,0x02, 0xAA,0x44, 0xAB,0x86, 0xAE,0xC8, 0xAF,0x0A, 0xAD,0x4C, 0xAC,0x8E
459e1051a39Sopenharmony_ci	data1	0xA7,0xD0, 0xA6,0x12, 0xA4,0x54, 0xA5,0x96, 0xA0,0xD8, 0xA1,0x1A, 0xA3,0x5C, 0xA2,0x9E
460e1051a39Sopenharmony_ci	data1	0xB5,0xE0, 0xB4,0x22, 0xB6,0x64, 0xB7,0xA6, 0xB2,0xE8, 0xB3,0x2A, 0xB1,0x6C, 0xB0,0xAE
461e1051a39Sopenharmony_ci	data1	0xBB,0xF0, 0xBA,0x32, 0xB8,0x74, 0xB9,0xB6, 0xBC,0xF8, 0xBD,0x3A, 0xBF,0x7C, 0xBE,0xBE
462e1051a39Sopenharmony_ci.size	rem_8bit#,512
463e1051a39Sopenharmony_cistringz	"GHASH for IA64, CRYPTOGAMS by <appro\@openssl.org>"
464e1051a39Sopenharmony_ci___
465e1051a39Sopenharmony_ci
466e1051a39Sopenharmony_ci$code =~ s/mux1(\s+)\S+\@rev/nop.i$1 0x0/gm      if ($big_endian);
467e1051a39Sopenharmony_ci$code =~ s/\`([^\`]*)\`/eval $1/gem;
468e1051a39Sopenharmony_ci
469e1051a39Sopenharmony_ciprint $code;
470e1051a39Sopenharmony_ciclose STDOUT or die "error closing STDOUT: $!";
471