1# Copyright (c) 2021 Huawei Device Co., Ltd. 2# Licensed under the Apache License, Version 2.0 (the "License"); 3# you may not use this file except in compliance with the License. 4# You may obtain a copy of the License at 5# 6# http://www.apache.org/licenses/LICENSE-2.0 7# 8# Unless required by applicable law or agreed to in writing, software 9# distributed under the License is distributed on an "AS IS" BASIS, 10# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11# See the License for the specific language governing permissions and 12# limitations under the License. 13 14tests: 15 - file-name: "jlt" 16 isa: 17 title: Conditional compared to register jump 18 description: > 19 Transfer execution to an instruction at offset bytes from the beginning of the current instruction if signed 20 32-bit integers in accumulator and register compare as specified. Offset is sign extended to the size of 21 instruction address. 22 exceptions: 23 - x_none 24 instructions: 25 - sig: jlt v:in:i32, imm:i32 26 acc: in:i32 27 format: [op_v_8_imm_8, op_v_8_imm_16] 28 commands: 29 30 - file-name: "invalid_v_reg" 31 isa: 32 verification: 33 - v1_type 34 runner-options: [compile-failure] 35 description: Check 'jlt' instruction with invalid 'v' register. 36 header-template: [] 37 code-template: | 38 .function i32 main() { 39 jlt %s 40 lbl: 41 check-type: exit-positive 42 cases: 43 - values: ["v256, lbl"] 44 - values: ["v65535, lbl"] 45 - values: ["v65536, lbl"] 46 - values: ["a0, lbl"] 47 - values: ["a256, lbl"] 48 - values: ["a65535, lbl"] 49 - values: ["lbl"] 50 - values: [""] 51 - values: ["}"] 52 - values: ["# v1, lbl"] 53 - values: ["V1, lbl"] 54 - values: ["v1, Lbl"] 55 56 57 - file-name: "invalid_a_reg" 58 isa: 59 verification: 60 - v1_type 61 runner-options: [compile-failure] 62 description: Check 'jlt' instruction with invalid 'a' register. 63 header-template: [] 64 code-template: | 65 .function void foo(i32 a0, i32 a1, i32 a2, i32 a3, i32 a4, i32 a5) <static> { 66 jlt %s 67 lbl: 68 return.void 69 } 70 .function i32 main() { 71 call.range foo, v0 72 check-type: exit-positive 73 cases: 74 - values: ["v256, lbl"] 75 - values: ["v65535, lbl"] 76 - values: ["v65536, lbl"] 77 - values: ["a6, lbl"] 78 - values: ["a256, lbl"] 79 - values: ["a65535, lbl"] 80 - values: ["lbl"] 81 - values: [""] 82 - values: ["}"] 83 - values: ["# a1, lbl"] 84 - values: ["A1, lbl"] 85 - values: ["a1, Lbl"] 86 87 88 - file-name: "valid_v_reg" 89 isa: 90 verification: 91 - v1_type 92 instructions: 93 - sig: jlt v:in:i32, imm:i32 94 acc: in:i32 95 format: [op_v_8_imm_8, op_v_8_imm_16] 96 description: Check 'jlt' instruction with valid 'v' register. 97 header-template: [] 98 code-template: | 99 .function i32 main() { 100 movi %s, 2 101 ldai 1 102 jlt %s, lbl 103 ldai 1 104 return 105 lbl: 106 check-type: exit-positive 107 cases: 108 - values: ["v0", "v0"] 109 - values: ["v7", "v7"] 110 - values: ["v8", "v8"] 111 - values: ["v15", "v15"] 112 - values: ["v16", "v16"] 113 - values: ["v254", "v254"] 114 - values: ["v255", "v255"] 115 tags: [tsan] 116 117 118 - file-name: "valid_a_reg" 119 isa: 120 verification: 121 - v1_type 122 instructions: 123 - sig: jlt v:in:i32, imm:i32 124 acc: in:i32 125 format: [op_v_8_imm_8, op_v_8_imm_16] 126 description: Check 'jlt' instruction with valid 'a' register. 127 header-template: [] 128 code-template: | 129 .function i32 foo(%s) <static> { 130 ldai 1 131 jlt %s, lbl 132 ldai 1 133 return 134 lbl: 135 ldai 0 136 return 137 } 138 .function i32 main() { 139 %s 140 call.range foo, v0 141 check-type: no-check 142 cases: 143 - values: 144 - i32 a0 145 - a0 146 - | 147 # 148 movi v0, 2 149 - values: 150 - i16 a0, i32 a1 151 - a1 152 - | 153 # 154 movi v0, 2 155 movi v1, 3 156 tags: [tsan] 157 - values: 158 - "#{[*0..255].map do |i| \" i32 a#{i}\" end .join(\",\")}" 159 - a254 160 - "#{[*0..255].map do |i| \" movi v#{i}, #{i}\\n\" end .join}" 161 bugid: ['3855'] 162 - values: 163 - "#{[*0..255].map do |i| \" i32 a#{i}\" end .join(\",\")}" 164 - a255 165 - "#{[*0..255].map do |i| \" movi v#{i}, #{i}\\n\" end .join}" 166 bugid: ['3855'] 167 168 169 - file-name: "uninitialized_regs" 170 isa: 171 verification: 172 - acc_type 173 - v1_type 174 runner-options: ['verifier-failure', 'verifier-debug-config'] 175 tags: [verifier] 176 description: Check 'jlt' instruction with uninitialized registers. 177 header-template: [] 178 code-template: | 179 .function i32 main() { 180 %s 181 jlt v1, lbl 182 ldai 1 183 return 184 lbl: 185 check-type: exit-positive 186 cases: 187 - description: Accumulator is not initialized. 188 values: 189 - movi v1, 1 190 - description: V register is not initialized. 191 values: 192 - ldai 1 193 - description: Accumulator and 'v' register are both not initialized. 194 values: 195 - "" 196 197 198 - file-name: "invalid_branch_target" 199 isa: 200 verification: 201 - branch_target 202 runner-options: [compile-failure] 203 description: Check 'jlt' instruction with invalid branch target. 204 header-template: [] 205 code-template: | 206 .record R {} 207 208 .function void R.ctor(R a0) <ctor> { 209 lbl_ctor: 210 return.void 211 } 212 213 .function void R.cctor() <cctor> { 214 lbl_cctor: 215 return.void 216 } 217 218 .function i32 foo(i32 a0, i32 a1) <static> { 219 lda a0 220 jlt a1, %s 221 return 222 } 223 224 .function i32 bar() <static> { 225 lbl_bar: 226 ldai 1 227 return 228 } 229 230 .function i32 main() { 231 movi v0, 0 232 movi v1, 1 233 call.short foo, v0, v1 234 lbl_main: 235 check-type: exit-positive 236 cases: 237 - values: ["main"] 238 - values: ["foo"] 239 - values: ["bar"] 240 - values: ["baz"] 241 - values: ["R"] 242 - values: ["lbl_main"] 243 - values: ["lbl_bar"] 244 - values: ["lbl_ctor"] 245 - values: ["lbl_cctor"] 246 247 248 - file-name: "prohibited_branch_target" 249 isa: 250 verification: 251 - branch_target 252 runner-options: ['verifier-failure', 'verifier-debug-config'] 253 tags: [verifier] 254 description: Check 'jlt' instruction with prohibited branch target. 255 header-template: [] 256 code-template: | 257 .record E1 {} 258 .record E2 {} 259 260 .function i32 main() { 261 ldai 1 262 movi v0, 1 263 jlt v0, %s 264 265 begin: 266 ldai 0 267 return 268 mid: 269 ldai 1 270 return 271 end: 272 ldai 2 273 return 274 275 catch_E1_begin: 276 ldai 3 277 return 278 catch_E1_mid: 279 ldai 4 280 return 281 catch_E1_end: 282 ldai 5 283 return 284 285 catch_E2_begin: 286 ldai 6 287 return 288 catch_E2_mid: 289 ldai 7 290 return 291 catch_E2_end: 292 293 quit: 294 ldai 8 295 return 296 297 .catch E1, begin, end, catch_E1_begin, catch_E1_end 298 .catch E2, catch_E1_begin, catch_E1_end, catch_E2_begin, catch_E2_end 299 outside: 300 check-type: none 301 cases: 302 - values: ["begin"] 303 runner-options: ['verifier-only', 'verifier-debug-config'] 304 - values: ["mid"] 305 runner-options: ['verifier-only', 'verifier-debug-config'] 306 - values: ["end"] 307 runner-options: ['verifier-only', 'verifier-debug-config'] 308 - values: ["quit"] 309 runner-options: ['verifier-only', 'verifier-debug-config'] 310 - values: ["catch_E1_begin"] 311 - values: ["catch_E1_mid"] 312 - values: ["catch_E1_end"] 313 runner-options: ['verifier-only', 'verifier-debug-config'] 314 - values: ["catch_E2_begin"] 315 - values: ["catch_E2_mid"] 316 - values: ["catch_E2_end"] 317 runner-options: ['verifier-only', 'verifier-debug-config'] 318 - values: ["outside"] 319 320 321 - file-name: "invalid_acc_value" 322 isa: 323 verification: 324 - acc_type 325 runner-options: ['verifier-failure', 'verifier-debug-config'] 326 tags: [verifier] 327 description: Check 'jlt' instruction with invalid accumulator value 328 header-template: [] 329 code-template: | 330 .record panda.Object <external> 331 .record panda.String <external> 332 .record panda.Class <external> 333 .record R {} 334 .function void R.ctor(R a0) <ctor> { 335 return.void 336 } 337 .function i32 main() { 338 %s 339 movi v1, 1 340 jlt v1, ok 341 ldai 1 342 return 343 ok: 344 check-type: exit-positive 345 cases: 346 - values: 347 - lda.null 348 - values: 349 - initobj R.ctor 350 - values: 351 - lda.str "test" 352 - values: 353 - lda.type panda.Object 354 - values: 355 - | 356 # 357 movi v0, 10 358 newarr v0, v0, i32[] 359 lda.obj v0 360 - values: 361 - | 362 # 363 movi v0, 10 364 newarr v0, v0, f64[] 365 lda.obj v0 366 - values: 367 - | 368 # 369 movi v0, 10 370 newarr v0, v0, R[] 371 lda.obj v0 372 - values: 373 - | 374 # 375 movi v0, 10 376 newarr v0, v0, panda.Class[][] 377 lda.obj v0 378 - values: 379 - | 380 # 381 movi v0, 10 382 newarr v0, v0, panda.String[] 383 lda.obj v0 384 - values: 385 - ldai.64 0 386 - values: 387 - ldai.64 1 388 - values: 389 - ldai.64 0x7fffffffffffffff 390 - values: 391 - ldai.64 0xffffffffffffffff 392 - values: 393 - ldai.64 0x8000000000000000 394 - values: 395 - | 396 # 397 fldai.64 0x0000000000000000 # Positive zero (+0.0, hexadecimal representation is `0x0000000000000000`) 398 - values: 399 - | 400 # 401 fldai.64 0x8000000000000000 # Negative zero (-0.0, hexadecimal representation is `0x8000000000000000`) 402 - values: 403 - | 404 # 405 fldai.64 0x0000000000000001 # Minimal positive value (4.9E-324, hexadecimal representation is `0x0000000000000001`) 406 - values: 407 - | 408 # 409 fldai.64 0x8000000000000001 # Maximal negative value (-4.9E-324, hexadecimal representation is `0x8000000000000001`) 410 - values: 411 - | 412 # 413 fldai.64 0x7fefffffffffffff # Maximal positive value (1.7976931348623157e308, hexadecimal representation is `0x7fefffffffffffff`) 414 - values: 415 - | 416 # 417 fldai.64 0xffefffffffffffff # Minimal negative value (-1.7976931348623157e308, hexadecimal representation is `0xffefffffffffffff`) 418 - values: 419 - | 420 # 421 fldai.64 0x7ff0000000000000 # Positive infinity (hexadecimal representation is `0x7ff0000000000000`) 422 - values: 423 - | 424 # 425 fldai.64 0xfff0000000000000 # Negative infinity (hexadecimal representation is `0xfff0000000000000`) 426 - values: 427 - | 428 # 429 fldai.64 0x7ff8000000000000 # NaN 430 431 432 - file-name: "invalid_v_value" 433 isa: 434 verification: 435 - v1_type 436 runner-options: ['verifier-failure', 'verifier-debug-config'] 437 tags: [verifier] 438 description: Check 'jlt' instruction with invalid v register value 439 header-template: [] 440 code-template: | 441 .record panda.Object <external> 442 .record panda.String <external> 443 .record panda.Class <external> 444 .record R {} 445 .function void R.ctor(R a0) <ctor> { 446 return.void 447 } 448 .function i32 main() { 449 %s 450 ldai 1 451 jlt v1, ok 452 ldai 1 453 return 454 ok: 455 check-type: exit-positive 456 cases: 457 - values: 458 - mov.null v1 459 - values: 460 - | 461 # 462 initobj R.ctor 463 sta.obj v1 464 - values: 465 - | 466 # 467 lda.str "test" 468 sta.obj v1 469 - values: 470 - | 471 # 472 lda.type panda.Object 473 sta.obj v1 474 - values: 475 - | 476 # 477 movi v0, 10 478 newarr v1, v0, i32[] 479 lda.obj v1 480 - values: 481 - | 482 # 483 movi v0, 10 484 newarr v1, v0, f64[] 485 lda.obj v1 486 - values: 487 - | 488 # 489 movi v0, 10 490 newarr v1, v0, R[] 491 lda.obj v1 492 - values: 493 - | 494 # 495 movi v0, 10 496 newarr v1, v0, panda.Class[][] 497 lda.obj v1 498 - values: 499 - | 500 # 501 movi v0, 10 502 newarr v1, v0, panda.String[] 503 lda.obj v1 504 - values: 505 - movi.64 v1, 0 506 - values: 507 - movi.64 v1, 1 508 - values: 509 - movi.64 v1, 0x7fffffffffffffff 510 - values: 511 - movi.64 v1, 0xffffffffffffffff 512 - values: 513 - movi.64 v1, 0x8000000000000000 514 - values: 515 - | 516 # 517 fmovi.64 v1, 0x0000000000000000 # Positive zero (+0.0, hexadecimal representation is `0x0000000000000000`) 518 - values: 519 - | 520 # 521 fmovi.64 v1, 0x8000000000000000 # Negative zero (-0.0, hexadecimal representation is `0x8000000000000000`) 522 - values: 523 - | 524 # 525 fmovi.64 v1, 0x0000000000000001 # Minimal positive value (4.9E-324, hexadecimal representation is `0x0000000000000001`) 526 - values: 527 - | 528 # 529 fmovi.64 v1, 0x8000000000000001 # Maximal negative value (-4.9E-324, hexadecimal representation is `0x8000000000000001`) 530 - values: 531 - | 532 # 533 fmovi.64 v1, 0x7fefffffffffffff # Maximal positive value (1.7976931348623157e308, hexadecimal representation is `0x7fefffffffffffff`) 534 - values: 535 - | 536 # 537 fmovi.64 v1, 0xffefffffffffffff # Minimal negative value (-1.7976931348623157e308, hexadecimal representation is `0xffefffffffffffff`) 538 - values: 539 - | 540 # 541 fmovi.64 v1, 0x7ff0000000000000 # Positive infinity (hexadecimal representation is `0x7ff0000000000000`) 542 - values: 543 - | 544 # 545 fmovi.64 v1, 0xfff0000000000000 # Negative infinity (hexadecimal representation is `0xfff0000000000000`) 546 - values: 547 - | 548 # 549 fmovi.64 v1, 0x7ff8000000000000 # NaN 550 551 552 - file-name: "invalid_both_acc_and_v_value" 553 isa: 554 verification: 555 - v1_type 556 - acc_type 557 runner-options: ['verifier-failure', 'verifier-debug-config'] 558 tags: [verifier] 559 description: Check 'jlt' instruction with invalid accumulator and v register value 560 header-template: [] 561 code-template: | 562 .record panda.Object <external> 563 .record panda.String <external> 564 .record panda.Class <external> 565 .record R {} 566 .function void R.ctor(R a0) <ctor> { 567 return.void 568 } 569 .function i32 main() { 570 *s 571 %s 572 jlt v1, ok 573 ldai 1 574 return 575 ok: 576 check-type: exit-positive 577 template-cases: 578 - values: 579 - lda.null 580 - values: 581 - initobj R.ctor 582 - values: 583 - lda.str "test" 584 - values: 585 - lda.type panda.Object 586 - values: 587 - | 588 # 589 movi v0, 10 590 newarr v0, v0, i32[] 591 lda.obj v0 592 - values: 593 - | 594 # 595 movi v0, 10 596 newarr v0, v0, f64[] 597 lda.obj v0 598 - values: 599 - | 600 # 601 movi v0, 10 602 newarr v0, v0, R[] 603 lda.obj v0 604 - values: 605 - | 606 # 607 movi v0, 10 608 newarr v0, v0, panda.Class[][] 609 lda.obj v0 610 - values: 611 - | 612 # 613 movi v0, 10 614 newarr v0, v0, panda.String[] 615 lda.obj v0 616 - values: 617 - ldai.64 0 618 - values: 619 - ldai.64 1 620 - values: 621 - ldai.64 0x7fffffffffffffff 622 - values: 623 - ldai.64 0xffffffffffffffff 624 - values: 625 - ldai.64 0x8000000000000000 626 - values: 627 - | 628 # 629 fldai.64 0x0000000000000000 # Positive zero (+0.0, hexadecimal representation is `0x0000000000000000`) 630 - values: 631 - | 632 # 633 fldai.64 0x8000000000000000 # Negative zero (-0.0, hexadecimal representation is `0x8000000000000000`) 634 - values: 635 - | 636 # 637 fldai.64 0x0000000000000001 # Minimal positive value (4.9E-324, hexadecimal representation is `0x0000000000000001`) 638 - values: 639 - | 640 # 641 fldai.64 0x8000000000000001 # Maximal negative value (-4.9E-324, hexadecimal representation is `0x8000000000000001`) 642 - values: 643 - | 644 # 645 fldai.64 0x7fefffffffffffff # Maximal positive value (1.7976931348623157e308, hexadecimal representation is `0x7fefffffffffffff`) 646 - values: 647 - | 648 # 649 fldai.64 0xffefffffffffffff # Minimal negative value (-1.7976931348623157e308, hexadecimal representation is `0xffefffffffffffff`) 650 - values: 651 - | 652 # 653 fldai.64 0x7ff0000000000000 # Positive infinity (hexadecimal representation is `0x7ff0000000000000`) 654 - values: 655 - | 656 # 657 fldai.64 0xfff0000000000000 # Negative infinity (hexadecimal representation is `0xfff0000000000000`) 658 - values: 659 - | 660 # 661 fldai.64 0x7ff8000000000000 # NaN 662 cases: 663 - values: 664 - mov.null v1 665 - values: 666 - | 667 # 668 initobj R.ctor 669 sta.obj v1 670 - values: 671 - | 672 # 673 lda.str "test" 674 sta.obj v1 675 - values: 676 - | 677 # 678 lda.type panda.Object 679 sta.obj v1 680 - values: 681 - | 682 # 683 movi v0, 10 684 newarr v1, v0, i32[] 685 lda.obj v1 686 - values: 687 - | 688 # 689 movi v0, 10 690 newarr v1, v0, f64[] 691 lda.obj v1 692 - values: 693 - | 694 # 695 movi v0, 10 696 newarr v1, v0, R[] 697 lda.obj v1 698 - values: 699 - | 700 # 701 movi v0, 10 702 newarr v1, v0, panda.Class[][] 703 lda.obj v1 704 - values: 705 - | 706 # 707 movi v0, 10 708 newarr v1, v0, panda.String[] 709 lda.obj v1 710 - values: 711 - movi.64 v1, 0 712 - values: 713 - movi.64 v1, 1 714 - values: 715 - movi.64 v1, 0x7fffffffffffffff 716 - values: 717 - movi.64 v1, 0xffffffffffffffff 718 - values: 719 - movi.64 v1, 0x8000000000000000 720 - values: 721 - | 722 # 723 fmovi.64 v1, 0x0000000000000000 # Positive zero (+0.0, hexadecimal representation is `0x0000000000000000`) 724 - values: 725 - | 726 # 727 fmovi.64 v1, 0x8000000000000000 # Negative zero (-0.0, hexadecimal representation is `0x8000000000000000`) 728 - values: 729 - | 730 # 731 fmovi.64 v1, 0x0000000000000001 # Minimal positive value (4.9E-324, hexadecimal representation is `0x0000000000000001`) 732 - values: 733 - | 734 # 735 fmovi.64 v1, 0x8000000000000001 # Maximal negative value (-4.9E-324, hexadecimal representation is `0x8000000000000001`) 736 - values: 737 - | 738 # 739 fmovi.64 v1, 0x7fefffffffffffff # Maximal positive value (1.7976931348623157e308, hexadecimal representation is `0x7fefffffffffffff`) 740 - values: 741 - | 742 # 743 fmovi.64 v1, 0xffefffffffffffff # Minimal negative value (-1.7976931348623157e308, hexadecimal representation is `0xffefffffffffffff`) 744 - values: 745 - | 746 # 747 fmovi.64 v1, 0x7ff0000000000000 # Positive infinity (hexadecimal representation is `0x7ff0000000000000`) 748 - values: 749 - | 750 # 751 fmovi.64 v1, 0xfff0000000000000 # Negative infinity (hexadecimal representation is `0xfff0000000000000`) 752 - values: 753 - | 754 # 755 fmovi.64 v1, 0x7ff8000000000000 # NaN 756 757 758 - file-name: "valid_values" 759 isa: 760 description: > 761 Transfer execution to an instruction at offset bytes from the beginning of the current instruction if signed 762 32-bit integers in accumulator and register compare as specified. Offset is sign extended to the size of 763 instruction address. 764 description: Check 'jlt' instruction with valid values in registers. 765 header-template: [] 766 code-template: | 767 .function i32 main() { 768 ldai %s 769 movi v1, %s 770 jlt v1, lbl 771 ldai %s 772 return 773 lbl: 774 ldai %s 775 check-type: no-check 776 cases: 777 - values: [-2147483648, -2147483648, 0, 1] 778 - values: [-2147483648, -1, 1, 0] 779 - values: [-2147483648, 0, 1, 0] 780 - values: [-2147483648, 1, 1, 0] 781 - values: [-2147483648, 2147483647, 1, 0] 782 783 - values: [-1, -2147483648, 0, 1] 784 - values: [-1, -1, 0, 1] 785 - values: [-1, 0, 1, 0] 786 - values: [-1, 1, 1, 0] 787 - values: [-1, 2147483647, 1, 0] 788 789 - values: [0, -2147483648, 0, 1] 790 - values: [0, -1, 0, 1] 791 - values: [0, 0, 0, 1] 792 - values: [0, 1, 1, 0] 793 - values: [0, 2147483647, 1, 0] 794 795 - values: [1, -2147483648, 0, 1] 796 - values: [1, -1, 0, 1] 797 - values: [1, 0, 0, 1] 798 - values: [1, 1, 0, 1] 799 - values: [1, 2147483647, 1, 0] 800 801 - values: [2147483647, -2147483648, 0, 1] 802 - values: [2147483647, -1, 0, 1] 803 - values: [2147483647, 0, 0, 1] 804 - values: [2147483647, 1, 0, 1] 805 - values: [2147483647, 2147483647, 0, 1] 806 807 808 - file-name: "valid_offset_values" 809 isa: 810 description: > 811 Transfer execution to an instruction at offset bytes from the beginning of the current instruction if signed 812 32-bit integers in accumulator and register compare as specified. Offset is sign extended to the size of 813 instruction address. 814 description: Check 'jlt' instruction with valid offset values. 815 header-template: [] 816 code-template: | 817 .function i32 main() { 818 ldai 1 819 movi v1, 2 820 %s 821 ldai 1 # 2-byte instruction 822 return # 1-byte instruction 823 quit: 824 check-type: exit-positive 825 cases: 826 - description: Same instruction jump, offset imm8, 0 bytes 827 values: 828 - | 829 # 830 ldai 10 831 lbl: 832 jlt v1, lbl 833 ldai 0 834 return 835 tags: [tsan] 836 bugid: ['3828'] 837 - description: Max forward jump for imm8, 3 + 120 + 1 + 3 = 127 bytes 838 values: 839 - | 840 # 841 jlt v1, quit # 3-byte instruction 842 movi.64 v0, 0 ##*12 843 neg # 1-byte instruction 844 tags: [tsan] 845 - description: Max backward jump for imm8, 3 + 120 + 2 + 2 + 1 = 128 bytes 846 values: 847 - | 848 # 849 jmp lbl2 850 lbl1: 851 jmp quit # 3-byte instruction 852 movi.64 v0, 0 ##*12 853 ldai 1 # 2-byte instruction 854 ldai 1 # 2-byte instruction 855 return # 1-byte instruction 856 lbl2: 857 jlt v1, lbl1 858 - description: Max forward jump for imm16, 32760 + 4 + 3 = 32767 bytes 859 values: 860 - | 861 # 862 jlt v1, quit # 4-byte instruction 863 movi.64 v0, 0 ##*3276 864 - description: Beyond max forward jump for imm16, 40000 + 4 + 3 = 40007 bytes. Converted to jgt + jmp by compiler. 865 values: 866 - | 867 # 868 jlt v1, quit # 4-byte instruction 869 movi.64 v0, 0 ##*4000 870 - description: Max backward jump for imm16, 5 + 32760 + 3 = 32768 bytes 871 values: 872 - | 873 # 874 jmp lbl2 875 lbl1: 876 jmp quit # 5-byte instruction 877 movi.64 v0, 0 ##*3276 878 ldai 1 879 return 880 lbl2: 881 jlt v1, lbl1 882 - description: Beyond max backward jump for imm16, 5 + 40000 = 40005 bytes. Converted to jgt + jmp by compiler. 883 values: 884 - | 885 # 886 jmp lbl2 887 lbl1: 888 jmp quit # 5-byte instruction 889 movi.64 v0, 0 ##*4000 890 ldai 1 891 return 892 lbl2: 893 jlt v1, lbl1 894 - description: Chain of forward jumps 895 values: 896 - | 897 # 898 jlt v1, lbl1 899 ldai 2 900 return 901 lbl1: 902 jlt v1, lbl2 903 ldai 3 904 return 905 lbl2: 906 jlt v1, lbl3 907 ldai 4 908 return 909 lbl3: 910 jlt v1, lbl4 911 ldai 5 912 return 913 lbl4: 914 jlt v1, quit 915 tags: [tsan] 916 - description: Chain of backward jumps 917 values: 918 - | 919 # 920 jmp lbl1 921 lbl6: 922 jmp quit 923 lbl5: 924 jlt v1, lbl6 925 ldai 5 926 return 927 lbl4: 928 jlt v1, lbl5 929 ldai 4 930 return 931 lbl3: 932 jlt v1, lbl4 933 ldai 3 934 return 935 lbl2: 936 jlt v1, lbl3 937 ldai 2 938 return 939 lbl1: 940 jlt v1, lbl2 941 tags: [tsan] 942