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] PR 83402 Fix ICE for vec_splat_s8, vec_splat_s16, vec_splat_s32 builtins


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


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