1 /* { dg-do run } */
2 /* { dg-options "-O3 -mpower8-vector -Wno-psabi" } */
3 /* { dg-require-effective-target p8vector_hw } */
4
5 #ifndef CHECK_H
6 #define CHECK_H "sse2-check.h"
7 #endif
8
9 #include CHECK_H
10
11 #ifndef TEST
12 #define TEST sse2_test_psrldq_1
13 #endif
14
15 #define N 0x5
16
17 #include <emmintrin.h>
18
19 static __m128i
20 __attribute__((noinline, unused))
21 test (__m128i s1)
22 {
23 return _mm_srli_si128 (s1, N);
24 }
25
26 static void
27 TEST (void)
28 {
29 union128i_b u, s;
30 char src[16] = { 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16 };
31 char e[16] = { 0 };
32 int i;
33
34 s.x = _mm_loadu_si128 ((__m128i *)src);
35
36 u.x = test (s.x);
37
38 for (i = 0; i < 16-N; i++)
39 e[i] = src[i+N];
40
41 if (check_union128i_b (u, e))
42 {
43 #if DEBUG
44 printf ("sse2_test_psrldq_1; check_union128i_b failed\n");
45 printf ("\tsrl\t([%x,%x,%x,%x, %x,%x,%x,%x,"
46 " %x,%x,%x,%x, %x,%x,%x,%x],\n",
47 s.a[0], s.a[1], s.a[2], s.a[3], s.a[4], s.a[5], s.a[6], s.a[7],
48 s.a[8], s.a[9], s.a[10], s.a[11], s.a[12], s.a[13], s.a[14],
49 s.a[15]);
50 printf ("\t ->\t [%x,%x,%x,%x, %x,%x,%x,%x, %x,%x,%x,%x, %x,%x,%x,%x]\n",
51 u.a[0], u.a[1], u.a[2], u.a[3], u.a[4], u.a[5], u.a[6], u.a[7],
52 u.a[8], u.a[9], u.a[10], u.a[11], u.a[12], u.a[13], u.a[14],
53 u.a[15]);
54 printf ("\texpect\t [%x,%x,%x,%x, %x,%x,%x,%x,"
55 " %x,%x,%x,%x, %x,%x,%x,%x]\n",
56 e[0], e[1], e[2], e[3], e[4], e[5], e[6], e[7], e[8], e[9],
57 e[10], e[11], e[12], e[13], e[14], e[15]);
58 #endif
59 abort ();
60 }
61 }