OSDN Git Service

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