2 /* { dg-options "-O3 -fno-inline" } */
6 extern void abort (void);
8 #define VARIANTS(VARIANT, STRUCT) \
9 VARIANT (uint8, , 8, _u8, 6, STRUCT) \
10 VARIANT (uint16, , 4, _u16, 3, STRUCT) \
11 VARIANT (uint32, , 2, _u32, 1, STRUCT) \
12 VARIANT (uint64, , 1, _u64, 0, STRUCT) \
13 VARIANT (int8, , 8, _s8, 5, STRUCT) \
14 VARIANT (int16, , 4, _s16, 2, STRUCT) \
15 VARIANT (int32, , 2, _s32, 0, STRUCT) \
16 VARIANT (int64, , 1, _s64, 0, STRUCT) \
17 VARIANT (poly8, , 8, _p8, 7, STRUCT) \
18 VARIANT (poly16, , 4, _p16, 1, STRUCT) \
19 VARIANT (float32, , 2, _f32, 1, STRUCT) \
20 VARIANT (float64, , 1, _f64, 0, STRUCT) \
21 VARIANT (uint8, q, 16, _u8, 14, STRUCT) \
22 VARIANT (uint16, q, 8, _u16, 4, STRUCT) \
23 VARIANT (uint32, q, 4, _u32, 3, STRUCT) \
24 VARIANT (uint64, q, 2, _u64, 0, STRUCT) \
25 VARIANT (int8, q, 16, _s8, 13, STRUCT) \
26 VARIANT (int16, q, 8, _s16, 6, STRUCT) \
27 VARIANT (int32, q, 4, _s32, 2, STRUCT) \
28 VARIANT (int64, q, 2, _s64, 1, STRUCT) \
29 VARIANT (poly8, q, 16, _p8, 12, STRUCT) \
30 VARIANT (poly16, q, 8, _p16, 5, STRUCT) \
31 VARIANT (float32, q, 4, _f32, 1, STRUCT)\
32 VARIANT (float64, q, 2, _f64, 0, STRUCT)
34 #define TESTMETH(BASE, Q, ELTS, SUFFIX, LANE, STRUCT) \
36 test_vst##STRUCT##Q##_lane##SUFFIX (const BASE##_t *data) \
38 BASE##x##ELTS##x##STRUCT##_t vectors; \
39 for (int i = 0; i < STRUCT; i++, data += ELTS) \
40 vectors.val[i] = vld1##Q##SUFFIX (data); \
41 BASE##_t temp[STRUCT]; \
42 vst##STRUCT##Q##_lane##SUFFIX (temp, vectors, LANE); \
43 for (int i = 0; i < STRUCT; i++) \
45 if (temp[i] != vget##Q##_lane##SUFFIX (vectors.val[i], LANE)) \
51 /* Tests of vst2_lane and vst2q_lane. */
52 VARIANTS (TESTMETH
, 2)
53 /* Tests of vst3_lane and vst3q_lane. */
54 VARIANTS (TESTMETH
, 3)
55 /* Tests of vst4_lane and vst4q_lane. */
56 VARIANTS (TESTMETH
, 4)
58 #define CHECK(BASE, Q, ELTS, SUFFIX, LANE, STRUCT) \
59 if (test_vst##STRUCT##Q##_lane##SUFFIX ((const BASE##_t *)orig_data)) \
63 main (int argc
, char **argv
)
65 /* Original data for all vector formats. */
66 uint64_t orig_data
[8] = {0x1234567890abcdefULL
, 0x13579bdf02468aceULL
,
67 0x012389ab4567cdefULL
, 0xfeeddadacafe0431ULL
,
68 0x1032547698badcfeULL
, 0xbadbadbadbad0badULL
,
69 0x0102030405060708ULL
, 0x0f0e0d0c0b0a0908ULL
};