This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: [offtopic] float vs. double?


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]