Re: [PATCH v2 07/15] switch return order in simplify_mask_or_and()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




On 16/08/18 23:12, Luc Van Oostenryck wrote:
> This function used an early return when the test guarding
> the simplification failed but this make impossible to add
> other ones simplifications.
> 
> In preparation for incoming additional simplifications,
> negate the test and siwtch the returns so that the early return

s/siwtch/switch/

ATB,
Ramsay Jones

> is now a catch-all return when no simplifications can apply.
> 
> Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@xxxxxxxxx>
> ---
>  simplify.c | 11 +++++------
>  1 file changed, 5 insertions(+), 6 deletions(-)
> 
> diff --git a/simplify.c b/simplify.c
> index 8d3ba44f3..a9635a9fd 100644
> --- a/simplify.c
> +++ b/simplify.c
> @@ -564,12 +564,11 @@ static int simplify_mask_or_and(struct instruction *insn, unsigned long long mas
>  		return 0;
>  	omask = src2->value;
>  	nmask = omask & mask;
> -	if (nmask != 0)
> -		return 0;
> -	// replace OP(((A & M') | B), C)
> -	// by      OP(B, C)
> -	// when	(M' & M) == 0
> -	return replace_pseudo(insn, &insn->src1, orb);
> +	if (nmask == 0) {
> +		// if (M' & M) == 0: ((a & M') | b) -> b
> +		return replace_pseudo(insn, &insn->src1, orb);
> +	}
> +	return 0;
>  }
>  
>  ///
> 



[Index of Archives]     [Newbies FAQ]     [LKML]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Trinity Fuzzer Tool]

  Powered by Linux