summaryrefslogtreecommitdiffstats
path: root/crypto/sha/asm/sha512-x86_64.pl
diff options
context:
space:
mode:
authorAndy Polyakov <appro@openssl.org>2014-06-12 21:45:41 +0200
committerAndy Polyakov <appro@openssl.org>2014-06-12 21:45:41 +0200
commit977f32e85241cba8be53e44dade32231e8a91718 (patch)
treeae76df809dd4f5b5696ad6abae14ac3dc5c922fd /crypto/sha/asm/sha512-x86_64.pl
parentAdded OPENSSL_assert check as per PR#3377 reported by Rainer Jung <rainer.jun... (diff)
downloadopenssl-977f32e85241cba8be53e44dade32231e8a91718.tar.xz
openssl-977f32e85241cba8be53e44dade32231e8a91718.zip
Facilitate back-porting of AESNI and SHA modules.
Fix SEH and stack handling in Win64 build.
Diffstat (limited to '')
-rwxr-xr-xcrypto/sha/asm/sha512-x86_64.pl11
1 files changed, 8 insertions, 3 deletions
diff --git a/crypto/sha/asm/sha512-x86_64.pl b/crypto/sha/asm/sha512-x86_64.pl
index 01698c40cf..0556a8f36a 100755
--- a/crypto/sha/asm/sha512-x86_64.pl
+++ b/crypto/sha/asm/sha512-x86_64.pl
@@ -123,6 +123,9 @@ if (!$avx && $win64 && ($flavour =~ /masm/ || $ENV{ASM} =~ /ml64/) &&
$avx = ($1>=10) + ($1>=11);
}
+$shaext=1; ### set to zero if compiling for 1.0.1
+$avx=1 if (!$shaext && $avx);
+
open OUT,"| \"$^X\" $xlate $flavour $output";
*STDOUT=*OUT;
@@ -259,7 +262,7 @@ $code.=<<___ if ($SZ==4 || $avx);
mov 4(%r11),%r10d
mov 8(%r11),%r11d
___
-$code.=<<___ if ($SZ==4);
+$code.=<<___ if ($SZ==4 && $shaext);
test \$`1<<29`,%r11d # check for SHA
jnz _shaext_shortcut
___
@@ -518,7 +521,7 @@ ___
######################################################################
# SIMD code paths
#
-if ($SZ==4) {{{
+if ($SZ==4 && $shaext) {{{
######################################################################
# Intel SHA Extensions implementation of SHA256 update function.
#
@@ -2295,10 +2298,12 @@ shaext_handler:
.rva .LSEH_end_$func
.rva .LSEH_info_$func
___
-$code.=<<___ if ($SZ==4);
+$code.=<<___ if ($SZ==4 && $shext);
.rva .LSEH_begin_${func}_shaext
.rva .LSEH_end_${func}_shaext
.rva .LSEH_info_${func}_shaext
+___
+$code.=<<___ if ($SZ==4);
.rva .LSEH_begin_${func}_ssse3
.rva .LSEH_end_${func}_ssse3
.rva .LSEH_info_${func}_ssse3