aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJussi Kivilinna <[email protected]>2022-03-12 10:28:20 +0200
committerJussi Kivilinna <[email protected]>2022-03-12 10:28:20 +0200
commita0db0a121571129b7149e51e98e5fbc6e35413e8 (patch)
treedd7b8d84c2b567a0e6855d34c6da0609e8687ce6
parent089223aa3b554e5c9a07d9176470308dab10ac8a (diff)
downloadlibgcrypt-a0db0a121571129b7149e51e98e5fbc6e35413e8.tar.gz
libgcrypt-a0db0a121571129b7149e51e98e5fbc6e35413e8.tar.bz2
libgcrypt-a0db0a121571129b7149e51e98e5fbc6e35413e8.zip
Fix building sha512-avx512 with clang
* cipher/sha512-avx512-amd64.S (_gcry_sha512_transform_amd64_avx512): Change "%xmm??" registers to "xmm??" for clear_reg parameter. * configure.ac (gcry_cv_gcc_inline_asm_avx512): Check support for registers in range "zmm16-zmm31". -- Signed-off-by: Jussi Kivilinna <[email protected]>
-rw-r--r--cipher/sha512-avx512-amd64.S14
-rw-r--r--configure.ac3
2 files changed, 10 insertions, 7 deletions
diff --git a/cipher/sha512-avx512-amd64.S b/cipher/sha512-avx512-amd64.S
index 317f3e5c..c0fdbc33 100644
--- a/cipher/sha512-avx512-amd64.S
+++ b/cipher/sha512-avx512-amd64.S
@@ -382,13 +382,13 @@ _gcry_sha512_transform_amd64_avx512:
vmovdqa [rsp + frame_XFER + 1*32], ymm0 /* burn stack */
vmovdqa [rsp + frame_XFER + 2*32], ymm0 /* burn stack */
vmovdqa [rsp + frame_XFER + 3*32], ymm0 /* burn stack */
- clear_reg(%xmm16);
- clear_reg(%xmm17);
- clear_reg(%xmm18);
- clear_reg(%xmm19);
- clear_reg(%xmm20);
- clear_reg(%xmm21);
- clear_reg(%xmm22);
+ clear_reg(xmm16);
+ clear_reg(xmm17);
+ clear_reg(xmm18);
+ clear_reg(xmm19);
+ clear_reg(xmm20);
+ clear_reg(xmm21);
+ clear_reg(xmm22);
/* Restore Stack Pointer */
mov rsp, RSP_SAVE
diff --git a/configure.ac b/configure.ac
index cf255bf3..b41322e3 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1567,6 +1567,9 @@ AC_CACHE_CHECK([whether GCC inline assembler supports AVX512 instructions],
[[void a(void) {
__asm__("xgetbv; vpopcntq %%zmm7, %%zmm1%{%%k1%}%{z%};\n\t":::"cc");
__asm__("vpexpandb %%zmm3, %%zmm1;\n\t":::"cc");
+ __asm__("vpxorq %%xmm22, %%xmm22, %%xmm22;\n\t":::"cc");
+ __asm__("vpxorq %%ymm22, %%ymm22, %%ymm22;\n\t":::"cc");
+ __asm__("vpxorq %%zmm22, %%zmm22, %%zmm22;\n\t":::"cc");
}]], [ a(); ] )],
[gcry_cv_gcc_inline_asm_avx512=yes])
fi])