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

--- Comment #3 from Uroš Bizjak <ubizjak at gmail dot com> ---
(In reply to Matthias Kretz from comment #2)

> 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?

[f]emms should be emitted by an intrinsic (_mm_empty), inserted by the
programmer. The programmer can mix FP and MMX instructions in the same
function, so there is no way for compiler to automatically emit emms.
Obviously, when the function returns value in %mm0 register (or in %fp), emms
should not be inserted at function exit.

Reply via email to