OLD | NEW |
| (Empty) |
1 // Copyright 2016 the V8 project authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 // This file holds inputs for the instructions tested by test-simulator-a64. | |
6 // | |
7 #include <stdint.h> | |
8 | |
9 // This header should only be used by test-simulator-arm64.cc, so it | |
10 // doesn't need the usual header guard. | |
11 #ifdef V8_TEST_SIMULATOR_INPUTS_ARM64_H_ | |
12 #error This header should be included only once. | |
13 #endif | |
14 #define V8_TEST_SIMULATOR_INPUTS_ARM64_H_ | |
15 | |
16 // clang-format off | |
17 | |
18 // Double values, stored as uint64_t representations. This ensures exact bit | |
19 // representation, and avoids the loss of NaNs and suchlike through C++ casts. | |
20 #define INPUT_DOUBLE_BASIC \ | |
21 /* Simple values. */ \ | |
22 /* 0.0 */ \ | |
23 0x0000000000000000, \ | |
24 /* The smallest normal value. */ \ | |
25 0x0010000000000000, \ | |
26 /* The value just below 0.5. */ \ | |
27 0x3fdfffffffffffff, \ | |
28 /* 0.5 */ \ | |
29 0x3fe0000000000000, \ | |
30 /* The value just above 0.5. */ \ | |
31 0x3fe0000000000001, \ | |
32 /* The value just below 1.0. */ \ | |
33 0x3fefffffffffffff, \ | |
34 /* 1.0 */ \ | |
35 0x3ff0000000000000, \ | |
36 /* The value just above 1.0. */ \ | |
37 0x3ff0000000000001, \ | |
38 /* 1.5 */ \ | |
39 0x3ff8000000000000, \ | |
40 /* 10 */ \ | |
41 0x4024000000000000, \ | |
42 /* The largest finite value. */ \ | |
43 0x7fefffffffffffff, \ | |
44 \ | |
45 /* Infinity. */ \ | |
46 0x7ff0000000000000, \ | |
47 \ | |
48 /* NaNs. */ \ | |
49 /* - Quiet NaNs */ \ | |
50 0x7ff923456789abcd, \ | |
51 0x7ff8000000000000, \ | |
52 /* - Signalling NaNs */ \ | |
53 0x7ff123456789abcd, \ | |
54 0x7ff0000000000000, \ | |
55 \ | |
56 /* Subnormals. */ \ | |
57 /* - A recognisable bit pattern. */ \ | |
58 0x000123456789abcd, \ | |
59 /* - The largest subnormal value. */ \ | |
60 0x000fffffffffffff, \ | |
61 /* - The smallest subnormal value. */ \ | |
62 0x0000000000000001, \ | |
63 \ | |
64 /* The same values again, but negated. */ \ | |
65 0x8000000000000000, \ | |
66 0x8010000000000000, \ | |
67 0xbfdfffffffffffff, \ | |
68 0xbfe0000000000000, \ | |
69 0xbfe0000000000001, \ | |
70 0xbfefffffffffffff, \ | |
71 0xbff0000000000000, \ | |
72 0xbff0000000000001, \ | |
73 0xbff8000000000000, \ | |
74 0xc024000000000000, \ | |
75 0xffefffffffffffff, \ | |
76 0xfff0000000000000, \ | |
77 0xfff923456789abcd, \ | |
78 0xfff8000000000000, \ | |
79 0xfff123456789abcd, \ | |
80 0xfff0000000000000, \ | |
81 0x800123456789abcd, \ | |
82 0x800fffffffffffff, \ | |
83 0x8000000000000001, | |
84 | |
85 | |
86 // Extra inputs. Passing these to 3- or 2-op instructions makes the trace file | |
87 // very large, so these should only be used with 1-op instructions. | |
88 #define INPUT_DOUBLE_CONVERSIONS \ | |
89 /* Values relevant for conversions to single-precision floats. */ \ | |
90 0x47efffff00000000, \ | |
91 /* - The smallest normalized float. */ \ | |
92 0x3810000000000000, \ | |
93 /* - Normal floats that need (ties-to-even) rounding. */ \ | |
94 /* For normalized numbers, bit 29 (0x0000000020000000) is the */ \ | |
95 /* lowest-order bit which will fit in the float's mantissa. */ \ | |
96 0x3ff0000000000000, \ | |
97 0x3ff0000000000001, \ | |
98 0x3ff0000010000000, \ | |
99 0x3ff0000010000001, \ | |
100 0x3ff0000020000000, \ | |
101 0x3ff0000020000001, \ | |
102 0x3ff0000030000000, \ | |
103 0x3ff0000030000001, \ | |
104 0x3ff0000040000000, \ | |
105 0x3ff0000040000001, \ | |
106 0x3ff0000050000000, \ | |
107 0x3ff0000050000001, \ | |
108 0x3ff0000060000000, \ | |
109 /* - A mantissa that overflows into the exponent during rounding. */ \ | |
110 0x3feffffff0000000, \ | |
111 /* - The largest double that rounds to a normal float. */ \ | |
112 0x47efffffefffffff, \ | |
113 /* - The smallest exponent that's too big for a float. */ \ | |
114 0x47f0000000000000, \ | |
115 /* - This exponent is in range, but the value rounds to infinity. */ \ | |
116 0x47effffff0000000, \ | |
117 /* - The largest double which is too small for a subnormal float. */ \ | |
118 0x3690000000000000, \ | |
119 /* - The largest subnormal float. */ \ | |
120 0x380fffffc0000000, \ | |
121 /* - The smallest subnormal float. */ \ | |
122 0x36a0000000000000, \ | |
123 /* - Subnormal floats that need (ties-to-even) rounding. */ \ | |
124 /* For these subnormals, bit 34 (0x0000000400000000) is the */ \ | |
125 /* lowest-order bit which will fit in the float's mantissa. */ \ | |
126 0x37c159e000000000, \ | |
127 0x37c159e000000001, \ | |
128 0x37c159e200000000, \ | |
129 0x37c159e200000001, \ | |
130 0x37c159e400000000, \ | |
131 0x37c159e400000001, \ | |
132 0x37c159e600000000, \ | |
133 0x37c159e600000001, \ | |
134 0x37c159e800000000, \ | |
135 0x37c159e800000001, \ | |
136 0x37c159ea00000000, \ | |
137 0x37c159ea00000001, \ | |
138 0x37c159ec00000000, \ | |
139 /* - The smallest double which rounds up to become a subnormal float. */ \ | |
140 0x3690000000000001, \ | |
141 \ | |
142 /* The same values again, but negated. */ \ | |
143 0xc7efffff00000000, \ | |
144 0xb810000000000000, \ | |
145 0xbff0000000000000, \ | |
146 0xbff0000000000001, \ | |
147 0xbff0000010000000, \ | |
148 0xbff0000010000001, \ | |
149 0xbff0000020000000, \ | |
150 0xbff0000020000001, \ | |
151 0xbff0000030000000, \ | |
152 0xbff0000030000001, \ | |
153 0xbff0000040000000, \ | |
154 0xbff0000040000001, \ | |
155 0xbff0000050000000, \ | |
156 0xbff0000050000001, \ | |
157 0xbff0000060000000, \ | |
158 0xbfeffffff0000000, \ | |
159 0xc7efffffefffffff, \ | |
160 0xc7f0000000000000, \ | |
161 0xc7effffff0000000, \ | |
162 0xb690000000000000, \ | |
163 0xb80fffffc0000000, \ | |
164 0xb6a0000000000000, \ | |
165 0xb7c159e000000000, \ | |
166 0xb7c159e000000001, \ | |
167 0xb7c159e200000000, \ | |
168 0xb7c159e200000001, \ | |
169 0xb7c159e400000000, \ | |
170 0xb7c159e400000001, \ | |
171 0xb7c159e600000000, \ | |
172 0xb7c159e600000001, \ | |
173 0xb7c159e800000000, \ | |
174 0xb7c159e800000001, \ | |
175 0xb7c159ea00000000, \ | |
176 0xb7c159ea00000001, \ | |
177 0xb7c159ec00000000, \ | |
178 0xb690000000000001, \ | |
179 \ | |
180 /* Values relevant for conversions to integers (frint). */ \ | |
181 \ | |
182 /* - The lowest-order mantissa bit has value 1. */ \ | |
183 0x4330000000000000, \ | |
184 0x4330000000000001, \ | |
185 0x4330000000000002, \ | |
186 0x4330000000000003, \ | |
187 0x433fedcba9876543, \ | |
188 0x433ffffffffffffc, \ | |
189 0x433ffffffffffffd, \ | |
190 0x433ffffffffffffe, \ | |
191 0x433fffffffffffff, \ | |
192 /* - The lowest-order mantissa bit has value 0.5. */ \ | |
193 0x4320000000000000, \ | |
194 0x4320000000000001, \ | |
195 0x4320000000000002, \ | |
196 0x4320000000000003, \ | |
197 0x432fedcba9876543, \ | |
198 0x432ffffffffffffc, \ | |
199 0x432ffffffffffffd, \ | |
200 0x432ffffffffffffe, \ | |
201 0x432fffffffffffff, \ | |
202 /* - The lowest-order mantissa bit has value 0.25. */ \ | |
203 0x4310000000000000, \ | |
204 0x4310000000000001, \ | |
205 0x4310000000000002, \ | |
206 0x4310000000000003, \ | |
207 0x431fedcba9876543, \ | |
208 0x431ffffffffffffc, \ | |
209 0x431ffffffffffffd, \ | |
210 0x431ffffffffffffe, \ | |
211 0x431fffffffffffff, \ | |
212 \ | |
213 /* The same values again, but negated. */ \ | |
214 0xc330000000000000, \ | |
215 0xc330000000000001, \ | |
216 0xc330000000000002, \ | |
217 0xc330000000000003, \ | |
218 0xc33fedcba9876543, \ | |
219 0xc33ffffffffffffc, \ | |
220 0xc33ffffffffffffd, \ | |
221 0xc33ffffffffffffe, \ | |
222 0xc33fffffffffffff, \ | |
223 0xc320000000000000, \ | |
224 0xc320000000000001, \ | |
225 0xc320000000000002, \ | |
226 0xc320000000000003, \ | |
227 0xc32fedcba9876543, \ | |
228 0xc32ffffffffffffc, \ | |
229 0xc32ffffffffffffd, \ | |
230 0xc32ffffffffffffe, \ | |
231 0xc32fffffffffffff, \ | |
232 0xc310000000000000, \ | |
233 0xc310000000000001, \ | |
234 0xc310000000000002, \ | |
235 0xc310000000000003, \ | |
236 0xc31fedcba9876543, \ | |
237 0xc31ffffffffffffc, \ | |
238 0xc31ffffffffffffd, \ | |
239 0xc31ffffffffffffe, \ | |
240 0xc31fffffffffffff, \ | |
241 \ | |
242 /* Values relevant for conversions to integers (fcvt). */ \ | |
243 0xc3e0000000000001, /* The value just below INT64_MIN. */ \ | |
244 0xc3e0000000000000, /* INT64_MIN */ \ | |
245 0xc3dfffffffffffff, /* The value just above INT64_MIN. */ \ | |
246 0x43dfffffffffffff, /* The value just below INT64_MAX. */ \ | |
247 /* INT64_MAX is not representable. */ \ | |
248 0x43e0000000000000, /* The value just above INT64_MAX. */ \ | |
249 \ | |
250 0x43efffffffffffff, /* The value just below UINT64_MAX. */ \ | |
251 /* UINT64_MAX is not representable. */ \ | |
252 0x43f0000000000000, /* The value just above UINT64_MAX. */ \ | |
253 \ | |
254 0xc1e0000000200001, /* The value just below INT32_MIN - 1.0. */ \ | |
255 0xc1e0000000200000, /* INT32_MIN - 1.0 */ \ | |
256 0xc1e00000001fffff, /* The value just above INT32_MIN - 1.0. */ \ | |
257 0xc1e0000000100001, /* The value just below INT32_MIN - 0.5. */ \ | |
258 0xc1e0000000100000, /* INT32_MIN - 0.5 */ \ | |
259 0xc1e00000000fffff, /* The value just above INT32_MIN - 0.5. */ \ | |
260 0xc1e0000000000001, /* The value just below INT32_MIN. */ \ | |
261 0xc1e0000000000000, /* INT32_MIN */ \ | |
262 0xc1dfffffffffffff, /* The value just above INT32_MIN. */ \ | |
263 0xc1dfffffffe00001, /* The value just below INT32_MIN + 0.5. */ \ | |
264 0xc1dfffffffe00000, /* INT32_MIN + 0.5 */ \ | |
265 0xc1dfffffffdfffff, /* The value just above INT32_MIN + 0.5. */ \ | |
266 \ | |
267 0x41dfffffff7fffff, /* The value just below INT32_MAX - 1.0. */ \ | |
268 0x41dfffffff800000, /* INT32_MAX - 1.0 */ \ | |
269 0x41dfffffff800001, /* The value just above INT32_MAX - 1.0. */ \ | |
270 0x41dfffffff9fffff, /* The value just below INT32_MAX - 0.5. */ \ | |
271 0x41dfffffffa00000, /* INT32_MAX - 0.5 */ \ | |
272 0x41dfffffffa00001, /* The value just above INT32_MAX - 0.5. */ \ | |
273 0x41dfffffffbfffff, /* The value just below INT32_MAX. */ \ | |
274 0x41dfffffffc00000, /* INT32_MAX */ \ | |
275 0x41dfffffffc00001, /* The value just above INT32_MAX. */ \ | |
276 0x41dfffffffdfffff, /* The value just below INT32_MAX + 0.5. */ \ | |
277 0x41dfffffffe00000, /* INT32_MAX + 0.5 */ \ | |
278 0x41dfffffffe00001, /* The value just above INT32_MAX + 0.5. */ \ | |
279 \ | |
280 0x41efffffffbfffff, /* The value just below UINT32_MAX - 1.0. */ \ | |
281 0x41efffffffc00000, /* UINT32_MAX - 1.0 */ \ | |
282 0x41efffffffc00001, /* The value just above UINT32_MAX - 1.0. */ \ | |
283 0x41efffffffcfffff, /* The value just below UINT32_MAX - 0.5. */ \ | |
284 0x41efffffffd00000, /* UINT32_MAX - 0.5 */ \ | |
285 0x41efffffffd00001, /* The value just above UINT32_MAX - 0.5. */ \ | |
286 0x41efffffffdfffff, /* The value just below UINT32_MAX. */ \ | |
287 0x41efffffffe00000, /* UINT32_MAX */ \ | |
288 0x41efffffffe00001, /* The value just above UINT32_MAX. */ \ | |
289 0x41efffffffefffff, /* The value just below UINT32_MAX + 0.5. */ \ | |
290 0x41effffffff00000, /* UINT32_MAX + 0.5 */ \ | |
291 0x41effffffff00001, /* The value just above UINT32_MAX + 0.5. */ | |
292 | |
293 | |
294 // Float values, stored as uint32_t representations. This ensures exact bit | |
295 // representation, and avoids the loss of NaNs and suchlike through C++ casts. | |
296 #define INPUT_FLOAT_BASIC \ | |
297 /* Simple values. */ \ | |
298 0x00000000, /* 0.0 */ \ | |
299 0x00800000, /* The smallest normal value. */ \ | |
300 0x3effffff, /* The value just below 0.5. */ \ | |
301 0x3f000000, /* 0.5 */ \ | |
302 0x3f000001, /* The value just above 0.5. */ \ | |
303 0x3f7fffff, /* The value just below 1.0. */ \ | |
304 0x3f800000, /* 1.0 */ \ | |
305 0x3f800001, /* The value just above 1.0. */ \ | |
306 0x3fc00000, /* 1.5 */ \ | |
307 0x41200000, /* 10 */ \ | |
308 0x7f8fffff, /* The largest finite value. */ \ | |
309 \ | |
310 /* Infinity. */ \ | |
311 0x7f800000, \ | |
312 \ | |
313 /* NaNs. */ \ | |
314 /* - Quiet NaNs */ \ | |
315 0x7fd23456, \ | |
316 0x7fc00000, \ | |
317 /* - Signalling NaNs */ \ | |
318 0x7f923456, \ | |
319 0x7f800001, \ | |
320 \ | |
321 /* Subnormals. */ \ | |
322 /* - A recognisable bit pattern. */ \ | |
323 0x00123456, \ | |
324 /* - The largest subnormal value. */ \ | |
325 0x007fffff, \ | |
326 /* - The smallest subnormal value. */ \ | |
327 0x00000001, \ | |
328 \ | |
329 /* The same values again, but negated. */ \ | |
330 0x80000000, \ | |
331 0x80800000, \ | |
332 0xbeffffff, \ | |
333 0xbf000000, \ | |
334 0xbf000001, \ | |
335 0xbf7fffff, \ | |
336 0xbf800000, \ | |
337 0xbf800001, \ | |
338 0xbfc00000, \ | |
339 0xc1200000, \ | |
340 0xff8fffff, \ | |
341 0xff800000, \ | |
342 0xffd23456, \ | |
343 0xffc00000, \ | |
344 0xff923456, \ | |
345 0xff800001, \ | |
346 0x80123456, \ | |
347 0x807fffff, \ | |
348 0x80000001, | |
349 | |
350 | |
351 // Extra inputs. Passing these to 3- or 2-op instructions makes the trace file | |
352 // very large, so these should only be used with 1-op instructions. | |
353 #define INPUT_FLOAT_CONVERSIONS \ | |
354 /* Values relevant for conversions to integers (frint). */ \ | |
355 /* - The lowest-order mantissa bit has value 1. */ \ | |
356 0x4b000000, \ | |
357 0x4b000001, \ | |
358 0x4b000002, \ | |
359 0x4b000003, \ | |
360 0x4b765432, \ | |
361 0x4b7ffffc, \ | |
362 0x4b7ffffd, \ | |
363 0x4b7ffffe, \ | |
364 0x4b7fffff, \ | |
365 /* - The lowest-order mantissa bit has value 0.5. */ \ | |
366 0x4a800000, \ | |
367 0x4a800001, \ | |
368 0x4a800002, \ | |
369 0x4a800003, \ | |
370 0x4af65432, \ | |
371 0x4afffffc, \ | |
372 0x4afffffd, \ | |
373 0x4afffffe, \ | |
374 0x4affffff, \ | |
375 /* - The lowest-order mantissa bit has value 0.25. */ \ | |
376 0x4a000000, \ | |
377 0x4a000001, \ | |
378 0x4a000002, \ | |
379 0x4a000003, \ | |
380 0x4a765432, \ | |
381 0x4a7ffffc, \ | |
382 0x4a7ffffd, \ | |
383 0x4a7ffffe, \ | |
384 0x4a7fffff, \ | |
385 \ | |
386 /* The same values again, but negated. */ \ | |
387 0xcb000000, \ | |
388 0xcb000001, \ | |
389 0xcb000002, \ | |
390 0xcb000003, \ | |
391 0xcb765432, \ | |
392 0xcb7ffffc, \ | |
393 0xcb7ffffd, \ | |
394 0xcb7ffffe, \ | |
395 0xcb7fffff, \ | |
396 0xca800000, \ | |
397 0xca800001, \ | |
398 0xca800002, \ | |
399 0xca800003, \ | |
400 0xcaf65432, \ | |
401 0xcafffffc, \ | |
402 0xcafffffd, \ | |
403 0xcafffffe, \ | |
404 0xcaffffff, \ | |
405 0xca000000, \ | |
406 0xca000001, \ | |
407 0xca000002, \ | |
408 0xca000003, \ | |
409 0xca765432, \ | |
410 0xca7ffffc, \ | |
411 0xca7ffffd, \ | |
412 0xca7ffffe, \ | |
413 0xca7fffff, \ | |
414 \ | |
415 /* Values relevant for conversions to integers (fcvt). */ \ | |
416 0xdf000001, /* The value just below INT64_MIN. */ \ | |
417 0xdf000000, /* INT64_MIN */ \ | |
418 0xdeffffff, /* The value just above INT64_MIN. */ \ | |
419 0x5effffff, /* The value just below INT64_MAX. */ \ | |
420 /* INT64_MAX is not representable. */ \ | |
421 0x5f000000, /* The value just above INT64_MAX. */ \ | |
422 \ | |
423 0x5f7fffff, /* The value just below UINT64_MAX. */ \ | |
424 /* UINT64_MAX is not representable. */ \ | |
425 0x5f800000, /* The value just above UINT64_MAX. */ \ | |
426 \ | |
427 0xcf000001, /* The value just below INT32_MIN. */ \ | |
428 0xcf000000, /* INT32_MIN */ \ | |
429 0xceffffff, /* The value just above INT32_MIN. */ \ | |
430 0x4effffff, /* The value just below INT32_MAX. */ \ | |
431 /* INT32_MAX is not representable. */ \ | |
432 0x4f000000, /* The value just above INT32_MAX. */ | |
433 | |
434 | |
435 #define INPUT_32BITS_FIXEDPOINT_CONVERSIONS \ | |
436 0x00000000, \ | |
437 0x00000001, \ | |
438 0x00800000, \ | |
439 0x00800001, \ | |
440 0x00876543, \ | |
441 0x01000000, \ | |
442 0x01000001, \ | |
443 0x01800000, \ | |
444 0x01800001, \ | |
445 0x02000000, \ | |
446 0x02000001, \ | |
447 0x02800000, \ | |
448 0x02800001, \ | |
449 0x03000000, \ | |
450 0x40000000, \ | |
451 0x7fffff80, \ | |
452 0x7fffffc0, \ | |
453 0x7fffffff, \ | |
454 0x80000000, \ | |
455 0x80000100, \ | |
456 0xffffff00, \ | |
457 0xffffff80, \ | |
458 0xffffffff, \ | |
459 0xffffffff | |
460 | |
461 #define INPUT_64BITS_FIXEDPOINT_CONVERSIONS \ | |
462 0x0000000000000000, \ | |
463 0x0000000000000001, \ | |
464 0x0000000040000000, \ | |
465 0x0000000100000000, \ | |
466 0x4000000000000000, \ | |
467 0x4000000000000400, \ | |
468 0x000000007fffffff, \ | |
469 0x00000000ffffffff, \ | |
470 0x0000000080000000, \ | |
471 0x0000000080000001, \ | |
472 0x7ffffffffffffc00, \ | |
473 0x0123456789abcde0, \ | |
474 0x0000000012345678, \ | |
475 0xffffffffc0000000, \ | |
476 0xffffffff00000000, \ | |
477 0xc000000000000000, \ | |
478 0x1000000000000000, \ | |
479 0x1000000000000001, \ | |
480 0x1000000000000080, \ | |
481 0x1000000000000081, \ | |
482 0x1000000000000100, \ | |
483 0x1000000000000101, \ | |
484 0x1000000000000180, \ | |
485 0x1000000000000181, \ | |
486 0x1000000000000200, \ | |
487 0x1000000000000201, \ | |
488 0x1000000000000280, \ | |
489 0x1000000000000281, \ | |
490 0x1000000000000300, \ | |
491 0x8000000000000000, \ | |
492 0x8000000000000001, \ | |
493 0x8000000000000200, \ | |
494 0x8000000000000201, \ | |
495 0x8000000000000400, \ | |
496 0x8000000000000401, \ | |
497 0x8000000000000600, \ | |
498 0x8000000000000601, \ | |
499 0x8000000000000800, \ | |
500 0x8000000000000801, \ | |
501 0x8000000000000a00, \ | |
502 0x8000000000000a01, \ | |
503 0x8000000000000c00, \ | |
504 0x7ffffffffffffe00, \ | |
505 0x7fffffffffffffff, \ | |
506 0xfffffffffffffc00, \ | |
507 0xffffffffffffffff | |
508 | |
509 // Float16 - Basic test values. | |
510 #define INPUT_FLOAT16_BASIC \ | |
511 0x3c00, /* 1 0 01111 0000000000 */ \ | |
512 0x3c01, /* Next smallest float after 1. 0 01111 0000000001 */ \ | |
513 0xc000, /* -2 1 10000 0000000000 */ \ | |
514 0x7bff, /* Maximum in half precision. 0 11110 1111111111 */ \ | |
515 0x0400, /* Minimum positive normal. 0 00001 0000000000 */ \ | |
516 0x03ff, /* Maximum subnormal. 0 00000 1111111111 */ \ | |
517 0x0001, /* Minimum positive subnormal. 0 00000 0000000001 */ \ | |
518 0x0000, /* 0 0 00000 0000000000 */ \ | |
519 0x8000, /* -0 1 00000 0000000000 */ \ | |
520 0x7c00, /* inf 0 11111 0000000000 */ \ | |
521 0xfc00, /* -inf 1 11111 0000000000 */ \ | |
522 0x3555, /* 1/3 0 01101 0101010101 */ \ | |
523 0x3e00, /* 1.5 0 01111 1000000000 */ \ | |
524 0x4900, /* 10 0 10010 0100000000 */ \ | |
525 0xbe00, /* -1.5 1 01111 1000000000 */ \ | |
526 0xc900, /* -10 1 10010 0100000000 */ \ | |
527 | |
528 // Float16 - Conversion test values. | |
529 // Note the second column in the comments shows what the value might | |
530 // look like if represented in single precision (32 bit) floating point format. | |
531 #define INPUT_FLOAT16_CONVERSIONS \ | |
532 0x37ff, /* 0.4999999701976776 0x3effffff f16: 0 01101 1111111111 */ \ | |
533 0x3800, /* 0.4999999701976776 0x3effffff f16: 0 01110 0000000000 */ \ | |
534 0x3801, /* 0.5000000596046448 0x3f000001 f16: 0 01110 0000000001 */ \ | |
535 0x3bff, /* 0.9999999403953552 0x3f7fffff f16: 0 01110 1111111111 */ \ | |
536 0x7c7f, /* nan 0x7f8fffff f16: 0 11111 0001111111 */ \ | |
537 0x7e91, /* nan 0x7fd23456 f16: 0 11111 1010010001 */ \ | |
538 0x7e00, /* nan 0x7fc00000 f16: 0 11111 1000000000 */ \ | |
539 0x7c91, /* nan 0x7f923456 f16: 0 11111 0010010001 */ \ | |
540 0x8001, /* -1.175494350822288e-38 0x80800000 f16: 1 00000 0000000001 */ \ | |
541 0xb7ff, /* -0.4999999701976776 0xbeffffff f16: 1 01101 1111111111 */ \ | |
542 0xb800, /* -0.4999999701976776 0xbeffffff f16: 1 01110 0000000000 */ \ | |
543 0xb801, /* -0.5000000596046448 0xbf000001 f16: 1 01110 0000000001 */ \ | |
544 0xbbff, /* -0.9999999403953552 0xbf7fffff f16: 1 01110 1111111111 */ \ | |
545 0xbc00, /* -0.9999999403953552 0xbf7fffff f16: 1 01111 0000000000 */ \ | |
546 0xbc01, /* -1.00000011920929 0xbf800001 f16: 1 01111 0000000001 */ \ | |
547 0xfc7f, /* -nan 0xff8fffff f16: 1 11111 0001111111 */ \ | |
548 0xfe91, /* -nan 0xffd23456 f16: 1 11111 1010010001 */ \ | |
549 0xfe00, /* -nan 0xffc00000 f16: 1 11111 1000000000 */ \ | |
550 0xfc91, /* -nan 0xff923456 f16: 1 11111 0010010001 */ \ | |
551 0xfbff, /* -8388608 0xcb000000 f16: 1 11110 1111111111 */ \ | |
552 0x0002, /* 1.192092895507812e-07 0x00000002 f16: 0 00000 0000000010 */ \ | |
553 0x8002, /* -1.192092895507812e-07 0x80000002 f16: 1 00000 0000000010 */ \ | |
554 0x8fff, /* -0.0004880428314208984 0x8fffffff f16: 1 00011 1111111111 */ \ | |
555 0xffff, /* -nan 0xffffffff f16: 1 11111 1111111111 */ \ | |
556 | |
557 // Some useful sets of values for testing vector SIMD operations. | |
558 #define INPUT_8BITS_IMM_LANECOUNT_FROMZERO \ | |
559 0x00, \ | |
560 0x01, \ | |
561 0x02, \ | |
562 0x03, \ | |
563 0x04, \ | |
564 0x05, \ | |
565 0x06, \ | |
566 0x07, \ | |
567 0x08, \ | |
568 0x09, \ | |
569 0x0a, \ | |
570 0x0b, \ | |
571 0x0c, \ | |
572 0x0d, \ | |
573 0x0e, \ | |
574 0x0f | |
575 | |
576 #define INPUT_16BITS_IMM_LANECOUNT_FROMZERO \ | |
577 0x00, \ | |
578 0x01, \ | |
579 0x02, \ | |
580 0x03, \ | |
581 0x04, \ | |
582 0x05, \ | |
583 0x06, \ | |
584 0x07 | |
585 | |
586 #define INPUT_32BITS_IMM_LANECOUNT_FROMZERO \ | |
587 0x00, \ | |
588 0x01, \ | |
589 0x02, \ | |
590 0x03 | |
591 | |
592 #define INPUT_64BITS_IMM_LANECOUNT_FROMZERO \ | |
593 0x00, \ | |
594 0x01 | |
595 | |
596 #define INPUT_8BITS_IMM_TYPEWIDTH_BASE \ | |
597 0x01, \ | |
598 0x02, \ | |
599 0x03, \ | |
600 0x04, \ | |
601 0x05, \ | |
602 0x06, \ | |
603 0x07 | |
604 | |
605 #define INPUT_16BITS_IMM_TYPEWIDTH_BASE \ | |
606 INPUT_8BITS_IMM_TYPEWIDTH_BASE, \ | |
607 0x08, \ | |
608 0x09, \ | |
609 0x0a, \ | |
610 0x0b, \ | |
611 0x0c, \ | |
612 0x0d, \ | |
613 0x0e, \ | |
614 0x0f | |
615 | |
616 #define INPUT_32BITS_IMM_TYPEWIDTH_BASE \ | |
617 INPUT_16BITS_IMM_TYPEWIDTH_BASE, \ | |
618 0x10, \ | |
619 0x11, \ | |
620 0x12, \ | |
621 0x13, \ | |
622 0x14, \ | |
623 0x15, \ | |
624 0x16, \ | |
625 0x17, \ | |
626 0x18, \ | |
627 0x19, \ | |
628 0x1a, \ | |
629 0x1b, \ | |
630 0x1c, \ | |
631 0x1d, \ | |
632 0x1e, \ | |
633 0x1f | |
634 | |
635 #define INPUT_64BITS_IMM_TYPEWIDTH_BASE \ | |
636 INPUT_32BITS_IMM_TYPEWIDTH_BASE, \ | |
637 0x20, \ | |
638 0x21, \ | |
639 0x22, \ | |
640 0x23, \ | |
641 0x24, \ | |
642 0x25, \ | |
643 0x26, \ | |
644 0x27, \ | |
645 0x28, \ | |
646 0x29, \ | |
647 0x2a, \ | |
648 0x2b, \ | |
649 0x2c, \ | |
650 0x2d, \ | |
651 0x2e, \ | |
652 0x2f, \ | |
653 0x30, \ | |
654 0x31, \ | |
655 0x32, \ | |
656 0x33, \ | |
657 0x34, \ | |
658 0x35, \ | |
659 0x36, \ | |
660 0x37, \ | |
661 0x38, \ | |
662 0x39, \ | |
663 0x3a, \ | |
664 0x3b, \ | |
665 0x3c, \ | |
666 0x3d, \ | |
667 0x3e, \ | |
668 0x3f | |
669 | |
670 #define INPUT_8BITS_IMM_TYPEWIDTH \ | |
671 INPUT_8BITS_IMM_TYPEWIDTH_BASE, \ | |
672 0x08 | |
673 | |
674 #define INPUT_16BITS_IMM_TYPEWIDTH \ | |
675 INPUT_16BITS_IMM_TYPEWIDTH_BASE, \ | |
676 0x10 | |
677 | |
678 #define INPUT_32BITS_IMM_TYPEWIDTH \ | |
679 INPUT_32BITS_IMM_TYPEWIDTH_BASE, \ | |
680 0x20 | |
681 | |
682 #define INPUT_64BITS_IMM_TYPEWIDTH \ | |
683 INPUT_64BITS_IMM_TYPEWIDTH_BASE, \ | |
684 0x40 | |
685 | |
686 #define INPUT_8BITS_IMM_TYPEWIDTH_FROMZERO \ | |
687 0x00, \ | |
688 INPUT_8BITS_IMM_TYPEWIDTH_BASE | |
689 | |
690 #define INPUT_16BITS_IMM_TYPEWIDTH_FROMZERO \ | |
691 0x00, \ | |
692 INPUT_16BITS_IMM_TYPEWIDTH_BASE | |
693 | |
694 #define INPUT_32BITS_IMM_TYPEWIDTH_FROMZERO \ | |
695 0x00, \ | |
696 INPUT_32BITS_IMM_TYPEWIDTH_BASE | |
697 | |
698 #define INPUT_64BITS_IMM_TYPEWIDTH_FROMZERO \ | |
699 0x00, \ | |
700 INPUT_64BITS_IMM_TYPEWIDTH_BASE | |
701 | |
702 #define INPUT_32BITS_IMM_TYPEWIDTH_FROMZERO_TOWIDTH \ | |
703 0x00, \ | |
704 INPUT_32BITS_IMM_TYPEWIDTH_BASE, \ | |
705 0x20 | |
706 | |
707 #define INPUT_64BITS_IMM_TYPEWIDTH_FROMZERO_TOWIDTH \ | |
708 0x00, \ | |
709 INPUT_64BITS_IMM_TYPEWIDTH_BASE, \ | |
710 0x40 | |
711 | |
712 #define INPUT_8BITS_BASIC \ | |
713 0x00, \ | |
714 0x01, \ | |
715 0x02, \ | |
716 0x08, \ | |
717 0x33, \ | |
718 0x55, \ | |
719 0x7d, \ | |
720 0x7e, \ | |
721 0x7f, \ | |
722 0x80, \ | |
723 0x81, \ | |
724 0x82, \ | |
725 0x83, \ | |
726 0xaa, \ | |
727 0xcc, \ | |
728 0xf8, \ | |
729 0xfd, \ | |
730 0xfe, \ | |
731 0xff | |
732 | |
733 // Basic values for vector SIMD operations of types 4H or 8H. | |
734 #define INPUT_16BITS_BASIC \ | |
735 0x0000, \ | |
736 0x0001, \ | |
737 0x0002, \ | |
738 0x0010, \ | |
739 0x007d, \ | |
740 0x007e, \ | |
741 0x007f, \ | |
742 0x3333, \ | |
743 0x5555, \ | |
744 0x7ffd, \ | |
745 0x7ffe, \ | |
746 0x7fff, \ | |
747 0x8000, \ | |
748 0x8001, \ | |
749 0xaaaa, \ | |
750 0xcccc, \ | |
751 0xff80, \ | |
752 0xff81, \ | |
753 0xff82, \ | |
754 0xff83, \ | |
755 0xfff0, \ | |
756 0xfffd, \ | |
757 0xfffe, \ | |
758 0xffff | |
759 | |
760 // Basic values for vector SIMD operations of types 2S or 4S. | |
761 #define INPUT_32BITS_BASIC \ | |
762 0x00000000, \ | |
763 0x00000001, \ | |
764 0x00000002, \ | |
765 0x00000020, \ | |
766 0x0000007d, \ | |
767 0x0000007e, \ | |
768 0x0000007f, \ | |
769 0x00007ffd, \ | |
770 0x00007ffe, \ | |
771 0x00007fff, \ | |
772 0x33333333, \ | |
773 0x55555555, \ | |
774 0x7ffffffd, \ | |
775 0x7ffffffe, \ | |
776 0x7fffffff, \ | |
777 0x80000000, \ | |
778 0x80000001, \ | |
779 0xaaaaaaaa, \ | |
780 0xcccccccc, \ | |
781 0xffff8000, \ | |
782 0xffff8001, \ | |
783 0xffff8002, \ | |
784 0xffff8003, \ | |
785 0xffffff80, \ | |
786 0xffffff81, \ | |
787 0xffffff82, \ | |
788 0xffffff83, \ | |
789 0xffffffe0, \ | |
790 0xfffffffd, \ | |
791 0xfffffffe, \ | |
792 0xffffffff | |
793 | |
794 // Basic values for vector SIMD operations of type 2D | |
795 #define INPUT_64BITS_BASIC \ | |
796 0x0000000000000000, \ | |
797 0x0000000000000001, \ | |
798 0x0000000000000002, \ | |
799 0x0000000000000040, \ | |
800 0x000000000000007d, \ | |
801 0x000000000000007e, \ | |
802 0x000000000000007f, \ | |
803 0x0000000000007ffd, \ | |
804 0x0000000000007ffe, \ | |
805 0x0000000000007fff, \ | |
806 0x000000007ffffffd, \ | |
807 0x000000007ffffffe, \ | |
808 0x000000007fffffff, \ | |
809 0x3333333333333333, \ | |
810 0x5555555555555555, \ | |
811 0x7ffffffffffffffd, \ | |
812 0x7ffffffffffffffe, \ | |
813 0x7fffffffffffffff, \ | |
814 0x8000000000000000, \ | |
815 0x8000000000000001, \ | |
816 0x8000000000000002, \ | |
817 0x8000000000000003, \ | |
818 0xaaaaaaaaaaaaaaaa, \ | |
819 0xcccccccccccccccc, \ | |
820 0xffffffff80000000, \ | |
821 0xffffffff80000001, \ | |
822 0xffffffff80000002, \ | |
823 0xffffffff80000003, \ | |
824 0xffffffffffff8000, \ | |
825 0xffffffffffff8001, \ | |
826 0xffffffffffff8002, \ | |
827 0xffffffffffff8003, \ | |
828 0xffffffffffffff80, \ | |
829 0xffffffffffffff81, \ | |
830 0xffffffffffffff82, \ | |
831 0xffffffffffffff83, \ | |
832 0xffffffffffffffc0, \ | |
833 0xfffffffffffffffd, \ | |
834 0xfffffffffffffffe, \ | |
835 0xffffffffffffffff | |
836 | |
837 // clang-format on | |
838 | |
839 // For most 2- and 3-op instructions, use only basic inputs. Because every | |
840 // combination is tested, the length of the output trace is very sensitive to | |
841 // the length of this list. | |
842 static const uint64_t kInputDoubleBasic[] = {INPUT_DOUBLE_BASIC}; | |
843 static const uint32_t kInputFloatBasic[] = {INPUT_FLOAT_BASIC}; | |
844 | |
845 #define INPUT_DOUBLE_ACC_DESTINATION INPUT_DOUBLE_BASIC | |
846 #define INPUT_FLOAT_ACC_DESTINATION INPUT_FLOAT_BASIC | |
847 | |
848 static const uint64_t kInputDoubleAccDestination[] = { | |
849 INPUT_DOUBLE_ACC_DESTINATION}; | |
850 | |
851 static const uint32_t kInputFloatAccDestination[] = { | |
852 INPUT_FLOAT_ACC_DESTINATION}; | |
853 | |
854 // For conversions, include several extra inputs. | |
855 static const uint64_t kInputDoubleConversions[] = { | |
856 INPUT_DOUBLE_BASIC INPUT_DOUBLE_CONVERSIONS}; | |
857 | |
858 static const uint32_t kInputFloatConversions[] = { | |
859 INPUT_FLOAT_BASIC INPUT_FLOAT_CONVERSIONS}; | |
860 | |
861 static const uint64_t kInput64bitsFixedPointConversions[] = { | |
862 INPUT_64BITS_BASIC, INPUT_64BITS_FIXEDPOINT_CONVERSIONS}; | |
863 | |
864 static const uint32_t kInput32bitsFixedPointConversions[] = { | |
865 INPUT_32BITS_BASIC, INPUT_32BITS_FIXEDPOINT_CONVERSIONS}; | |
866 | |
867 static const uint16_t kInputFloat16Conversions[] = { | |
868 INPUT_FLOAT16_BASIC INPUT_FLOAT16_CONVERSIONS}; | |
869 | |
870 static const uint8_t kInput8bitsBasic[] = {INPUT_8BITS_BASIC}; | |
871 | |
872 static const uint16_t kInput16bitsBasic[] = {INPUT_16BITS_BASIC}; | |
873 | |
874 static const uint32_t kInput32bitsBasic[] = {INPUT_32BITS_BASIC}; | |
875 | |
876 static const uint64_t kInput64bitsBasic[] = {INPUT_64BITS_BASIC}; | |
877 | |
878 static const int kInput8bitsImmTypeWidth[] = {INPUT_8BITS_IMM_TYPEWIDTH}; | |
879 | |
880 static const int kInput16bitsImmTypeWidth[] = {INPUT_16BITS_IMM_TYPEWIDTH}; | |
881 | |
882 static const int kInput32bitsImmTypeWidth[] = {INPUT_32BITS_IMM_TYPEWIDTH}; | |
883 | |
884 static const int kInput64bitsImmTypeWidth[] = {INPUT_64BITS_IMM_TYPEWIDTH}; | |
885 | |
886 static const int kInput8bitsImmTypeWidthFromZero[] = { | |
887 INPUT_8BITS_IMM_TYPEWIDTH_FROMZERO}; | |
888 | |
889 static const int kInput16bitsImmTypeWidthFromZero[] = { | |
890 INPUT_16BITS_IMM_TYPEWIDTH_FROMZERO}; | |
891 | |
892 static const int kInput32bitsImmTypeWidthFromZero[] = { | |
893 INPUT_32BITS_IMM_TYPEWIDTH_FROMZERO}; | |
894 | |
895 static const int kInput64bitsImmTypeWidthFromZero[] = { | |
896 INPUT_64BITS_IMM_TYPEWIDTH_FROMZERO}; | |
897 | |
898 static const int kInput32bitsImmTypeWidthFromZeroToWidth[] = { | |
899 INPUT_32BITS_IMM_TYPEWIDTH_FROMZERO_TOWIDTH}; | |
900 | |
901 static const int kInput64bitsImmTypeWidthFromZeroToWidth[] = { | |
902 INPUT_64BITS_IMM_TYPEWIDTH_FROMZERO_TOWIDTH}; | |
903 | |
904 // These immediate values are used only in 'shll{2}' tests. | |
905 static const int kInput8bitsImmSHLL[] = {8}; | |
906 static const int kInput16bitsImmSHLL[] = {16}; | |
907 static const int kInput32bitsImmSHLL[] = {32}; | |
908 | |
909 static const double kInputDoubleImmZero[] = {0.0}; | |
910 | |
911 static const int kInput8bitsImmZero[] = {0}; | |
912 | |
913 static const int kInput16bitsImmZero[] = {0}; | |
914 | |
915 static const int kInput32bitsImmZero[] = {0}; | |
916 | |
917 static const int kInput64bitsImmZero[] = {0}; | |
918 | |
919 static const int kInput8bitsImmLaneCountFromZero[] = { | |
920 INPUT_8BITS_IMM_LANECOUNT_FROMZERO}; | |
921 | |
922 static const int kInput16bitsImmLaneCountFromZero[] = { | |
923 INPUT_16BITS_IMM_LANECOUNT_FROMZERO}; | |
924 | |
925 static const int kInput32bitsImmLaneCountFromZero[] = { | |
926 INPUT_32BITS_IMM_LANECOUNT_FROMZERO}; | |
927 | |
928 static const int kInput64bitsImmLaneCountFromZero[] = { | |
929 INPUT_64BITS_IMM_LANECOUNT_FROMZERO}; | |
930 | |
931 #define INPUT_8BITS_ACC_DESTINATION INPUT_8BITS_BASIC | |
932 #define INPUT_16BITS_ACC_DESTINATION INPUT_16BITS_BASIC | |
933 #define INPUT_32BITS_ACC_DESTINATION INPUT_32BITS_BASIC | |
934 #define INPUT_64BITS_ACC_DESTINATION INPUT_64BITS_BASIC | |
935 | |
936 static const uint8_t kInput8bitsAccDestination[] = { | |
937 INPUT_8BITS_ACC_DESTINATION}; | |
938 | |
939 static const uint16_t kInput16bitsAccDestination[] = { | |
940 INPUT_16BITS_ACC_DESTINATION}; | |
941 | |
942 static const uint32_t kInput32bitsAccDestination[] = { | |
943 INPUT_32BITS_ACC_DESTINATION}; | |
944 | |
945 static const uint64_t kInput64bitsAccDestination[] = { | |
946 INPUT_64BITS_ACC_DESTINATION}; | |
947 | |
948 static const int kInputHIndices[] = {0, 1, 2, 3, 4, 5, 6, 7}; | |
949 | |
950 static const int kInputSIndices[] = {0, 1, 2, 3}; | |
951 | |
952 static const int kInputDIndices[] = {0, 1}; | |
OLD | NEW |