Chromium Code Reviews| 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. |
| 11 # | 11 # |
| 12 # Each table consists of | 12 # Each table consists of |
| 13 # - A name, | 13 # - A name, |
| 14 # - A citation in the Architecture Reference Manual, | 14 # - A citation in the Architecture Reference Manual, |
| 15 # - One or more columns defining bitfields to match, and | 15 # - One or more columns defining bitfields to match, and |
| 16 # - One or more rows describing patterns in those bitfields. | 16 # - One or more rows describing patterns in those bitfields. |
| 17 # | 17 # |
| 18 # A leading tilde (~) negates a pattern. A hyphen (-) is short for a string of | 18 # A leading tilde (~) negates a pattern. A hyphen (-) is short for a string of |
| 19 # don't-care bits (x). A double-quote (") indicates that a pattern is the same | 19 # don't-care bits (x). A double-quote (") indicates that a pattern is the same |
| 20 # as the row above it. | 20 # as the row above it. |
| 21 # | 21 # |
| 22 # Each row may specify a terminal instruction class ("=InstClass"), or forward | 22 # Each row may specify a terminal instruction class ("=InstClass"), or forward |
| 23 # the reader to a different table ("->table_name"). | 23 # the reader to a different table ("->table_name"). |
| 24 # | 24 # |
| 25 # If an encoding is not valid in every ARM architecture rev, the instruction | 25 # If an encoding is not valid in every ARM architecture rev, the instruction |
| 26 # class may indicate the rev or feature that makes the encoding valid in | 26 # class may indicate the rev or feature that makes the encoding valid in |
| 27 # parentheses. | 27 # parentheses. |
| 28 # | |
| 29 # For documentation and testing, an "=InstClass" can be followed by up to 3 | |
|
robertm
2012/04/11 01:28:43
thanks for reverse engineering and documenting it
Karl
2012/04/16 23:18:10
Done.
| |
| 30 # additional identifiers, and has the form: | |
| 31 # =InstClass Rule Pattern Constraints | |
| 32 # where | |
| 33 # InstClass - is the class decoder to return when matched. | |
| 34 # Rule - is the Arm rule that applies to the match (see below). | |
| 35 # Pattern - is a bitpattern for testing instances of the rule. | |
| 36 # Constraints - identifies what additional constraints are assumed | |
| 37 # by the corresponding rule. | |
| 38 # | |
| 39 # The Rules are identified with an identifier of the form: | |
| 40 # NNN_Rule_SS_AA_Pppp | |
| 41 # where | |
| 42 # NNN is the nmenonic of the instruction. | |
| 43 # SS is the section number in A8.6.SS that define the instruction. | |
| 44 # AA is the instruction form on that page, | |
| 45 # pp is the page number in A8-pp that the instruction is on. | |
| 46 # | |
| 47 # Patterns are sequences of 32 characters as follows: | |
| 48 # '1' - Bit must be value 1. | |
| 49 # '0' - Bit must be value 0. | |
| 50 # 'aaa...aa' (for some sequence of m lower case letters) - | |
| 51 # Try all possible combinations of bits for the m bytes. | |
| 52 # 'AAA...A' (for some sequence of m upper case letters) - | |
| 53 # Try the following combinations: | |
| 54 # (1) All m bits set to 1. | |
| 55 # (2) All m bits set to 0. | |
| 56 # (3) For each 4-bit subsequence, try all combinations, | |
| 57 # setting remaining bits to 1. | |
| 58 # (4) For each 4-bit subsequence, try all combinations, | |
| 59 # setting remaining bits to 0. | |
| 60 # | |
| 61 # Constraints identifiers used are: | |
| 62 # RegsNotPc - All register defined by instruction are not Pc (R15). | |
| 28 | 63 |
| 29 -- ARMv7 (See Section A5.1) | 64 -- ARMv7 (See Section A5.1) |
| 30 cond(31:28) op1(27:25) op(4) | 65 cond(31:28) op1(27:25) op(4) |
| 31 ~1111 00x - ->dp_misc | 66 ~1111 00x - ->dp_misc |
| 32 " 010 - ->load_store_word_byte | 67 " 010 - ->load_store_word_byte |
| 33 " 011 0 ->load_store_word_byte | 68 " 011 0 ->load_store_word_byte |
| 34 " " 1 ->media | 69 " " 1 ->media |
| 35 " 10x - ->branch_block_xfer | 70 " 10x - ->branch_block_xfer |
| 36 " 11x - ->super_cop | 71 " 11x - ->super_cop |
| 37 1111 - - ->unconditional | 72 1111 - - ->unconditional |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 76 " ~00000 11 =DataProc # ROR(immediate) A8-278 | 111 " ~00000 11 =DataProc # ROR(immediate) A8-278 |
| 77 1110x - - =DataProc # BIC(register) A8-52 | 112 1110x - - =DataProc # BIC(register) A8-52 |
| 78 1111x - - =DataProc # MVN(register) A8-216 | 113 1111x - - =DataProc # MVN(register) A8-216 |
| 79 | 114 |
| 80 -- dp_reg_shifted (See Section A5.2.2) | 115 -- dp_reg_shifted (See Section A5.2.2) |
| 81 op1(24:20) op2(6:5) | 116 op1(24:20) op2(6:5) |
| 82 0000x - =Binary4RegisterShiftedOp # AND(register-shifted) A1 A8-3 8 | 117 0000x - =Binary4RegisterShiftedOp # AND(register-shifted) A1 A8-3 8 |
| 83 0001x - =Binary4RegisterShiftedOp # EOR(register-shifted) A1 A8-9 8 | 118 0001x - =Binary4RegisterShiftedOp # EOR(register-shifted) A1 A8-9 8 |
| 84 0010x - =Binary4RegisterShiftedOp # SUB(register-shifted) A1 A8-4 24 | 119 0010x - =Binary4RegisterShiftedOp # SUB(register-shifted) A1 A8-4 24 |
| 85 0011x - =Binary4RegisterShiftedOp # RSB(register-shifted) A1 A8-2 88 | 120 0011x - =Binary4RegisterShiftedOp # RSB(register-shifted) A1 A8-2 88 |
| 86 0100x - =Binary4RegisterShiftedOp # ADD(register-shifted) A1 A8-2 6 | 121 0100x - =Binary4RegisterShiftedOp Add_Rule_7_A1_P26 \ |
| 122 cccc0000100snnnnddddssss0tt1m mmm \ | |
| 123 RegsNotPc | |
| 87 0101x - =Binary4RegisterShiftedOp # ADC(register-shifted) A1 A8-1 8 | 124 0101x - =Binary4RegisterShiftedOp # ADC(register-shifted) A1 A8-1 8 |
| 88 0110x - =Binary4RegisterShiftedOp # SBC(register-shifted) A1 A8-3 06 | 125 0110x - =Binary4RegisterShiftedOp # SBC(register-shifted) A1 A8-3 06 |
| 89 0111x - =Binary4RegisterShiftedOp # RSC(register-shifted) A1 A8-2 94 | 126 0111x - =Binary4RegisterShiftedOp # RSC(register-shifted) A1 A8-2 94 |
| 90 10001 - =Binary3RegisterShiftedTest # TST(register-shifted) A1 A8-4 58 | 127 10001 - =Binary3RegisterShiftedTest # TST(register-shifted) A1 A8-4 58 |
| 91 10011 - =Binary3RegisterShiftedTest # TEQ(register-shifted) A1 A8-4 52 | 128 10011 - =Binary3RegisterShiftedTest # TEQ(register-shifted) A1 A8-4 52 |
| 92 10101 - =Binary3RegisterShiftedTest # CMP(register-shifted) A1 A8-8 4 | 129 10101 - =Binary3RegisterShiftedTest # CMP(register-shifted) A1 A8-8 4 |
| 93 10111 - =Binary3RegisterShiftedTest # CMN(register-shifted) A1 A8-7 8 | 130 10111 - =Binary3RegisterShiftedTest # CMN(register-shifted) A1 A8-7 8 |
| 94 1100x - =Binary4RegisterShiftedOp # ORR(register-shifted) A1 A8-2 32 | 131 1100x - =Binary4RegisterShiftedOp # ORR(register-shifted) A1 A8-2 32 |
| 95 1101x 00 =DataProc # LSL(register) A8-180 | 132 1101x 00 =DataProc # LSL(register) A8-180 |
| 96 " 01 =DataProc # LSR(register) A8-184 | 133 " 01 =DataProc # LSR(register) A8-184 |
| (...skipping 506 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 603 " 0x01 =VectorLoad # VLD2(single) | 640 " 0x01 =VectorLoad # VLD2(single) |
| 604 " 1001 " | 641 " 1001 " |
| 605 " 1101 =VectorLoad # VLD2(single, all lanes) | 642 " 1101 =VectorLoad # VLD2(single, all lanes) |
| 606 " 0x10 =VectorLoad # VLD3(single) | 643 " 0x10 =VectorLoad # VLD3(single) |
| 607 " 1010 " | 644 " 1010 " |
| 608 " 1110 =VectorLoad # VLD3(single, all lanes) | 645 " 1110 =VectorLoad # VLD3(single, all lanes) |
| 609 " 0x11 =VectorLoad # VLD4(single) | 646 " 0x11 =VectorLoad # VLD4(single) |
| 610 " 1011 " | 647 " 1011 " |
| 611 " 1111 =VectorLoad # VLD4(single, all lanes) | 648 " 1111 =VectorLoad # VLD4(single, all lanes) |
| 612 - - =Undefined # Note on page A7-27 | 649 - - =Undefined # Note on page A7-27 |
| OLD | NEW |