On Wed, Feb 23, 2022 at 05:21:26PM +0800, liuhongt via Gcc-patches wrote:
> For evex encoding vp{xor,or,and}, suffix is needed.
> 
> Or there would be an error for
> vpxor %ymm0, %ymm31, %ymm1

The insn is about V1TImode, so the error would be on
vpxor %xmm0, %xmm31, %xmm1

> 
> Error: unsupported instruction `vpxor'
> 
> Bootstrapped and regtested x86_64-pc-linux-gnu{-m32,}.
> Pushed to trunk.
> 
> gcc/ChangeLog:
> 
>       * config/i386/sse.md (<code>v1ti3): Add suffix and replace
>       isa attr of alternative 2 from avx to avx512vl.

The patch looks good, but I think it would be nice to have a dg-do assemble
testcase for it.
Something like untested:
/* { dg-do assemble { target { int128 && avx512vl } } } */
/* { dg-options "-O2 -mavx512vl" } */

typedef __int128 V __attribute__((vector_size (16)));

void
foo (V *x, V *y, V *z)
{
  register V a __asm ("xmm31") = *z;
  __asm ("" : "+v" (a));
  x[0] = y[0] & a;
  x[1] = y[1] | a;
  x[2] = y[2] ^ a;
}

        Jakub

Reply via email to