How to determine that 2.0 == (float) 2 in a front-end.
Toon Moene
toon@moene.indiv.nluug.nl
Tue Jun 25 17:59:00 GMT 2002
L.S.,
Fortran sports this strange fiction that X**2.0 is the same as X**2 is
the same as X*X (for those interested I can explain). This turns out to
be an interesting optimisation I might be able to implement in the
Fortran front-end.
Obviously, because X**Y, with Y real, is implemented by computing
EXP(Y*LOG*(X)) one doesn't want to change 2.0 to 2 lightly (i.e.,
without the assurance of -funsafe-math_optimizations).
That aside, what is the procedure a front-end has to follow to determine
that a constant A (some float mode) is in fact "equal" to a constant I
(some integer mode) ?
Thanks in advance,
--
Toon Moene - mailto:toon@moene.indiv.nluug.nl - phoneto: +31 346 214290
Saturnushof 14, 3738 XG Maartensdijk, The Netherlands
Maintainer, GNU Fortran 77: http://gcc.gnu.org/onlinedocs/g77_news.html
Join GNU Fortran 95: http://g95.sourceforge.net/ (under construction)
More information about the Gcc
mailing list