This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: [Bug target/29337] -mfpmath=387 doesn't use fistp for double-to-integer conversion
- From: Andrew Pinski <pinskia at physics dot uc dot edu>
- To: gcc-bugzilla at gcc dot gnu dot org
- Cc: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 04 Oct 2006 22:05:34 -0700
- Subject: Re: [Bug target/29337] -mfpmath=387 doesn't use fistp for double-to-integer conversion
- References: <bug-29337-12811@http.gcc.gnu.org/bugzilla/> <20061005050024.17364.qmail@sourceware.org>
On Thu, 2006-10-05 at 05:00 +0000, seongbae dot park at gmail dot com
wrote:
> With 4.1.0 i686-unknown-linux-gnu target:
>
> # gcc -O2 m.c -S
try -O2 -msse2, you get:
_Z8todoubledd:
subl $12, %esp
fldl 24(%esp)
faddl 16(%esp)
fstpl (%esp)
movsd (%esp), %xmm0
addl $12, %esp
cvttsd2si %xmm0, %eax
ret
Though I think the movsd should not be there but that is a different
issue.
-- Pinski