Debian Codegraph @

gcc/testsuite/gcc.target/powerpc/sse2-psrldq-1.c

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