summaryrefslogtreecommitdiff
path: root/gcc/simplify-rtx.c
diff options
context:
space:
mode:
authorsayle <sayle@138bc75d-0d04-0410-961f-82ee72b054a4>2002-07-20 22:24:58 +0000
committersayle <sayle@138bc75d-0d04-0410-961f-82ee72b054a4>2002-07-20 22:24:58 +0000
commit88d97b054698b4acfe6c7979155cafcb7713cf37 (patch)
treee37fb51103098113d2493eb7dee473ac4dd1ec99 /gcc/simplify-rtx.c
parent31699db16852eef71b3bcb7fda02a61136589bba (diff)
downloadgcc-88d97b054698b4acfe6c7979155cafcb7713cf37.tar.gz
* 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@55614 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/simplify-rtx.c')
-rw-r--r--gcc/simplify-rtx.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/gcc/simplify-rtx.c b/gcc/simplify-rtx.c
index 95a2af09dc2..b98c47581f1 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;
}