2 /* { dg-options "-O3" } */
6 extern void abort (void);
8 #define TESTMETH(BASE, ELTS, STRUCT, SUFFIX) \
9 int __attribute__ ((noinline)) \
10 test_vld##STRUCT##SUFFIX () \
12 BASE##_t data[ELTS * STRUCT]; \
13 BASE##_t temp[ELTS]; \
14 BASE##x##ELTS##x##STRUCT##_t vectors; \
16 for (i = 0; i < STRUCT * ELTS; i++) \
17 data [i] = (BASE##_t) 2*i + 1; \
18 asm volatile ("" : : : "memory"); \
19 vectors = vld##STRUCT##SUFFIX (data); \
20 for (i = 0; i < STRUCT; i++) \
22 vst1##SUFFIX (temp, vectors.val[i]); \
23 asm volatile ("" : : : "memory"); \
24 for (j = 0; j < ELTS; j++) \
25 if (temp[j] != data[i + STRUCT*j]) \
31 #define VARIANTS(VARIANT, STRUCT) \
32 VARIANT (uint8, 8, STRUCT, _u8) \
33 VARIANT (uint16, 4, STRUCT, _u16) \
34 VARIANT (uint32, 2, STRUCT, _u32) \
35 VARIANT (uint64, 1, STRUCT, _u64) \
36 VARIANT (int8, 8, STRUCT, _s8) \
37 VARIANT (int16, 4, STRUCT, _s16) \
38 VARIANT (int32, 2, STRUCT, _s32) \
39 VARIANT (int64, 1, STRUCT, _s64) \
40 VARIANT (poly8, 8, STRUCT, _p8) \
41 VARIANT (poly16, 4, STRUCT, _p16) \
42 VARIANT (float16, 4, STRUCT, _f16) \
43 VARIANT (float32, 2, STRUCT, _f32) \
44 VARIANT (float64, 1, STRUCT, _f64) \
45 VARIANT (uint8, 16, STRUCT, q_u8) \
46 VARIANT (uint16, 8, STRUCT, q_u16) \
47 VARIANT (uint32, 4, STRUCT, q_u32) \
48 VARIANT (uint64, 2, STRUCT, q_u64) \
49 VARIANT (int8, 16, STRUCT, q_s8) \
50 VARIANT (int16, 8, STRUCT, q_s16) \
51 VARIANT (int32, 4, STRUCT, q_s32) \
52 VARIANT (int64, 2, STRUCT, q_s64) \
53 VARIANT (poly8, 16, STRUCT, q_p8) \
54 VARIANT (poly16, 8, STRUCT, q_p16) \
55 VARIANT (float16, 8, STRUCT, q_f16) \
56 VARIANT (float32, 4, STRUCT, q_f32) \
57 VARIANT (float64, 2, STRUCT, q_f64)
59 /* Tests of vld2 and vld2q. */
60 VARIANTS (TESTMETH
, 2)
62 /* Tests of vld3 and vld3q. */
63 VARIANTS (TESTMETH
, 3)
65 /* Tests of vld4 and vld4q. */
66 VARIANTS (TESTMETH
, 4)
68 #define CHECK(BASE, ELTS, STRUCT, SUFFIX) \
69 if (test_vld##STRUCT##SUFFIX () != 0) \
73 main (int argc
, char **argv
)