| 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_pmovmskb_1 |
| 14 |
#endif |
| 15 |
|
| 16 |
#include <emmintrin.h> |
| 17 |
|
| 18 |
#ifdef _ARCH_PWR8 |
| 19 |
static int |
| 20 |
__attribute__((noinline, unused)) |
| 21 |
test (__m128i s1) |
| 22 |
{ |
| 23 |
return _mm_movemask_epi8 (s1); |
| 24 |
} |
| 25 |
#endif |
| 26 |
|
| 27 |
static void |
| 28 |
TEST (void) |
| 29 |
{ |
| 30 |
#ifdef _ARCH_PWR8 |
| 31 |
union128i_b s1; |
| 32 |
int i, u, e=0; |
| 33 |
|
| 34 |
s1.x = _mm_set_epi8 (1,2,3,4,10,20,30,90,-80,-40,-100,-15,98, 25, 98,7); |
| 35 |
|
| 36 |
__asm("" : "+v"(s1.x)); |
| 37 |
u = test (s1.x); |
| 38 |
|
| 39 |
for (i = 0; i < 16; i++) |
| 40 |
if (s1.a[i] & (1<<7)) |
| 41 |
e = e | (1<<i); |
| 42 |
|
| 43 |
if (checkVi (&u, &e, 1)) |
| 44 |
{ |
| 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 (); |
| 55 |
} |
| 56 |
#endif |
| 57 |
} |