This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: Casting of Floating Point Data Types to Ints
- To: kbowers at eecs dot berkeley dot edu, gcc-bugs at gcc dot gnu dot org
- Subject: Re: Casting of Floating Point Data Types to Ints
- From: N8TM at aol dot com
- Date: Sat, 21 Aug 1999 04:35:57 EDT
>>casting a floating
point value to integers
>>casting on x86 platforms
causes the processor to stall
>>if inline assembly is used to correct the problem, for a large 2D3V
electrostatic PIC simulation, the simulation performance increases
roughly 100%
The same can be said for the Livermore Fortran Kernel 13 and 14 benchmarks.
Incidentally, the results in Kernel 14 don't vary with rounding mode, as I
have verified both by editing the gcc/g77 .s code and by changing the Fortran
source to use NINT() with the MipsPro compiler's -OPT:fast_nint=ON. That
option permits the slight variation from standard Fortran implied by the IEEE
rounding nearest even.
As your later quotation shows, Intel has always been aware that their
processor design did not allow efficient implementation of standard C and
Fortran rounding. C9X defines some intrinsics which deal with this problem
and are already present in glibc. Why not use those? Unfortunately, with
the x86, if you want efficiency, it seems you must assume that there will be
no outside tinkering with the rounding mode.
Tim Prince
tprince@computer.org