x86_64 assembly pack: allow clang to compile AVX code.

This commit is contained in:
Andy Polyakov 2014-06-24 08:24:25 +02:00
parent 015364baf3
commit ac171925ab
12 changed files with 44 additions and 0 deletions

View file

@ -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;

View file

@ -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

View file

@ -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);

View file

@ -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;

View file

@ -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;

View file

@ -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;

View file

@ -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);

View file

@ -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;

View file

@ -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);

View file

@ -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

View file

@ -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;

View file

@ -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);