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: "pluto at agmk dot net" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 3 Oct 2006 21:57:52 -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 #1 from pluto at agmk dot net 2006-10-03 21:57 -------
(In reply to comment #0)
> This makes a difference if/when the extra precision of 387 makes difference
for an extra prescision try to use a `long double'.
$ cat fp.cpp
int convert( long double x ) { return (int)x; }
int convert( double x ) { return (int)x; }
convert(long double):
fldt 8(%rsp)
fnstcw -10(%rsp)
movzwl -10(%rsp), %eax
orb $12, %ah
movw %ax, -12(%rsp)
fldcw -12(%rsp)
fistpl -16(%rsp)
fldcw -10(%rsp)
movl -16(%rsp), %eax
ret
convert(double):
cvttsd2si %xmm0, %eax
ret
--
pluto at agmk dot net changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |pluto at agmk dot net
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29337