2 #include "arm-neon-ref.h"
3 #include "compute-ref-data.h"
5 /* Expected results. */
7 VECT_VAR_DECL(expected0
,int,8,8) [] = { 0xf0, 0xf0, 0xf0, 0xf0,
8 0xf0, 0xf0, 0xf0, 0xf0 };
9 VECT_VAR_DECL(expected0
,int,16,4) [] = { 0xfff0, 0xfff0, 0xfff0, 0xfff0 };
10 VECT_VAR_DECL(expected0
,int,32,2) [] = { 0xfffffff0, 0xfffffff0 };
11 VECT_VAR_DECL(expected0
,int,64,1) [] = { 0xfffffffffffffff0 };
12 VECT_VAR_DECL(expected0
,uint
,8,8) [] = { 0xf0, 0xf0, 0xf0, 0xf0,
13 0xf0, 0xf0, 0xf0, 0xf0 };
14 VECT_VAR_DECL(expected0
,uint
,16,4) [] = { 0xfff0, 0xfff0, 0xfff0, 0xfff0 };
15 VECT_VAR_DECL(expected0
,uint
,32,2) [] = { 0xfffffff0, 0xfffffff0 };
16 VECT_VAR_DECL(expected0
,uint
,64,1) [] = { 0xfffffffffffffff0 };
17 VECT_VAR_DECL(expected0
,poly
,8,8) [] = { 0xf0, 0xf0, 0xf0, 0xf0,
18 0xf0, 0xf0, 0xf0, 0xf0 };
19 VECT_VAR_DECL(expected0
,poly
,16,4) [] = { 0xfff0, 0xfff0, 0xfff0, 0xfff0 };
20 VECT_VAR_DECL(expected0
,hfloat
,16,4) [] = { 0xcc00, 0xcc00, 0xcc00, 0xcc00 };
21 VECT_VAR_DECL(expected0
,hfloat
,32,2) [] = { 0xc1800000, 0xc1800000 };
22 VECT_VAR_DECL(expected0
,int,8,16) [] = { 0xf0, 0xf0, 0xf0, 0xf0,
23 0xf0, 0xf0, 0xf0, 0xf0,
24 0xf0, 0xf0, 0xf0, 0xf0,
25 0xf0, 0xf0, 0xf0, 0xf0 };
26 VECT_VAR_DECL(expected0
,int,16,8) [] = { 0xfff0, 0xfff0, 0xfff0, 0xfff0,
27 0xfff0, 0xfff0, 0xfff0, 0xfff0 };
28 VECT_VAR_DECL(expected0
,int,32,4) [] = { 0xfffffff0, 0xfffffff0,
29 0xfffffff0, 0xfffffff0 };
30 VECT_VAR_DECL(expected0
,int,64,2) [] = { 0xfffffffffffffff0,
32 VECT_VAR_DECL(expected0
,uint
,8,16) [] = { 0xf0, 0xf0, 0xf0, 0xf0,
33 0xf0, 0xf0, 0xf0, 0xf0,
34 0xf0, 0xf0, 0xf0, 0xf0,
35 0xf0, 0xf0, 0xf0, 0xf0 };
36 VECT_VAR_DECL(expected0
,uint
,16,8) [] = { 0xfff0, 0xfff0, 0xfff0, 0xfff0,
37 0xfff0, 0xfff0, 0xfff0, 0xfff0 };
38 VECT_VAR_DECL(expected0
,uint
,32,4) [] = { 0xfffffff0, 0xfffffff0,
39 0xfffffff0, 0xfffffff0 };
40 VECT_VAR_DECL(expected0
,uint
,64,2) [] = { 0xfffffffffffffff0,
42 VECT_VAR_DECL(expected0
,poly
,8,16) [] = { 0xf0, 0xf0, 0xf0, 0xf0,
43 0xf0, 0xf0, 0xf0, 0xf0,
44 0xf0, 0xf0, 0xf0, 0xf0,
45 0xf0, 0xf0, 0xf0, 0xf0 };
46 VECT_VAR_DECL(expected0
,poly
,16,8) [] = { 0xfff0, 0xfff0, 0xfff0, 0xfff0,
47 0xfff0, 0xfff0, 0xfff0, 0xfff0 };
48 VECT_VAR_DECL(expected0
,hfloat
,16,8) [] = { 0xcc00, 0xcc00, 0xcc00, 0xcc00,
49 0xcc00, 0xcc00, 0xcc00, 0xcc00 };
50 VECT_VAR_DECL(expected0
,hfloat
,32,4) [] = { 0xc1800000, 0xc1800000,
51 0xc1800000, 0xc1800000 };
54 VECT_VAR_DECL(expected1
,int,8,8) [] = { 0xf1, 0xf1, 0xf1, 0xf1,
55 0xf1, 0xf1, 0xf1, 0xf1 };
56 VECT_VAR_DECL(expected1
,int,16,4) [] = { 0xfff1, 0xfff1, 0xfff1, 0xfff1 };
57 VECT_VAR_DECL(expected1
,int,32,2) [] = { 0xfffffff1, 0xfffffff1 };
58 VECT_VAR_DECL(expected1
,int,64,1) [] = { 0xfffffffffffffff1 };
59 VECT_VAR_DECL(expected1
,uint
,8,8) [] = { 0xf1, 0xf1, 0xf1, 0xf1,
60 0xf1, 0xf1, 0xf1, 0xf1 };
61 VECT_VAR_DECL(expected1
,uint
,16,4) [] = { 0xfff1, 0xfff1, 0xfff1, 0xfff1 };
62 VECT_VAR_DECL(expected1
,uint
,32,2) [] = { 0xfffffff1, 0xfffffff1 };
63 VECT_VAR_DECL(expected1
,uint
,64,1) [] = { 0xfffffffffffffff1 };
64 VECT_VAR_DECL(expected1
,poly
,8,8) [] = { 0xf1, 0xf1, 0xf1, 0xf1,
65 0xf1, 0xf1, 0xf1, 0xf1 };
66 VECT_VAR_DECL(expected1
,poly
,16,4) [] = { 0xfff1, 0xfff1, 0xfff1, 0xfff1 };
67 VECT_VAR_DECL(expected1
,hfloat
,16,4) [] = { 0xcb80, 0xcb80, 0xcb80, 0xcb80 };
68 VECT_VAR_DECL(expected1
,hfloat
,32,2) [] = { 0xc1700000, 0xc1700000 };
69 VECT_VAR_DECL(expected1
,int,8,16) [] = { 0xf1, 0xf1, 0xf1, 0xf1,
70 0xf1, 0xf1, 0xf1, 0xf1,
71 0xf1, 0xf1, 0xf1, 0xf1,
72 0xf1, 0xf1, 0xf1, 0xf1 };
73 VECT_VAR_DECL(expected1
,int,16,8) [] = { 0xfff1, 0xfff1, 0xfff1, 0xfff1,
74 0xfff1, 0xfff1, 0xfff1, 0xfff1 };
75 VECT_VAR_DECL(expected1
,int,32,4) [] = { 0xfffffff1, 0xfffffff1,
76 0xfffffff1, 0xfffffff1 };
77 VECT_VAR_DECL(expected1
,int,64,2) [] = { 0xfffffffffffffff1,
79 VECT_VAR_DECL(expected1
,uint
,8,16) [] = { 0xf1, 0xf1, 0xf1, 0xf1,
80 0xf1, 0xf1, 0xf1, 0xf1,
81 0xf1, 0xf1, 0xf1, 0xf1,
82 0xf1, 0xf1, 0xf1, 0xf1 };
83 VECT_VAR_DECL(expected1
,uint
,16,8) [] = { 0xfff1, 0xfff1, 0xfff1, 0xfff1,
84 0xfff1, 0xfff1, 0xfff1, 0xfff1 };
85 VECT_VAR_DECL(expected1
,uint
,32,4) [] = { 0xfffffff1, 0xfffffff1,
86 0xfffffff1, 0xfffffff1 };
87 VECT_VAR_DECL(expected1
,uint
,64,2) [] = { 0xfffffffffffffff1,
89 VECT_VAR_DECL(expected1
,poly
,8,16) [] = { 0xf1, 0xf1, 0xf1, 0xf1,
90 0xf1, 0xf1, 0xf1, 0xf1,
91 0xf1, 0xf1, 0xf1, 0xf1,
92 0xf1, 0xf1, 0xf1, 0xf1 };
93 VECT_VAR_DECL(expected1
,poly
,16,8) [] = { 0xfff1, 0xfff1, 0xfff1, 0xfff1,
94 0xfff1, 0xfff1, 0xfff1, 0xfff1 };
95 VECT_VAR_DECL(expected1
,hfloat
,16,8) [] = { 0xcb80, 0xcb80, 0xcb80, 0xcb80,
96 0xcb80, 0xcb80, 0xcb80, 0xcb80 };
97 VECT_VAR_DECL(expected1
,hfloat
,32,4) [] = { 0xc1700000, 0xc1700000,
98 0xc1700000, 0xc1700000 };
101 VECT_VAR_DECL(expected2
,int,8,8) [] = { 0xf2, 0xf2, 0xf2, 0xf2,
102 0xf2, 0xf2, 0xf2, 0xf2 };
103 VECT_VAR_DECL(expected2
,int,16,4) [] = { 0xfff2, 0xfff2, 0xfff2, 0xfff2 };
104 VECT_VAR_DECL(expected2
,int,32,2) [] = { 0xfffffff2, 0xfffffff2 };
105 VECT_VAR_DECL(expected2
,int,64,1) [] = { 0xfffffffffffffff2 };
106 VECT_VAR_DECL(expected2
,uint
,8,8) [] = { 0xf2, 0xf2, 0xf2, 0xf2,
107 0xf2, 0xf2, 0xf2, 0xf2 };
108 VECT_VAR_DECL(expected2
,uint
,16,4) [] = { 0xfff2, 0xfff2, 0xfff2, 0xfff2 };
109 VECT_VAR_DECL(expected2
,uint
,32,2) [] = { 0xfffffff2, 0xfffffff2 };
110 VECT_VAR_DECL(expected2
,uint
,64,1) [] = { 0xfffffffffffffff2 };
111 VECT_VAR_DECL(expected2
,poly
,8,8) [] = { 0xf2, 0xf2, 0xf2, 0xf2,
112 0xf2, 0xf2, 0xf2, 0xf2 };
113 VECT_VAR_DECL(expected2
,poly
,16,4) [] = { 0xfff2, 0xfff2, 0xfff2, 0xfff2 };
114 VECT_VAR_DECL(expected2
,hfloat
,16,4) [] = { 0xcb00, 0xcb00, 0xcb00, 0xcb00 };
115 VECT_VAR_DECL(expected2
,hfloat
,32,2) [] = { 0xc1600000, 0xc1600000 };
116 VECT_VAR_DECL(expected2
,int,8,16) [] = { 0xf2, 0xf2, 0xf2, 0xf2,
117 0xf2, 0xf2, 0xf2, 0xf2,
118 0xf2, 0xf2, 0xf2, 0xf2,
119 0xf2, 0xf2, 0xf2, 0xf2 };
120 VECT_VAR_DECL(expected2
,int,16,8) [] = { 0xfff2, 0xfff2, 0xfff2, 0xfff2,
121 0xfff2, 0xfff2, 0xfff2, 0xfff2 };
122 VECT_VAR_DECL(expected2
,int,32,4) [] = { 0xfffffff2, 0xfffffff2,
123 0xfffffff2, 0xfffffff2 };
124 VECT_VAR_DECL(expected2
,int,64,2) [] = { 0xfffffffffffffff2,
125 0xfffffffffffffff2 };
126 VECT_VAR_DECL(expected2
,uint
,8,16) [] = { 0xf2, 0xf2, 0xf2, 0xf2,
127 0xf2, 0xf2, 0xf2, 0xf2,
128 0xf2, 0xf2, 0xf2, 0xf2,
129 0xf2, 0xf2, 0xf2, 0xf2 };
130 VECT_VAR_DECL(expected2
,uint
,16,8) [] = { 0xfff2, 0xfff2, 0xfff2, 0xfff2,
131 0xfff2, 0xfff2, 0xfff2, 0xfff2 };
132 VECT_VAR_DECL(expected2
,uint
,32,4) [] = { 0xfffffff2, 0xfffffff2,
133 0xfffffff2, 0xfffffff2 };
134 VECT_VAR_DECL(expected2
,uint
,64,2) [] = { 0xfffffffffffffff2,
135 0xfffffffffffffff2 };
136 VECT_VAR_DECL(expected2
,poly
,8,16) [] = { 0xf2, 0xf2, 0xf2, 0xf2,
137 0xf2, 0xf2, 0xf2, 0xf2,
138 0xf2, 0xf2, 0xf2, 0xf2,
139 0xf2, 0xf2, 0xf2, 0xf2 };
140 VECT_VAR_DECL(expected2
,poly
,16,8) [] = { 0xfff2, 0xfff2, 0xfff2, 0xfff2,
141 0xfff2, 0xfff2, 0xfff2, 0xfff2 };
142 VECT_VAR_DECL(expected2
,hfloat
,16,8) [] = { 0xcb00, 0xcb00, 0xcb00, 0xcb00,
143 0xcb00, 0xcb00, 0xcb00, 0xcb00 };
144 VECT_VAR_DECL(expected2
,hfloat
,32,4) [] = { 0xc1600000, 0xc1600000,
145 0xc1600000, 0xc1600000 };
147 #define TEST_MSG "VLD1_DUP/VLD1_DUPQ"
148 void exec_vld1_dup (void)
152 /* Fill vector with buffer item #i. */
153 #define TEST_VLD1_DUP(VAR, BUF, Q, T1, T2, W, N) \
154 VECT_VAR(VAR, T1, W, N) = \
155 vld1##Q##_dup_##T2##W(&VECT_VAR(BUF, T1, W, N)[i]); \
156 vst1##Q##_##T2##W(VECT_VAR(result, T1, W, N), VECT_VAR(VAR, T1, W, N))
158 DECL_VARIABLE_ALL_VARIANTS(vector
);
160 /* Try to read different places from the input buffer. */
161 for (i
=0; i
<3; i
++) {
164 TEST_MACRO_ALL_VARIANTS_2_5(TEST_VLD1_DUP
, vector
, buffer_dup
);
166 #if defined (__ARM_FP16_FORMAT_IEEE) || defined (__ARM_FP16_FORMAT_ALTERNATIVE)
167 TEST_VLD1_DUP(vector
, buffer_dup
, , float, f
, 16, 4);
168 TEST_VLD1_DUP(vector
, buffer_dup
, q
, float, f
, 16, 8);
170 TEST_VLD1_DUP(vector
, buffer_dup
, , float, f
, 32, 2);
171 TEST_VLD1_DUP(vector
, buffer_dup
, q
, float, f
, 32, 4);
175 CHECK_RESULTS_NAMED (TEST_MSG
, expected0
, "");
178 CHECK_RESULTS_NAMED (TEST_MSG
, expected1
, "");
181 CHECK_RESULTS_NAMED (TEST_MSG
, expected2
, "");