[RFC] Fold floating-point comparisons

Roger Sayle roger@eyesopen.com
Wed May 26 22:02:00 GMT 2004


On Wed, 26 May 2004, Paolo Bonzini wrote:
> This patch implements the optimizations that Roger suggested in his
> message "[PATCH] Document a bunch of expression tree codes", and in
> general makes GCC able to combine floating-point comparisons.

Hi Paolo,

Could you describe the intended semantics of your new LTGT_EXPR?
You'll notice that my patch above was primarily documenting tree
codes, so proposing a new new tree code without atleast documenting
it would appear to be more part of the problem than of the solution.

Floating point equality and inequality operators, i.e. EQ_EXPR,
NE_EXPR and UNEQ_EXPR don't trap.  So I'd recommend that the same
apply for your new LTGT_EXPR.

Is LTGT_EXPR(x,y) supposed to be !isnan(x) && !isnan(y) && (x!=y)?
So LTGT_EXPR(x,y) == NOT_EXPR (UNEQ_EXPR (x, y))?


> Regtests are still to be written.

And as always you need to bootstrap and regression test your patch,
waiting for the regression tests to complete, checking that there
are no new failures or regressions and then post to the gcc-patches
list indicating the target triple that you tested on and these results.
The rules in contribute.html help avoid the common mistakes that can
break bootstrap or adversely affect the compiler.

Roger
--



More information about the Gcc-patches mailing list