This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: rs6000: floating point cast oddities?
- From: Dale Johannesen <dalej at apple dot com>
- To: degger at fhm dot edu
- Cc: Dale Johannesen <dalej at apple dot com>, gcc at gcc dot gnu dot org
- Date: Mon, 17 Dec 2001 12:59:22 -0800
- Subject: Re: rs6000: floating point cast oddities?
On Monday, December 17, 2001, at 12:53 PM, degger@fhm.edu wrote:
> On 17 Dec, Dale Johannesen wrote:
>
>>> What I expect it do to is:
>>> Load a single precision 1.0 and add it to the register
>>> of the second parameter.
>
>> No, according to the language 1.0 is double, and the addition
>> should therefore be done in double. You can write 1.0f to
>> specify a float 1.0.
>
> This seems pretty strange to me. Would you please cite the passage
> of the specification?
(c89) The type of FP constants is in 3.1.3.1: "An unsuffixed
floating point constant has type double."
Promotion rules are in 3.2.1.5; after some cases that don't apply,
"if either operand has type double, the other operand is converted
to double."