On Mon, May 11, 2020 at 09:31:41PM -0500, Bill Schmidt wrote:
> On 5/11/20 7:16 AM, Segher Boessenkool wrote:
> >>    * config/rs6000/rs6000-c.c (altivec_resolve_overloaded_builtin):
> >>    Change fourth operand for vec_ternarylogic to require
> >>    compatibility with unsigned SImode rather than unsigned QImode.
> >Is it still checked for range 0..255 though?  (If the compiler can
> >derive that).
> 
> Yep, we already have this:
> 
>   if (icode == CODE_FOR_xxeval)
>     {
>       /* Only allow 8-bit unsigned literals.  */
>       STRIP_NOPS (arg3);
>       if (TREE_CODE (arg3) != INTEGER_CST
>           || TREE_INT_CST_LOW (arg3) & ~0xff)
>         {
>           error ("argument 4 must be an 8-bit unsigned literal");
>           return CONST0_RTX (tmode);
>         }
>     }

That test only makes sure that bits 0x00000000ffffff00 are zero -- which
does work correctly here because we do know the operand is SImode.
Tricky.


Segher

Reply via email to