提交 f6ff1aa8 编写于 作者: A Andy Polyakov

sha512-x86_64.pl: revert previous change and solve the problem through

perlasm/x86_64-xlate.pl instead.
上级 3a5485a9
...@@ -772,6 +772,45 @@ my $rdrand = sub { ...@@ -772,6 +772,45 @@ my $rdrand = sub {
} }
}; };
sub rxb {
local *opcode=shift;
my ($dst,$src1,$src2,$rxb)=@_;
$rxb|=0x7<<5;
$rxb&=~(0x04<<5) if($dst>=8);
$rxb&=~(0x01<<5) if($src1>=8);
$rxb&=~(0x02<<5) if($src2>=8);
push @opcode,$rxb;
}
my $vprotd = sub {
if (shift =~ /\$([x0-9a-f]+),\s*%xmm([0-9]+),\s*%xmm([0-9]+)/) {
my @opcode=(0x8f);
rxb(\@opcode,$3,$2,-1,0x08);
push @opcode,0x78,0xc2;
push @opcode,0xc0|($2&7)|(($3&7)<<3); # ModR/M
my $c=$1;
push @opcode,$c=~/^0/?oct($c):$c;
@opcode;
} else {
();
}
};
my $vprotq = sub {
if (shift =~ /\$([x0-9a-f]+),\s*%xmm([0-9]+),\s*%xmm([0-9]+)/) {
my @opcode=(0x8f);
rxb(\@opcode,$3,$2,-1,0x08);
push @opcode,0x78,0xc3;
push @opcode,0xc0|($2&7)|(($3&7)<<3); # ModR/M
my $c=$1;
push @opcode,$c=~/^0/?oct($c):$c;
@opcode;
} else {
();
}
};
if ($nasm) { if ($nasm) {
print <<___; print <<___;
default rel default rel
......
...@@ -95,13 +95,13 @@ die "can't locate x86_64-xlate.pl"; ...@@ -95,13 +95,13 @@ die "can't locate x86_64-xlate.pl";
$avx=1 if (`$ENV{CC} -Wa,-v -c -o /dev/null -x assembler /dev/null 2>&1` $avx=1 if (`$ENV{CC} -Wa,-v -c -o /dev/null -x assembler /dev/null 2>&1`
=~ /GNU assembler version ([2-9]\.[0-9]+)/ && =~ /GNU assembler version ([2-9]\.[0-9]+)/ &&
(($xop = $1>=2.21) || $1>=2.19)); $1>=2.19);
$avx=1 if (!$avx && $win64 && ($flavour =~ /nasm/ || $ENV{ASM} =~ /nasm/) && $avx=1 if (!$avx && $win64 && ($flavour =~ /nasm/ || $ENV{ASM} =~ /nasm/) &&
`nasm -v 2>&1` =~ /NASM version ([2-9]\.[0-9]+)/ && `nasm -v 2>&1` =~ /NASM version ([2-9]\.[0-9]+)/ &&
($xop = $1>=2.09)); $1>=2.09);
$avx=1 if (!$avx && $win64 && ($flavour =~ /masm/ || $ENV{ASM} =~ /ml64/) && $avx=1 if (!$avx && $win64 && ($flavour =~ /masm/ || $ENV{ASM} =~ /ml64/) &&
`ml64 2>&1` =~ /Version ([0-9]+)\./ && `ml64 2>&1` =~ /Version ([0-9]+)\./ &&
($xop = $1>=10)); $1>=10);
open STDOUT,"| \"$^X\" $xlate $flavour $output"; open STDOUT,"| \"$^X\" $xlate $flavour $output";
...@@ -237,7 +237,7 @@ $code.=<<___ if ($SZ==4 || $avx); ...@@ -237,7 +237,7 @@ $code.=<<___ if ($SZ==4 || $avx);
mov 0(%r11),%r10d mov 0(%r11),%r10d
mov 4(%r11),%r11d mov 4(%r11),%r11d
___ ___
$code.=<<___ if ($avx && $xop && $SZ==8); $code.=<<___ if ($avx && $SZ==8);
test \$`1<<11`,%r11d # check for XOP test \$`1<<11`,%r11d # check for XOP
jnz .Lxop_shortcut jnz .Lxop_shortcut
___ ___
...@@ -824,7 +824,7 @@ if ($avx) {{ ...@@ -824,7 +824,7 @@ if ($avx) {{
###################################################################### ######################################################################
# XOP code path # XOP code path
# #
if ($xop && $SZ==8) { # SHA512 only if ($SZ==8) { # SHA512 only
$code.=<<___; $code.=<<___;
.type ${func}_xop,\@function,4 .type ${func}_xop,\@function,4
.align 64 .align 64
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册