| 1 |
/* { dg-do run } */ |
| 2 |
/* { dg-options "-O3 -mvsx" } */ |
| 3 |
/* { dg-additional-options "-mdejagnu-cpu=power8" { target { ! has_arch_pwr8 } } } */ |
| 4 |
/* { dg-require-effective-target p8vector_hw } */ |
| 5 |
|
| 6 |
#define NO_WARN_X86_INTRINSICS 1 |
| 7 |
#ifndef CHECK_H |
| 8 |
#define CHECK_H "mmx-check.h" |
| 9 |
#endif |
| 10 |
|
| 11 |
#ifndef TEST |
| 12 |
#define TEST mmx_test |
| 13 |
#endif |
| 14 |
|
| 15 |
#define N 0xb |
| 16 |
|
| 17 |
#include CHECK_H |
| 18 |
|
| 19 |
#include <mmintrin.h> |
| 20 |
|
| 21 |
static __m64 |
| 22 |
__attribute__((noinline, unused)) |
| 23 |
test (__m64 s1) |
| 24 |
{ |
| 25 |
return _mm_srl_pi32 (s1, N); |
| 26 |
} |
| 27 |
|
| 28 |
static void |
| 29 |
TEST (void) |
| 30 |
{ |
| 31 |
__m64_union u, s1; |
| 32 |
__m64_union e; |
| 33 |
int i; |
| 34 |
|
| 35 |
s1.as_m64 = _mm_setr_pi32 (1000, -20000); |
| 36 |
u.as_m64 = test (s1.as_m64); |
| 37 |
|
| 38 |
if (N < 16) |
| 39 |
for (i = 0; i < 2; i++) |
| 40 |
e.as_int[i] = (unsigned int)s1.as_int[i] >> N; |
| 41 |
|
| 42 |
if (u.as_m64 != e.as_m64) |
| 43 |
abort (); |
| 44 |
} |