From 0da65b89f1c0930d104b273a9218fb63226f4cad Mon Sep 17 00:00:00 2001 From: Roger 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). * 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 --- 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 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; } -- cgit v1.1