summaryrefslogtreecommitdiffstats
path: root/crypto/bn
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:26:03 +0200
commit377551b9c4e12aa7846f4d80cf3604f2e396c964 (patch)
tree8603d2669c0af5b9dea93f22874a16f21e916d79 /crypto/bn
parent361fd136e9d960b05e7596b9a1786852522a8cd3 (diff)
x86_64 assembly pack: refine clang detection.
(cherry picked from commit a356e488ad50ca9de3fc4955839441c5aff11ed3) Resolved conflicts: crypto/bn/asm/rsaz-avx2.pl
Diffstat (limited to 'crypto/bn')
-rwxr-xr-xcrypto/bn/asm/rsaz-avx2.pl6
-rwxr-xr-xcrypto/bn/asm/rsaz-x86_64.pl5
2 files changed, 9 insertions, 2 deletions
diff --git a/crypto/bn/asm/rsaz-avx2.pl b/crypto/bn/asm/rsaz-avx2.pl
index 59727ef0af..59e394dda6 100755
--- a/crypto/bn/asm/rsaz-avx2.pl
+++ b/crypto/bn/asm/rsaz-avx2.pl
@@ -93,8 +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);
+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");