}
}
+if (!$avx512vaes && `$ENV{CC} -x c /dev/null -dM -E|grep __clang_major__`
+ =~ /#define __clang_major__.([0-9]+)/) {
+ if ($1) {
+ $avx512vaes = ($1>=11); #icx started with clang 11
+ }
+}
+
open OUT,"| \"$^X\" \"$xlate\" $flavour \"$output\""
or die "can't call $xlate: $!";
*STDOUT=*OUT;
$avx = ($2>=3.0) + ($2>3.0);
}
+if (!$avx && `$ENV{CC} -x c /dev/null -dM -E|grep __clang_major__`
+ =~ /#define __clang_major__.([0-9]+)/) {
+ if ($1) {
+ $avx = ($1>=11); #icx started with clang 11
+ }
+}
+
open OUT,"| \"$^X\" \"$xlate\" $flavour \"$output\""
or die "can't call $xlate: $!";
*STDOUT=*OUT;
$1>=10);
$avx=1 if (!$avx && `$ENV{CC} -v 2>&1` =~ /((?:clang|LLVM) version|.*based on LLVM) ([0-9]+\.[0-9]+)/ && $2>=3.0);
+$avx=1 if (!$avx && `$ENV{CC} -x c /dev/null -dM -E|grep __clang_major__` =~ /#define __clang_major__.([0-9]+)/ &&
+ $1>=11); #icx started with clang 11
+
$shaext=1; ### set to zero if compiling for 1.0.1
$stitched_decrypt=0;
$avx = ($2>=3.0) + ($2>3.0);
}
+if (!$avx && `$ENV{CC} -x c /dev/null -dM -E|grep __clang_major__`
+ =~ /#define __clang_major__.([0-9]+)/) {
+ if ($1) {
+ $avx = ($1>=11); #icx started with clang 11
+ }
+}
+
$shaext=$avx; ### set to zero if compiling for 1.0.1
$avx=1 if (!$shaext && $avx);
}
}
+if (!$avx512vaes && `$ENV{CC} -x c /dev/null -dM -E|grep __clang_major__`
+ =~ /#define __clang_major__.([0-9]+)/) {
+ if ($1) {
+ $avx512vaes = ($1>=11); #icx started with clang 11
+ }
+}
+
open OUT,"| \"$^X\" \"$xlate\" $flavour \"$output\""
or die "can't call $xlate: $!";
*STDOUT=*OUT;
}
}
+if (!$avx512ifma && `$ENV{CC} -x c /dev/null -dM -E|grep __clang_major__`
+ =~ /#define __clang_major__.([0-9]+)/) {
+ if ($1) {
+ $avx512ifma = ($1>=11); #icx started with clang 11
+ }
+}
+
open OUT,"| \"$^X\" \"$xlate\" $flavour \"$output\""
or die "can't call $xlate: $!";
*STDOUT=*OUT;
$avxifma = ($ver>=16.0);
}
+if (!$avxifma && `$ENV{CC} -x c /dev/null -dM -E|grep __clang_major__`
+ =~ /#define __clang_major__.([0-9]+)/) {
+ if ($1) {
+ $avxifma = ($1>=16);
+ }
+}
+
if ($win64 && ($flavour =~ /nasm/ || $ENV{ASM} =~ /nasm/) &&
`nasm -v 2>&1` =~ /NASM version ([0-9]+)\.([0-9]+)(?:\.([0-9]+))?(rc[0-9]+)?/) {
my $ver = $1 + $2/100.0 + $3/10000.0; # 3.1.0->3.01, 3.10.1->3.1001
}
}
+if (!$avx512ifma && `$ENV{CC} -x c /dev/null -dM -E|grep __clang_major__`
+ =~ /#define __clang_major__.([0-9]+)/) {
+ if ($1) {
+ $avx512ifma = ($1>=11); #icx started with clang 11
+ }
+}
+
open OUT,"| \"$^X\" \"$xlate\" $flavour \"$output\""
or die "can't call $xlate: $!";
*STDOUT=*OUT;
$avxifma = ($ver>=16.0);
}
+if (!$avxifma && `$ENV{CC} -x c /dev/null -dM -E|grep __clang_major__`
+ =~ /#define __clang_major__.([0-9]+)/) {
+ if ($1) {
+ $avxifma = ($1>=16);
+ }
+}
+
if ($win64 && ($flavour =~ /nasm/ || $ENV{ASM} =~ /nasm/) &&
`nasm -v 2>&1` =~ /NASM version ([2-9]\.[0-9]+)(?:\.([0-9]+))?(rc[0-9]+)?/) {
$avxifma = ($1>2.16) + ($1==2.16 && ((!defined($2) && !defined($3)) || (defined($2))));
}
}
+if (!$avx512ifma && `$ENV{CC} -x c /dev/null -dM -E|grep __clang_major__`
+ =~ /#define __clang_major__.([0-9]+)/) {
+ if ($1) {
+ $avx512ifma = ($1>=11); #icx started with clang 11
+ }
+}
+
open OUT,"| \"$^X\" \"$xlate\" $flavour \"$output\""
or die "can't call $xlate: $!";
*STDOUT=*OUT;
$avxifma = ($ver>=16.0);
}
+if (!$avxifma && `$ENV{CC} -x c /dev/null -dM -E|grep __clang_major__`
+ =~ /#define __clang_major__.([0-9]+)/) {
+ if ($1) {
+ $avxifma = ($1>=16);
+ }
+}
+
if ($win64 && ($flavour =~ /nasm/ || $ENV{ASM} =~ /nasm/) &&
`nasm -v 2>&1` =~ /NASM version ([2-9]\.[0-9]+)(?:\.([0-9]+))?(rc[0-9]+)?/) {
$avxifma = ($1>2.16) + ($1==2.16 && ((!defined($2) && !defined($3)) || (defined($2))));
$addx = ($ver>=3.03);
}
+if (!$avx && `$ENV{CC} -x c /dev/null -dM -E|grep __clang_major__`
+ =~ /#define __clang_major__.([0-9]+)/) {
+ if ($1) {
+ $addx = ($1>=11); #icx started with clang 11
+ $avx = ($1>=11);
+ }
+}
+
open OUT,"| \"$^X\" \"$xlate\" $flavour \"$output\""
or die "can't call $xlate: $!";
*STDOUT = *OUT;
$addx = ($ver>=3.03);
}
+if (!$addx && `$ENV{CC} -x c /dev/null -dM -E|grep __clang_major__`
+ =~ /#define __clang_major__.([0-9]+)/) {
+ if ($1) {
+ $addx = ($1>=11); #icx started with clang 11
+ }
+}
+
($out, $inp, $mod) = ("%rdi", "%rsi", "%rbp"); # common internal API
{
my ($out,$inp,$mod,$n0,$times) = ("%rdi","%rsi","%rdx","%rcx","%r8d");
$addx = ($ver>=3.03);
}
+if (!$addx && `$ENV{CC} -x c /dev/null -dM -E|grep __clang_major__`
+ =~ /#define __clang_major__.([0-9]+)/) {
+ if ($1) {
+ $addx = ($1>=11); #icx started with clang 11
+ }
+}
+
# int bn_mul_mont(
$rp="%rdi"; # BN_ULONG *rp,
$ap="%rsi"; # const BN_ULONG *ap,
$addx = ($ver>=3.03);
}
+if (!$addx && `$ENV{CC} -x c /dev/null -dM -E|grep __clang_major__`
+ =~ /#define __clang_major__.([0-9]+)/) {
+ if ($1) {
+ $addx = ($1>=11); #icx started with clang 11
+ }
+}
+
# int bn_mul_mont_gather5(
$rp="%rdi"; # BN_ULONG *rp,
$ap="%rsi"; # const BN_ULONG *ap,
`$ENV{CC} -v 2>&1` =~ /((?:clang|LLVM) version|based on LLVM) ([0-9]+\.[0-9]+)/ &&
$2>=3.0); # first version supporting AVX
+$ymm=1 if ($xmm && !$ymm &&
+ `$ENV{CC} -x c /dev/null -dM -E|grep __clang_major__` =~ /#define __clang_major__.([0-9]+)/ &&
+ $1>=11); #icx started with clang 11
+
$a="eax";
($b,$b_)=("ebx","ebp");
($c,$c_)=("ecx","esi");
$avx = ($2>=3.0) + ($2>3.0);
}
+if (!$avx && `$ENV{CC} -x c /dev/null -dM -E|grep __clang_major__`
+ =~ /#define __clang_major__.([0-9]+)/) {
+ if ($1) {
+ $avx = ($1>=11); #icx started with clang 11
+ }
+}
+
open OUT,"| \"$^X\" \"$xlate\" $flavour \"$output\""
or die "can't call $xlate: $!";
*STDOUT=*OUT;
$addx = ($ver>=3.03);
}
+if (!$addx && `$ENV{CC} -x c /dev/null -dM -E|grep __clang_major__`
+ =~ /#define __clang_major__.([0-9]+)/) {
+ if ($1) {
+ $avx = ($1>=11); #icx started with clang 11
+ $addx = ($1>=11);
+ }
+}
+
$code.=<<___;
.text
.extern OPENSSL_ia32cap_P
$addx = ($ver>=3.03);
}
+if (!$addx && `$ENV{CC} -x c /dev/null -dM -E|grep __clang_major__`
+ =~ /#define __clang_major__.([0-9]+)/) {
+ if ($1) {
+ $addx = ($1>=11); #icx started with clang 11
+ }
+}
+
$code.=<<___;
.text
}
}
+if (!$avx512vaes && `$ENV{CC} -x c /dev/null -dM -E|grep __clang_major__`
+ =~ /#define __clang_major__.([0-9]+)/) {
+ if ($1) {
+ $avx512vaes = ($1>=11); #icx started with clang 11
+ }
+}
+
open OUT, "| \"$^X\" \"$xlate\" $flavour \"$output\""
or die "can't call $xlate: $!";
*STDOUT = *OUT;
$avx = ($2>=3.0) + ($2>3.0);
}
+if (!$avx && `$ENV{CC} -x c /dev/null -dM -E|grep __clang_major__`
+ =~ /#define __clang_major__.([0-9]+)/) {
+ if ($1) {
+ $avx = ($1>=11); #icx started with clang 11
+ }
+}
+
open OUT,"| \"$^X\" \"$xlate\" $flavour \"$output\""
or die "can't call $xlate: $!";
*STDOUT=*OUT;
$avx = ($2>=3.0) + ($2>3.0);
}
+if (!$avx && `$ENV{CC} -x c /dev/null -dM -E|grep __clang_major__`
+ =~ /#define __clang_major__.([0-9]+)/) {
+ if ($1) {
+ $avx = ($1>=11); #icx started with clang 11
+ }
+}
+
open OUT,"| \"$^X\" \"$xlate\" $flavour \"$output\""
or die "can't call $xlate: $!";
*STDOUT=*OUT;
if (!$avx && `$ENV{CC} -v 2>&1` =~ /((?:clang|LLVM) version|based on LLVM) ([0-9]+\.[0-9]+)/) {
$avx = ($2>=3.0) + ($2>3.0);
}
+
+ if (!$avx && `$ENV{CC} -x c /dev/null -dM -E|grep __clang_major__`
+ =~ /#define __clang_major__.([0-9]+)/) {
+ if ($1) {
+ $avx = ($1>=11); #icx started with clang 11
+ }
+ }
}
########################################################################
$avx = ($2>=3.0) + ($2>3.0);
}
+if (!$avx && `$ENV{CC} -x c /dev/null -dM -E|grep __clang_major__`
+ =~ /#define __clang_major__.([0-9]+)/) {
+ if ($1) {
+ $avx = ($1>=11); #icx started with clang 11
+ }
+}
+
open OUT,"| \"$^X\" \"$xlate\" $flavour \"$output\""
or die "can't call $xlate: $!";
*STDOUT=*OUT;
$ymm=1 if ($xmm && !$ymm && `$ENV{CC} -v 2>&1` =~ /((?:clang|LLVM) version|based on LLVM) ([0-9]+\.[0-9]+)/ &&
$2>=3.0); # first version supporting AVX
+$ymm=1 if ($xmm && !$ymm && `$ENV{CC} -x c /dev/null -dM -E|grep __clang_major__` =~ /#define __clang_major__.([0-9]+)/ &&
+ $1>=11); #icx started with clang 11
+
$shaext=$xmm; ### set to zero if compiling for 1.0.1
&external_label("OPENSSL_ia32cap_P") if ($xmm);
$avx = ($2>=3.0) + ($2>3.0);
}
+if (!$avx && `$ENV{CC} -x c /dev/null -dM -E|grep __clang_major__`
+ =~ /#define __clang_major__.([0-9]+)/) {
+ if ($1) {
+ $avx = ($1>=11); #icx started with clang 11
+ }
+}
+
open OUT,"| \"$^X\" \"$xlate\" $flavour \"$output\""
or die "can't call $xlate: $!";
*STDOUT=*OUT;
$avx = ($2>=3.0) + ($2>3.0);
}
+if (!$avx && `$ENV{CC} -x c /dev/null -dM -E|grep __clang_major__`
+ =~ /#define __clang_major__.([0-9]+)/) {
+ if ($1) {
+ $avx = ($1>=11); #icx started with clang 11
+ }
+}
+
$shaext=1; ### set to zero if compiling for 1.0.1
$avx=1 if (!$shaext && $avx);
$avx = ($2>=3.0) + ($2>3.0);
}
+if ($xmm && !$avx && `$ENV{CC} -x c /dev/null -dM -E|grep __clang_major__`
+ =~ /#define __clang_major__.([0-9]+)/) {
+ if ($1) {
+ $avx = ($1>=11); #icx started with clang 11
+ }
+}
+
$shaext=$xmm; ### set to zero if compiling for 1.0.1
$unroll_after = 64*4; # If pre-evicted from L1P cache first spin of
$avx = ($2>=3.0) + ($2>3.0);
}
+if (!$avx && `$ENV{CC} -x c /dev/null -dM -E|grep __clang_major__`
+ =~ /#define __clang_major__.([0-9]+)/) {
+ if ($1) {
+ $avx = ($1>=11); #icx started with clang 11
+ }
+}
+
open OUT,"| \"$^X\" \"$xlate\" $flavour \"$output\""
or die "can't call $xlate: $!";
*STDOUT=*OUT;
$avx = ($2>=3.0) + ($2>3.0);
}
+if (!$avx && `$ENV{CC} -x c /dev/null -dM -E|grep __clang_major__`
+ =~ /#define __clang_major__.([0-9]+)/) {
+ if ($1) {
+ $avx = ($1>=11); #icx started with clang 11
+ }
+}
+
$shaext=1; ### set to zero if compiling for 1.0.1
$avx=1 if (!$shaext && $avx);