Debian Codegraph @

debian/rust-vendor/openssl-src/openssl/crypto/bn/asm/rsaz-3k-avxifma.pl

raw
1 # Copyright 2024-2026 The OpenSSL Project Authors. All Rights Reserved.
2 # Copyright (c) 2024, Intel Corporation. All Rights Reserved.
3 #
4 # Licensed under the Apache License 2.0 (the "License"). You may not use
5 # this file except in compliance with the License. You can obtain a copy
6 # in the file LICENSE in the source distribution or at
7 # https://www.openssl.org/source/license.html
8 #
9 # Written by Zhiguo Zhou <[email protected]> and Wangyang Guo <[email protected]>.
10 # Special thanks to Tomasz Kantecki <[email protected]> for his valuable suggestions.
11 #
12 # October 2024
13 #
14 # Initial release.
15 #
16
17 # $output is the last argument if it looks like a file (it has an extension)
18 # $flavour is the first argument if it doesn't look like a file
19 $output = $#ARGV >= 0 && $ARGV[$#ARGV] =~ m|\.\w+$| ? pop : undef;
20 $flavour = $#ARGV >= 0 && $ARGV[0] !~ m|\.| ? shift : undef;
21
22 $win64=0; $win64=1 if ($flavour =~ /[nm]asm|mingw64/ || $output =~ /\.asm$/);
23 $avxifma=0;
24
25 $0 =~ m/(.*[\/\\])[^\/\\]+$/; $dir=$1;
26 ( $xlate="${dir}x86_64-xlate.pl" and -f $xlate ) or
27 ( $xlate="${dir}../../perlasm/x86_64-xlate.pl" and -f $xlate) or
28 die "can't locate x86_64-xlate.pl";
29
30 if (`$ENV{CC} -Wa,-v -c -o /dev/null -x assembler /dev/null 2>&1`
31 =~ /GNU assembler version ([2-9]\.[0-9]+)/) {
32 $avxifma = ($1>=2.40);
33 }
34
35 if (!$avxifma && `$ENV{CC} -v 2>&1`
36 =~ /\s*((?:clang|LLVM) version|.*based on LLVM) ([0-9]+)\.([0-9]+)\.([0-9]+)?/) {
37 my $ver = $2 + $3/100.0 + $4/10000.0; # 3.1.0->3.01, 3.10.1->3.1001
38 $avxifma = ($ver>=16.0);
39 }
40
41 if ($win64 && ($flavour =~ /nasm/ || $ENV{ASM} =~ /nasm/) &&
42 `nasm -v 2>&1` =~ /NASM version ([2-9]\.[0-9]+)(?:\.([0-9]+))?(rc[0-9]+)?/) {
43 $avxifma = ($1>2.16) + ($1==2.16 && ((!defined($2) && !defined($3)) || (defined($2))));
44 }
45
46 open OUT,"| \"$^X\" \"$xlate\" $flavour \"$output\""
47 or die "can't call $xlate: $!";
48 *STDOUT=*OUT;
49
50 if ($avxifma>0) {{{
51 @_6_args_universal_ABI = ("%rdi","%rsi","%rdx","%rcx","%r8","%r9");
52
53 ###############################################################################
54 # Almost Montgomery Multiplication (AMM) for 30-digit number in radix 2^52.
55 #
56 # AMM is defined as presented in the paper [1].
57 #
58 # The input and output are presented in 2^52 radix domain, i.e.
59 # |res|, |a|, |b|, |m| are arrays of 32 64-bit qwords with 12 high bits zeroed
60 #
61 # NOTE: the function uses zero-padded data - 2 high QWs is a padding.
62 #
63 # |k0| is a Montgomery coefficient, which is here k0 = -1/m mod 2^64
64 #
65 # NB: the AMM implementation does not perform "conditional" subtraction step
66 # specified in the original algorithm as according to the Lemma 1 from the paper
67 # [2], the result will be always < 2*m and can be used as a direct input to
68 # the next AMM iteration. This post-condition is true, provided the correct
69 # parameter |s| (notion of the Lemma 1 from [2]) is chosen, i.e. s >= n + 2 * k,
70 # which matches our case: 1560 > 1536 + 2 * 1.
71 #
72 # [1] Gueron, S. Efficient software implementations of modular exponentiation.
73 # DOI: 10.1007/s13389-012-0031-5
74 # [2] Gueron, S. Enhanced Montgomery Multiplication.
75 # DOI: 10.1007/3-540-36400-5_5
76 #
77 # void ossl_rsaz_amm52x30_x1_avxifma256(BN_ULONG *res,
78 # const BN_ULONG *a,
79 # const BN_ULONG *b,
80 # const BN_ULONG *m,
81 # BN_ULONG k0);
82 ###############################################################################
83 {
84 # input parameters ("%rdi","%rsi","%rdx","%rcx","%r8")
85 my ($res,$a,$b,$m,$k0) = @_6_args_universal_ABI;
86
87 my $mask52 = "%rax";
88 my $acc0_0 = "%r9";
89 my $acc0_0_low = "%r9d";
90 my $b_ptr = "%r11";
91
92 my $iter = "%ebx";
93
94 my $zero = "%ymm0";
95 my $Bi = "%ymm1";
96 my $Bi_xmm = "%xmm1";
97 my $Yi = "%ymm2";
98 my $Yi_xmm = "%xmm2";
99 my ($R0_0,$R0_0h,$R1_0,$R1_0h,$R2_0,$R2_0h,$R3_0,$R3_0h) = map("%ymm$_",(3..10));
100
101 # Registers mapping for normalization
102 my ($T0,$T0h,$T1,$T1h,$T2,$T2h,$T3,$T3h) = ("$zero", "$Bi", "$Yi", map("%ymm$_", (11..15)));
103 my $T0_xmm = "%xmm0";
104
105 sub amm52x30_x1() {
106 # _data_offset - offset in the |a| or |m| arrays pointing to the beginning
107 # of data for corresponding AMM operation;
108 # _b_offset - offset in the |b| array pointing to the next qword digit;
109 my ($_data_offset,$_b_offset,$_acc,$_R0,$_R0h,$_R1,$_R1h,$_R2,$_R2h,$_R3,$_R3h,$_k0) = @_;
110 $code.=<<___;
111 movq $_b_offset($b_ptr), %r13 # b[i]
112
113 vpbroadcastq $_b_offset($b_ptr), $Bi # broadcast b[i]
114 movq $_data_offset($a), %rdx
115 mulx %r13, %r13, %r12 # a[0]*b[i] = (t0,t2)
116 addq %r13, $_acc # acc += t0
117 movq %r12, %r10
118 adcq \$0, %r10 # t2 += CF
119
120 movq $_k0, %r13
121 imulq $_acc, %r13 # acc * k0
122 andq $mask52, %r13 # yi = (acc * k0) & mask52
123
124 vmovq %r13, $Yi_xmm
125 vpbroadcastq $Yi_xmm, $Yi # broadcast y[i]
126 movq $_data_offset($m), %rdx
127 mulx %r13, %r13, %r12 # yi * m[0] = (t0,t1)
128 addq %r13, $_acc # acc += t0
129 adcq %r12, %r10 # t2 += (t1 + CF)
130
131 shrq \$52, $_acc
132 salq \$12, %r10
133 or %r10, $_acc # acc = ((acc >> 52) | (t2 << 12))
134
135 lea -264(%rsp), %rsp
136
137 {vex} vpmadd52luq `$_data_offset`($a), $Bi, $_R0
138 {vex} vpmadd52luq `$_data_offset+32`($a), $Bi, $_R0h
139 {vex} vpmadd52luq `$_data_offset+64*1`($a), $Bi, $_R1
140 {vex} vpmadd52luq `$_data_offset+64*1+32`($a), $Bi, $_R1h
141 {vex} vpmadd52luq `$_data_offset+64*2`($a), $Bi, $_R2
142 {vex} vpmadd52luq `$_data_offset+64*2+32`($a), $Bi, $_R2h
143 {vex} vpmadd52luq `$_data_offset+64*3`($a), $Bi, $_R3
144 {vex} vpmadd52luq `$_data_offset+64*3+32`($a), $Bi, $_R3h
145
146 {vex} vpmadd52luq `$_data_offset`($m), $Yi, $_R0
147 {vex} vpmadd52luq `$_data_offset+32`($m), $Yi, $_R0h
148 {vex} vpmadd52luq `$_data_offset+64*1`($m), $Yi, $_R1
149 {vex} vpmadd52luq `$_data_offset+64*1+32`($m), $Yi, $_R1h
150 {vex} vpmadd52luq `$_data_offset+64*2`($m), $Yi, $_R2
151 {vex} vpmadd52luq `$_data_offset+64*2+32`($m), $Yi, $_R2h
152 {vex} vpmadd52luq `$_data_offset+64*3`($m), $Yi, $_R3
153 {vex} vpmadd52luq `$_data_offset+64*3+32`($m), $Yi, $_R3h
154
155 # Shift accumulators right by 1 qword, zero extending the highest one
156 vmovdqu $_R0, `32*0`(%rsp)
157 vmovdqu $_R0h, `32*1`(%rsp)
158 vmovdqu $_R1, `32*2`(%rsp)
159 vmovdqu $_R1h, `32*3`(%rsp)
160 vmovdqu $_R2, `32*4`(%rsp)
161 vmovdqu $_R2h, `32*5`(%rsp)
162 vmovdqu $_R3, `32*6`(%rsp)
163 vmovdqu $_R3h, `32*7`(%rsp)
164 movq \$0, `32*8`(%rsp)
165
166 vmovdqu `32*0 + 8`(%rsp), $_R0
167 vmovdqu `32*1 + 8`(%rsp), $_R0h
168 vmovdqu `32*2 + 8`(%rsp), $_R1
169 vmovdqu `32*3 + 8`(%rsp), $_R1h
170 vmovdqu `32*4 + 8`(%rsp), $_R2
171 vmovdqu `32*5 + 8`(%rsp), $_R2h
172 vmovdqu `32*6 + 8`(%rsp), $_R3
173 vmovdqu `32*7 + 8`(%rsp), $_R3h
174
175 addq 8(%rsp), $_acc # acc += R0[0]
176
177 {vex} vpmadd52huq `$_data_offset`($a), $Bi, $_R0
178 {vex} vpmadd52huq `$_data_offset+32`($a), $Bi, $_R0h
179 {vex} vpmadd52huq `$_data_offset+64*1`($a), $Bi, $_R1
180 {vex} vpmadd52huq `$_data_offset+64*1+32`($a), $Bi, $_R1h
181 {vex} vpmadd52huq `$_data_offset+64*2`($a), $Bi, $_R2
182 {vex} vpmadd52huq `$_data_offset+64*2+32`($a), $Bi, $_R2h
183 {vex} vpmadd52huq `$_data_offset+64*3`($a), $Bi, $_R3
184 {vex} vpmadd52huq `$_data_offset+64*3+32`($a), $Bi, $_R3h
185
186 {vex} vpmadd52huq `$_data_offset`($m), $Yi, $_R0
187 {vex} vpmadd52huq `$_data_offset+32`($m), $Yi, $_R0h
188 {vex} vpmadd52huq `$_data_offset+64*1`($m), $Yi, $_R1
189 {vex} vpmadd52huq `$_data_offset+64*1+32`($m), $Yi, $_R1h
190 {vex} vpmadd52huq `$_data_offset+64*2`($m), $Yi, $_R2
191 {vex} vpmadd52huq `$_data_offset+64*2+32`($m), $Yi, $_R2h
192 {vex} vpmadd52huq `$_data_offset+64*3`($m), $Yi, $_R3
193 {vex} vpmadd52huq `$_data_offset+64*3+32`($m), $Yi, $_R3h
194
195 lea 264(%rsp),%rsp
196 ___
197 }
198
199 # Normalization routine: handles carry bits and gets bignum qwords to normalized
200 # 2^52 representation.
201 #
202 # Uses %r8-14,%e[abcd]x
203 sub amm52x30_x1_norm {
204 my ($_acc,$_R0,$_R0h,$_R1,$_R1h,$_R2,$_R2h,$_R3,$_R3h) = @_;
205 $code.=<<___;
206 # Put accumulator to low qword in R0
207 vmovq $_acc, $T0_xmm
208 vpbroadcastq $T0_xmm, $T0
209 vpblendd \$3, $T0, $_R0, $_R0
210
211 # Extract "carries" (12 high bits) from each QW of the bignum
212 # Save them to LSB of QWs in T0..Tn
213 vpsrlq \$52, $_R0, $T0
214 vpsrlq \$52, $_R0h, $T0h
215 vpsrlq \$52, $_R1, $T1
216 vpsrlq \$52, $_R1h, $T1h
217 vpsrlq \$52, $_R2, $T2
218 vpsrlq \$52, $_R2h, $T2h
219 vpsrlq \$52, $_R3, $T3
220 vpsrlq \$52, $_R3h, $T3h
221
222 lea -32(%rsp),%rsp
223 vmovupd $_R0, (%rsp)
224
225 # "Shift left" T0..Tn by 1 QW
226 vpermq \$144, $T3h, $T3h
227 vpermq \$3, $T3, $_R0
228 vblendpd \$1, $_R0, $T3h, $T3h
229
230 vpermq \$144, $T3, $T3
231 vpermq \$3, $T2h, $_R0
232 vblendpd \$1, $_R0, $T3, $T3
233
234 vpermq \$144, $T2h, $T2h
235 vpermq \$3, $T2, $_R0
236 vblendpd \$1, $_R0, $T2h, $T2h
237
238 vpermq \$144, $T2, $T2
239 vpermq \$3, $T1h, $_R0
240 vblendpd \$1, $_R0, $T2, $T2
241
242 vpermq \$144, $T1h, $T1h
243 vpermq \$3, $T1, $_R0
244 vblendpd \$1, $_R0, $T1h, $T1h
245
246 vpermq \$144, $T1, $T1
247 vpermq \$3, $T0h, $_R0
248 vblendpd \$1, $_R0, $T1, $T1
249
250 vpermq \$144, $T0h, $T0h
251 vpermq \$3, $T0, $_R0
252 vblendpd \$1, $_R0, $T0h, $T0h
253
254 vpermq \$144, $T0, $T0
255 vpand .Lhigh64x3(%rip), $T0, $T0
256
257 vmovupd (%rsp), $_R0
258 lea 32(%rsp),%rsp
259
260 # Drop "carries" from R0..Rn QWs
261 vpand .Lmask52x4(%rip), $_R0, $_R0
262 vpand .Lmask52x4(%rip), $_R0h, $_R0h
263 vpand .Lmask52x4(%rip), $_R1, $_R1
264 vpand .Lmask52x4(%rip), $_R1h, $_R1h
265 vpand .Lmask52x4(%rip), $_R2, $_R2
266 vpand .Lmask52x4(%rip), $_R2h, $_R2h
267 vpand .Lmask52x4(%rip), $_R3, $_R3
268 vpand .Lmask52x4(%rip), $_R3h, $_R3h
269
270 # Sum R0..Rn with corresponding adjusted carries
271 vpaddq $T0, $_R0, $_R0
272 vpaddq $T0h, $_R0h, $_R0h
273 vpaddq $T1, $_R1, $_R1
274 vpaddq $T1h, $_R1h, $_R1h
275 vpaddq $T2, $_R2, $_R2
276 vpaddq $T2h, $_R2h, $_R2h
277 vpaddq $T3, $_R3, $_R3
278 vpaddq $T3h, $_R3h, $_R3h
279
280 # Now handle carry bits from this addition
281 # Get mask of QWs whose 52-bit parts overflow
282 vpcmpgtq .Lmask52x4(%rip),${_R0},$T0 # OP=nle (i.e. gt)
283 vpcmpgtq .Lmask52x4(%rip),${_R0h},$T0h
284 vmovmskpd $T0, %r14d
285 vmovmskpd $T0h,%r13d
286 shl \$4,%r13b
287 or %r13b,%r14b
288
289 vpcmpgtq .Lmask52x4(%rip),${_R1},$T1
290 vpcmpgtq .Lmask52x4(%rip),${_R1h},$T1h
291 vmovmskpd $T1, %r13d
292 vmovmskpd $T1h,%r12d
293 shl \$4,%r12b
294 or %r12b,%r13b
295
296 vpcmpgtq .Lmask52x4(%rip),${_R2},$T2
297 vpcmpgtq .Lmask52x4(%rip),${_R2h},$T2h
298 vmovmskpd $T2, %r12d
299 vmovmskpd $T2h,%r11d
300 shl \$4,%r11b
301 or %r11b,%r12b
302
303 vpcmpgtq .Lmask52x4(%rip),${_R3},$T3
304 vpcmpgtq .Lmask52x4(%rip),${_R3h},$T3h
305 vmovmskpd $T3, %r11d
306 vmovmskpd $T3h,%r10d
307 shl \$4,%r10b
308 or %r10b,%r11b
309
310 addb %r14b,%r14b
311 adcb %r13b,%r13b
312 adcb %r12b,%r12b
313 adcb %r11b,%r11b
314
315 # Get mask of QWs whose 52-bit parts saturated
316 vpcmpeqq .Lmask52x4(%rip),${_R0},$T0 # OP=eq
317 vpcmpeqq .Lmask52x4(%rip),${_R0h},$T0h
318 vmovmskpd $T0, %r9d
319 vmovmskpd $T0h,%r8d
320 shl \$4,%r8b
321 or %r8b,%r9b
322
323 vpcmpeqq .Lmask52x4(%rip),${_R1},$T1
324 vpcmpeqq .Lmask52x4(%rip),${_R1h},$T1h
325 vmovmskpd $T1, %r8d
326 vmovmskpd $T1h,%edx
327 shl \$4,%dl
328 or %dl,%r8b
329
330 vpcmpeqq .Lmask52x4(%rip),${_R2},$T2
331 vpcmpeqq .Lmask52x4(%rip),${_R2h},$T2h
332 vmovmskpd $T2, %edx
333 vmovmskpd $T2h,%ecx
334 shl \$4,%cl
335 or %cl,%dl
336
337 vpcmpeqq .Lmask52x4(%rip),${_R3},$T3
338 vpcmpeqq .Lmask52x4(%rip),${_R3h},$T3h
339 vmovmskpd $T3, %ecx
340 vmovmskpd $T3h,%ebx
341 shl \$4,%bl
342 or %bl,%cl
343
344 addb %r9b,%r14b
345 adcb %r8b,%r13b
346 adcb %dl,%r12b
347 adcb %cl,%r11b
348
349 xor %r9b,%r14b
350 xor %r8b,%r13b
351 xor %dl,%r12b
352 xor %cl,%r11b
353
354 lea .Lkmasklut(%rip), %rdx
355
356 mov %r14b, %r10b
357 and \$0xf, %r14
358 vpsubq .Lmask52x4(%rip), $_R0, $T0
359 shl \$5, %r14
360 vmovapd (%rdx,%r14), $T1
361 vblendvpd $T1, $T0, $_R0, $_R0
362
363 shr \$4, %r10b
364 and \$0xf, %r10
365 vpsubq .Lmask52x4(%rip), $_R0h, $T0
366 shl \$5, %r10
367 vmovapd (%rdx,%r10), $T1
368 vblendvpd $T1, $T0, $_R0h, $_R0h
369
370 mov %r13b, %r10b
371 and \$0xf, %r13
372 vpsubq .Lmask52x4(%rip), $_R1, $T0
373 shl \$5, %r13
374 vmovapd (%rdx,%r13), $T1
375 vblendvpd $T1, $T0, $_R1, $_R1
376
377 shr \$4, %r10b
378 and \$0xf, %r10
379 vpsubq .Lmask52x4(%rip), $_R1h, $T0
380 shl \$5, %r10
381 vmovapd (%rdx,%r10), $T1
382 vblendvpd $T1, $T0, $_R1h, $_R1h
383
384 mov %r12b, %r10b
385 and \$0xf, %r12
386 vpsubq .Lmask52x4(%rip), $_R2, $T0
387 shl \$5, %r12
388 vmovapd (%rdx,%r12), $T1
389 vblendvpd $T1, $T0, $_R2, $_R2
390
391 shr \$4, %r10b
392 and \$0xf, %r10
393 vpsubq .Lmask52x4(%rip), $_R2h, $T0
394 shl \$5, %r10
395 vmovapd (%rdx,%r10), $T1
396 vblendvpd $T1, $T0, $_R2h, $_R2h
397
398 mov %r11b, %r10b
399 and \$0xf, %r11
400 vpsubq .Lmask52x4(%rip), $_R3, $T0
401 shl \$5, %r11
402 vmovapd (%rdx,%r11), $T1
403 vblendvpd $T1, $T0, $_R3, $_R3
404
405 shr \$4, %r10b
406 and \$0xf, %r10
407 vpsubq .Lmask52x4(%rip), $_R3h, $T0
408 shl \$5, %r10
409 vmovapd (%rdx,%r10), $T1
410 vblendvpd $T1, $T0, $_R3h, $_R3h
411
412 vpand .Lmask52x4(%rip), $_R0, $_R0
413 vpand .Lmask52x4(%rip), $_R0h, $_R0h
414 vpand .Lmask52x4(%rip), $_R1, $_R1
415 vpand .Lmask52x4(%rip), $_R1h, $_R1h
416 vpand .Lmask52x4(%rip), $_R2, $_R2
417 vpand .Lmask52x4(%rip), $_R2h, $_R2h
418 vpand .Lmask52x4(%rip), $_R3, $_R3
419
420 vpand .Lmask52x4(%rip), $_R3h, $_R3h
421 ___
422 }
423
424 $code.=<<___;
425 .text
426
427 .globl ossl_rsaz_amm52x30_x1_avxifma256
428 .type ossl_rsaz_amm52x30_x1_avxifma256,\@function,5
429 .align 32
430 ossl_rsaz_amm52x30_x1_avxifma256:
431 .cfi_startproc
432 endbranch
433 push %rbx
434 .cfi_push %rbx
435 push %rbp
436 .cfi_push %rbp
437 push %r12
438 .cfi_push %r12
439 push %r13
440 .cfi_push %r13
441 push %r14
442 .cfi_push %r14
443 push %r15
444 .cfi_push %r15
445 ___
446 $code.=<<___ if ($win64);
447 lea -168(%rsp),%rsp # 16*10 + (8 bytes to get correct 16-byte SIMD alignment)
448 vmovapd %xmm6, `0*16`(%rsp) # save non-volatile registers
449 vmovapd %xmm7, `1*16`(%rsp)
450 vmovapd %xmm8, `2*16`(%rsp)
451 vmovapd %xmm9, `3*16`(%rsp)
452 vmovapd %xmm10,`4*16`(%rsp)
453 vmovapd %xmm11,`5*16`(%rsp)
454 vmovapd %xmm12,`6*16`(%rsp)
455 vmovapd %xmm13,`7*16`(%rsp)
456 vmovapd %xmm14,`8*16`(%rsp)
457 vmovapd %xmm15,`9*16`(%rsp)
458 .Lossl_rsaz_amm52x30_x1_avxifma256_body:
459 ___
460 $code.=<<___;
461 # Zeroing accumulators
462 vpxor $zero, $zero, $zero
463 vmovapd $zero, $R0_0
464 vmovapd $zero, $R0_0h
465 vmovapd $zero, $R1_0
466 vmovapd $zero, $R1_0h
467 vmovapd $zero, $R2_0
468 vmovapd $zero, $R2_0h
469 vmovapd $zero, $R3_0
470 vmovapd $zero, $R3_0h
471
472 xorl $acc0_0_low, $acc0_0_low
473
474 movq $b, $b_ptr # backup address of b
475 movq \$0xfffffffffffff, $mask52 # 52-bit mask
476
477 # Loop over 30 digits unrolled by 4
478 mov \$7, $iter
479
480 .align 32
481 .Lloop7:
482 ___
483 foreach my $idx (0..3) {
484 &amm52x30_x1(0,8*$idx,$acc0_0,$R0_0,$R0_0h,$R1_0,$R1_0h,$R2_0,$R2_0h,$R3_0,$R3_0h,$k0);
485 }
486 $code.=<<___;
487 lea `4*8`($b_ptr), $b_ptr
488 dec $iter
489 jne .Lloop7
490 ___
491 &amm52x30_x1(0,8*0,$acc0_0,$R0_0,$R0_0h,$R1_0,$R1_0h,$R2_0,$R2_0h,$R3_0,$R3_0h,$k0);
492 &amm52x30_x1(0,8*1,$acc0_0,$R0_0,$R0_0h,$R1_0,$R1_0h,$R2_0,$R2_0h,$R3_0,$R3_0h,$k0);
493
494 &amm52x30_x1_norm($acc0_0,$R0_0,$R0_0h,$R1_0,$R1_0h,$R2_0,$R2_0h,$R3_0,$R3_0h);
495 $code.=<<___;
496
497 vmovdqu $R0_0, `0*32`($res)
498 vmovdqu $R0_0h, `1*32`($res)
499 vmovdqu $R1_0, `2*32`($res)
500 vmovdqu $R1_0h, `3*32`($res)
501 vmovdqu $R2_0, `4*32`($res)
502 vmovdqu $R2_0h, `5*32`($res)
503 vmovdqu $R3_0, `6*32`($res)
504 vmovdqu $R3_0h, `7*32`($res)
505
506 vzeroupper
507 lea (%rsp),%rax
508 .cfi_def_cfa_register %rax
509 ___
510 $code.=<<___ if ($win64);
511 vmovapd `0*16`(%rax),%xmm6
512 vmovapd `1*16`(%rax),%xmm7
513 vmovapd `2*16`(%rax),%xmm8
514 vmovapd `3*16`(%rax),%xmm9
515 vmovapd `4*16`(%rax),%xmm10
516 vmovapd `5*16`(%rax),%xmm11
517 vmovapd `6*16`(%rax),%xmm12
518 vmovapd `7*16`(%rax),%xmm13
519 vmovapd `8*16`(%rax),%xmm14
520 vmovapd `9*16`(%rax),%xmm15
521 lea 168(%rsp),%rax
522 ___
523 $code.=<<___;
524 mov 0(%rax),%r15
525 .cfi_restore %r15
526 mov 8(%rax),%r14
527 .cfi_restore %r14
528 mov 16(%rax),%r13
529 .cfi_restore %r13
530 mov 24(%rax),%r12
531 .cfi_restore %r12
532 mov 32(%rax),%rbp
533 .cfi_restore %rbp
534 mov 40(%rax),%rbx
535 .cfi_restore %rbx
536 lea 48(%rax),%rsp # restore rsp
537 .cfi_def_cfa %rsp,8
538 .Lossl_rsaz_amm52x30_x1_avxifma256_epilogue:
539 ret
540 .cfi_endproc
541 .size ossl_rsaz_amm52x30_x1_avxifma256, .-ossl_rsaz_amm52x30_x1_avxifma256
542 ___
543
544 $code.=<<___;
545 .section .rodata align=32
546 .align 32
547 .Lmask52x4:
548 .quad 0xfffffffffffff
549 .quad 0xfffffffffffff
550 .quad 0xfffffffffffff
551 .quad 0xfffffffffffff
552 .Lhigh64x3:
553 .quad 0x0
554 .quad 0xffffffffffffffff
555 .quad 0xffffffffffffffff
556 .quad 0xffffffffffffffff
557 .Lkmasklut:
558 #0000
559 .quad 0x0
560 .quad 0x0
561 .quad 0x0
562 .quad 0x0
563 #0001
564 .quad 0xffffffffffffffff
565 .quad 0x0
566 .quad 0x0
567 .quad 0x0
568 #0010
569 .quad 0x0
570 .quad 0xffffffffffffffff
571 .quad 0x0
572 .quad 0x0
573 #0011
574 .quad 0xffffffffffffffff
575 .quad 0xffffffffffffffff
576 .quad 0x0
577 .quad 0x0
578 #0100
579 .quad 0x0
580 .quad 0x0
581 .quad 0xffffffffffffffff
582 .quad 0x0
583 #0101
584 .quad 0xffffffffffffffff
585 .quad 0x0
586 .quad 0xffffffffffffffff
587 .quad 0x0
588 #0110
589 .quad 0x0
590 .quad 0xffffffffffffffff
591 .quad 0xffffffffffffffff
592 .quad 0x0
593 #0111
594 .quad 0xffffffffffffffff
595 .quad 0xffffffffffffffff
596 .quad 0xffffffffffffffff
597 .quad 0x0
598 #1000
599 .quad 0x0
600 .quad 0x0
601 .quad 0x0
602 .quad 0xffffffffffffffff
603 #1001
604 .quad 0xffffffffffffffff
605 .quad 0x0
606 .quad 0x0
607 .quad 0xffffffffffffffff
608 #1010
609 .quad 0x0
610 .quad 0xffffffffffffffff
611 .quad 0x0
612 .quad 0xffffffffffffffff
613 #1011
614 .quad 0xffffffffffffffff
615 .quad 0xffffffffffffffff
616 .quad 0x0
617 .quad 0xffffffffffffffff
618 #1100
619 .quad 0x0
620 .quad 0x0
621 .quad 0xffffffffffffffff
622 .quad 0xffffffffffffffff
623 #1101
624 .quad 0xffffffffffffffff
625 .quad 0x0
626 .quad 0xffffffffffffffff
627 .quad 0xffffffffffffffff
628 #1110
629 .quad 0x0
630 .quad 0xffffffffffffffff
631 .quad 0xffffffffffffffff
632 .quad 0xffffffffffffffff
633 #1111
634 .quad 0xffffffffffffffff
635 .quad 0xffffffffffffffff
636 .quad 0xffffffffffffffff
637 .quad 0xffffffffffffffff
638 ___
639
640 ###############################################################################
641 # Dual Almost Montgomery Multiplication for 30-digit number in radix 2^52
642 #
643 # See description of ossl_rsaz_amm52x30_x1_ifma256() above for details about Almost
644 # Montgomery Multiplication algorithm and function input parameters description.
645 #
646 # This function does two AMMs for two independent inputs, hence dual.
647 #
648 # NOTE: the function uses zero-padded data - 2 high QWs is a padding.
649 #
650 # void ossl_rsaz_amm52x30_x2_avxifma256(BN_ULONG out[2][32],
651 # const BN_ULONG a[2][32],
652 # const BN_ULONG b[2][32],
653 # const BN_ULONG m[2][32],
654 # const BN_ULONG k0[2]);
655 ###############################################################################
656
657 $code.=<<___;
658 .text
659
660 .globl ossl_rsaz_amm52x30_x2_avxifma256
661 .type ossl_rsaz_amm52x30_x2_avxifma256,\@function,5
662 .align 32
663 ossl_rsaz_amm52x30_x2_avxifma256:
664 .cfi_startproc
665 endbranch
666 push %rbx
667 .cfi_push %rbx
668 push %rbp
669 .cfi_push %rbp
670 push %r12
671 .cfi_push %r12
672 push %r13
673 .cfi_push %r13
674 push %r14
675 .cfi_push %r14
676 push %r15
677 .cfi_push %r15
678 ___
679 $code.=<<___ if ($win64);
680 lea -168(%rsp),%rsp
681 vmovapd %xmm6, `0*16`(%rsp) # save non-volatile registers
682 vmovapd %xmm7, `1*16`(%rsp)
683 vmovapd %xmm8, `2*16`(%rsp)
684 vmovapd %xmm9, `3*16`(%rsp)
685 vmovapd %xmm10,`4*16`(%rsp)
686 vmovapd %xmm11,`5*16`(%rsp)
687 vmovapd %xmm12,`6*16`(%rsp)
688 vmovapd %xmm13,`7*16`(%rsp)
689 vmovapd %xmm14,`8*16`(%rsp)
690 vmovapd %xmm15,`9*16`(%rsp)
691 .Lossl_rsaz_amm52x30_x2_avxifma256_body:
692 ___
693 $code.=<<___;
694 # Zeroing accumulators
695 vpxor $zero, $zero, $zero
696 vmovapd $zero, $R0_0
697 vmovapd $zero, $R0_0h
698 vmovapd $zero, $R1_0
699 vmovapd $zero, $R1_0h
700 vmovapd $zero, $R2_0
701 vmovapd $zero, $R2_0h
702 vmovapd $zero, $R3_0
703 vmovapd $zero, $R3_0h
704
705 xorl $acc0_0_low, $acc0_0_low
706
707 movq $b, $b_ptr # backup address of b
708 movq \$0xfffffffffffff, $mask52 # 52-bit mask
709
710 mov \$30, $iter
711
712 .align 32
713 .Lloop30:
714 ___
715 &amm52x30_x1( 0, 0,$acc0_0,$R0_0,$R0_0h,$R1_0,$R1_0h,$R2_0,$R2_0h,$R3_0,$R3_0h,"($k0)");
716 $code.=<<___;
717 lea 8($b_ptr), $b_ptr
718 dec $iter
719 jne .Lloop30
720
721 push $b_ptr
722 push $a
723 push $m
724 push $k0
725 ___
726 &amm52x30_x1_norm($acc0_0,$R0_0,$R0_0h,$R1_0,$R1_0h,$R2_0,$R2_0h,$R3_0,$R3_0h);
727 $code.=<<___;
728 pop $k0
729 pop $m
730 pop $a
731 pop $b_ptr
732
733 vmovdqu $R0_0, `0*32`($res)
734 vmovdqu $R0_0h, `1*32`($res)
735 vmovdqu $R1_0, `2*32`($res)
736 vmovdqu $R1_0h, `3*32`($res)
737 vmovdqu $R2_0, `4*32`($res)
738 vmovdqu $R2_0h, `5*32`($res)
739 vmovdqu $R3_0, `6*32`($res)
740 vmovdqu $R3_0h, `7*32`($res)
741
742 xorl $acc0_0_low, $acc0_0_low
743
744 lea 16($b_ptr), $b_ptr
745 movq \$0xfffffffffffff, $mask52 # 52-bit mask
746
747 mov \$30, $iter
748
749 vpxor $zero, $zero, $zero
750 vmovapd $zero, $R0_0
751 vmovapd $zero, $R0_0h
752 vmovapd $zero, $R1_0
753 vmovapd $zero, $R1_0h
754 vmovapd $zero, $R2_0
755 vmovapd $zero, $R2_0h
756 vmovapd $zero, $R3_0
757 vmovapd $zero, $R3_0h
758 .align 32
759 .Lloop40:
760 ___
761 # 32*8 = offset of the next dimension in two-dimension array
762 &amm52x30_x1(32*8, 0,$acc0_0,$R0_0,$R0_0h,$R1_0,$R1_0h,$R2_0,$R2_0h,$R3_0,$R3_0h,"8($k0)");
763 $code.=<<___;
764 lea 8($b_ptr), $b_ptr
765 dec $iter
766 jne .Lloop40
767 ___
768 &amm52x30_x1_norm($acc0_0,$R0_0,$R0_0h,$R1_0,$R1_0h,$R2_0,$R2_0h,$R3_0,$R3_0h);
769 $code.=<<___;
770
771 vmovdqu $R0_0, `8*32`($res)
772 vmovdqu $R0_0h, `9*32`($res)
773 vmovdqu $R1_0, `10*32`($res)
774 vmovdqu $R1_0h, `11*32`($res)
775 vmovdqu $R2_0, `12*32`($res)
776 vmovdqu $R2_0h, `13*32`($res)
777 vmovdqu $R3_0, `14*32`($res)
778 vmovdqu $R3_0h, `15*32`($res)
779
780 vzeroupper
781 lea (%rsp),%rax
782 .cfi_def_cfa_register %rax
783 ___
784 $code.=<<___ if ($win64);
785 vmovapd `0*16`(%rax),%xmm6
786 vmovapd `1*16`(%rax),%xmm7
787 vmovapd `2*16`(%rax),%xmm8
788 vmovapd `3*16`(%rax),%xmm9
789 vmovapd `4*16`(%rax),%xmm10
790 vmovapd `5*16`(%rax),%xmm11
791 vmovapd `6*16`(%rax),%xmm12
792 vmovapd `7*16`(%rax),%xmm13
793 vmovapd `8*16`(%rax),%xmm14
794 vmovapd `9*16`(%rax),%xmm15
795 lea 168(%rsp),%rax
796 ___
797 $code.=<<___;
798 mov 0(%rax),%r15
799 .cfi_restore %r15
800 mov 8(%rax),%r14
801 .cfi_restore %r14
802 mov 16(%rax),%r13
803 .cfi_restore %r13
804 mov 24(%rax),%r12
805 .cfi_restore %r12
806 mov 32(%rax),%rbp
807 .cfi_restore %rbp
808 mov 40(%rax),%rbx
809 .cfi_restore %rbx
810 lea 48(%rax),%rsp
811 .cfi_def_cfa %rsp,8
812 .Lossl_rsaz_amm52x30_x2_avxifma256_epilogue:
813 ret
814 .cfi_endproc
815 .size ossl_rsaz_amm52x30_x2_avxifma256, .-ossl_rsaz_amm52x30_x2_avxifma256
816 ___
817 }
818
819 ###############################################################################
820 # Constant time extraction from the precomputed table of powers base^i, where
821 # i = 0..2^EXP_WIN_SIZE-1
822 #
823 # The input |red_table| contains precomputations for two independent base values.
824 # |red_table_idx1| and |red_table_idx2| are corresponding power indexes.
825 #
826 # Extracted value (output) is 2 (30 + 2) digits numbers in 2^52 radix.
827 # (2 high QW is zero padding)
828 #
829 # void ossl_extract_multiplier_2x30_win5_avx(BN_ULONG *red_Y,
830 # const BN_ULONG red_table[1 << EXP_WIN_SIZE][2][32],
831 # int red_table_idx1, int red_table_idx2);
832 #
833 # EXP_WIN_SIZE = 5
834 ###############################################################################
835 {
836 # input parameters
837 my ($out,$red_tbl,$red_tbl_idx1,$red_tbl_idx2)=$win64 ? ("%rcx","%rdx","%r8", "%r9") : # Win64 order
838 ("%rdi","%rsi","%rdx","%rcx"); # Unix order
839
840 my ($t0,$t1,$t2,$t3,$t4,$t5,$t6,$t7) = map("%ymm$_", (0..7));
841 my ($t8,$t9,$t10,$t11,$t12,$t13,$t14,$t15) = map("%ymm$_", (0..7));
842 my ($tmp,$cur_idx,$idx1,$idx2,$ones,$mask) = map("%ymm$_", (8..13));
843
844 my @t = ($t0,$t1,$t2,$t3,$t4,$t5,$t6,$t7,$t8,$t9,$t10,$t11,$t12,$t13,$t14,$t15);
845 my $t0xmm = $t0;
846 my $tmp_xmm = "%xmm8";
847 $t0xmm =~ s/%y/%x/;
848
849 $code.=<<___;
850 .text
851
852 .align 32
853 .globl ossl_extract_multiplier_2x30_win5_avx
854 .type ossl_extract_multiplier_2x30_win5_avx,\@abi-omnipotent
855 ossl_extract_multiplier_2x30_win5_avx:
856 .cfi_startproc
857 endbranch
858 ___
859 $code.=<<___ if ($win64);
860 push %rsi # save non-volatile registers
861 push %rdi
862 lea -168(%rsp), %rsp # 16*10 + (8 bytes to get correct 16-byte SIMD alignment)
863 vmovapd %xmm6, `16*0`(%rsp)
864 vmovapd %xmm7, `16*1`(%rsp)
865 vmovapd %xmm8, `16*2`(%rsp)
866 vmovapd %xmm9, `16*3`(%rsp)
867 vmovapd %xmm10, `16*4`(%rsp)
868 vmovapd %xmm11, `16*5`(%rsp)
869 vmovapd %xmm12, `16*6`(%rsp)
870 vmovapd %xmm13, `16*7`(%rsp)
871 vmovapd %xmm14, `16*8`(%rsp)
872 vmovapd %xmm15, `16*9`(%rsp)
873 ___
874 $code.=<<___;
875 vmovapd .Lones(%rip), $ones # broadcast ones
876 vmovq $red_tbl_idx1, $tmp_xmm
877 vpbroadcastq $tmp_xmm, $idx1
878 vmovq $red_tbl_idx2, $tmp_xmm
879 vpbroadcastq $tmp_xmm, $idx2
880 leaq `(1<<5)*2*32*8`($red_tbl), %rax # holds end of the tbl
881
882 # zeroing t0..n, cur_idx
883 vpxor $t0xmm, $t0xmm, $t0xmm
884 vmovapd $t0, $cur_idx
885 ___
886 foreach (1..7) {
887 $code.="vmovapd $t0, $t[$_] \n";
888 }
889 $code.=<<___;
890
891 .align 32
892 .Lloop:
893 vpcmpeqq $cur_idx, $idx1, $mask # mask of (idx1 == cur_idx)
894 ___
895 foreach (0..7) {
896 $code.=<<___;
897 vmovdqu `${_}*32`($red_tbl), $tmp # load data from red_tbl
898 #vpblendmq $tmp, $t[$_], ${t[$_]}{%k1} # extract data when mask is not zero
899 vblendvpd $mask, $tmp, $t[$_], ${t[$_]} # extract data when mask is not zero
900 ___
901 }
902 $code.=<<___;
903 vpaddq $ones, $cur_idx, $cur_idx # increment cur_idx
904 addq \$`2*32*8`, $red_tbl
905 cmpq $red_tbl, %rax
906 jne .Lloop
907 ___
908 # store t0..n
909 foreach (0..7) {
910 $code.="vmovdqu $t[$_], `${_}*32`($out) \n";
911 }
912
913 #second half
914 $code.=<<___;
915 leaq `-(1<<5)*2*32*8`(%rax), $red_tbl
916
917 # zeroing t0..n, cur_idx
918 vpxor $t0xmm, $t0xmm, $t0xmm
919 vmovapd $t0, $cur_idx
920 ___
921 foreach (8..15) {
922 $code.="vmovapd $t0, $t[$_] \n";
923 }
924 $code.=<<___;
925
926 .align 32
927 .Lloop_8_15:
928 vpcmpeqq $cur_idx, $idx2, $mask # mask of (idx2 == cur_idx)
929 ___
930 foreach (8..15) {
931 $code.=<<___;
932 vmovdqu `${_}*32`($red_tbl), $tmp # load data from red_tbl
933 #vpblendmq $tmp, $t[$_], ${t[$_]}{%k2} # extract data when mask is not zero
934 vblendvpd $mask, $tmp, $t[$_], ${t[$_]} # extract data when mask is not zero
935 ___
936 }
937 $code.=<<___;
938 vpaddq $ones, $cur_idx, $cur_idx # increment cur_idx
939 addq \$`2*32*8`, $red_tbl
940 cmpq $red_tbl, %rax
941 jne .Lloop_8_15
942 ___
943 # store t0..n
944 foreach (8..15) {
945 $code.="vmovdqu $t[$_], `${_}*32`($out) \n";
946 }
947
948 $code.=<<___;
949 vzeroupper
950 ___
951 $code.=<<___ if ($win64);
952 vmovapd `16*0`(%rsp), %xmm6
953 vmovapd `16*1`(%rsp), %xmm7
954 vmovapd `16*2`(%rsp), %xmm8
955 vmovapd `16*3`(%rsp), %xmm9
956 vmovapd `16*4`(%rsp), %xmm10
957 vmovapd `16*5`(%rsp), %xmm11
958 vmovapd `16*6`(%rsp), %xmm12
959 vmovapd `16*7`(%rsp), %xmm13
960 vmovapd `16*8`(%rsp), %xmm14
961 vmovapd `16*9`(%rsp), %xmm15
962 lea 168(%rsp), %rsp
963 pop %rdi
964 pop %rsi
965 ___
966
967 $code.=<<___;
968
969 ret
970 .cfi_endproc
971 .size ossl_extract_multiplier_2x30_win5_avx, .-ossl_extract_multiplier_2x30_win5_avx
972 ___
973 $code.=<<___;
974 .section .rodata align=32
975 .align 32
976 .Lones:
977 .quad 1,1,1,1
978 .Lzeros:
979 .quad 0,0,0,0
980 ___
981 }
982
983 if ($win64) {
984 $rec="%rcx";
985 $frame="%rdx";
986 $context="%r8";
987 $disp="%r9";
988
989 $code.=<<___;
990 .extern __imp_RtlVirtualUnwind
991 .type rsaz_avx_handler,\@abi-omnipotent
992 .align 16
993 rsaz_avx_handler:
994 push %rsi
995 push %rdi
996 push %rbx
997 push %rbp
998 push %r12
999 push %r13
1000 push %r14
1001 push %r15
1002 pushfq
1003 sub \$64,%rsp
1004
1005 mov 120($context),%rax # pull context->Rax
1006 mov 248($context),%rbx # pull context->Rip
1007
1008 mov 8($disp),%rsi # disp->ImageBase
1009 mov 56($disp),%r11 # disp->HandlerData
1010
1011 mov 0(%r11),%r10d # HandlerData[0]
1012 lea (%rsi,%r10),%r10 # prologue label
1013 cmp %r10,%rbx # context->Rip<.Lprologue
1014 jb .Lcommon_seh_tail
1015
1016 mov 4(%r11),%r10d # HandlerData[1]
1017 lea (%rsi,%r10),%r10 # epilogue label
1018 cmp %r10,%rbx # context->Rip>=.Lepilogue
1019 jae .Lcommon_seh_tail
1020
1021 mov 152($context),%rax # pull context->Rsp
1022
1023 lea (%rax),%rsi # %xmm save area
1024 lea 512($context),%rdi # & context.Xmm6
1025 mov \$20,%ecx # 10*sizeof(%xmm0)/sizeof(%rax)
1026 .long 0xa548f3fc # cld; rep movsq
1027
1028 lea `48+168`(%rax),%rax
1029
1030 mov -8(%rax),%rbx
1031 mov -16(%rax),%rbp
1032 mov -24(%rax),%r12
1033 mov -32(%rax),%r13
1034 mov -40(%rax),%r14
1035 mov -48(%rax),%r15
1036 mov %rbx,144($context) # restore context->Rbx
1037 mov %rbp,160($context) # restore context->Rbp
1038 mov %r12,216($context) # restore context->R12
1039 mov %r13,224($context) # restore context->R13
1040 mov %r14,232($context) # restore context->R14
1041 mov %r15,240($context) # restore context->R14
1042
1043 .Lcommon_seh_tail:
1044 mov 8(%rax),%rdi
1045 mov 16(%rax),%rsi
1046 mov %rax,152($context) # restore context->Rsp
1047 mov %rsi,168($context) # restore context->Rsi
1048 mov %rdi,176($context) # restore context->Rdi
1049
1050 mov 40($disp),%rdi # disp->ContextRecord
1051 mov $context,%rsi # context
1052 mov \$154,%ecx # sizeof(CONTEXT)
1053 .long 0xa548f3fc # cld; rep movsq
1054
1055 mov $disp,%rsi
1056 xor %rcx,%rcx # arg1, UNW_FLAG_NHANDLER
1057 mov 8(%rsi),%rdx # arg2, disp->ImageBase
1058 mov 0(%rsi),%r8 # arg3, disp->ControlPc
1059 mov 16(%rsi),%r9 # arg4, disp->FunctionEntry
1060 mov 40(%rsi),%r10 # disp->ContextRecord
1061 lea 56(%rsi),%r11 # &disp->HandlerData
1062 lea 24(%rsi),%r12 # &disp->EstablisherFrame
1063 mov %r10,32(%rsp) # arg5
1064 mov %r11,40(%rsp) # arg6
1065 mov %r12,48(%rsp) # arg7
1066 mov %rcx,56(%rsp) # arg8, (NULL)
1067 call *__imp_RtlVirtualUnwind(%rip)
1068
1069 mov \$1,%eax # ExceptionContinueSearch
1070 add \$64,%rsp
1071 popfq
1072 pop %r15
1073 pop %r14
1074 pop %r13
1075 pop %r12
1076 pop %rbp
1077 pop %rbx
1078 pop %rdi
1079 pop %rsi
1080 ret
1081 .size rsaz_avx_handler,.-rsaz_avx_handler
1082
1083 .section .pdata
1084 .align 4
1085 .rva .LSEH_begin_ossl_rsaz_amm52x30_x1_avxifma256
1086 .rva .LSEH_end_ossl_rsaz_amm52x30_x1_avxifma256
1087 .rva .LSEH_info_ossl_rsaz_amm52x30_x1_avxifma256
1088
1089 .rva .LSEH_begin_ossl_rsaz_amm52x30_x2_avxifma256
1090 .rva .LSEH_end_ossl_rsaz_amm52x30_x2_avxifma256
1091 .rva .LSEH_info_ossl_rsaz_amm52x30_x2_avxifma256
1092
1093 .section .xdata
1094 .align 8
1095 .LSEH_info_ossl_rsaz_amm52x30_x1_avxifma256:
1096 .byte 9,0,0,0
1097 .rva rsaz_avx_handler
1098 .rva .Lossl_rsaz_amm52x30_x1_avxifma256_body,.Lossl_rsaz_amm52x30_x1_avxifma256_epilogue
1099 .LSEH_info_ossl_rsaz_amm52x30_x2_avxifma256:
1100 .byte 9,0,0,0
1101 .rva rsaz_avx_handler
1102 .rva .Lossl_rsaz_amm52x30_x2_avxifma256_body,.Lossl_rsaz_amm52x30_x2_avxifma256_epilogue
1103 ___
1104 }
1105 }}} else {{{ # fallback for old assembler
1106 $code.=<<___;
1107 .text
1108
1109 .globl ossl_rsaz_amm52x30_x1_avxifma256
1110 .globl ossl_rsaz_amm52x30_x2_avxifma256
1111 .globl ossl_extract_multiplier_2x30_win5_avx
1112 .type ossl_rsaz_amm52x30_x1_avxifma256,\@abi-omnipotent
1113 ossl_rsaz_amm52x30_x1_avxifma256:
1114 ossl_rsaz_amm52x30_x2_avxifma256:
1115 ossl_extract_multiplier_2x30_win5_avx:
1116 .byte 0x0f,0x0b # ud2
1117 ret
1118 .size ossl_rsaz_amm52x30_x1_avxifma256, .-ossl_rsaz_amm52x30_x1_avxifma256
1119 ___
1120 }}}
1121
1122 $code =~ s/\`([^\`]*)\`/eval $1/gem;
1123 print $code;
1124 close STDOUT or die "error closing STDOUT: $!";