summaryrefslogtreecommitdiff
path: root/gcc/simplify-rtx.c
diff options
context:
space:
mode:
authorrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>2000-09-18 18:24:32 +0000
committerrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>2000-09-18 18:24:32 +0000
commit069a05d1dee193f4df79d3e4b3bc067ebced3954 (patch)
treeddee6e9c6a5df5d1308e04b8d34274665f561576 /gcc/simplify-rtx.c
parentbc8f8789e48ff14bedd9f87d767f83d57fb761aa (diff)
downloadgcc-069a05d1dee193f4df79d3e4b3bc067ebced3954.tar.gz
* combine.c (combine_simplify_rtx): Use gen_unary to distribute
the NOT for De Morgan's rule. * simplify-rtx.c (simplify_unary_operation): Simplify a BImode NOT of a comparison to the reverse comparison. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@36506 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/simplify-rtx.c')
-rw-r--r--gcc/simplify-rtx.c17
1 files changed, 14 insertions, 3 deletions
diff --git a/gcc/simplify-rtx.c b/gcc/simplify-rtx.c
index 1e130768eed..eb1ac584dbb 100644
--- a/gcc/simplify-rtx.c
+++ b/gcc/simplify-rtx.c
@@ -583,10 +583,21 @@ simplify_unary_operation (code, mode, op, op_mode)
aren't constant. */
switch (code)
{
- case NEG:
case NOT:
- /* (not (not X)) == X, similarly for NEG. */
- if (GET_CODE (op) == code)
+ /* (not (not X)) == X. */
+ if (GET_CODE (op) == NOT)
+ return XEXP (op, 0);
+
+ /* (not (eq X Y)) == (ne X Y), etc. */
+ if (mode == BImode && GET_RTX_CLASS (GET_CODE (op)) == '<'
+ && can_reverse_comparison_p (op, NULL_RTX))
+ return gen_rtx_fmt_ee (reverse_condition (GET_CODE (op)),
+ op_mode, XEXP (op, 0), XEXP (op, 1));
+ break;
+
+ case NEG:
+ /* (neg (neg X)) == X. */
+ if (GET_CODE (op) == NEG)
return XEXP (op, 0);
break;