This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: rs6000: floating point cast oddities?


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]