1 /* We haven't implemented these intrinsics for arm yet.  */
2 /* { dg-xfail-if "" { arm*-*-* } } */
3 /* { dg-do run } */
4 /* { dg-options "-O3" } */
5 
6 #include <arm_neon.h>
7 #include "arm-neon-ref.h"
8 
9 extern void abort (void);
10 
11 #define TESTMETH(BASE, ELTS, SUFFIX)	\
12 int __attribute__ ((noinline))			\
13 test_vst1##SUFFIX##_x3 ()			\
14 {						\
15   BASE##_t data[ELTS * 3];			\
16   BASE##_t temp[ELTS * 3];			\
17   BASE##x##ELTS##x##3##_t vectors;		\
18   int i,j;					\
19   for (i = 0; i < ELTS * 3; i++)		\
20     data [i] = (BASE##_t) 3*i;		\
21   asm volatile ("" : : : "memory");		\
22   vectors.val[0] = vld1##SUFFIX (data);		\
23   vectors.val[1] = vld1##SUFFIX (&data[ELTS]);	\
24   vectors.val[2] = vld1##SUFFIX (&data[ELTS * 2]);	\
25   vst1##SUFFIX##_x3 (temp, vectors);		\
26   asm volatile ("" : : : "memory");		\
27   for (j = 0; j < ELTS * 3; j++)		\
28     if (temp[j] != data[j])			\
29       return 1;					\
30   return 0;					\
31 }
32 
33 #define VARIANTS_1(VARIANT)	\
34 VARIANT (uint8, 8, _u8)		\
35 VARIANT (uint16, 4, _u16)	\
36 VARIANT (uint32, 2, _u32)	\
37 VARIANT (uint64, 1, _u64)	\
38 VARIANT (int8, 8, _s8)		\
39 VARIANT (int16, 4, _s16)	\
40 VARIANT (int32, 2, _s32)	\
41 VARIANT (int64, 1, _s64)	\
42 VARIANT (poly8, 8, _p8)		\
43 VARIANT (poly16, 4, _p16)	\
44 VARIANT (float16, 4, _f16)	\
45 VARIANT (float32, 2, _f32)	\
46 VARIANT (uint8, 16, q_u8)	\
47 VARIANT (uint16, 8, q_u16)	\
48 VARIANT (uint32, 4, q_u32)	\
49 VARIANT (uint64, 2, q_u64)	\
50 VARIANT (int8, 16, q_s8)	\
51 VARIANT (int16, 8, q_s16)	\
52 VARIANT (int32, 4, q_s32)	\
53 VARIANT (int64, 2, q_s64)	\
54 VARIANT (poly8, 16, q_p8)	\
55 VARIANT (poly16, 8, q_p16)	\
56 VARIANT (float16, 8, q_f16)	\
57 VARIANT (float32, 4, q_f32)
58 
59 #ifdef __aarch64__
60 #define VARIANTS(VARIANT) VARIANTS_1(VARIANT)	\
61 VARIANT (float64, 1, _f64)			\
62 VARIANT (float64, 2, q_f64)
63 #else
64 #define VARIANTS(VARIANT) VARIANTS_1(VARIANT)
65 #endif
66 
67 /* Tests of vst1_x3 and vst1q_x3.  */
VARIANTS(TESTMETH)68 VARIANTS (TESTMETH)
69 
70 #define CHECKS(BASE, ELTS, SUFFIX)	\
71   if (test_vst1##SUFFIX##_x3 () != 0)	\
72     fprintf (stderr, "test_vst1##SUFFIX##_x3");
73 
74 int
75 main (int argc, char **argv)
76 {
77   VARIANTS (CHECKS)
78 
79   return 0;
80 }
81 
82