1  /* { dg-do compile } */
       2  /* { dg-require-effective-target lp64 } */
       3  /* { dg-options "-O3 -msse2" } */
       4  
       5  typedef long v2di __attribute__((vector_size(16)));
       6  typedef int v4si __attribute__((vector_size(16)));
       7  
       8  void bar (v4si *p, __int128_t *q)
       9  {
      10    union { __int128_t a; v4si b; } u;
      11    u.a = *q;
      12    (*p)[0] = u.b[0];
      13    (*p)[1] = u.b[2];
      14    (*p)[2] = u.b[1];
      15    (*p)[3] = u.b[3];
      16  }
      17  
      18  /* The function should end up with sth like
      19       [v]pshufd $216, (%esi), %xmm0
      20       [v]movdqa %xmm0, (%edi)
      21       ret
      22     recognized by SLP vectorization involving an existing "vector".  */
      23  /* { dg-final { scan-assembler-not "punpck" } } */
      24  /* { dg-final { scan-assembler-times "pshufd" 1 } } */