blob: 1b3241ca9942465706e7e018907f473c3d6ddb15 [file] [log] [blame]
Christophe Lyon073831a2011-01-24 17:37:40 +01001/*
2
Christophe Lyon80902f62013-03-29 16:26:42 +01003Copyright (c) 2009, 2010, 2011, 2013 STMicroelectronics
Christophe Lyon073831a2011-01-24 17:37:40 +01004Written by Christophe Lyon
5
6Permission is hereby granted, free of charge, to any person obtaining a copy
7of this software and associated documentation files (the "Software"), to deal
8in the Software without restriction, including without limitation the rights
9to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10copies of the Software, and to permit persons to whom the Software is
11furnished to do so, subject to the following conditions:
12
13The above copyright notice and this permission notice shall be included in
14all copies or substantial portions of the Software.
15
16THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22THE SOFTWARE.
23
24*/
25
Christophe Lyon1775be02014-07-10 13:46:54 +020026#if defined(__arm__) || defined(__aarch64__)
Christophe Lyon073831a2011-01-24 17:37:40 +010027#include <arm_neon.h>
28#else
Christophe Lyon0dab5f72011-07-19 17:14:09 +020029#include "stm-arm-neon.h"
Christophe Lyon073831a2011-01-24 17:37:40 +010030#endif
31
32#include "stm-arm-neon-ref.h"
33
34#define TEST_MSG "VREINTERPRET/VREINTERPRETQ"
35
36void exec_vreinterpret (void)
37{
38 int i;
39
40 /* Basic test: y=vreinterpret(x), then store the result. */
41#define TEST_VREINTERPRET(Q, T1, T2, W, N, TS1, TS2, WS, NS) \
42 VECT_VAR(vector_res, T1, W, N) = \
43 vreinterpret##Q##_##T2##W##_##TS2##WS(VECT_VAR(vector, TS1, WS, NS)); \
44 vst1##Q##_##T2##W(VECT_VAR(result, T1, W, N), \
45 VECT_VAR(vector_res, T1, W, N)); \
46 DUMP(TEST_MSG, T1, W, N, PRIx##W);
47
Christophe Lyond9ab3e32014-07-11 16:44:32 +020048#define TEST_VREINTERPRET_POLY(Q, T1, T2, W, N, TS1, TS2, WS, NS) \
49 VECT_VAR(vector_res, T1, W, N) = \
50 vreinterpret##Q##_##T2##W##_##TS2##WS(VECT_VAR(vector, TS1, WS, NS)); \
51 vst1##Q##_##T2##W(VECT_VAR(result, T1, W, N), \
52 VECT_VAR(vector_res, T1, W, N)); \
53 DUMP_POLY(TEST_MSG, T1, W, N, PRIx##W);
54
Christophe Lyon073831a2011-01-24 17:37:40 +010055#define TEST_VREINTERPRET_FP(Q, T1, T2, W, N, TS1, TS2, WS, NS) \
56 VECT_VAR(vector_res, T1, W, N) = \
57 vreinterpret##Q##_##T2##W##_##TS2##WS(VECT_VAR(vector, TS1, WS, NS)); \
58 vst1##Q##_##T2##W(VECT_VAR(result, T1, W, N), \
59 VECT_VAR(vector_res, T1, W, N)); \
60 DUMP_FP(TEST_MSG, T1, W, N, PRIx##W);
61
Christophe Lyond98beba2016-08-24 18:02:41 +020062#if defined(__ARM_FP16_FORMAT_IEEE) && ( ((__ARM_FP & 0x2) != 0) || ((__ARM_NEON_FP16_INTRINSICS & 1) != 0) )
Christophe Lyon34adaf62013-04-11 15:05:18 +020063#define TEST_VREINTERPRET_FP16(Q, T1, T2, W, N, TS1, TS2, WS, NS) \
64 VECT_VAR(vector_res, T1, W, N) = \
65 vreinterpret##Q##_##T2##W##_##TS2##WS(VECT_VAR(vector, TS1, WS, NS)); \
66 vst1##Q##_##T2##W(VECT_VAR(result, T1, W, N), \
67 VECT_VAR(vector_res, T1, W, N)); \
68 DUMP_FP16(TEST_MSG, T1, W, N, PRIx##W);
69#endif
70
Christophe Lyon073831a2011-01-24 17:37:40 +010071 /* With ARM RVCT, we need to declare variables before any executable
72 statement */
73 DECL_VARIABLE_ALL_VARIANTS(vector);
74 DECL_VARIABLE_ALL_VARIANTS(vector_res);
Christophe Lyond98beba2016-08-24 18:02:41 +020075#if defined(__ARM_FP16_FORMAT_IEEE) && ( ((__ARM_FP & 0x2) != 0) || ((__ARM_NEON_FP16_INTRINSICS & 1) != 0) )
Christophe Lyon34adaf62013-04-11 15:05:18 +020076 DECL_VARIABLE(vector, float, 16, 4);
77 DECL_VARIABLE(vector_res, float, 16, 4);
78 DECL_VARIABLE(vector, float, 16, 8);
79 DECL_VARIABLE(vector_res, float, 16, 8);
80#endif
Christophe Lyon073831a2011-01-24 17:37:40 +010081
82 clean_results ();
83
84
85 /* Initialize input "vector" from "buffer" */
Christophe Lyonf2053672014-12-16 10:26:00 +010086 TEST_MACRO_ALL_VARIANTS_2_5(VLOAD, vector, buffer);
87 VLOAD(vector, buffer, , float, f, 32, 2);
88 VLOAD(vector, buffer, q, float, f, 32, 4);
Christophe Lyond98beba2016-08-24 18:02:41 +020089#if defined(__ARM_FP16_FORMAT_IEEE) && ( ((__ARM_FP & 0x2) != 0) || ((__ARM_NEON_FP16_INTRINSICS & 1) != 0) )
Christophe Lyonf2053672014-12-16 10:26:00 +010090 VLOAD(vector, buffer, , float, f, 16, 4);
91 VLOAD(vector, buffer, q, float, f, 16, 8);
Christophe Lyon34adaf62013-04-11 15:05:18 +020092#endif
Christophe Lyon073831a2011-01-24 17:37:40 +010093
94 /* The same result buffers are used multiple times, so output them
95 before overwriting them */
96 fprintf(ref_file, "\n%s output:\n", TEST_MSG);
Christophe Lyonbf218262014-07-10 15:53:15 +020097 fprintf(gcc_tests_file, "\n%s output:\n", TEST_MSG);
Christophe Lyon073831a2011-01-24 17:37:40 +010098
Christophe Lyon073831a2011-01-24 17:37:40 +010099 /* vreinterpret_s8_xx */
100 TEST_VREINTERPRET(, int, s, 8, 8, int, s, 16, 4);
101 TEST_VREINTERPRET(, int, s, 8, 8, int, s, 32, 2);
102 TEST_VREINTERPRET(, int, s, 8, 8, int, s, 64, 1);
103 TEST_VREINTERPRET(, int, s, 8, 8, uint, u, 8, 8);
104 TEST_VREINTERPRET(, int, s, 8, 8, uint, u, 16, 4);
105 TEST_VREINTERPRET(, int, s, 8, 8, uint, u, 32, 2);
106 TEST_VREINTERPRET(, int, s, 8, 8, uint, u, 64, 1);
Christophe Lyon80902f62013-03-29 16:26:42 +0100107 TEST_VREINTERPRET(, int, s, 8, 8, poly, p, 8, 8);
108 TEST_VREINTERPRET(, int, s, 8, 8, poly, p, 16, 4);
Christophe Lyon073831a2011-01-24 17:37:40 +0100109
110 /* vreinterpret_s16_xx */
111 TEST_VREINTERPRET(, int, s, 16, 4, int, s, 8, 8);
112 TEST_VREINTERPRET(, int, s, 16, 4, int, s, 32, 2);
113 TEST_VREINTERPRET(, int, s, 16, 4, int, s, 64, 1);
114 TEST_VREINTERPRET(, int, s, 16, 4, uint, u, 8, 8);
115 TEST_VREINTERPRET(, int, s, 16, 4, uint, u, 16, 4);
116 TEST_VREINTERPRET(, int, s, 16, 4, uint, u, 32, 2);
117 TEST_VREINTERPRET(, int, s, 16, 4, uint, u, 64, 1);
Christophe Lyon80902f62013-03-29 16:26:42 +0100118 TEST_VREINTERPRET(, int, s, 16, 4, poly, p, 8, 8);
119 TEST_VREINTERPRET(, int, s, 16, 4, poly, p, 16, 4);
Christophe Lyon073831a2011-01-24 17:37:40 +0100120
121 /* vreinterpret_s32_xx */
122 TEST_VREINTERPRET(, int, s, 32, 2, int, s, 8, 8);
123 TEST_VREINTERPRET(, int, s, 32, 2, int, s, 16, 4);
124 TEST_VREINTERPRET(, int, s, 32, 2, int, s, 64, 1);
125 TEST_VREINTERPRET(, int, s, 32, 2, uint, u, 8, 8);
126 TEST_VREINTERPRET(, int, s, 32, 2, uint, u, 16, 4);
127 TEST_VREINTERPRET(, int, s, 32, 2, uint, u, 32, 2);
128 TEST_VREINTERPRET(, int, s, 32, 2, uint, u, 64, 1);
Christophe Lyon80902f62013-03-29 16:26:42 +0100129 TEST_VREINTERPRET(, int, s, 32, 2, poly, p, 8, 8);
130 TEST_VREINTERPRET(, int, s, 32, 2, poly, p, 16, 4);
Christophe Lyon073831a2011-01-24 17:37:40 +0100131
132 /* vreinterpret_s64_xx */
133 TEST_VREINTERPRET(, int, s, 64, 1, int, s, 8, 8);
134 TEST_VREINTERPRET(, int, s, 64, 1, int, s, 16, 4);
135 TEST_VREINTERPRET(, int, s, 64, 1, int, s, 32, 2);
136 TEST_VREINTERPRET(, int, s, 64, 1, uint, u, 8, 8);
137 TEST_VREINTERPRET(, int, s, 64, 1, uint, u, 16, 4);
138 TEST_VREINTERPRET(, int, s, 64, 1, uint, u, 32, 2);
139 TEST_VREINTERPRET(, int, s, 64, 1, uint, u, 64, 1);
Christophe Lyon80902f62013-03-29 16:26:42 +0100140 TEST_VREINTERPRET(, int, s, 64, 1, poly, p, 8, 8);
141 TEST_VREINTERPRET(, int, s, 64, 1, poly, p, 16, 4);
Christophe Lyon073831a2011-01-24 17:37:40 +0100142
143 /* vreinterpret_u8_xx */
144 TEST_VREINTERPRET(, uint, u, 8, 8, int, s, 8, 8);
145 TEST_VREINTERPRET(, uint, u, 8, 8, int, s, 16, 4);
146 TEST_VREINTERPRET(, uint, u, 8, 8, int, s, 32, 2);
147 TEST_VREINTERPRET(, uint, u, 8, 8, int, s, 64, 1);
148 TEST_VREINTERPRET(, uint, u, 8, 8, uint, u, 16, 4);
149 TEST_VREINTERPRET(, uint, u, 8, 8, uint, u, 32, 2);
150 TEST_VREINTERPRET(, uint, u, 8, 8, uint, u, 64, 1);
Christophe Lyon80902f62013-03-29 16:26:42 +0100151 TEST_VREINTERPRET(, uint, u, 8, 8, poly, p, 8, 8);
152 TEST_VREINTERPRET(, uint, u, 8, 8, poly, p, 16, 4);
Christophe Lyon073831a2011-01-24 17:37:40 +0100153
154 /* vreinterpret_u16_xx */
155 TEST_VREINTERPRET(, uint, u, 16, 4, int, s, 8, 8);
156 TEST_VREINTERPRET(, uint, u, 16, 4, int, s, 16, 4);
157 TEST_VREINTERPRET(, uint, u, 16, 4, int, s, 32, 2);
158 TEST_VREINTERPRET(, uint, u, 16, 4, int, s, 64, 1);
159 TEST_VREINTERPRET(, uint, u, 16, 4, uint, u, 8, 8);
160 TEST_VREINTERPRET(, uint, u, 16, 4, uint, u, 32, 2);
161 TEST_VREINTERPRET(, uint, u, 16, 4, uint, u, 64, 1);
Christophe Lyon80902f62013-03-29 16:26:42 +0100162 TEST_VREINTERPRET(, uint, u, 16, 4, poly, p, 8, 8);
163 TEST_VREINTERPRET(, uint, u, 16, 4, poly, p, 16, 4);
Christophe Lyon073831a2011-01-24 17:37:40 +0100164
165 /* vreinterpret_u32_xx */
166 TEST_VREINTERPRET(, uint, u, 32, 2, int, s, 8, 8);
167 TEST_VREINTERPRET(, uint, u, 32, 2, int, s, 16, 4);
168 TEST_VREINTERPRET(, uint, u, 32, 2, int, s, 32, 2);
169 TEST_VREINTERPRET(, uint, u, 32, 2, int, s, 64, 1);
170 TEST_VREINTERPRET(, uint, u, 32, 2, uint, u, 8, 8);
171 TEST_VREINTERPRET(, uint, u, 32, 2, uint, u, 16, 4);
172 TEST_VREINTERPRET(, uint, u, 32, 2, uint, u, 64, 1);
Christophe Lyon80902f62013-03-29 16:26:42 +0100173 TEST_VREINTERPRET(, uint, u, 32, 2, poly, p, 8, 8);
174 TEST_VREINTERPRET(, uint, u, 32, 2, poly, p, 16, 4);
Christophe Lyon073831a2011-01-24 17:37:40 +0100175
176 /* vreinterpret_u64_xx */
177 TEST_VREINTERPRET(, uint, u, 64, 1, int, s, 8, 8);
178 TEST_VREINTERPRET(, uint, u, 64, 1, int, s, 16, 4);
179 TEST_VREINTERPRET(, uint, u, 64, 1, int, s, 32, 2);
180 TEST_VREINTERPRET(, uint, u, 64, 1, int, s, 64, 1);
181 TEST_VREINTERPRET(, uint, u, 64, 1, uint, u, 8, 8);
182 TEST_VREINTERPRET(, uint, u, 64, 1, uint, u, 16, 4);
183 TEST_VREINTERPRET(, uint, u, 64, 1, uint, u, 32, 2);
Christophe Lyon80902f62013-03-29 16:26:42 +0100184 TEST_VREINTERPRET(, uint, u, 64, 1, poly, p, 8, 8);
185 TEST_VREINTERPRET(, uint, u, 64, 1, poly, p, 16, 4);
186
187 /* vreinterpret_p8_xx */
Christophe Lyond9ab3e32014-07-11 16:44:32 +0200188 TEST_VREINTERPRET_POLY(, poly, p, 8, 8, int, s, 8, 8);
189 TEST_VREINTERPRET_POLY(, poly, p, 8, 8, int, s, 16, 4);
190 TEST_VREINTERPRET_POLY(, poly, p, 8, 8, int, s, 32, 2);
191 TEST_VREINTERPRET_POLY(, poly, p, 8, 8, int, s, 64, 1);
192 TEST_VREINTERPRET_POLY(, poly, p, 8, 8, uint, u, 8, 8);
193 TEST_VREINTERPRET_POLY(, poly, p, 8, 8, uint, u, 16, 4);
194 TEST_VREINTERPRET_POLY(, poly, p, 8, 8, uint, u, 32, 2);
195 TEST_VREINTERPRET_POLY(, poly, p, 8, 8, uint, u, 64, 1);
196 TEST_VREINTERPRET_POLY(, poly, p, 8, 8, poly, p, 16, 4);
Christophe Lyon80902f62013-03-29 16:26:42 +0100197
198 /* vreinterpret_p16_xx */
Christophe Lyond9ab3e32014-07-11 16:44:32 +0200199 TEST_VREINTERPRET_POLY(, poly, p, 16, 4, int, s, 8, 8);
200 TEST_VREINTERPRET_POLY(, poly, p, 16, 4, int, s, 16, 4);
201 TEST_VREINTERPRET_POLY(, poly, p, 16, 4, int, s, 32, 2);
202 TEST_VREINTERPRET_POLY(, poly, p, 16, 4, int, s, 64, 1);
203 TEST_VREINTERPRET_POLY(, poly, p, 16, 4, uint, u, 8, 8);
204 TEST_VREINTERPRET_POLY(, poly, p, 16, 4, uint, u, 16, 4);
205 TEST_VREINTERPRET_POLY(, poly, p, 16, 4, uint, u, 32, 2);
206 TEST_VREINTERPRET_POLY(, poly, p, 16, 4, uint, u, 64, 1);
207 TEST_VREINTERPRET_POLY(, poly, p, 16, 4, poly, p, 8, 8);
Christophe Lyon073831a2011-01-24 17:37:40 +0100208
209 /* vreinterpretq_s8_xx */
210 TEST_VREINTERPRET(q, int, s, 8, 16, int, s, 16, 8);
211 TEST_VREINTERPRET(q, int, s, 8, 16, int, s, 32, 4);
212 TEST_VREINTERPRET(q, int, s, 8, 16, int, s, 64, 2);
213 TEST_VREINTERPRET(q, int, s, 8, 16, uint, u, 8, 16);
214 TEST_VREINTERPRET(q, int, s, 8, 16, uint, u, 16, 8);
215 TEST_VREINTERPRET(q, int, s, 8, 16, uint, u, 32, 4);
216 TEST_VREINTERPRET(q, int, s, 8, 16, uint, u, 64, 2);
Christophe Lyon80902f62013-03-29 16:26:42 +0100217 TEST_VREINTERPRET(q, int, s, 8, 16, poly, p, 8, 16);
218 TEST_VREINTERPRET(q, int, s, 8, 16, poly, p, 16, 8);
Christophe Lyon073831a2011-01-24 17:37:40 +0100219
220 /* vreinterpretq_s16_xx */
221 TEST_VREINTERPRET(q, int, s, 16, 8, int, s, 8, 16);
222 TEST_VREINTERPRET(q, int, s, 16, 8, int, s, 32, 4);
223 TEST_VREINTERPRET(q, int, s, 16, 8, int, s, 64, 2);
224 TEST_VREINTERPRET(q, int, s, 16, 8, uint, u, 8, 16);
225 TEST_VREINTERPRET(q, int, s, 16, 8, uint, u, 16, 8);
226 TEST_VREINTERPRET(q, int, s, 16, 8, uint, u, 32, 4);
227 TEST_VREINTERPRET(q, int, s, 16, 8, uint, u, 64, 2);
Christophe Lyon80902f62013-03-29 16:26:42 +0100228 TEST_VREINTERPRET(q, int, s, 16, 8, poly, p, 8, 16);
229 TEST_VREINTERPRET(q, int, s, 16, 8, poly, p, 16, 8);
Christophe Lyon073831a2011-01-24 17:37:40 +0100230
231 /* vreinterpretq_s32_xx */
232 TEST_VREINTERPRET(q, int, s, 32, 4, int, s, 8, 16);
233 TEST_VREINTERPRET(q, int, s, 32, 4, int, s, 16, 8);
234 TEST_VREINTERPRET(q, int, s, 32, 4, int, s, 64, 2);
235 TEST_VREINTERPRET(q, int, s, 32, 4, uint, u, 8, 16);
236 TEST_VREINTERPRET(q, int, s, 32, 4, uint, u, 16, 8);
237 TEST_VREINTERPRET(q, int, s, 32, 4, uint, u, 32, 4);
238 TEST_VREINTERPRET(q, int, s, 32, 4, uint, u, 64, 2);
Christophe Lyon80902f62013-03-29 16:26:42 +0100239 TEST_VREINTERPRET(q, int, s, 32, 4, poly, p, 8, 16);
240 TEST_VREINTERPRET(q, int, s, 32, 4, poly, p, 16, 8);
Christophe Lyon073831a2011-01-24 17:37:40 +0100241
242 /* vreinterpretq_s64_xx */
243 TEST_VREINTERPRET(q, int, s, 64, 2, int, s, 8, 16);
244 TEST_VREINTERPRET(q, int, s, 64, 2, int, s, 16, 8);
245 TEST_VREINTERPRET(q, int, s, 64, 2, int, s, 32, 4);
246 TEST_VREINTERPRET(q, int, s, 64, 2, uint, u, 8, 16);
247 TEST_VREINTERPRET(q, int, s, 64, 2, uint, u, 16, 8);
248 TEST_VREINTERPRET(q, int, s, 64, 2, uint, u, 32, 4);
249 TEST_VREINTERPRET(q, int, s, 64, 2, uint, u, 64, 2);
Christophe Lyon80902f62013-03-29 16:26:42 +0100250 TEST_VREINTERPRET(q, int, s, 64, 2, poly, p, 8, 16);
251 TEST_VREINTERPRET(q, int, s, 64, 2, poly, p, 16, 8);
Christophe Lyon073831a2011-01-24 17:37:40 +0100252
253 /* vreinterpretq_u16_xx */
254 TEST_VREINTERPRET(q, uint, u, 16, 8, int, s, 8, 16);
255 TEST_VREINTERPRET(q, uint, u, 16, 8, int, s, 16, 8);
256 TEST_VREINTERPRET(q, uint, u, 16, 8, int, s, 32, 4);
257 TEST_VREINTERPRET(q, uint, u, 16, 8, int, s, 64, 2);
258 TEST_VREINTERPRET(q, uint, u, 16, 8, uint, u, 8, 16);
259 TEST_VREINTERPRET(q, uint, u, 16, 8, uint, u, 32, 4);
260 TEST_VREINTERPRET(q, uint, u, 16, 8, uint, u, 64, 2);
Christophe Lyon80902f62013-03-29 16:26:42 +0100261 TEST_VREINTERPRET(q, uint, u, 16, 8, poly, p, 8, 16);
262 TEST_VREINTERPRET(q, uint, u, 16, 8, poly, p, 16, 8);
Christophe Lyon073831a2011-01-24 17:37:40 +0100263
264 /* vreinterpretq_u32_xx */
265 TEST_VREINTERPRET(q, uint, u, 32, 4, int, s, 8, 16);
266 TEST_VREINTERPRET(q, uint, u, 32, 4, int, s, 16, 8);
267 TEST_VREINTERPRET(q, uint, u, 32, 4, int, s, 32, 4);
268 TEST_VREINTERPRET(q, uint, u, 32, 4, int, s, 64, 2);
269 TEST_VREINTERPRET(q, uint, u, 32, 4, uint, u, 8, 16);
270 TEST_VREINTERPRET(q, uint, u, 32, 4, uint, u, 16, 8);
271 TEST_VREINTERPRET(q, uint, u, 32, 4, uint, u, 64, 2);
Christophe Lyon80902f62013-03-29 16:26:42 +0100272 TEST_VREINTERPRET(q, uint, u, 32, 4, poly, p, 8, 16);
273 TEST_VREINTERPRET(q, uint, u, 32, 4, poly, p, 16, 8);
Christophe Lyon073831a2011-01-24 17:37:40 +0100274
275 /* vreinterpretq_u64_xx */
276 TEST_VREINTERPRET(q, uint, u, 64, 2, int, s, 8, 16);
277 TEST_VREINTERPRET(q, uint, u, 64, 2, int, s, 16, 8);
278 TEST_VREINTERPRET(q, uint, u, 64, 2, int, s, 32, 4);
279 TEST_VREINTERPRET(q, uint, u, 64, 2, int, s, 64, 2);
280 TEST_VREINTERPRET(q, uint, u, 64, 2, uint, u, 8, 16);
281 TEST_VREINTERPRET(q, uint, u, 64, 2, uint, u, 16, 8);
282 TEST_VREINTERPRET(q, uint, u, 64, 2, uint, u, 32, 4);
Christophe Lyon80902f62013-03-29 16:26:42 +0100283 TEST_VREINTERPRET(q, uint, u, 64, 2, poly, p, 8, 16);
284 TEST_VREINTERPRET(q, uint, u, 64, 2, poly, p, 16, 8);
Christophe Lyon073831a2011-01-24 17:37:40 +0100285
286 /* vreinterpretq_u8_xx */
287 TEST_VREINTERPRET(q, uint, u, 8, 16, int, s, 8, 16);
288 TEST_VREINTERPRET(q, uint, u, 8, 16, int, s, 16, 8);
289 TEST_VREINTERPRET(q, uint, u, 8, 16, int, s, 32, 4);
290 TEST_VREINTERPRET(q, uint, u, 8, 16, int, s, 64, 2);
291 TEST_VREINTERPRET(q, uint, u, 8, 16, uint, u, 16, 8);
292 TEST_VREINTERPRET(q, uint, u, 8, 16, uint, u, 32, 4);
293 TEST_VREINTERPRET(q, uint, u, 8, 16, uint, u, 64, 2);
Christophe Lyon80902f62013-03-29 16:26:42 +0100294 TEST_VREINTERPRET(q, uint, u, 8, 16, poly, p, 8, 16);
295 TEST_VREINTERPRET(q, uint, u, 8, 16, poly, p, 16, 8);
Christophe Lyon073831a2011-01-24 17:37:40 +0100296
297 /* vreinterpret_f32_xx */
298 TEST_VREINTERPRET_FP(, float, f, 32, 2, int, s, 8, 8);
299 TEST_VREINTERPRET_FP(, float, f, 32, 2, int, s, 16, 4);
300 TEST_VREINTERPRET_FP(, float, f, 32, 2, int, s, 32, 2);
301 TEST_VREINTERPRET_FP(, float, f, 32, 2, int, s, 64, 1);
302 TEST_VREINTERPRET_FP(, float, f, 32, 2, uint, u, 8, 8);
303 TEST_VREINTERPRET_FP(, float, f, 32, 2, uint, u, 16, 4);
304 TEST_VREINTERPRET_FP(, float, f, 32, 2, uint, u, 32, 2);
305 TEST_VREINTERPRET_FP(, float, f, 32, 2, uint, u, 64, 1);
Christophe Lyon80902f62013-03-29 16:26:42 +0100306 TEST_VREINTERPRET_FP(, float, f, 32, 2, poly, p, 8, 8);
307 TEST_VREINTERPRET_FP(, float, f, 32, 2, poly, p, 16, 4);
Christophe Lyon073831a2011-01-24 17:37:40 +0100308
309 /* vreinterpretq_f32_xx */
310 TEST_VREINTERPRET_FP(q, float, f, 32, 4, int, s, 8, 16);
311 TEST_VREINTERPRET_FP(q, float, f, 32, 4, int, s, 16, 8);
312 TEST_VREINTERPRET_FP(q, float, f, 32, 4, int, s, 32, 4);
313 TEST_VREINTERPRET_FP(q, float, f, 32, 4, int, s, 64, 2);
314 TEST_VREINTERPRET_FP(q, float, f, 32, 4, uint, u, 8, 16);
315 TEST_VREINTERPRET_FP(q, float, f, 32, 4, uint, u, 16, 8);
316 TEST_VREINTERPRET_FP(q, float, f, 32, 4, uint, u, 32, 4);
317 TEST_VREINTERPRET_FP(q, float, f, 32, 4, uint, u, 64, 2);
Christophe Lyon80902f62013-03-29 16:26:42 +0100318 TEST_VREINTERPRET_FP(q, float, f, 32, 4, poly, p, 8, 16);
319 TEST_VREINTERPRET_FP(q, float, f, 32, 4, poly, p, 16, 8);
Christophe Lyon073831a2011-01-24 17:37:40 +0100320
321 /* vreinterpret_xx_f32 */
322 TEST_VREINTERPRET(, int, s, 8, 8, float, f, 32, 2);
323 TEST_VREINTERPRET(, int, s, 16, 4, float, f, 32, 2);
324 TEST_VREINTERPRET(, int, s, 32, 2, float, f, 32, 2);
325 TEST_VREINTERPRET(, int, s, 64, 1, float, f, 32, 2);
326 TEST_VREINTERPRET(, uint, u, 8, 8, float, f, 32, 2);
327 TEST_VREINTERPRET(, uint, u, 16, 4, float, f, 32, 2);
328 TEST_VREINTERPRET(, uint, u, 32, 2, float, f, 32, 2);
329 TEST_VREINTERPRET(, uint, u, 64, 1, float, f, 32, 2);
Christophe Lyond9ab3e32014-07-11 16:44:32 +0200330 TEST_VREINTERPRET_POLY(, poly, p, 8, 8, float, f, 32, 2);
331 TEST_VREINTERPRET_POLY(, poly, p, 16, 4, float, f, 32, 2);
Christophe Lyon073831a2011-01-24 17:37:40 +0100332
333 /* vreinterpretq_xx_f32 */
334 TEST_VREINTERPRET(q, int, s, 8, 16, float, f, 32, 4);
335 TEST_VREINTERPRET(q, int, s, 16, 8, float, f, 32, 4);
336 TEST_VREINTERPRET(q, int, s, 32, 4, float, f, 32, 4);
337 TEST_VREINTERPRET(q, int, s, 64, 2, float, f, 32, 4);
338 TEST_VREINTERPRET(q, uint, u, 8, 16, float, f, 32, 4);
339 TEST_VREINTERPRET(q, uint, u, 16, 8, float, f, 32, 4);
340 TEST_VREINTERPRET(q, uint, u, 32, 4, float, f, 32, 4);
341 TEST_VREINTERPRET(q, uint, u, 64, 2, float, f, 32, 4);
Christophe Lyond9ab3e32014-07-11 16:44:32 +0200342 TEST_VREINTERPRET_POLY(q, poly, p, 8, 16, float, f, 32, 4);
343 TEST_VREINTERPRET_POLY(q, poly, p, 16, 8, float, f, 32, 4);
Christophe Lyon34adaf62013-04-11 15:05:18 +0200344
Christophe Lyond98beba2016-08-24 18:02:41 +0200345#if defined(__ARM_FP16_FORMAT_IEEE) && ( ((__ARM_FP & 0x2) != 0) || ((__ARM_NEON_FP16_INTRINSICS & 1) != 0) )
Christophe Lyon34adaf62013-04-11 15:05:18 +0200346 /* vreinterpret_f16_xx */
347 TEST_VREINTERPRET_FP16(, float, f, 16, 4, int, s, 8, 8);
348 TEST_VREINTERPRET_FP16(, float, f, 16, 4, int, s, 16, 4);
349 TEST_VREINTERPRET_FP16(, float, f, 16, 4, int, s, 32, 2);
350 TEST_VREINTERPRET_FP16(, float, f, 16, 4, int, s, 64, 1);
351 TEST_VREINTERPRET_FP16(, float, f, 16, 4, uint, u, 8, 8);
352 TEST_VREINTERPRET_FP16(, float, f, 16, 4, uint, u, 16, 4);
353 TEST_VREINTERPRET_FP16(, float, f, 16, 4, uint, u, 32, 2);
354 TEST_VREINTERPRET_FP16(, float, f, 16, 4, uint, u, 64, 1);
355 TEST_VREINTERPRET_FP16(, float, f, 16, 4, poly, p, 8, 8);
356 TEST_VREINTERPRET_FP16(, float, f, 16, 4, poly, p, 16, 4);
357 TEST_VREINTERPRET_FP16(, float, f, 16, 4, float, f, 32, 2);
358
359 /* vreinterpretq_f16_xx */
360 TEST_VREINTERPRET_FP16(q, float, f, 16, 8, int, s, 8, 16);
361 TEST_VREINTERPRET_FP16(q, float, f, 16, 8, int, s, 16, 8);
362 TEST_VREINTERPRET_FP16(q, float, f, 16, 8, int, s, 32, 4);
363 TEST_VREINTERPRET_FP16(q, float, f, 16, 8, int, s, 64, 2);
364 TEST_VREINTERPRET_FP16(q, float, f, 16, 8, uint, u, 8, 16);
365 TEST_VREINTERPRET_FP16(q, float, f, 16, 8, uint, u, 16, 8);
366 TEST_VREINTERPRET_FP16(q, float, f, 16, 8, uint, u, 32, 4);
367 TEST_VREINTERPRET_FP16(q, float, f, 16, 8, uint, u, 64, 2);
368 TEST_VREINTERPRET_FP16(q, float, f, 16, 8, poly, p, 8, 16);
369 TEST_VREINTERPRET_FP16(q, float, f, 16, 8, poly, p, 16, 8);
370 TEST_VREINTERPRET_FP16(q, float, f, 16, 8, float, f, 32, 4);
371
372 /* vreinterpret_xx_f16 */
373 TEST_VREINTERPRET(, int, s, 8, 8, float, f, 16, 4);
374 TEST_VREINTERPRET(, int, s, 16, 4, float, f, 16, 4);
375 TEST_VREINTERPRET(, int, s, 32, 2, float, f, 16, 4);
376 TEST_VREINTERPRET(, int, s, 64, 1, float, f, 16, 4);
377 TEST_VREINTERPRET(, uint, u, 8, 8, float, f, 16, 4);
378 TEST_VREINTERPRET(, uint, u, 16, 4, float, f, 16, 4);
379 TEST_VREINTERPRET(, uint, u, 32, 2, float, f, 16, 4);
380 TEST_VREINTERPRET(, uint, u, 64, 1, float, f, 16, 4);
Christophe Lyond9ab3e32014-07-11 16:44:32 +0200381 TEST_VREINTERPRET_POLY(, poly, p, 8, 8, float, f, 16, 4);
382 TEST_VREINTERPRET_POLY(, poly, p, 16, 4, float, f, 16, 4);
Christophe Lyon34adaf62013-04-11 15:05:18 +0200383 TEST_VREINTERPRET_FP(, float, f, 32, 2, float, f, 16, 4);
384
385 /* vreinterpretq_xx_f16 */
386 TEST_VREINTERPRET(q, int, s, 8, 16, float, f, 16, 8);
387 TEST_VREINTERPRET(q, int, s, 16, 8, float, f, 16, 8);
388 TEST_VREINTERPRET(q, int, s, 32, 4, float, f, 16, 8);
389 TEST_VREINTERPRET(q, int, s, 64, 2, float, f, 16, 8);
390 TEST_VREINTERPRET(q, uint, u, 8, 16, float, f, 16, 8);
391 TEST_VREINTERPRET(q, uint, u, 16, 8, float, f, 16, 8);
392 TEST_VREINTERPRET(q, uint, u, 32, 4, float, f, 16, 8);
393 TEST_VREINTERPRET(q, uint, u, 64, 2, float, f, 16, 8);
Christophe Lyond9ab3e32014-07-11 16:44:32 +0200394 TEST_VREINTERPRET_POLY(q, poly, p, 8, 16, float, f, 16, 8);
395 TEST_VREINTERPRET_POLY(q, poly, p, 16, 8, float, f, 16, 8);
Christophe Lyon34adaf62013-04-11 15:05:18 +0200396 TEST_VREINTERPRET_FP(q, float, f, 32, 4, float, f, 16, 8);
397#endif
Christophe Lyon073831a2011-01-24 17:37:40 +0100398}