Debian Codegraph @

gcc/testsuite/gcc.target/i386/sse2-pshufhw-1.c

raw
1 /* { dg-do run } */
2 /* { dg-options "-O2 -msse2" } */
3 /* { dg-require-effective-target sse2 } */
4
5 #ifndef CHECK_H
6 #define CHECK_H "sse2-check.h"
7 #endif
8
9 #ifndef TEST
10 #define TEST sse2_test
11 #endif
12
13 #define N 0xec
14
15 #include CHECK_H
16
17 #include <emmintrin.h>
18
19 static __m128i
20 __attribute__((noinline, unused))
21 test (__m128i s1)
22 {
23 return _mm_shufflehi_epi16 (s1, N);
24 }
25
26 static void
27 TEST (void)
28 {
29 union128i_q s1;
30 union128i_w u;
31 short e[8] = {0};
32 int i;
33 int m1[4] = {0x3, 0x3<<2, 0x3<<4, 0x3<<6};
34 int m2[4];
35
36 s1.x = _mm_set_epi64x (0xabcde,0xef58a234);
37 u.x = test (s1.x);
38
39 for (i = 0; i < 4; i++)
40 e[i] = (s1.a[0]>>(16 * i)) & 0xffff;
41
42 for (i = 0; i < 4; i++)
43 m2[i] = (N & m1[i])>>(2*i);
44
45 for (i = 0; i < 4; i++)
46 e[i+4] = (s1.a[1] >> (16 * m2[i])) & 0xffff;
47
48 if (check_union128i_w(u, e))
49 abort ();
50 }