This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: vax double precision broken
- From: Joe Buck <jbuck at synopsys dot com>
- To: pkoning at equallogic dot com (Paul Koning)
- Cc: gcc at gcc dot gnu dot org
- Date: Sat, 1 Jun 2002 17:08:46 -0700 (PDT)
- Subject: Re: vax double precision broken
> The single and double IEEE formats do indeed look similar to VAX F and
> G formats respectively, but they do NOT match. There are three key
> differences: the halfwords are in the opposite order (sign bit is bit
> 31 in each case for IEEE); the exponent bias is one less -- 127 and
> 1023 for IEEE vs. 128 and 1024 for VAX; and the hidden high order bit
> is interpreted as the bit just to the left of the binary point (2**0)
> in IEEE rather than just to the right (2**-1) as in VAX. (In
> addition, IEEE has both Inf and NaN, while DEC format only has NaN.
> And IEEE has denormals; DEC does not.)
There's a 4th difference: F-floating has the same exponent size as IEEE
single precision, but D-floating has the same number of exponent bits
as F-floating while IEEE doubles have more exponent bits. (Conversion
from Vax-D to Vax-F is a simple matter of rounding off the mantissa, while
for IEEE, overflow can occur because the double precision type has greater
range).