From 80ec0ef3620e2830afca8645530a32117f5cfe63 Mon Sep 17 00:00:00 2001 From: Marco Barbone Date: Wed, 22 Jul 2026 12:10:26 -0400 Subject: [PATCH] fix: bind swizzle shuffle mask to constexpr for gcc-15 g++-15 rejects a constexpr helper call passed inline to _mm_permute_ps/ _mm_permute_pd ('the last argument must be an 8-bit immediate'). Bind the mod_shuffle result to a constexpr local first, matching the convention used at every other call site in the codebase. --- include/xsimd/arch/xsimd_avx_128.hpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/include/xsimd/arch/xsimd_avx_128.hpp b/include/xsimd/arch/xsimd_avx_128.hpp index 4877b4ba5..b9430cab4 100644 --- a/include/xsimd/arch/xsimd_avx_128.hpp +++ b/include/xsimd/arch/xsimd_avx_128.hpp @@ -210,13 +210,15 @@ namespace xsimd template XSIMD_INLINE batch swizzle(batch const& self, batch_constant, requires_arch) noexcept { - return _mm_permute_ps(self, detail::mod_shuffle(V0, V1, V2, V3)); + constexpr auto mask = detail::mod_shuffle(V0, V1, V2, V3); + return _mm_permute_ps(self, mask); } template XSIMD_INLINE batch swizzle(batch const& self, batch_constant, requires_arch) noexcept { - return _mm_permute_pd(self, detail::mod_shuffle(V0, V1)); + constexpr auto mask = detail::mod_shuffle(V0, V1); + return _mm_permute_pd(self, mask); } }