summaryrefslogtreecommitdiff
path: root/gcc/simplify-rtx.c
diff options
context:
space:
mode:
authorrask <rask@138bc75d-0d04-0410-961f-82ee72b054a4>2007-09-09 19:21:59 +0000
committerrask <rask@138bc75d-0d04-0410-961f-82ee72b054a4>2007-09-09 19:21:59 +0000
commit7333737f42f1f2b00a32fe2fbed73915b2a045d1 (patch)
tree9cf93feb394109316dfdca4d1a5926ddbe2320f6 /gcc/simplify-rtx.c
parent1b3841036e9cc0005835cc32e5983598e809ec24 (diff)
downloadgcc-7333737f42f1f2b00a32fe2fbed73915b2a045d1.tar.gz
PR target/30315
* config/i386/i386.h (CANONICALIZE_COMPARISON): Delete. * simplify-rtx.c (simplify_relational_operation_1): Add the canonicalization from i386.h. * doc/md.texi (Canonicalization of Instructions): Document it. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@128305 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/simplify-rtx.c')
-rw-r--r--gcc/simplify-rtx.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/gcc/simplify-rtx.c b/gcc/simplify-rtx.c
index ac91f2fc92a..02f9e2b4c36 100644
--- a/gcc/simplify-rtx.c
+++ b/gcc/simplify-rtx.c
@@ -3813,6 +3813,12 @@ simplify_relational_operation_1 (enum rtx_code code, enum machine_mode mode,
}
}
+ /* Canonicalize (LTU/GEU (PLUS a b) b) as (LTU/GEU (PLUS a b) a). */
+ if ((code == LTU || code == GEU)
+ && GET_CODE (op0) == PLUS
+ && rtx_equal_p (op1, XEXP (op0, 1)))
+ return simplify_gen_relational (code, mode, cmp_mode, op0, XEXP (op0, 0));
+
if (op1 == const0_rtx)
{
/* Canonicalize (GTU x 0) as (NE x 0). */