| 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_pslldq_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_slli_si128 (s1, N); |
| 25 |
} |
| 26 |
|
| 27 |
static void |
| 28 |
TEST (void) |
| 29 |
{ |
| 30 |
union128i_b u, s; |
| 31 |
char src[16] = |
| 32 |
{ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16 }; |
| 33 |
char e[16] = |
| 34 |
{ 0 }; |
| 35 |
int i; |
| 36 |
|
| 37 |
s.x = _mm_loadu_si128 ((__m128i *) src); |
| 38 |
|
| 39 |
u.x = test (s.x); |
| 40 |
|
| 41 |
for (i = 0; i < 16 - N; i++) |
| 42 |
e[i + N] = src[i]; |
| 43 |
|
| 44 |
if (check_union128i_b (u, e)) |
| 45 |
{ |
| 46 |
#if DEBUG |
| 47 |
printf ("sse2_test_pslldq_1; check_union128i_b failed\n"); |
| 48 |
printf ("\t s ([%x,%x,%x,%x, %x,%x,%x,%x, %x,%x,%x,%x, %x,%x,%x,%x])\n", |
| 49 |
s.a[0], s.a[1], s.a[2], s.a[3], s.a[4], s.a[5], s.a[6], s.a[7], |
| 50 |
s.a[8], s.a[9], s.a[10], s.a[11], s.a[12], s.a[13], s.a[14], |
| 51 |
s.a[15]); |
| 52 |
printf ("\t u ->\t [%x,%x,%x,%x, %x,%x,%x,%x," |
| 53 |
" %x,%x,%x,%x, %x,%x,%x,%x]\n", |
| 54 |
u.a[0], u.a[1], u.a[2], u.a[3], u.a[4], u.a[5], u.a[6], u.a[7], |
| 55 |
u.a[8], u.a[9], u.a[10], u.a[11], u.a[12], u.a[13], u.a[14], |
| 56 |
u.a[15]); |
| 57 |
printf ("\t expect\t [%x,%x,%x,%x, %x,%x,%x,%x," |
| 58 |
" %x,%x,%x,%x, %x,%x,%x,%x]\n", |
| 59 |
e[0], e[1], e[2], e[3], e[4], e[5], e[6], e[7], e[8], e[9], |
| 60 |
e[10], e[11], e[12], e[13], e[14], e[15]); |
| 61 |
#endif |
| 62 |
abort (); |
| 63 |
} |
| 64 |
} |