Author: jkim
Date: Mon May 16 19:10:35 2016
New Revision: 299964
URL: https://svnweb.freebsd.org/changeset/base/299964

Log:
  Detect Clang to support AVX instructions on x86 platforms.
  Note head (OpenSSL 1.0.2 branch) has similar changes.

Modified:
  stable/10/crypto/openssl/crypto/aes/asm/aesni-sha1-x86_64.pl
  stable/10/crypto/openssl/crypto/sha/asm/sha1-586.pl
  stable/10/crypto/openssl/crypto/sha/asm/sha1-x86_64.pl

Modified: stable/10/crypto/openssl/crypto/aes/asm/aesni-sha1-x86_64.pl
==============================================================================
--- stable/10/crypto/openssl/crypto/aes/asm/aesni-sha1-x86_64.pl        Mon May 
16 19:07:58 2016        (r299963)
+++ stable/10/crypto/openssl/crypto/aes/asm/aesni-sha1-x86_64.pl        Mon May 
16 19:10:35 2016        (r299964)
@@ -68,6 +68,7 @@ $avx=1 if (!$avx && $win64 && ($flavour 
 $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 2>&1` =~ /((?:^clang|LLVM) version|.*based on 
LLVM) ([3-9]\.[0-9]+)/ && $2>=3.0);
 
 open OUT,"| \"$^X\" $xlate $flavour $output";
 *STDOUT=*OUT;

Modified: stable/10/crypto/openssl/crypto/sha/asm/sha1-586.pl
==============================================================================
--- stable/10/crypto/openssl/crypto/sha/asm/sha1-586.pl Mon May 16 19:07:58 
2016        (r299963)
+++ stable/10/crypto/openssl/crypto/sha/asm/sha1-586.pl Mon May 16 19:10:35 
2016        (r299964)
@@ -116,6 +116,9 @@ $ymm=1 if ($xmm && !$ymm && $ARGV[0] eq 
                `nasm -v 2>&1` =~ /NASM version ([2-9]\.[0-9]+)/ &&
                $1>=2.03);      # first version supporting AVX
 
+$ymm=1 if ($xmm && !$ymm && `$ENV{CC} -v 2>&1` =~ /(^clang version|based on 
LLVM) ([3-9]\.[0-9]+)/ &&
+               $2>=3.0);       # first version supporting AVX
+
 &external_label("OPENSSL_ia32cap_P") if ($xmm);
 
 

Modified: stable/10/crypto/openssl/crypto/sha/asm/sha1-x86_64.pl
==============================================================================
--- stable/10/crypto/openssl/crypto/sha/asm/sha1-x86_64.pl      Mon May 16 
19:07:58 2016        (r299963)
+++ stable/10/crypto/openssl/crypto/sha/asm/sha1-x86_64.pl      Mon May 16 
19:10:35 2016        (r299964)
@@ -81,6 +81,8 @@ $avx=1 if (!$avx && $win64 && ($flavour 
 $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 2>&1` =~ /((?:^clang|LLVM) version|.*based on 
LLVM) ([3-9]\.[0-9]+)/ &&
+          $2>=3.0);
 
 open OUT,"| \"$^X\" $xlate $flavour $output";
 *STDOUT=*OUT;
_______________________________________________
[email protected] mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "[email protected]"

Reply via email to