Re: floating point

darcy@usul.CS.Berkeley.EDU (Joseph D. Darcy)
6 Nov 1998 14:40:14 -0500

          From comp.compilers

Related articles
[4 earlier articles]
Re: floating point will@ccs.neu.edu (William D Clinger) (1998-10-10)
Re: floating point dmcq@fano.demon.co.uk (David McQuillan) (1998-10-13)
Re: floating point darcy@CS.Berkeley.EDU (Joseph D. Darcy) (1998-10-19)
Re: floating point darcy@usul.CS.Berkeley.EDU (1998-10-24)
Re: floating point comments@cygnus-software.com (Bruce Dawson) (1998-11-01)
Re: floating point comments@cygnus-software.com (Bruce Dawson) (1998-11-01)
Re: floating point darcy@usul.CS.Berkeley.EDU (1998-11-06)
Re: floating point darcy@CS.Berkeley.EDU (Joseph D. Darcy) (1998-11-06)
Re: floating point comments@cygnus-software.com (Bruce Dawson) (1998-11-07)
Re: floating point eggert@twinsun.com (1998-11-19)
Re: floating point dmcq@fano.demon.co.uk (David McQuillan) (1998-11-21)
Re: floating point darcy@CS.Berkeley.EDU (Joseph D. Darcy) (1998-12-01)
Floating Point jimp@powersite.net (Jim) (1999-11-02)
| List of all articles for this month |
From: darcy@usul.CS.Berkeley.EDU (Joseph D. Darcy)
Newsgroups: comp.compilers
Date: 6 Nov 1998 14:40:14 -0500
Organization: University of California, Berkeley
References: 98-09-164 98-10-018 98-10-040 98-10-120 98-11-015
Keywords: arithmetic

Bruce Dawson <comments@cygnus-software.com> writes:


>Bruce Dawson said:
>> > It can introduce double rounding, and it doesn't clamp the
>> > exponent. The exponent clamping can be forced by writing to memory,
>> > but the double rounding is inevitable (but rare?)


>Joseph D. Darcy wrote:


[double rounding on underflow is unlikely to cause a problem for
practical programs]


>Just to clarify: Doug Priest's quote was talking about double rounding
>caused by writing doubles to memory and having the exponent range
>reduced by this process. I was intending to refer to the double
>rounding that happens in the x86 when the rounding mode is set to
>double and the results are first rounded to 64-bit precision, and then
>to 53 bit precision - even before being written to memory. On this
>topic Doug Priest says:


When the x86's rounding precision is set to double, the answer is
rounded to 53 significand bits (with extended exponent range).
Likewise, when the rounding precision is set to float, only 24 bit
significands are generated.


If a compiler sets the rounding precision to double extended (64
significand bits) and then writes these values out as double, double
rounding can occur. However, if the intention is to only operate on
double values and not use double extended, there is no reason not to
set the rounding precision. Adds and multiplies go just as fast under
double precision and divide is somewhat faster.


-Joe Darcy
darcy@cs.berkeley.edu


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.