| 1 |
/* { dg-do run } */ |
| 2 |
/* { dg-require-effective-target sse4 } */ |
| 3 |
/* { dg-options "-O2 -msse4.1" } */ |
| 4 |
|
| 5 |
#ifndef CHECK_H |
| 6 |
#define CHECK_H "sse4_1-check.h" |
| 7 |
#endif |
| 8 |
|
| 9 |
#ifndef TEST |
| 10 |
#define TEST sse4_1_test |
| 11 |
#endif |
| 12 |
|
| 13 |
#include CHECK_H |
| 14 |
|
| 15 |
#include <smmintrin.h> |
| 16 |
#include <string.h> |
| 17 |
|
| 18 |
#define NUM 20 |
| 19 |
|
| 20 |
static void |
| 21 |
init_movntdqa (int *src) |
| 22 |
{ |
| 23 |
int i, j, sign = 1; |
| 24 |
|
| 25 |
for (i = 0; i < NUM; i++) |
| 26 |
for (j = 0; j < 4; j++) |
| 27 |
{ |
| 28 |
src[i * 4 + j] = j * i * i * sign; |
| 29 |
sign = -sign; |
| 30 |
} |
| 31 |
} |
| 32 |
|
| 33 |
static void |
| 34 |
TEST (void) |
| 35 |
{ |
| 36 |
union |
| 37 |
{ |
| 38 |
__m128i x[NUM]; |
| 39 |
int i[NUM * 4]; |
| 40 |
} dst, src; |
| 41 |
int i; |
| 42 |
|
| 43 |
init_movntdqa (src.i); |
| 44 |
|
| 45 |
for (i = 0; i < NUM; i++) |
| 46 |
dst.x[i] = _mm_stream_load_si128 (&src.x[i]); |
| 47 |
|
| 48 |
for (i = 0; i < NUM; i++) |
| 49 |
if (memcmp (&dst.x[i], &src.x[i], sizeof(src.x[i]))) |
| 50 |
abort (); |
| 51 |
} |