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); } }