From: rainerjung Date: Mon, 8 Sep 2025 22:10:40 +0000 (+0200) Subject: Update sha512-x86_64.pl X-Git-Tag: 4.0-PRE-CLANG-FORMAT-WEBKIT~247 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=241d4826f8ee39c92d9b3233146c3e12314871ec;p=thirdparty%2Fopenssl.git Update sha512-x86_64.pl Do not use new assembler code for CPUs with SHA512 support in case the assembler only supports avx but not avx2. Reviewed-by: Shane Lontis Reviewed-by: Paul Dale (Merged from https://github.com/openssl/openssl/pull/28488) --- diff --git a/crypto/sha/asm/sha512-x86_64.pl b/crypto/sha/asm/sha512-x86_64.pl index cdc585c902c..029468db9ff 100755 --- a/crypto/sha/asm/sha512-x86_64.pl +++ b/crypto/sha/asm/sha512-x86_64.pl @@ -574,7 +574,9 @@ $TABLE: .quad 0x0001020304050607,0x08090a0b0c0d0e0f .quad 0x0001020304050607,0x08090a0b0c0d0e0f .asciz "SHA512 block transform for x86_64, CRYPTOGAMS by " +___ +$code.=<<___ if ($avx>1); # $K512 duplicates data every 16 bytes. # The Intel(R) SHA512 implementation requires reads of 32 consecutive bytes. .align 64 @@ -620,6 +622,8 @@ ${TABLE}_single: .quad 0x3c9ebe0a15c9bebc, 0x431d67c49c100d4c .quad 0x4cc5d4becb3e42b6, 0x597f299cfc657e2a .quad 0x5fcb6fab3ad6faec, 0x6c44198c4a475817 +___ +$code.=<<___; .previous ___ } @@ -2379,7 +2383,7 @@ ___ }} }}}}} -if ($SZ==8) { +if ($SZ==8 && $avx>1) { $code.=<<___; .type ${func}_sha512ext,\@function,3 .align 64