1 /* { dg-do run { target { ! ia32 } } } */
2 /* { dg-require-effective-target sse4 } */
3 /* { dg-options "-O2 -msse4.1" } */
4
5
6 #ifndef CHECK
7 #define CHECK "sse4_1-check.h"
8 #endif
9
10 #ifndef TEST
11 #define TEST sse4_1_test
12 #endif
13
14 #include CHECK
15
16 #include "sse4_1-vec-set-1a.c"
17
18 #define CALC_TEST(vtype, type, N, idx) \
19 do \
20 { \
21 int i,val = idx * idx - idx * 3 + 16; \
22 type res[N],exp[N]; \
23 vtype resv; \
24 for (i = 0; i < N; i++) \
25 { \
26 res[i] = i * i - i * 3 + 15; \
27 exp[i] = res[i]; \
28 } \
29 exp[idx] = val; \
30 resv = foo_##vtype (*(vtype *)&res[0], val, idx); \
31 for (i = 0; i < N; i++) \
32 { \
33 if (resv[i] != exp[i]) \
34 abort (); \
35 } \
36 } \
37 while (0)
38
39 static void
40 TEST (void)
41 {
42 CALC_TEST (v4qi, char, 4, 2);
43 CALC_TEST (v2hi, short, 2, 1);
44 }