| 1 |
/* { dg-do run } */ |
| 2 |
/* { dg-options "-O2 -fno-strict-aliasing -msse2" } */ |
| 3 |
/* { dg-additional-options "-mno-mmx" { target { ! ia32 } } } */ |
| 4 |
|
| 5 |
#include "sse2-check.h" |
| 6 |
|
| 7 |
__attribute__((noinline, noclone)) |
| 8 |
static void |
| 9 |
test_set (char i0, char i1, char i2, char i3, |
| 10 |
char i4, char i5, char i6, char i7, long long *r) |
| 11 |
{ |
| 12 |
*(__m64 *) r = _mm_set_pi8 (i0, i1, i2, i3, i4, i5, i6, i7); |
| 13 |
} |
| 14 |
|
| 15 |
/* Routine to manually compute the results */ |
| 16 |
static void |
| 17 |
compute_correct_result (char i0, char i1, char i2, char i3, |
| 18 |
char i4, char i5, char i6, char i7, |
| 19 |
long long *res_p) |
| 20 |
{ |
| 21 |
char *res = (char *) res_p; |
| 22 |
res[0] = i7; |
| 23 |
res[1] = i6; |
| 24 |
res[2] = i5; |
| 25 |
res[3] = i4; |
| 26 |
res[4] = i3; |
| 27 |
res[5] = i2; |
| 28 |
res[6] = i1; |
| 29 |
res[7] = i0; |
| 30 |
} |
| 31 |
|
| 32 |
static void |
| 33 |
sse2_test (void) |
| 34 |
{ |
| 35 |
char i0, i1, i2, i3, i4, i5, i6, i7; |
| 36 |
long long r, ck; |
| 37 |
|
| 38 |
/* Run the MMX tests */ |
| 39 |
i0 = 0x12; |
| 40 |
i1 = 0x34; |
| 41 |
i2 = 0x56; |
| 42 |
i3 = 0x78; |
| 43 |
i4 = 0x90; |
| 44 |
i5 = 0xab; |
| 45 |
i6 = 0xcd; |
| 46 |
i7 = 0xef; |
| 47 |
test_set (i0, i1, i2, i3, i4, i5, i6, i7, &r); |
| 48 |
compute_correct_result (i0, i1, i2, i3, i4, i5, i6, i7, &ck); |
| 49 |
if (ck != r) |
| 50 |
abort (); |
| 51 |
} |