Update concepts branch to revision 131834
[official-gcc.git] / gcc / testsuite / gcc.target / i386 / sse2-vec-4.c
blob31e480659cca3035950ba3b262d0fef219765ae2
1 /* { dg-do run } */
2 /* { dg-options "-O2 -msse2" } */
4 #include "sse2-check.h"
6 #include <emmintrin.h>
8 static void
9 sse2_test (void)
11 union
13 __m128i x;
14 char c[16];
15 short s[8];
16 int i[4];
17 long long ll[2];
18 } val1;
19 short res[8];
20 int masks[8];
21 int i;
23 for (i = 0; i < 16; i++)
24 val1.c[i] = i;
26 res[0] = __builtin_ia32_vec_ext_v8hi ((__v8hi)val1.x, 0);
27 res[1] = __builtin_ia32_vec_ext_v8hi ((__v8hi)val1.x, 1);
28 res[2] = __builtin_ia32_vec_ext_v8hi ((__v8hi)val1.x, 2);
29 res[3] = __builtin_ia32_vec_ext_v8hi ((__v8hi)val1.x, 3);
30 res[4] = __builtin_ia32_vec_ext_v8hi ((__v8hi)val1.x, 4);
31 res[5] = __builtin_ia32_vec_ext_v8hi ((__v8hi)val1.x, 5);
32 res[6] = __builtin_ia32_vec_ext_v8hi ((__v8hi)val1.x, 6);
33 res[7] = __builtin_ia32_vec_ext_v8hi ((__v8hi)val1.x, 7);
35 for (i = 0; i < 8; i++)
36 masks[i] = i;
38 for (i = 0; i < 8; i++)
39 if (res[i] != val1.s [masks[i]])
40 abort ();