Skip to content

Commit c71a9b2

Browse files
DiamonDinoiaserge-sans-paille
authored andcommitted
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.
1 parent 82a37aa commit c71a9b2

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

include/xsimd/arch/xsimd_avx_128.hpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -210,13 +210,15 @@ namespace xsimd
210210
template <class A, uint32_t V0, uint32_t V1, uint32_t V2, uint32_t V3>
211211
XSIMD_INLINE batch<float, A> swizzle(batch<float, A> const& self, batch_constant<uint32_t, A, V0, V1, V2, V3>, requires_arch<avx_128>) noexcept
212212
{
213-
return _mm_permute_ps(self, detail::mod_shuffle(V0, V1, V2, V3));
213+
constexpr auto mask = detail::mod_shuffle(V0, V1, V2, V3);
214+
return _mm_permute_ps(self, mask);
214215
}
215216

216217
template <class A, uint32_t V0, uint32_t V1>
217218
XSIMD_INLINE batch<double, A> swizzle(batch<double, A> const& self, batch_constant<uint64_t, A, V0, V1>, requires_arch<avx_128>) noexcept
218219
{
219-
return _mm_permute_pd(self, detail::mod_shuffle(V0, V1));
220+
constexpr auto mask = detail::mod_shuffle(V0, V1);
221+
return _mm_permute_pd(self, mask);
220222
}
221223

222224
}

0 commit comments

Comments
 (0)