This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug target/49257] -mfpmath=sse generates x87 instructions on 32 bits OS
- From: "rth at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 6 Jun 2011 15:49:25 +0000
- Subject: [Bug target/49257] -mfpmath=sse generates x87 instructions on 32 bits OS
- Auto-submitted: auto-generated
- References: <bug-49257-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49257
--- Comment #7 from Richard Henderson <rth at gcc dot gnu.org> 2011-06-06 15:49:06 UTC ---
Uros, the code you generate has a double-rounding error.
You can generate code inline if you have access to SSE2,
by converting the pieces to DFmode and then truncating
to SFmode. Since DFmode has > 2x the number of bits, we
don't get a double rounding bug.
Otherwise, we *do* have an algorithm to do DI->SF conversion
in libgcc2.c. See the last bit of ifdeffery there; the
amount of code is really quite large.
Unfortunately, we'd need to define some new symbol in
libgcc to do this completely in SSE mode. The default
calling conventions would use the FP stack to return the
results.