diff --git a/crypto/aes/asm/aesni-mb-x86_64.pl b/crypto/aes/asm/aesni-mb-x86_64.pl index ddfe084cc78b9573981d85c79de0bc4882a65328..d6ee86608764cdb2ff01f4e52be3e9bac895ddec 100644 --- a/crypto/aes/asm/aesni-mb-x86_64.pl +++ b/crypto/aes/asm/aesni-mb-x86_64.pl @@ -63,6 +63,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/aes/asm/aesni-sha1-x86_64.pl b/crypto/aes/asm/aesni-sha1-x86_64.pl index 7f253750f3f41554b305284807bf3f2449d23b93..92f34618d487d04186c2c32e80e5ba13b11273cc 100644 --- a/crypto/aes/asm/aesni-sha1-x86_64.pl +++ b/crypto/aes/asm/aesni-sha1-x86_64.pl @@ -94,6 +94,7 @@ $avx=1 if (!$avx && $win64 && ($flavour =~ /nasm/ || $ENV{ASM} =~ /nasm/) && $avx=1 if (!$avx && $win64 && ($flavour =~ /masm/ || $ENV{ASM} =~ /ml64/) && `ml64 2>&1` =~ /Version ([0-9]+)\./ && $1>=10); +$avx=1 if (!$avx && `$ENV{CC} -v` =~ /LLVM ([3-9]\.[0-9]+)/ && $1>=3.0); $shaext=1; ### set to zero if compiling for 1.0.1 diff --git a/crypto/aes/asm/aesni-sha256-x86_64.pl b/crypto/aes/asm/aesni-sha256-x86_64.pl index 6225561a8fea2e5a73c44dd5c3b4c105f9012ab6..96b44f340eb8106ab685e62c60baa16ae920e44c 100644 --- a/crypto/aes/asm/aesni-sha256-x86_64.pl +++ b/crypto/aes/asm/aesni-sha256-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); +} + $shaext=$avx; ### set to zero if compiling for 1.0.1 $avx=1 if (!$shaext && $avx); diff --git a/crypto/bn/asm/rsaz-avx2.pl b/crypto/bn/asm/rsaz-avx2.pl index 3eb95569fb6b7e6cf481dae7aea783069e13fe1e..f76ab609d1ccb8a94dfa00b6e67a83509f955f56 100755 --- a/crypto/bn/asm/rsaz-avx2.pl +++ b/crypto/bn/asm/rsaz-avx2.pl @@ -90,6 +90,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/modes/asm/aesni-gcm-x86_64.pl b/crypto/modes/asm/aesni-gcm-x86_64.pl index 3781933917227dd127352fa8d7d066804dacba13..1ac6b5b8458a8a5b164661683fa4e03bfc2aa65c 100644 --- a/crypto/modes/asm/aesni-gcm-x86_64.pl +++ b/crypto/modes/asm/aesni-gcm-x86_64.pl @@ -53,6 +53,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/modes/asm/ghash-x86_64.pl b/crypto/modes/asm/ghash-x86_64.pl index f1aca3e5343157e4e67792b64b3a303a2e0b175c..f88af159950fd5744eba37e88d6d9e42854e6ac2 100644 --- a/crypto/modes/asm/ghash-x86_64.pl +++ b/crypto/modes/asm/ghash-x86_64.pl @@ -102,6 +102,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-586.pl b/crypto/sha/asm/sha1-586.pl index 81252a62e90565e79bc410d73fc12de1ed10133c..9d08a4cad434aff37fa20fa707a3cb44cd82413c 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 3a19029e5ee0fac30adb2705be31e682a9815342..88707a7e5d64d6c6b460fbb18da73350cfa29a93 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 9aa128ed3aef4218171952a895cd69bffd9eb2b5..6a68d96967950d7fd7d8ce523df8d12b675e5896 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 ee094a92147fa817380a89c7786a923e45da6596..75f792495cfa442755b2bbf3697b9b038ac6a5b7 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 ec870170320d3725b7715dcbd5e230bb668310cc..a332eef0a3a398d0bfee64befcb99316aa67e25a 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 0556a8f36a906356086deb3d0810b01a3f27eb25..4b16c5f5b7ae2f07309fcc26754a129654ec17ab 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);