https://gcc.gnu.org/bugzilla/show_bug.cgi?id=122818

--- Comment #6 from Matthias Kretz (Vir) <mkretz at gcc dot gnu.org> ---
> I wasn't aware of the ABI guarantees, but do they have to be respected
> within the same function?

Sure, the ABI guarantee is unnecessary inside a single function. However, the
simd_mask type has no way of knowing enough of its context to transparently
morph into something more efficient. Therefore this behavior is part of the
type and only the optimizer could undo the unnecessary work.

> Because deduce only works when the size matches,
> but with -msse4.2 the issue appears again.

Yes. I did not implement a more efficient ABI for std::experimental::simd.
Otherwise, deduce_t would be able to provide something better.

> I'm not a C++ expert so I might not be aware what an ABI guarantee implies
> for code generation, including within the same unit.

It means that the way objects of this type are passed to/from functions is
independent of compiler flags. native_simd<int> obviously changes with -march
and is therefore not ABI "stable" in that sense.

Reply via email to