On Mon, Apr 16, 2018 at 09:26:13AM -0700, Carl Love wrote:
> > But then the & ~0x1f test is not good either, it does not work for
> > values
> > -16..-1 ?
> > 
> > You cannot handle signed and unsigned exactly the same for the test
> > for
> > allowed values.

> The test
> 
> if (TREE_CODE (arg0) != INTEGER_CST
>            || TREE_INT_CST_LOW (arg0) & ~0x1f)
>          return false;
> 
> is really checking if the value is not an integer or the value is not a
> 5-bit constant.  It seems to me this should work fine for signed and
> unsigned 5-bit numbers.

All negative numbers (-16..-1 here) have bits outside 0x1f set (all bits
outside it).


Segher

Reply via email to