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: -funsafe-math-optimizations and -fno-rounding-math


On 11/11/06, Revital1 Eres <ERES@il.ibm.com> wrote:

Hello,


-fno-rounding-math enables the transformation of (-(X - Y)) -> (Y - X)
in simplify-rtx.c  which seems to be the same transformation
that enabled by -funsafe-math-optimizations in fold-const.c.

If I understand currently -frounding-math means that the rounding mode is
important.
In that case should there be correlation between
-funsafe-math-optimizations
and -fno-rounding-math (which currently does not exist)?

I think the simplify-rtx.c code is partly wrong, as it changes behavior with signed zeros. I don't know off-hand if -(X - Y) and Y - X behave the same in rounding if the rounding mode is round to nearest, but certainly for round to +Inf it will differ. So HONOR_SIGNED_ZEROS (mode) && !flag_rounding_math might be the correct predicate here (and in the fold-const.c case).

But floating point rounding scares me ;)

Richard.


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