| OLD | NEW |
| 1 # ARMv7 Instruction Encodings | 1 # ARMv7 Instruction Encodings |
| 2 # | 2 # |
| 3 # This table is derived from the "ARM Architecture Reference Manual, ARMv7-A | 3 # This table is derived from the "ARM Architecture Reference Manual, ARMv7-A |
| 4 # and ARMv7-R edition" and is used here with the permission of ARM Limited. | 4 # and ARMv7-R edition" and is used here with the permission of ARM Limited. |
| 5 # Reproduction for purposes other than the development and distribution of | 5 # Reproduction for purposes other than the development and distribution of |
| 6 # Native Client may require the explicit permission of ARM Limited. | 6 # Native Client may require the explicit permission of ARM Limited. |
| 7 | 7 |
| 8 # This file defines the Native Client "instruction classes" assigned to every | 8 # This file defines the Native Client "instruction classes" assigned to every |
| 9 # possible ARMv7 instruction encoding. It is organized into a series of tables, | 9 # possible ARMv7 instruction encoding. It is organized into a series of tables, |
| 10 # and directly parallels the ARM Architecture Reference Manual cited above. | 10 # and directly parallels the ARM Architecture Reference Manual cited above. |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 92 # The following defines a class decoder hierarchy used to select the | 92 # The following defines a class decoder hierarchy used to select the |
| 93 # appropriate tester. We want to add class hierarchy information for | 93 # appropriate tester. We want to add class hierarchy information for |
| 94 # classes that want their tester to be defined on a superclass. | 94 # classes that want their tester to be defined on a superclass. |
| 95 # By providing this information, the generator can pick out | 95 # By providing this information, the generator can pick out |
| 96 # the corresponding baseline class tester to use, and does | 96 # the corresponding baseline class tester to use, and does |
| 97 # not need to define separate testers for derived classes of | 97 # not need to define separate testers for derived classes of |
| 98 # the baseline class tester. | 98 # the baseline class tester. |
| 99 # ############################################################# | 99 # ############################################################# |
| 100 | 100 |
| 101 class ForbiddenCondNop : UnsafeCondNop | 101 class ForbiddenCondNop : UnsafeCondNop |
| 102 class Load2RegisterImmediateDoubleOp : LoadStore2RegisterImmediateDoubleOp | |
| 103 class Load2RegisterImmediateOp : LoadStore2RegisterImmediateOp | |
| 104 class Load3RegisterDoubleOp : LoadStore3RegisterDoubleOp | 102 class Load3RegisterDoubleOp : LoadStore3RegisterDoubleOp |
| 103 class Load2RegisterImm8DoubleOp : LoadStore2RegisterImm8DoubleOp |
| 104 class Load2RegisterImm8Op : LoadStore2RegisterImm8Op |
| 105 class Load2RegisterImm12Op : LoadStore2RegisterImm12Op |
| 106 class Load3RegisterImm5Op : LoadStore3RegisterImm5Op |
| 105 class Load3RegisterOp : LoadStore3RegisterOp | 107 class Load3RegisterOp : LoadStore3RegisterOp |
| 106 class MaskedBinary2RegisterImmediateOp : Binary2RegisterImmediateOp | 108 class MaskedBinary2RegisterImmediateOp : Binary2RegisterImmediateOp |
| 107 class MaskedBinaryRegisterImmediateTest : BinaryRegisterImmediateTest | 109 class MaskedBinaryRegisterImmediateTest : BinaryRegisterImmediateTest |
| 108 class Store2RegisterImmediateDoubleOp : LoadStore2RegisterImmediateDoubleOp | |
| 109 class Store2RegisterImmediateOp : LoadStore2RegisterImmediateOp | |
| 110 class Store3RegisterDoubleOp : LoadStore3RegisterDoubleOp | 110 class Store3RegisterDoubleOp : LoadStore3RegisterDoubleOp |
| 111 class Store2RegisterImm8DoubleOp : LoadStore2RegisterImm8DoubleOp |
| 112 class Store2RegisterImm8Op : LoadStore2RegisterImm8Op |
| 113 class Store2RegisterImm12Op : LoadStore2RegisterImm12Op |
| 114 class Store3RegisterImm5Op : LoadStore3RegisterImm5Op |
| 111 class Store3RegisterOp : LoadStore3RegisterOp | 115 class Store3RegisterOp : LoadStore3RegisterOp |
| 112 | 116 |
| 113 ############################################################## | 117 ############################################################## |
| 114 # The following define decoder tables. | 118 # The following define decoder tables. |
| 115 ############################################################## | 119 ############################################################## |
| 116 | 120 |
| 117 +-- ARMv7 (See Section A5.1) | 121 +-- ARMv7 (See Section A5.1) |
| 118 | cond(31:28) op1(27:25) op(4) | 122 | cond(31:28) op1(27:25) op(4) |
| 119 | ~1111 00x - ->dp_misc | 123 | ~1111 00x - ->dp_misc |
| 120 | " 010 - ->load_store_word_byte | 124 | " 010 - ->load_store_word_byte |
| (...skipping 414 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 535 +-- | 539 +-- |
| 536 | 540 |
| 537 +-- extra_load_store (See Section A5.2.8) | 541 +-- extra_load_store (See Section A5.2.8) |
| 538 | op2(6:5) op1(24:20) Rn(19:16) | 542 | op2(6:5) op1(24:20) Rn(19:16) |
| 539 | 01 xx0x0 - = Store3RegisterOp => StrRegister | 543 | 01 xx0x0 - = Store3RegisterOp => StrRegister |
| 540 Strh_Rule_208_A1_P412 | 544 Strh_Rule_208_A1_P412 |
| 541 cccc000pd0w0nnnntttt00001011mmmm | 545 cccc000pd0w0nnnntttt00001011mmmm |
| 542 | " xx0x1 - = Load3RegisterOp => LdrRegister | 546 | " xx0x1 - = Load3RegisterOp => LdrRegister |
| 543 Ldrh_Rule_76_A1_P156 | 547 Ldrh_Rule_76_A1_P156 |
| 544 cccc000pd0w1nnnntttt00001011mmmm | 548 cccc000pd0w1nnnntttt00001011mmmm |
| 545 | " xx1x0 - = Store2RegisterImmediateOp => StrImmediate | 549 | " xx1x0 - = Store2RegisterImm8Op => StrImmediate |
| 546 Strh_Rule_207_A1_P410 | 550 Strh_Rule_207_A1_P410 |
| 547 cccc000pd1w0nnnnttttiiii1011iiii | 551 cccc000pd1w0nnnnttttiiii1011iiii |
| 548 | " xx1x1 ~1111 = Load2RegisterImmediateOp => LdrImmediate | 552 | " xx1x1 ~1111 = Load2RegisterImm8Op => LdrImmediate |
| 549 Ldrh_Rule_74_A1_P152 | 553 Ldrh_Rule_74_A1_P152 |
| 550 cccc000pd1w1nnnnttttiiii1011iiii NotRnIsPc | 554 cccc000pd1w1nnnnttttiiii1011iiii NotRnIsPc |
| 551 | " " 1111 = Load2RegisterImmediateOp => LdrImmediate | 555 | " " 1111 = Load2RegisterImm8Op => LdrImmediate |
| 552 Ldrh_Rule_75_A1_P154 | 556 Ldrh_Rule_75_A1_P154 |
| 553 cccc0001d1011111ttttiiii1011iiii | 557 cccc0001d1011111ttttiiii1011iiii |
| 554 | 10 xx0x0 - = Load3RegisterDoubleOp => LdrRegisterDouble | 558 | 10 xx0x0 - = Load3RegisterDoubleOp => LdrRegisterDouble |
| 555 Ldrd_Rule_68_A1_P140 | 559 Ldrd_Rule_68_A1_P140 |
| 556 cccc000pd0w0nnnntttt00001101mmmm (v5TE) | 560 cccc000pd0w0nnnntttt00001101mmmm (v5TE) |
| 557 | " xx0x1 - = Load3RegisterOp => LdrRegister | 561 | " xx0x1 - = Load3RegisterOp => LdrRegister |
| 558 Ldrsb_Rule_80_A1_P164 | 562 Ldrsb_Rule_80_A1_P164 |
| 559 cccc000pd0w1nnnntttt00001101mmmm | 563 cccc000pd0w1nnnntttt00001101mmmm |
| 560 | " xx1x0 ~1111 = Load2RegisterImmediateDoubleOp | 564 | " xx1x0 ~1111 = Load2RegisterImm8DoubleOp |
| 561 => LdrImmediateDouble | 565 => LdrImmediateDouble |
| 562 Ldrd_Rule_66_A1_P136 | 566 Ldrd_Rule_66_A1_P136 |
| 563 cccc000pd1w0nnnnttttiiii1101iiii NotRnIsPc (v5
TE) | 567 cccc000pd1w0nnnnttttiiii1101iiii NotRnIsPc (v5
TE) |
| 564 | " " 1111 = Load2RegisterImmediateDoubleOp | 568 | " " 1111 = Load2RegisterImm8DoubleOp |
| 565 => LdrImmediateDouble | 569 => LdrImmediateDouble |
| 566 Ldrd_Rule_67_A1_P138 | 570 Ldrd_Rule_67_A1_P138 |
| 567 cccc0001d1001111ttttiiii1101iiii (v5TE) | 571 cccc0001d1001111ttttiiii1101iiii (v5TE) |
| 568 | " xx1x1 ~1111 = Load2RegisterImmediateOp => LdrImmediate | 572 | " xx1x1 ~1111 = Load2RegisterImm8Op => LdrImmediate |
| 569 Ldrsb_Rule_78_A1_P160 | 573 Ldrsb_Rule_78_A1_P160 |
| 570 cccc000pd1w1nnnnttttiiii1101iiii NotRnIsPc | 574 cccc000pd1w1nnnnttttiiii1101iiii NotRnIsPc |
| 571 | " " 1111 = Load2RegisterImmediateOp => LdrImmediate | 575 | " " 1111 = Load2RegisterImm8Op => LdrImmediate |
| 572 ldrsb_Rule_79_A1_162 | 576 ldrsb_Rule_79_A1_162 |
| 573 cccc0001d1011111ttttiiii1101iiii | 577 cccc0001d1011111ttttiiii1101iiii |
| 574 | 11 xx0x0 - = Store3RegisterDoubleOp => StrRegisterDouble | 578 | 11 xx0x0 - = Store3RegisterDoubleOp => StrRegisterDouble |
| 575 Strd_Rule_201_A1_P398 | 579 Strd_Rule_201_A1_P398 |
| 576 cccc000pd0w0nnnntttt00001111mmmm | 580 cccc000pd0w0nnnntttt00001111mmmm |
| 577 | " xx0x1 - = Load3RegisterOp => LdrRegister | 581 | " xx0x1 - = Load3RegisterOp => LdrRegister |
| 578 Ldrsh_Rule_84_A1_P172 | 582 Ldrsh_Rule_84_A1_P172 |
| 579 cccc000pd0w1nnnntttt00001111mmmm | 583 cccc000pd0w1nnnntttt00001111mmmm |
| 580 | " xx1x0 - = Store2RegisterImmediateDoubleOp | 584 | " xx1x0 - = Store2RegisterImm8DoubleOp |
| 581 => StrImmediateDouble | 585 => StrImmediateDouble |
| 582 Strd_Rule_200_A1_P396 | 586 Strd_Rule_200_A1_P396 |
| 583 cccc000pd1w0nnnnttttiiii1111iiii | 587 cccc000pd1w0nnnnttttiiii1111iiii |
| 584 | " xx1x1 ~1111 = Load2RegisterImmediateOp => LdrImmediate | 588 | " xx1x1 ~1111 = Load2RegisterImm8Op => LdrImmediate |
| 585 Ldrsh_Rule_82_A1_P168 | 589 Ldrsh_Rule_82_A1_P168 |
| 586 cccc000pd1w1nnnnttttiiii1111iiii NotRnIsPc | 590 cccc000pd1w1nnnnttttiiii1111iiii NotRnIsPc |
| 587 | " " 1111 = Load2RegisterImmediateOp => LdrImmediate | 591 | " " 1111 = Load2RegisterImm8Op => LdrImmediate |
| 588 Ldrsh_Rule_83_A1_P170 | 592 Ldrsh_Rule_83_A1_P170 |
| 589 cccc0001d1011111ttttiiii1111iiii | 593 cccc0001d1011111ttttiiii1111iiii |
| 590 +-- | 594 +-- |
| 591 | 595 |
| 592 # Unprivileged load-store table omitted: modeled as Forbidden. | 596 # Unprivileged load-store table omitted: modeled as Forbidden. |
| 593 # They are not expected in user code. | 597 # They are not expected in user code. |
| 594 | 598 |
| 595 +-- sync (See Section A5.2.10) | 599 +-- sync (See Section A5.2.10) |
| 596 | op(23:20) | 600 | op(23:20) |
| 597 | 0x00 =Deprecated # SWP, SWPB TODO(cbiffle): model these? | 601 | 0x00 =Deprecated # SWP, SWPB TODO(cbiffle): model these? |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 667 | 011 01 - =BxBlx(v5T) # BLX(register) | 671 | 011 01 - =BxBlx(v5T) # BLX(register) |
| 668 | 101 - - ->sat_add_sub | 672 | 101 - - ->sat_add_sub |
| 669 | 111 01 - =Breakpoint(v5T) # BKPT | 673 | 111 01 - =Breakpoint(v5T) # BKPT |
| 670 | 111 11 - =Forbidden # SMC | 674 | 111 11 - =Forbidden # SMC |
| 671 | else: =Undefined # Note on page A5-18 | 675 | else: =Undefined # Note on page A5-18 |
| 672 +-- | 676 +-- |
| 673 | 677 |
| 674 +-- load_store_word_byte (See Section A5.3) | 678 +-- load_store_word_byte (See Section A5.3) |
| 675 | A(25) op1(24:20) B(4) Rn(19:16) | 679 | A(25) op1(24:20) B(4) Rn(19:16) |
| 676 # Following 2 rows implement op1 = xx0x0 & ~0x010 | 680 # Following 2 rows implement op1 = xx0x0 & ~0x010 |
| 677 | 0 1x0x0 - - =StoreImmediate # STR(immediate) A8-384 | 681 | 0 1x0x0 - - = Store2RegisterImm12Op => StrImmediate |
| 682 Str_Rule_194_A1_P384 |
| 683 cccc010pd0w0nnnnttttiiiiiiiiiiii |
| 678 | " 0x000 " " " | 684 | " 0x000 " " " |
| 679 # Following 2 rows implement op1 = xx0x0 & ~0x010 | 685 # Following 2 rows implement op1 = xx0x0 & ~0x010 |
| 680 | 1 1x0x0 0 - =StoreRegister # STR(register) A8-386 | 686 | 1 1x0x0 0 - = Store3RegisterImm5Op => StrRegister |
| 687 Str_Rule_195_A1_P386 |
| 688 cccc011pd0w0nnnnttttiiiiitt0mmmm |
| 681 | " 0x000 " " " | 689 | " 0x000 " " " |
| 682 | 0 0x010 - - =Forbidden # STRT A8-416 | 690 # STRT (rule 210, A1 and A2, page 416) define unprivledge stores, which |
| 691 # NaCl doesn't allow. |
| 692 | 0 0x010 - - = Forbidden |
| 683 | 1 0x010 0 - " | 693 | 1 0x010 0 - " |
| 684 # Following 2 rows implement op1 = xx0x1 & ~0x011 | 694 # Following 2 rows implement op1 = xx0x1 & ~0x011 |
| 685 | 0 1x0x1 - ~1111 =LoadImmediate # LDR(immediate) A8-120 | 695 | 0 1x0x1 - ~1111 = Load2RegisterImm12Op => LdrImmediate |
| 696 Ldr_Rule_58_A1_P120 |
| 697 cccc010pd0w1nnnnttttiiiiiiiiiiii NotRnIsPc |
| 686 | " 0x001 " " " | 698 | " 0x001 " " " |
| 687 # Following 2 rows implement op1 = xx0x1 & ~0x011 | 699 # Following 2 rows implement op1 = xx0x1 & ~0x011 |
| 688 | " 1x0x1 " 1111 =LoadImmediate # LDR(literal) A8-122 | 700 | " 1x0x1 " 1111 = Load2RegisterImm12Op => LdrImmediate |
| 701 Ldr_Rule_59_A1_P122 |
| 702 cccc0101d0011111ttttiiiiiiiiiiii |
| 689 | " 0x001 " " " | 703 | " 0x001 " " " |
| 690 # Following 2 rows implement op1 = xx0x1 & ~0x011 | 704 # Following 2 rows implement op1 = xx0x1 & ~0x011 |
| 691 | 1 1x0x1 0 - =LoadRegister # LDR(register) A8-124 | 705 | 1 1x0x1 0 - = Load3RegisterImm5Op => LdrRegister |
| 706 Ldr_Rule_60_A1_P124 |
| 707 cccc011pd0w1nnnnttttiiiiitt0mmmm |
| 692 | " xx001 " " " | 708 | " xx001 " " " |
| 693 | 0 0x011 - - =Forbidden # LDRT A8-176 | 709 # LDRT (rule 86, A1 and A2, page 176) define unprivledge loads, which |
| 710 # NaCl doesn't allow. |
| 711 | 0 0x011 - - = Forbidden |
| 694 | 1 0x011 0 - " | 712 | 1 0x011 0 - " |
| 695 # Following 2 rows implement op1 = xx1x0 & ~0x110 | 713 # Following 2 rows implement op1 = xx1x0 & ~0x110 |
| 696 | 0 1x1x0 - - =StoreImmediate # STRB(immediate) A8-390 | 714 | 0 1x1x0 - - = Store2RegisterImm12Op => StrImmediate |
| 715 Strb_Rule_197_A1_P390 |
| 716 cccc010pd1w0nnnnttttiiiiiiiiiiii |
| 697 | " 0x100 " " " | 717 | " 0x100 " " " |
| 698 # Following 2 rows implement op1 = xx1x0 & ~0x110 | 718 # Following 2 rows implement op1 = xx1x0 & ~0x110 |
| 699 | 1 1x1x0 0 - =StoreRegister # STRB(register) A8-392 | 719 | 1 1x1x0 0 - = Store3RegisterImm5Op => StrRegister |
| 720 Strb_Rule_198_A1_P392 |
| 721 cccc011pd1w0nnnnttttiiiiitt0mmmm |
| 700 | " 0x100 " " " | 722 | " 0x100 " " " |
| 701 | 0 0x110 - - =Forbidden # STRBT A8-394 | 723 # Strbt (rule 199, A1 and A2, page 394) define unprivledged stores, which |
| 724 # NaCl doesn't allow. |
| 725 | 0 0x110 - - = Forbidden # STRBT A8-394 |
| 702 | 1 0x110 0 - " | 726 | 1 0x110 0 - " |
| 703 # Following 2 rows implement op1 = xx1x1 & ~0x111 | 727 # Following 2 rows implement op1 = xx1x1 & ~0x111 |
| 704 | 0 1x1x1 - ~1111 =LoadImmediate # LDRB(immediate) A8-128 | 728 | 0 1x1x1 - ~1111 = Load2RegisterImm12Op => LdrImmediate |
| 729 Ldrb_Rule_62_A1_P128 |
| 730 cccc010pd1w1nnnnttttiiiiiiiiiiii NotRnIsPc |
| 705 | " 0x101 " " " | 731 | " 0x101 " " " |
| 706 # Following 2 rows implement op1 = xx1x1 & ~0x111 | 732 # Following 2 rows implement op1 = xx1x1 & ~0x111 |
| 707 | " 1x1x1 " 1111 =LoadImmediate # LDRB(literal) A8-130 | 733 | " 1x1x1 " 1111 = Load2RegisterImm12Op => LdrImmediate |
| 734 Ldrb_Rule_63_A1_P130 |
| 735 cccc0101d1011111ttttiiiiiiiiiiii |
| 708 | " 0x101 " " " | 736 | " 0x101 " " " |
| 709 # Following 2 rows implement op1 = xx1x1 & ~0x111 | 737 # Following 2 rows implement op1 = xx1x1 & ~0x111 |
| 710 | 1 1x1x1 0 - =LoadRegister # LDRB(register) A8-132 | 738 | 1 1x1x1 0 - = Load3RegisterImm5Op => LdrRegister |
| 739 Ldrb_Rule_64_A1_P132 |
| 740 cccc011pd1w1nnnnttttiiiiitt0mmmm |
| 711 | " 0x101 " " " | 741 | " 0x101 " " " |
| 712 | 0 0x111 - - =Forbidden # LDRBT A8-132 | 742 # Ldrbt (rule 65, A1 and A2, page 134) define unprivledged loads, which |
| 743 # NaCl doesn't allow. |
| 744 | 0 0x111 - - = Forbidden |
| 713 | 1 0x111 0 - " | 745 | 1 0x111 0 - " |
| 714 +-- | 746 +-- |
| 715 | 747 |
| 716 +-- media (See Section A5.4) | 748 +-- media (See Section A5.4) |
| 717 | op1(24:20) op2(7:5) Rd(15:12) Rn(3:0) | 749 | op1(24:20) op2(7:5) Rd(15:12) Rn(3:0) |
| 718 | 000xx - - - ->parallel_add_sub_signed | 750 | 000xx - - - ->parallel_add_sub_signed |
| 719 | 001xx - - - ->parallel_add_sub_unsigned | 751 | 001xx - - - ->parallel_add_sub_unsigned |
| 720 | 01xxx - - - ->pack_sat_rev | 752 | 01xxx - - - ->pack_sat_rev |
| 721 | 10xxx - - - ->signed_mult | 753 | 10xxx - - - ->signed_mult |
| 722 | 11000 000 1111 - =Multiply(v6) # USAD8 | 754 | 11000 000 1111 - =Multiply(v6) # USAD8 |
| (...skipping 433 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1156 | " 1001 " | 1188 | " 1001 " |
| 1157 | " 1101 =VectorLoad # VLD2(single, all lanes) | 1189 | " 1101 =VectorLoad # VLD2(single, all lanes) |
| 1158 | " 0x10 =VectorLoad # VLD3(single) | 1190 | " 0x10 =VectorLoad # VLD3(single) |
| 1159 | " 1010 " | 1191 | " 1010 " |
| 1160 | " 1110 =VectorLoad # VLD3(single, all lanes) | 1192 | " 1110 =VectorLoad # VLD3(single, all lanes) |
| 1161 | " 0x11 =VectorLoad # VLD4(single) | 1193 | " 0x11 =VectorLoad # VLD4(single) |
| 1162 | " 1011 " | 1194 | " 1011 " |
| 1163 | " 1111 =VectorLoad # VLD4(single, all lanes) | 1195 | " 1111 =VectorLoad # VLD4(single, all lanes) |
| 1164 | else: =Undefined # Note on page A7-27 | 1196 | else: =Undefined # Note on page A7-27 |
| 1165 +-- | 1197 +-- |
| OLD | NEW |