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