From 88d97b054698b4acfe6c7979155cafcb7713cf37 Mon Sep 17 00:00:00 2001 From: sayle Date: Sat, 20 Jul 2002 22:24:58 +0000 Subject: * 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 --- gcc/simplify-rtx.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'gcc/simplify-rtx.c') 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; } -- cgit v1.2.1