Re: [PATCH v2 13/15] simplify OP((x | C), K) when (C & M) == M

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

 



On Mon, Aug 20, 2018 at 06:37:24PM +0100, Ramsay Jones wrote:
> 
> 
> On 16/08/18 23:12, Luc Van Oostenryck wrote:
> > If the effective mask (C & M) is equal to the outer mask (M),
> > then the OR operation is unneeded and can be replaced by M itself,
> > giving: OP(M', K) with M' == (C & M)
> > 
> > For example, code like:
> > 	unsigned int foo(int x)
> > 	{
> > 		return (x | 7) & 2;
> > 	}
> 
> C == 7, K == 2, OP == &, (C & K) == K. Hmm, so M == K?

Indeed, since the operation here is an AND for which the
effective mask is the 'concrete' mask itself.a

-- Luc



[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