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