From 83f323021530b11679bf2d029c9e4c43cf64808f Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Fri, 17 Jan 2025 10:39:38 -0800 Subject: [PATCH] crc-x86_64: port to old GCC compilers MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit * 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. --- ChangeLog | 6 ++++++ m4/crc-x86_64.m4 | 2 ++ 2 files changed, 8 insertions(+) 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"); } ]]) -- 2.39.5