Daily bump.
[official-gcc.git] / gcc / testsuite / gcc.target / powerpc / sse2-pmovmskb-1.c
blob8740835c29d40615cd3d15f00d96eec4433df5fb
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 } */
6 #ifndef CHECK_H
7 #define CHECK_H "sse2-check.h"
8 #endif
10 #include CHECK_H
12 #ifndef TEST
13 #define TEST sse2_test_pmovmskb_1
14 #endif
16 #include <emmintrin.h>
18 #ifdef _ARCH_PWR8
19 static int
20 __attribute__((noinline, unused))
21 test (__m128i s1)
23 return _mm_movemask_epi8 (s1);
25 #endif
27 static void
28 TEST (void)
30 #ifdef _ARCH_PWR8
31 union128i_b s1;
32 int i, u, e=0;
34 s1.x = _mm_set_epi8 (1,2,3,4,10,20,30,90,-80,-40,-100,-15,98, 25, 98,7);
36 __asm("" : "+v"(s1.x));
37 u = test (s1.x);
39 for (i = 0; i < 16; i++)
40 if (s1.a[i] & (1<<7))
41 e = e | (1<<i);
43 if (checkVi (&u, &e, 1))
45 #if DEBUG
46 printf ("sse2_test_pmovmskb_1; checkVi failed\n");
47 printf ("\t ([%x,%x,%x,%x, %x,%x,%x,%x,"
48 " %x,%x,%x,%x, %x,%x,%x,%x], -> %x)\n",
49 s1.a[0], s1.a[1], s1.a[2], s1.a[3], s1.a[4], s1.a[5], s1.a[6],
50 s1.a[7], s1.a[8], s1.a[9], s1.a[10], s1.a[11], s1.a[12],
51 s1.a[13], s1.a[14], s1.a[15], u);
52 printf ("\t expect %x\n", e);
53 #endif
54 abort ();
56 #endif