summaryrefslogtreecommitdiffstats
path: root/crypto/bn/asm
diff options
context:
space:
mode:
authorAndy Polyakov <appro@openssl.org>2014-06-28 17:23:21 +0200
committerAndy Polyakov <appro@openssl.org>2014-06-28 17:23:21 +0200
commita356e488ad50ca9de3fc4955839441c5aff11ed3 (patch)
treec91932bc8cfa2a0d38e0c1e7e1a2b1965c490f1b /crypto/bn/asm
parent7c206db9280865ae4af352dbc14e9019a6c4795d (diff)
x86_64 assembly pack: refine clang detection.
Diffstat (limited to 'crypto/bn/asm')
-rwxr-xr-xcrypto/bn/asm/rsaz-avx2.pl7
-rwxr-xr-xcrypto/bn/asm/rsaz-x86_64.pl5
2 files changed, 9 insertions, 3 deletions
diff --git a/crypto/bn/asm/rsaz-avx2.pl b/crypto/bn/asm/rsaz-avx2.pl
index 931dd5a7d2..59e394dda6 100755
--- a/crypto/bn/asm/rsaz-avx2.pl
+++ b/crypto/bn/asm/rsaz-avx2.pl
@@ -93,9 +93,10 @@ if (!$avx && $win64 && ($flavour =~ /masm/ || $ENV{ASM} =~ /ml64/) &&
$addx = ($1>=11);
}
-if (!$avx && `$ENV{CC} -v 2>&1` =~ /LLVM ([3-9]\.[0-9]+)/) {
- $avx = ($1>=3.0) + ($1>=3.1);
- $addx = 0;
+if (!$avx && `$ENV{CC} -v 2>&1` =~ /(^clang version|based on LLVM) ([3-9])\.([0-9]+)/) {
+ my $ver = $2 + $3/100.0; # 3.1->3.01, 3.10->3.10
+ $avx = ($ver>=3.0) + ($ver>=3.01);
+ $addx = ($ver>=3.03);
}
open OUT,"| $^X $xlate $flavour $output";
diff --git a/crypto/bn/asm/rsaz-x86_64.pl b/crypto/bn/asm/rsaz-x86_64.pl
index 120b473492..cd651f7e78 100755
--- a/crypto/bn/asm/rsaz-x86_64.pl
+++ b/crypto/bn/asm/rsaz-x86_64.pl
@@ -113,6 +113,11 @@ if (!$addx && $win64 && ($flavour =~ /masm/ || $ENV{ASM} =~ /ml64/) &&
$addx = ($1>=11);
}
+if (!$addx && `$ENV{CC} -v 2>&1` =~ /(^clang version|based on LLVM) ([3-9])\.([0-9]+)/) {
+ my $ver = $2 + $3/100.0; # 3.1->3.01, 3.10->3.10
+ $addx = ($ver>=3.03);
+}
+
($out, $inp, $mod) = ("%rdi", "%rsi", "%rbp"); # common internal API
{
my ($out,$inp,$mod,$n0,$times) = ("%rdi","%rsi","%rdx","%rcx","%r8d");