aboutsummaryrefslogtreecommitdiff
path: root/gcc/simplify-rtx.c
diff options
context:
space:
mode:
authorRichard Henderson <rth@cygnus.com>2000-09-18 11:24:32 -0700
committerRichard Henderson <rth@gcc.gnu.org>2000-09-18 11:24:32 -0700
commit5bd60ce6de2d4e0b0e7975c04772393b76b97909 (patch)
treeddee6e9c6a5df5d1308e04b8d34274665f561576 /gcc/simplify-rtx.c
parentb4927ead98f192ffb7f0893ccf64a1afec298465 (diff)
downloadgcc-5bd60ce6de2d4e0b0e7975c04772393b76b97909.zip
gcc-5bd60ce6de2d4e0b0e7975c04772393b76b97909.tar.gz
gcc-5bd60ce6de2d4e0b0e7975c04772393b76b97909.tar.bz2
combine.c (combine_simplify_rtx): Use gen_unary to distribute the NOT for De Morgan's rule.
* 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. From-SVN: r36506
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 1e13076..eb1ac58 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;