Avoid clobbering non-volatile XMM registers
authorBernd Edlinger <bernd.edlinger@hotmail.de>
Tue, 22 Aug 2023 14:07:30 +0000 (16:07 +0200)
committerBernd Edlinger <bernd.edlinger@hotmail.de>
Sat, 2 Sep 2023 08:28:52 +0000 (10:28 +0200)
This affects some Poly1305 assembler functions
which are only used for certain CPU types.

Remove those functions for Windows targets,
as a simple interim solution.

Fixes #21522

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/21808)

(cherry picked from commit 7b8e27bc2e02238986d89ef0ece067ec1b48e165)

crypto/poly1305/asm/poly1305-x86_64.pl

index fa9bfb7a7b814c6051c78986581e7c2b3400a93c..24bab9d0bcf950711611ddcb5414b548b16f5cb0 100755 (executable)
@@ -195,7 +195,7 @@ $code.=<<___        if ($avx>1);
        bt      \$`5+32`,%r9            # AVX2?
        cmovc   %rax,%r10
 ___
-$code.=<<___   if ($avx>3);
+$code.=<<___   if ($avx>3 && !$win64);
        mov     \$`(1<<31|1<<21|1<<16)`,%rax
        shr     \$32,%r9
        and     %rax,%r9
@@ -2724,7 +2724,7 @@ $code.=<<___;
 .cfi_endproc
 .size  poly1305_blocks_avx512,.-poly1305_blocks_avx512
 ___
-if ($avx>3) {
+if ($avx>3 && !$win64) {
 ########################################################################
 # VPMADD52 version using 2^44 radix.
 #