This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH, i386] automatic MMX/x87 FPU mode switching (the real one)
- From: Richard Henderson <rth at redhat dot com>
- To: Uros Bizjak <uros dot bizjak at kss-loka dot si>
- Cc: gcc-patches at gcc dot gnu dot org, rth at gcc dot gnu dot org, roger at eyesopen dot com
- Date: Sun, 26 Jun 2005 22:01:47 -0700
- Subject: Re: [PATCH, i386] automatic MMX/x87 FPU mode switching (the real one)
- References: <1119350611.42b7ef5373f49@ssl.kss-loka.si>
On Tue, Jun 21, 2005 at 12:43:31PM +0200, Uros Bizjak wrote:
> A IMHO nice feature of this patch is, that manually inserted emms (via
> _mm_empty() intrinsic) is also handled with LCM approach. If there is no need
> for emms in this place, it is not emitted. And this patch also handles (stupid)
> code like:
>
> #include <mmintrin.h>
>
> __v8qi
> aaa (__v8qi x, __v8qi y)
> {
> __v8qi mm1;
>
> mm1 = _mm_add_pi8 (x, y);
> _mm_empty ();
> return mm1;
> }
>
> 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.
> 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.
[ Grr... forgot to change the mime type of the patch for inclusion
in the reply mail. Review coming separately. ]
r~