summaryrefslogtreecommitdiffstats
path: root/crypto/sha
diff options
context:
space:
mode:
authorAndy Polyakov <appro@openssl.org>2014-06-24 08:24:25 +0200
committerAndy Polyakov <appro@openssl.org>2014-06-27 22:55:07 +0200
commit912f08dd5ed4f68fb275f3b2db828349fcffba14 (patch)
treede456b2669094d7018a5e28fa4112bef0b7f61d9 /crypto/sha
parent1067663d852435b1adff32ec01e9b8e54d2b5896 (diff)
x86_64 assembly pack: allow clang to compile AVX code.
(cherry picked from commit ac171925ab527a55fbb27872ff69af94f7ec995b)
Diffstat (limited to 'crypto/sha')
-rw-r--r--crypto/sha/asm/sha1-586.pl3
-rw-r--r--crypto/sha/asm/sha1-mb-x86_64.pl4
-rwxr-xr-xcrypto/sha/asm/sha1-x86_64.pl4
-rw-r--r--crypto/sha/asm/sha256-586.pl4
-rw-r--r--crypto/sha/asm/sha256-mb-x86_64.pl4
-rwxr-xr-xcrypto/sha/asm/sha512-x86_64.pl4
6 files changed, 23 insertions, 0 deletions
diff --git a/crypto/sha/asm/sha1-586.pl b/crypto/sha/asm/sha1-586.pl
index 81252a62e9..9d08a4cad4 100644
--- a/crypto/sha/asm/sha1-586.pl
+++ b/crypto/sha/asm/sha1-586.pl
@@ -128,6 +128,9 @@ $ymm=1 if ($xmm && !$ymm && $ARGV[0] eq "win32" &&
`ml 2>&1` =~ /Version ([0-9]+)\./ &&
$1>=10); # first version supporting AVX
+$ymm=1 if ($xmm && !$ymm && `$ENV{CC} -v` =~ /LLVM ([3-9]\.[0-9]+)/ &&
+ $1>=3.0); # first version supporting AVX
+
$shaext=$xmm; ### set to zero if compiling for 1.0.1
&external_label("OPENSSL_ia32cap_P") if ($xmm);
diff --git a/crypto/sha/asm/sha1-mb-x86_64.pl b/crypto/sha/asm/sha1-mb-x86_64.pl
index 3a19029e5e..88707a7e5d 100644
--- a/crypto/sha/asm/sha1-mb-x86_64.pl
+++ b/crypto/sha/asm/sha1-mb-x86_64.pl
@@ -58,6 +58,10 @@ if (!$avx && $win64 && ($flavour =~ /masm/ || $ENV{ASM} =~ /ml64/) &&
$avx = ($1>=10) + ($1>=11);
}
+if (!$avx && `$ENV{CC} -v` =~ /LLVM ([3-9]\.[0-9]+)/) {
+ $avx = ($1>=3.0) + ($1>=3.1);
+}
+
open OUT,"| \"$^X\" $xlate $flavour $output";
*STDOUT=*OUT;
diff --git a/crypto/sha/asm/sha1-x86_64.pl b/crypto/sha/asm/sha1-x86_64.pl
index 9aa128ed3a..6a68d96967 100755
--- a/crypto/sha/asm/sha1-x86_64.pl
+++ b/crypto/sha/asm/sha1-x86_64.pl
@@ -107,6 +107,10 @@ if (!$avx && $win64 && ($flavour =~ /masm/ || $ENV{ASM} =~ /ml64/) &&
$avx = ($1>=10) + ($1>=11);
}
+if (!$avx && `$ENV{CC} -v` =~ /LLVM ([2-9]\.[0-9]+)/) {
+ $avx = ($1>=3.0) + ($1>=3.1);
+}
+
$shaext=1; ### set to zero if compiling for 1.0.1
$avx=1 if (!$shaext && $avx);
diff --git a/crypto/sha/asm/sha256-586.pl b/crypto/sha/asm/sha256-586.pl
index ee094a9214..75f792495c 100644
--- a/crypto/sha/asm/sha256-586.pl
+++ b/crypto/sha/asm/sha256-586.pl
@@ -82,6 +82,10 @@ if ($xmm && !$avx && $ARGV[0] eq "win32" &&
$avx = ($1>=10) + ($1>=11);
}
+if ($xmm && !$avx && `$ENV{CC} -v` =~ /LLVM ([3-9]\.[0-9]+)/) {
+ $avx = ($1>=3.0) + ($1>=3.1);
+}
+
$shaext=$xmm; ### set to zero if compiling for 1.0.1
$unroll_after = 64*4; # If pre-evicted from L1P cache first spin of
diff --git a/crypto/sha/asm/sha256-mb-x86_64.pl b/crypto/sha/asm/sha256-mb-x86_64.pl
index ec87017032..a332eef0a3 100644
--- a/crypto/sha/asm/sha256-mb-x86_64.pl
+++ b/crypto/sha/asm/sha256-mb-x86_64.pl
@@ -59,6 +59,10 @@ if (!$avx && $win64 && ($flavour =~ /masm/ || $ENV{ASM} =~ /ml64/) &&
$avx = ($1>=10) + ($1>=11);
}
+if (!$avx && `$ENV{CC} -v` =~ /LLVM ([3-9]\.[0-9]+)/) {
+ $avx = ($1>=3.0) + ($1>=3.1);
+}
+
open OUT,"| \"$^X\" $xlate $flavour $output";
*STDOUT=*OUT;
diff --git a/crypto/sha/asm/sha512-x86_64.pl b/crypto/sha/asm/sha512-x86_64.pl
index 0556a8f36a..4b16c5f5b7 100755
--- a/crypto/sha/asm/sha512-x86_64.pl
+++ b/crypto/sha/asm/sha512-x86_64.pl
@@ -123,6 +123,10 @@ if (!$avx && $win64 && ($flavour =~ /masm/ || $ENV{ASM} =~ /ml64/) &&
$avx = ($1>=10) + ($1>=11);
}
+if (!$avx && `$ENV{CC} -v` =~ /LLVM ([3-9]\.[0-9]+)/) {
+ $avx = ($1>=3.0) + ($1>=3.1);
+}
+
$shaext=1; ### set to zero if compiling for 1.0.1
$avx=1 if (!$shaext && $avx);