const_double - RTL

Jim Wilson
Sat May 8 00:51:00 GMT 2004

Iman Narasamdya wrote:
> I would like to construct the double value from the operands of 
> const_double. How to do so? Particularly, I don't understand how the 
> operands are created from a double / float value.

We don't really provide a way to convert a const_double into a double 
value.  Since the host and target may have different floating point 
representations, in general, we can not use FP values inside the 
compiler.  Instead, we have REAL_VALUE_TYPE which is an abstracted 
representation of an FP value.  We have routines to convert between 
REAL_VALUE_TYPE and const_double, we have routines to perform operations 
on REAL_VALUE_TYPE, and we have routines to output REAL_VALUE_TYPE to 
assembly language.  But if you actually want a double value, you may be 
out of luck.

Most of this stuff is in real.h and real.c.  See for instance 
Jim Wilson, GNU Tools Support,

More information about the Gcc mailing list