1/* { dg-do run } */ 2/* { dg-options "-O -msse2" } */ 3/* { dg-require-effective-target sse2 } */ 4/* { dg-require-effective-target sse2_runtime } */ 5 6#include "isa-check.h" 7 8typedef long long S; 9typedef long long V __attribute__((vector_size(16))); 10typedef long long IV __attribute__((vector_size(16))); 11typedef union { S s[2]; V v; } U; 12 13static U i[2], b, c; 14 15extern int memcmp (const void *, const void *, __SIZE_TYPE__); 16#define assert(T) ((T) || (__builtin_trap (), 0)) 17 18#define TEST(E0, E1) \ 19 b.v = __builtin_ia32_vec_perm_v2di (i[0].v, i[1].v, (IV){E0, E1}); \ 20 c.s[0] = i[0].s[E0]; \ 21 c.s[1] = i[0].s[E1]; \ 22 __asm__("" : : : "memory"); \ 23 assert (memcmp (&b, &c, sizeof(c)) == 0); 24 25#include "vperm-2-2.inc" 26 27int main() 28{ 29 i[0].s[0] = 0; 30 i[0].s[1] = 1; 31 i[0].s[2] = 2; 32 i[0].s[3] = 3; 33 34 check(); 35 return 0; 36} 37