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

Marc Glisse <glisse at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |glisse at gcc dot gnu.org

--- Comment #38 from Marc Glisse <glisse at gcc dot gnu.org> ---
(hello, just passing by)

(In reply to Jakub Jelinek from comment #33)
> The __m512 type is really meant to be only used in AVX512F and later code,
> like __m256 is meant to be only used in AVX and later code and __m128 in SSE
> and later code,

Makes sense, and indeed for a long time it wasn't even defined without the
relevant -march flag.

> if you use it for something else, it behaves as a standard
> GNU vector_size attribute extension.

Was that done on purpose, or is it an accidental consequence of the change to
allow intrinsics in functions with a target attribute? Are you aware of any
legitimate use of __m512 (obtained by including the intrinsic header) where the
user actually wants the generic GNU vector behavior?

> There is a warning when passing the generic vectors wider than hw sizes which 
> have hw size in newer ISAs as function arguments or returning them.

Would it make sense to have a warning for *any* use of __m512 in a function
that isn't for the appropriate target (whatever the technical mean to achieve
that, maybe a new attribute saying that the type must match the hardware, so
the warning can distinguish __m512 from user-defined types)? As you mention, it
isn't meant to be used there. And if it isn't going to behave as users expect,
a warning or error would be more helpful.

(Personally, I'd be in favor of adding the alignment attribute like clang does,
it shouldn't affect the uses with valid target (we don't mangle the alignment
in the type or use it for type equality), and I don't think anyone uses __m512
correctly without the right target. But since this was rejected, the warning
would be a compromise)

Reply via email to