From: Paul Eggert Date: Fri, 17 Jan 2025 18:39:38 +0000 (-0800) Subject: crc-x86_64: port to old GCC compilers X-Git-Url: https://gitweb.git.savannah.gnu.org/gitweb/?a=commitdiff_plain;h=83f323021530b11679bf2d029c9e4c43cf64808f;p=gnulib.git crc-x86_64: port to old GCC compilers * m4/crc-x86_64.m4 (gl_CRC_X86_64_PCLMUL): Check that the compiler supports __m128i_u, too, since we’re using the type now. Issue reported in the same message from Lasse Collin. --- diff --git a/ChangeLog b/ChangeLog index 3164c1c587..5796c80ae0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,11 @@ 2025-01-17 Paul Eggert + crc-x86_64: port to old GCC compilers + * m4/crc-x86_64.m4 (gl_CRC_X86_64_PCLMUL): + Check that the compiler supports __m128i_u, too, + since we’re using the type now. Issue reported in + the same message from Lasse Collin. + crc-x86_64: better fix for unaligned access Avoid undefined behavior in a way that doesn’t require the input buffer to be aligned. diff --git a/m4/crc-x86_64.m4 b/m4/crc-x86_64.m4 index 41b7b0fe05..b705d8c80c 100644 --- a/m4/crc-x86_64.m4 +++ b/m4/crc-x86_64.m4 @@ -23,6 +23,8 @@ AC_DEFUN([gl_CRC_X86_64_PCLMUL], __m128i a, b; a = _mm_clmulepi64_si128 (a, b, 0x00); a = _mm_shuffle_epi8 (a, b); + static __m128i_u u; + b = _mm_loadu_si128 (&u); return __builtin_cpu_supports ("pclmul"); } ]])