RFA; DFP and REAL_TYPE?

Mark Mitchell mark@codesourcery.com
Tue Mar 22 04:50:00 GMT 2005


Robert Dewar wrote:
> Mark Mitchell wrote:
> 
>> I would expect that some decimal floating point values are not 
>> precisely representable in the binary format.
> 
> 
> OK, I agree that decimal floating-point needs its own format. But still
> you can store the decimal mantissa and decimal exponent in binary format
> without any problem, and that's probably what you want to do on a machine
> that does not have native decimal format support.

I would think that, as elsewhere in real.c, you would probably want to 
use the same exact bit representation that will be used on the target. 
This is useful so that you can easily emit assembly literals by simply 
printing the bytes in hex, for example.

Of course, you could do as you suggest (storing the various fields of 
the decimal number in binary formats), and, yes, on many host machines 
that would in more efficient internal computations.  But, I'm not 
confident that the savings you would get out of that would outweigh the 
appeal of having bit-for-bit consistency between the host and target.

In any case, this is rather a detail; the key decision Jon is trying to 
make is whether or not he has to introduce a new format in real.c, 
together with new routines to perform oeprations on that format, to 
which I think we agree the answer is in the affirmative.

-- 
Mark Mitchell
CodeSourcery, LLC
mark@codesourcery.com
(916) 791-8304



More information about the Gcc mailing list