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

--- Comment #2 from Matthias Kretz <kretz at kde dot org> ---
Ah, because of:

typedef int __m64 __attribute__ ((__vector_size__ (8), __may_alias__));

? Too be pedantic only `int [[gnu::vector_size(8)]]` equals __m64. But I see
your point.

I guess clang interprets the optional nature of __m64 to mean that they can
pass vector_size(8) objects on the stack? (aka, there's no __m64 here)

But then 2.2.1 says "Therefore, every function that uses the MMX registers is
required to issue an emms or femms instruction after using MMX registers,
before returning or calling another function."
This is in contradiction to Table 2.4 which requires __m64 to be returned via
%mm0. Calling emms before ret would invalidate the return value. I.e. the ABI
must require callers of functions that return via %mm0 to call emms.

Am I reading this wrong, or is the ABI broken here?

Note, I am fine with a wontfix. Just want to be extra clear about the design
decision here.

Reply via email to