This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [patch] simplify-rtx.c: Simplify ~y when (x - (x & y)) is found.


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>


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]