This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug target/29337] -mfpmath=387 doesn't use fistp for double-to-integer conversion
- From: "uros at kss-loka dot si" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 4 Oct 2006 06:46:50 -0000
- Subject: [Bug target/29337] -mfpmath=387 doesn't use fistp for double-to-integer conversion
- References: <bug-29337-12811@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #3 from uros at kss-loka dot si 2006-10-04 06:46 -------
> I'm afraid you're missing my point.
> The problem is that for 64-bit and 32-bit floating-point to integer conversion,
> x86 (32bit) target uses fistp* whereas x86_64 (64-bit) target uses cvt* WHEN
> -mfpmath=387.
> This defeats the purpose of the option -mfpmath=387 which is supposed to make
> floating-point computations to use 387, instead of SSE2.
If SSE is available, then SSE cvt* is used in order to avoid long control-word
setting sequences. This is cheaper even if we have to move value from x87
register, as cvt* can handle mem->reg transformations.
If you really need fistp* sequence, you can try with -mno-sse2 (you can't just
disable sse on x86_64 target) or perhaps use -msse3, where fisttp insn will be
generated.
Saying that, I wonder where excess precision effects come into play here. We
are talking about truncate-to-integer instruction, so I would really like to
see an example of this effect.
>
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29337