Skip to content

Fix gcc-15 'must be an 8-bit immediate' in avx_128 swizzle#1387

Merged
serge-sans-paille merged 1 commit into
xtensor-stack:masterfrom
DiamonDinoia:fix-gcc15-swizzle-immediate
Jul 22, 2026
Merged

Fix gcc-15 'must be an 8-bit immediate' in avx_128 swizzle#1387
serge-sans-paille merged 1 commit into
xtensor-stack:masterfrom
DiamonDinoia:fix-gcc15-swizzle-immediate

Conversation

@DiamonDinoia

@DiamonDinoia DiamonDinoia commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

g++-15 rejects a constexpr helper call passed inline to _mm_permute_ps/_mm_permute_pd:

error: the last argument must be an 8-bit immediate

It refuses to constant-fold a constexpr function call directly at a builtin immediate operand unless the value is first bound to a constexpr object. Every other detail::mod_shuffle / detail::shuffle call site in the codebase already does this; these two swizzle overloads in xsimd_avx_128.hpp were the only inline exceptions.

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.
@serge-sans-paille
serge-sans-paille merged commit c71a9b2 into xtensor-stack:master Jul 22, 2026
87 checks passed
@serge-sans-paille

Copy link
Copy Markdown
Contributor

thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants