diff options
author | Roger Sayle <roger@eyesopen.com> | 2002-07-20 22:24:58 +0000 |
---|---|---|
committer | Roger Sayle <sayle@gcc.gnu.org> | 2002-07-20 22:24:58 +0000 |
commit | 0da65b89f1c0930d104b273a9218fb63226f4cad (patch) | |
tree | e37fb51103098113d2493eb7dee473ac4dd1ec99 /gcc/simplify-rtx.c | |
parent | 68cd2524d653124382c131d4a739c7f33a95c6b1 (diff) | |
download | gcc-0da65b89f1c0930d104b273a9218fb63226f4cad.zip gcc-0da65b89f1c0930d104b273a9218fb63226f4cad.tar.gz gcc-0da65b89f1c0930d104b273a9218fb63226f4cad.tar.bz2 |
simplify-rtx.c (simplify_relational_operation): Optimize abs(x) < 0.0 (and abs(x) >= 0.0 when using -ffast-math).
* simplify-rtx.c (simplify_relational_operation): Optimize
abs(x) < 0.0 (and abs(x) >= 0.0 when using -ffast-math).
* gcc.c-torture/execute/20020720-1.c: New test case.
From-SVN: r55614
Diffstat (limited to 'gcc/simplify-rtx.c')
-rw-r--r-- | gcc/simplify-rtx.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/gcc/simplify-rtx.c b/gcc/simplify-rtx.c index 95a2af0..b98c475 100644 --- a/gcc/simplify-rtx.c +++ b/gcc/simplify-rtx.c @@ -2075,6 +2075,28 @@ simplify_relational_operation (code, mode, op0, op1) return const0_rtx; break; + case LT: + /* Optimize abs(x) < 0.0. */ + if (trueop1 == CONST0_RTX (mode)) + { + tem = GET_CODE (trueop0) == FLOAT_EXTEND ? XEXP (trueop0, 0) + : trueop0; + if (GET_CODE (tem) == ABS) + return const0_rtx; + } + break; + + case GE: + /* Optimize abs(x) >= 0.0. */ + if (trueop1 == CONST0_RTX (mode) && !HONOR_NANS (mode)) + { + tem = GET_CODE (trueop0) == FLOAT_EXTEND ? XEXP (trueop0, 0) + : trueop0; + if (GET_CODE (tem) == ABS) + return const1_rtx; + } + break; + default: break; } |