Patchwork picochip: simplify expression

login
register
mail settings
Submitter Nicolas Kaiser
Date Oct. 29, 2010, 1:38 p.m.
Message ID <20101029153805.023c3b05@absol.kitzblitz>
Download mbox | patch
Permalink /patch/69586/
State New
Headers show

Comments

Nicolas Kaiser - Oct. 29, 2010, 1:38 p.m.
Hi there!

I noticed an expression that can be simplified like:
 (a || (!a && b)) => (a || b)

Best regards,
Signed-off-by: Nicolas Kaiser <nikai@nikai.net>
---
Hariharan Sandanagobalane - Oct. 29, 2010, 1:49 p.m.
Sounds like a good change. Let me know if you would like me to commit this.

Cheers
Hari

On 29/10/10 14:38, Nicolas Kaiser wrote:
> Hi there!
>
> I noticed an expression that can be simplified like:
>   (a || (!a&&  b)) =>  (a || b)
>
> Best regards,
> Signed-off-by: Nicolas Kaiser<nikai@nikai.net>
> ---
> --- a/gcc/config/picochip/picochip.c	2010-10-29 11:14:04.299096263 +0200
> +++ b/gcc/config/picochip/picochip.c	2010-10-29 15:13:18.715976486 +0200
> @@ -2299,8 +2299,7 @@ picochip_is_short_branch (rtx insn)
>     int isRealShortBranch = (get_attr_length(insn) == SHORT_BRANCH_LENGTH);
>
>     return (isRealShortBranch ||
> -	  (!isRealShortBranch&&
> -	   picochip_current_vliw_state.num_insns_in_packet>  1));
> +	  picochip_current_vliw_state.num_insns_in_packet>  1);
>   }
>
>   /* Output a compare-and-branch instruction (matching the cbranch
>

Patch

--- a/gcc/config/picochip/picochip.c	2010-10-29 11:14:04.299096263 +0200
+++ b/gcc/config/picochip/picochip.c	2010-10-29 15:13:18.715976486 +0200
@@ -2299,8 +2299,7 @@  picochip_is_short_branch (rtx insn)
   int isRealShortBranch = (get_attr_length(insn) == SHORT_BRANCH_LENGTH);
 
   return (isRealShortBranch ||
-	  (!isRealShortBranch &&
-	   picochip_current_vliw_state.num_insns_in_packet > 1));
+	  picochip_current_vliw_state.num_insns_in_packet > 1);
 }
 
 /* Output a compare-and-branch instruction (matching the cbranch