diff options
author | Richard Henderson <rth@cygnus.com> | 2000-09-18 11:24:32 -0700 |
---|---|---|
committer | Richard Henderson <rth@gcc.gnu.org> | 2000-09-18 11:24:32 -0700 |
commit | 5bd60ce6de2d4e0b0e7975c04772393b76b97909 (patch) | |
tree | ddee6e9c6a5df5d1308e04b8d34274665f561576 /gcc/combine.c | |
parent | b4927ead98f192ffb7f0893ccf64a1afec298465 (diff) | |
download | gcc-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/combine.c')
-rw-r--r-- | gcc/combine.c | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/gcc/combine.c b/gcc/combine.c index 07c7e67..033bfac 100644 --- a/gcc/combine.c +++ b/gcc/combine.c @@ -3933,21 +3933,17 @@ combine_simplify_rtx (x, op0_mode, last, in_dest) if (GET_CODE (XEXP (x, 0)) == IOR || GET_CODE (XEXP (x, 0)) == AND) { rtx in1 = XEXP (XEXP (x, 0), 0), in2 = XEXP (XEXP (x, 0), 1); + enum machine_mode op_mode; - if (GET_CODE (in1) == NOT) - in1 = XEXP (in1, 0); - else - in1 = gen_rtx_combine (NOT, GET_MODE (in1), in1); + op_mode = GET_MODE (in1); + in1 = gen_unary (NOT, op_mode, op_mode, in1); - if (GET_CODE (in2) == NOT) - in2 = XEXP (in2, 0); - else if (GET_CODE (in2) == CONST_INT - && GET_MODE_BITSIZE (mode) <= HOST_BITS_PER_WIDE_INT) - in2 = GEN_INT (GET_MODE_MASK (mode) & ~INTVAL (in2)); - else - in2 = gen_rtx_combine (NOT, GET_MODE (in2), in2); + op_mode = GET_MODE (in2); + if (op_mode == VOIDmode) + op_mode = mode; + in2 = gen_unary (NOT, op_mode, op_mode, in2); - if (GET_CODE (in2) == NOT) + if (GET_CODE (in2) == NOT && GET_CODE (in1) != NOT) { rtx tem = in2; in2 = in1; in1 = tem; |