This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: rs6000: floating point cast oddities?
- From: degger at fhm dot edu
- To: dje at watson dot ibm dot com
- Cc: gcc at gcc dot gnu dot org
- Date: Mon, 17 Dec 2001 19:41:40 +0100 (CET)
- Subject: Re: rs6000: floating point cast oddities?
- Reply-to: degger at fhm dot edu
On 17 Dec, David Edelsohn wrote:
>> I can prevent gcc from doing it in double precision by adding
>> a cast but this is not a good reason for being stupid in the
>> first place I guess. :)
> This is completely correct code. If you do not want the
> intermediate double, use 1.0f. By default 1.0 is a double.
Yes, it is correct but stupid. Where are the expected gains to
use double calculations when result and operands are singleprecision
floats? gcc tries to be as smart as possible and thus has compilcated
optimisation passes but fails to emit a simple float instead of the
double although all other operands and the results are floats and the
result is (or should be) the same?
If there's not any compelling reason why it has to be that way I'll
have a look at the intermediate code generation to see if I can
come up with something more clever. For my taste there are far to many
frsps in assembly generated by gcc for floatingpoint operation (in any
precision) to be funny.
--
Servus,
Daniel