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 10:36:20 -0800
- Subject: Re: rs6000: floating point cast oddities?
On Monday, December 17, 2001, at 09:07 AM, degger@fhm.edu wrote:
> Hija,
>
> Consider:
> float
> foo (float a, float b)
> {
> return b+1.0;
> }
>
> 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.