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.