Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/boringssl.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam Langley <agl@chromium.org>2014-07-25 04:28:34 +0400
committerAdam Langley <agl@chromium.org>2014-07-29 04:05:13 +0400
commit2811da2ecaf125511349d13d5fd7e1fa74e1a914 (patch)
treef19d832fd9b22c3eba373334c9f47b4a3517caa3 /crypto/bn/asm
parentb351d8387525053963d00d867bb18996916b73f6 (diff)
x86_64 assembly pack: allow clang to compile AVX code.
(Imported from upstream's 912f08dd5ed4f68fb275f3b2db828349fcffba14, 52f856526c46ee80ef4c8c37844f084423a3eff7 and 377551b9c4e12aa7846f4d80cf3604f2e396c964) Change-Id: Ic2bf93371f6d246818729810e7a45b3f0021845a
Diffstat (limited to 'crypto/bn/asm')
-rw-r--r--crypto/bn/asm/rsaz-avx2.pl6
-rw-r--r--crypto/bn/asm/rsaz-x86_64.pl5
2 files changed, 11 insertions, 0 deletions
diff --git a/crypto/bn/asm/rsaz-avx2.pl b/crypto/bn/asm/rsaz-avx2.pl
index 85e1ce91..59e394dd 100644
--- a/crypto/bn/asm/rsaz-avx2.pl
+++ b/crypto/bn/asm/rsaz-avx2.pl
@@ -93,6 +93,12 @@ if (!$avx && $win64 && ($flavour =~ /masm/ || $ENV{ASM} =~ /ml64/) &&
$addx = ($1>=11);
}
+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";
*STDOUT = *OUT;
diff --git a/crypto/bn/asm/rsaz-x86_64.pl b/crypto/bn/asm/rsaz-x86_64.pl
index 120b4734..cd651f7e 100644
--- 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");