| 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_pmuludq_1 |
| 14 |
#endif |
| 15 |
|
| 16 |
#include <emmintrin.h> |
| 17 |
|
| 18 |
static __m128i |
| 19 |
__attribute__((noinline, unused)) |
| 20 |
test (__m128i s1, __m128i s2) |
| 21 |
{ |
| 22 |
__asm("" : "+v"(s1), "+v"(s2)); |
| 23 |
return _mm_mul_epu32 (s1, s2); |
| 24 |
} |
| 25 |
|
| 26 |
static void |
| 27 |
TEST (void) |
| 28 |
{ |
| 29 |
union128i_d s1, s2; |
| 30 |
union128i_q u; |
| 31 |
long long e[2]; |
| 32 |
|
| 33 |
s1.x = _mm_set_epi32 (10,2067,3033,905); |
| 34 |
s2.x = _mm_set_epi32 (11, 9834, 7444, 10222); |
| 35 |
__asm("" : "+v"(s1.x), "+v"(s2.x)); |
| 36 |
u.x = test (s1.x, s2.x); |
| 37 |
|
| 38 |
e[0] = s1.a[0] * s2.a[0]; |
| 39 |
e[1] = s1.a[2] * s2.a[2]; |
| 40 |
|
| 41 |
if (check_union128i_q (u, e)) |
| 42 |
{ |
| 43 |
#if DEBUG |
| 44 |
printf ("sse2_test_pmuludq_1; check_union128i_q failed\n"); |
| 45 |
printf ("\t ([%x,%x,%x,%x], [%x,%x,%x,%x], -> [%llx, %llx])\n", s1.a[0], |
| 46 |
s1.a[1], s1.a[2], s1.a[3], s2.a[0], s2.a[1], s2.a[2], s2.a[3], |
| 47 |
u.a[0], u.a[1]); |
| 48 |
printf ("\t expect [%llx, %llx]\n", e[0], e[1]); |
| 49 |
#endif |
| 50 |
abort (); |
| 51 |
} |
| 52 |
} |