This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [patch] simplify-rtx.c: Simplify ~y when (x - (x & y)) is found.
- From: Geoff Keating <geoffk at geoffk dot org>
- To: Kazu Hirata <kazu at cs dot umass dot edu>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: 14 Feb 2003 05:52:58 -0800
- Subject: Re: [patch] simplify-rtx.c: Simplify ~y when (x - (x & y)) is found.
- References: <20030214.071624.55826122.kazu@cs.umass.edu>
Kazu Hirata <kazu@cs.umass.edu> writes:
> Regression testing on h8300 port in progress. OK to apply if no
> regression is found?
This is OK.
> 2003-02-14 Kazu Hirata <kazu@cs.umass.edu>
>
> * simplify-rtx.c (simplify_binary_operation): Simplify ~y when
> (x - (x & y)) is found.
>
> Index: simplify-rtx.c
> ===================================================================
> RCS file: /cvs/gcc/gcc/gcc/simplify-rtx.c,v
> retrieving revision 1.136
> diff -u -r1.136 simplify-rtx.c
> --- simplify-rtx.c 9 Feb 2003 22:55:35 -0000 1.136
> +++ simplify-rtx.c 14 Feb 2003 05:08:15 -0000
> @@ -1338,11 +1338,17 @@
> if (GET_CODE (op1) == AND)
> {
> if (rtx_equal_p (op0, XEXP (op1, 0)))
> - return simplify_gen_binary (AND, mode, op0,
> - gen_rtx_NOT (mode, XEXP (op1, 1)));
> + {
> + tem = simplify_gen_unary (NOT, mode, XEXP (op1, 1),
> + GET_MODE (XEXP (op1, 1)));
> + return simplify_gen_binary (AND, mode, op0, tem);
> + }
> if (rtx_equal_p (op0, XEXP (op1, 1)))
> - return simplify_gen_binary (AND, mode, op0,
> - gen_rtx_NOT (mode, XEXP (op1, 0)));
> + {
> + tem = simplify_gen_unary (NOT, mode, XEXP (op1, 0),
> + GET_MODE (XEXP (op1, 0)));
> + return simplify_gen_binary (AND, mode, op0, tem);
> + }
> }
> break;
>
>
--
- Geoffrey Keating <geoffk@geoffk.org>