Include _mm512_zextsi128_si512() in AVX-512 configure probes.
authorTom Lane <[email protected]>
Mon, 23 Jun 2025 15:50:21 +0000 (11:50 -0400)
committerTom Lane <[email protected]>
Mon, 23 Jun 2025 15:50:21 +0000 (11:50 -0400)
Commit 43da39430 added a dependency on this intrinsic to our
AVX-512 CRC code.  It turns out this intrinsic was added to
gcc later than the other ones we were using, so that there
are platforms where the new code fails to compile.  Since only
relatively old (pre-gcc-10) compilers are affected, it doesn't
seem worth trying to make the AVX-512 CRC code actually work
on these platforms.  Just add the new intrinsic to the configure
probe, so that we'll conclude the code can't be built.

Author: Tom Lane <[email protected]>
Reviewed-by: Nathan Bossart <[email protected]>
Discussion: https://postgr.es/m/3350336.1750690281@sss.pgh.pa.us

config/c-compiler.m4
configure
meson.build

index 5f3e1d1faf93050030a780bb6a9741b64a1abdb8..da40bd6a64755d5fa665ba4668134e10bd5dc7bd 100644 (file)
@@ -602,6 +602,7 @@ AC_CACHE_CHECK([for _mm512_clmulepi64_epi128], [Ac_cachevar],
     {
       __m128i z;
 
+      x = _mm512_xor_si512(_mm512_zextsi128_si512(_mm_cvtsi32_si128(0)), x);
       y = _mm512_clmulepi64_epi128(x, y, 0);
       z = _mm_ternarylogic_epi64(
                 _mm512_castsi512_si128(y),
index 4f15347cc95031440ac5693cc4c59b9abfa43c23..3d3d3db97a456cfb440f26911a4e5e79d7c0eeab 100755 (executable)
--- a/configure
+++ b/configure
@@ -18227,6 +18227,7 @@ else
     {
       __m128i z;
 
+      x = _mm512_xor_si512(_mm512_zextsi128_si512(_mm_cvtsi32_si128(0)), x);
       y = _mm512_clmulepi64_epi128(x, y, 0);
       z = _mm_ternarylogic_epi64(
                 _mm512_castsi512_si128(y),
index 474763ad19f0cf1d2259501ff8bb19d854f509d3..6ffe7b47275569faca5b34b31ae8b67c70e2457c 100644 (file)
@@ -2465,6 +2465,7 @@ int main(void)
 {
      __m128i z;
 
+    x = _mm512_xor_si512(_mm512_zextsi128_si512(_mm_cvtsi32_si128(0)), x);
     y = _mm512_clmulepi64_epi128(x, y, 0);
     z = _mm_ternarylogic_epi64(
             _mm512_castsi512_si128(y),