This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH, i386] automatic MMX/x87 FPU mode switching (the realone)


Richard Henderson wrote:

to produce correct asm code:

aaa:
subl $12, %esp
paddb %mm1, %mm0
movq %mm0, (%esp)
emms
movq (%esp), %mm0
addl $12, %esp
ret



This result contradicts your previous statement that manually insertted
emms are not emitted. Which might be cool, but is not 100% required for
this patch; just that we get correct code with them.


This example was trying to show that even manually inserted emms doesn't hurt the code :)

However, if you agree, I would prefer __builtin_emms to be ignored, as compiler can determine by itself , where emms should be emitted.

For __builtin_apply ()problems, I suggest that called function (for i386)
should NOT use MMX registers, and that it is always called in FPU_MODE_387.



I agree. You planning on working on this I assume?


I suppose the workaround patch you posted is good enough in the meantime. Or we could temporarily xfail the test.


I'm looking into this problem - it exposes a latent bug. The problem is that %mm and %st are returned together from __builtin_apply. However, I would like to fix it differently that in the workaround patch, because it looks that some other code (PR19161) is suffering from the same problem.

Uros.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]