This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: [offtopic] float vs. double?
- To: nbecker at fred dot net
- Subject: Re: [offtopic] float vs. double?
- From: N8TM at aol dot com
- Date: Tue, 4 Aug 1998 02:27:09 EDT
- Cc: egcs at cygnus dot com
In a message dated 8/3/98 7:56:26 PM Pacific Daylight Time, nbecker@fred.net
writes:
> Is there anything much to be saved by using float over
> double?
>
The short answer is there's nothing unexpected; as the default mode for Intel
is to put all arithmetic into extended double mode, most differences will be
due to cache behavior, double misalignments, and the like. Setting single
precision mode may save quite a bit of time for division and square root, but
is not generally viable.
I've run Livermore loops in single and double precision. In my opinion,
extended precision should be used in those cases where it preserves accuracy,
and the result is that the differences in speed are minimal, except for those
misalignments. i686-linux-pc-gnulibc1 shows much less misalignment effect
than i686-pc-cygwin32. Choosing options such as -Os which minimize register
spills help to avoid misalignment penalties.