Rev 5191 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 5191 | Rev 6324 | ||
---|---|---|---|
Line 1... | Line 1... | ||
1 | /* mips.h. Mips opcode list for GDB, the GNU debugger. |
1 | /* mips.h. Mips opcode list for GDB, the GNU debugger. |
2 | Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, |
- | |
3 | 2003, 2004, 2005, 2008, 2009, 2010, 2013 |
- | |
4 | Free Software Foundation, Inc. |
2 | Copyright (C) 1993-2015 Free Software Foundation, Inc. |
5 | Contributed by Ralph Campbell and OSF |
3 | Contributed by Ralph Campbell and OSF |
6 | Commented and modified by Ian Lance Taylor, Cygnus Support |
4 | Commented and modified by Ian Lance Taylor, Cygnus Support |
Line 7... | Line 5... | ||
7 | 5 | ||
Line 411... | Line 409... | ||
411 | which. */ |
409 | which. */ |
412 | OP_VU0_SUFFIX, |
410 | OP_VU0_SUFFIX, |
Line 413... | Line 411... | ||
413 | 411 | ||
414 | /* Like OP_VU0_SUFFIX, but used when the operand's value has already |
412 | /* Like OP_VU0_SUFFIX, but used when the operand's value has already |
415 | been set. Any suffix used here must match the previous value. */ |
413 | been set. Any suffix used here must match the previous value. */ |
- | 414 | OP_VU0_MATCH_SUFFIX, |
|
- | 415 | ||
- | 416 | /* An index selected by an integer, e.g. [1]. */ |
|
- | 417 | OP_IMM_INDEX, |
|
- | 418 | ||
- | 419 | /* An index selected by a register, e.g. [$2]. */ |
|
- | 420 | OP_REG_INDEX, |
|
- | 421 | ||
- | 422 | /* The operand spans two 5-bit register fields, both of which must be set to |
|
- | 423 | the source register. */ |
|
- | 424 | OP_SAME_RS_RT, |
|
- | 425 | ||
- | 426 | /* Described by mips_prev_operand. */ |
|
- | 427 | OP_CHECK_PREV, |
|
- | 428 | ||
- | 429 | /* A register operand that must not be zero. */ |
|
416 | OP_VU0_MATCH_SUFFIX |
430 | OP_NON_ZERO_REG |
Line 417... | Line 431... | ||
417 | }; |
431 | }; |
418 | 432 | ||
419 | /* Enumerates the types of MIPS register. */ |
433 | /* Enumerates the types of MIPS register. */ |
Line 452... | Line 466... | ||
452 | 466 | ||
453 | /* R5900 VU0 registers $I, $Q, $R and $ACC. */ |
467 | /* R5900 VU0 registers $I, $Q, $R and $ACC. */ |
454 | OP_REG_R5900_I, |
468 | OP_REG_R5900_I, |
455 | OP_REG_R5900_Q, |
469 | OP_REG_R5900_Q, |
456 | OP_REG_R5900_R, |
470 | OP_REG_R5900_R, |
- | 471 | OP_REG_R5900_ACC, |
|
- | 472 | ||
- | 473 | /* MSA registers $w0-$w31. */ |
|
- | 474 | OP_REG_MSA, |
|
- | 475 | ||
- | 476 | /* MSA control registers $0-$31. */ |
|
457 | OP_REG_R5900_ACC |
477 | OP_REG_MSA_CTRL |
Line 458... | Line 478... | ||
458 | }; |
478 | }; |
459 | 479 | ||
460 | /* Base class for all operands. */ |
480 | /* Base class for all operands. */ |
Line 541... | Line 561... | ||
541 | /* If nonnull, REG_MAP[N] gives the register associated with encoding N, |
561 | /* If nonnull, REG_MAP[N] gives the register associated with encoding N, |
542 | otherwise the encoding is the same as the register number. */ |
562 | otherwise the encoding is the same as the register number. */ |
543 | const unsigned char *reg_map; |
563 | const unsigned char *reg_map; |
544 | }; |
564 | }; |
Line -... | Line 565... | ||
- | 565 | ||
- | 566 | /* Describes an operand that which must match a condition based on the |
|
- | 567 | previous operand. */ |
|
- | 568 | struct mips_check_prev_operand |
|
- | 569 | { |
|
- | 570 | struct mips_operand root; |
|
- | 571 | ||
- | 572 | bfd_boolean greater_than_ok; |
|
- | 573 | bfd_boolean less_than_ok; |
|
- | 574 | bfd_boolean equal_ok; |
|
- | 575 | bfd_boolean zero_ok; |
|
- | 576 | }; |
|
545 | 577 | ||
546 | /* Describes an operand that encodes a pair of registers. */ |
578 | /* Describes an operand that encodes a pair of registers. */ |
547 | struct mips_reg_pair_operand |
579 | struct mips_reg_pair_operand |
548 | { |
580 | { |
Line 889... | Line 921... | ||
889 | "+Z" 5-bit fz register (OP_*_FZ) |
921 | "+Z" 5-bit fz register (OP_*_FZ) |
Line 890... | Line 922... | ||
890 | 922 | ||
891 | Enhanced VA Scheme: |
923 | Enhanced VA Scheme: |
Line -... | Line 924... | ||
- | 924 | "+j" 9-bit signed offset in bit 7 (OP_*_EVAOFFSET) |
|
- | 925 | ||
- | 926 | MSA Extension: |
|
- | 927 | "+d" 5-bit MSA register (FD) |
|
- | 928 | "+e" 5-bit MSA register (FS) |
|
- | 929 | "+h" 5-bit MSA register (FT) |
|
- | 930 | "+k" 5-bit GPR at bit 6 |
|
- | 931 | "+l" 5-bit MSA control register at bit 6 |
|
- | 932 | "+n" 5-bit MSA control register at bit 11 |
|
- | 933 | "+o" 4-bit vector element index at bit 16 |
|
- | 934 | "+u" 3-bit vector element index at bit 16 |
|
- | 935 | "+v" 2-bit vector element index at bit 16 |
|
- | 936 | "+w" 1-bit vector element index at bit 16 |
|
- | 937 | "+T" (-512 .. 511) << 0 at bit 16 |
|
- | 938 | "+U" (-512 .. 511) << 1 at bit 16 |
|
- | 939 | "+V" (-512 .. 511) << 2 at bit 16 |
|
- | 940 | "+W" (-512 .. 511) << 3 at bit 16 |
|
- | 941 | "+~" 2 bit LSA/DLSA shift amount from 1 to 4 at bit 6 |
|
- | 942 | "+!" 3 bit unsigned bit position at bit 16 |
|
- | 943 | "+@" 4 bit unsigned bit position at bit 16 |
|
- | 944 | "+#" 6 bit unsigned bit position at bit 16 |
|
- | 945 | "+$" 5 bit unsigned immediate at bit 16 |
|
- | 946 | "+%" 5 bit signed immediate at bit 16 |
|
- | 947 | "+^" 10 bit signed immediate at bit 11 |
|
- | 948 | "+&" 0 vector element index |
|
- | 949 | "+*" 5-bit register vector element index at bit 16 |
|
- | 950 | "+|" 8-bit mask at bit 16 |
|
- | 951 | ||
- | 952 | MIPS R6: |
|
- | 953 | "+:" 11-bit mask at bit 0 |
|
- | 954 | "+'" 26 bit PC relative branch target address |
|
- | 955 | "+"" 21 bit PC relative branch target address |
|
- | 956 | "+;" 5 bit same register in both OP_*_RS and OP_*_RT |
|
- | 957 | "+I" 2bit unsigned bit position at bit 6 |
|
- | 958 | "+O" 3bit unsigned bit position at bit 6 |
|
- | 959 | "+R" must be program counter |
|
- | 960 | "-a" (-262144 .. 262143) << 2 at bit 0 |
|
- | 961 | "-b" (-131072 .. 131071) << 3 at bit 0 |
|
- | 962 | "-d" Same as destination register GP |
|
- | 963 | "-s" 5 bit source register specifier (OP_*_RS) not $0 |
|
- | 964 | "-t" 5 bit source register specifier (OP_*_RT) not $0 |
|
- | 965 | "-u" 5 bit source register specifier (OP_*_RT) greater than OP_*_RS |
|
- | 966 | "-v" 5 bit source register specifier (OP_*_RT) not $0 not OP_*_RS |
|
- | 967 | "-w" 5 bit source register specifier (OP_*_RT) less than or equal to OP_*_RS |
|
- | 968 | "-x" 5 bit source register specifier (OP_*_RT) greater than or |
|
- | 969 | equal to OP_*_RS |
|
- | 970 | "-y" 5 bit source register specifier (OP_*_RT) not $0 less than OP_*_RS |
|
- | 971 | "-A" symbolic offset (-262144 .. 262143) << 2 at bit 0 |
|
892 | "+j" 9-bit signed offset in bit 7 (OP_*_EVAOFFSET) |
972 | "-B" symbolic offset (-131072 .. 131071) << 3 at bit 0 |
893 | 973 | ||
894 | Other: |
974 | Other: |
895 | "()" parens surrounding optional value |
975 | "()" parens surrounding optional value |
Line 896... | Line 976... | ||
896 | "," separates operands |
976 | "," separates operands |
897 | "+" Start of extension sequence. |
977 | "+" Start of extension sequence. |
898 | 978 | ||
899 | Characters used so far, for quick reference when adding more: |
979 | Characters used so far, for quick reference when adding more: |
900 | "1234567890" |
980 | "1234567890" |
Line 901... | Line 981... | ||
901 | "%[]<>(),+:'@!#$*&\~" |
981 | "%[]<>(),+-:'@!#$*&\~" |
902 | "ABCDEFGHIJKLMNOPQRSTUVWXYZ" |
982 | "ABCDEFGHIJKLMNOPQRSTUVWXYZ" |
903 | "abcdefghijklopqrstuvwxz" |
983 | "abcdefghijklopqrstuvwxz" |
- | 984 | ||
904 | 985 | Extension character sequences used so far ("+" followed by the |
|
905 | Extension character sequences used so far ("+" followed by the |
986 | following), for quick reference when adding more: |
- | 987 | "1234567890" |
|
- | 988 | "~!@#$%^&*|:'";" |
|
- | 989 | "ABCEFGHIJKLMNOPQRSTUVWXZ" |
|
- | 990 | "abcdefghijklmnopqrstuvwxyz" |
|
- | 991 | ||
906 | following), for quick reference when adding more: |
992 | Extension character sequences used so far ("-" followed by the |
Line 907... | Line 993... | ||
907 | "1234567890" |
993 | following), for quick reference when adding more: |
908 | "ABCEFGHJKLMNPQSXZ" |
994 | "AB" |
Line 932... | Line 1018... | ||
932 | #define INSN_READ_COND_CODE 0x00000100 |
1018 | #define INSN_READ_COND_CODE 0x00000100 |
933 | /* TLB operation. */ |
1019 | /* TLB operation. */ |
934 | #define INSN_TLB 0x00000200 |
1020 | #define INSN_TLB 0x00000200 |
935 | /* Reads coprocessor register other than floating point register. */ |
1021 | /* Reads coprocessor register other than floating point register. */ |
936 | #define INSN_COP 0x00000400 |
1022 | #define INSN_COP 0x00000400 |
937 | /* Instruction loads value from memory, requiring delay. */ |
1023 | /* Instruction loads value from memory. */ |
938 | #define INSN_LOAD_MEMORY_DELAY 0x00000800 |
1024 | #define INSN_LOAD_MEMORY 0x00000800 |
939 | /* Instruction loads value from coprocessor, requiring delay. */ |
1025 | /* Instruction loads value from coprocessor, (may require delay). */ |
940 | #define INSN_LOAD_COPROC_DELAY 0x00001000 |
1026 | #define INSN_LOAD_COPROC 0x00001000 |
941 | /* Instruction has unconditional branch delay slot. */ |
1027 | /* Instruction has unconditional branch delay slot. */ |
942 | #define INSN_UNCOND_BRANCH_DELAY 0x00002000 |
1028 | #define INSN_UNCOND_BRANCH_DELAY 0x00002000 |
943 | /* Instruction has conditional branch delay slot. */ |
1029 | /* Instruction has conditional branch delay slot. */ |
944 | #define INSN_COND_BRANCH_DELAY 0x00004000 |
1030 | #define INSN_COND_BRANCH_DELAY 0x00004000 |
945 | /* Conditional branch likely: if branch not taken, insn nullified. */ |
1031 | /* Conditional branch likely: if branch not taken, insn nullified. */ |
946 | #define INSN_COND_BRANCH_LIKELY 0x00008000 |
1032 | #define INSN_COND_BRANCH_LIKELY 0x00008000 |
947 | /* Moves to coprocessor register, requiring delay. */ |
1033 | /* Moves to coprocessor register, (may require delay). */ |
948 | #define INSN_COPROC_MOVE_DELAY 0x00010000 |
1034 | #define INSN_COPROC_MOVE 0x00010000 |
949 | /* Loads coprocessor register from memory, requiring delay. */ |
1035 | /* Loads coprocessor register from memory, requiring delay. */ |
950 | #define INSN_COPROC_MEMORY_DELAY 0x00020000 |
1036 | #define INSN_COPROC_MEMORY_DELAY 0x00020000 |
951 | /* Reads the HI register. */ |
1037 | /* Reads the HI register. */ |
952 | #define INSN_READ_HI 0x00040000 |
1038 | #define INSN_READ_HI 0x00040000 |
953 | /* Reads the LO register. */ |
1039 | /* Reads the LO register. */ |
Line 1012... | Line 1098... | ||
1012 | #define INSN2_COND_BRANCH 0x00001000 |
1098 | #define INSN2_COND_BRANCH 0x00001000 |
1013 | /* Reads from $16. This is true of the MIPS16 0x6500 nop. */ |
1099 | /* Reads from $16. This is true of the MIPS16 0x6500 nop. */ |
1014 | #define INSN2_READ_GPR_16 0x00002000 |
1100 | #define INSN2_READ_GPR_16 0x00002000 |
1015 | /* Has an "\.x?y?z?w?" suffix based on mips_vu0_channel_mask. */ |
1101 | /* Has an "\.x?y?z?w?" suffix based on mips_vu0_channel_mask. */ |
1016 | #define INSN2_VU0_CHANNEL_SUFFIX 0x00004000 |
1102 | #define INSN2_VU0_CHANNEL_SUFFIX 0x00004000 |
- | 1103 | /* Instruction has a forbidden slot. */ |
|
- | 1104 | #define INSN2_FORBIDDEN_SLOT 0x00008000 |
|
Line 1017... | Line 1105... | ||
1017 | 1105 | ||
1018 | /* Masks used to mark instructions to indicate which MIPS ISA level |
1106 | /* Masks used to mark instructions to indicate which MIPS ISA level |
1019 | they were introduced in. INSN_ISA_MASK masks an enumeration that |
1107 | they were introduced in. INSN_ISA_MASK masks an enumeration that |
1020 | specifies the base ISA level(s). The remainder of a 32-bit |
1108 | specifies the base ISA level(s). The remainder of a 32-bit |
1021 | word constructed using these macros is a bitmask of the remaining |
1109 | word constructed using these macros is a bitmask of the remaining |
Line 1022... | Line 1110... | ||
1022 | INSN_* values below. */ |
1110 | INSN_* values below. */ |
Line 1023... | Line 1111... | ||
1023 | 1111 | ||
1024 | #define INSN_ISA_MASK 0x0000000ful |
1112 | #define INSN_ISA_MASK 0x0000001ful |
1025 | 1113 | ||
1026 | /* We cannot start at zero due to ISA_UNKNOWN below. */ |
1114 | /* We cannot start at zero due to ISA_UNKNOWN below. */ |
1027 | #define INSN_ISA1 1 |
1115 | #define INSN_ISA1 1 |
1028 | #define INSN_ISA2 2 |
1116 | #define INSN_ISA2 2 |
1029 | #define INSN_ISA3 3 |
1117 | #define INSN_ISA3 3 |
1030 | #define INSN_ISA4 4 |
1118 | #define INSN_ISA4 4 |
- | 1119 | #define INSN_ISA5 5 |
|
- | 1120 | #define INSN_ISA32 6 |
|
- | 1121 | #define INSN_ISA32R2 7 |
|
1031 | #define INSN_ISA5 5 |
1122 | #define INSN_ISA32R3 8 |
1032 | #define INSN_ISA32 6 |
1123 | #define INSN_ISA32R5 9 |
- | 1124 | #define INSN_ISA32R6 10 |
|
- | 1125 | #define INSN_ISA64 11 |
|
- | 1126 | #define INSN_ISA64R2 12 |
|
1033 | #define INSN_ISA32R2 7 |
1127 | #define INSN_ISA64R3 13 |
1034 | #define INSN_ISA64 8 |
1128 | #define INSN_ISA64R5 14 |
1035 | #define INSN_ISA64R2 9 |
1129 | #define INSN_ISA64R6 15 |
1036 | /* Below this point the INSN_* values correspond to combinations of ISAs. |
1130 | /* Below this point the INSN_* values correspond to combinations of ISAs. |
1037 | They are only for use in the opcodes table to indicate membership of |
1131 | They are only for use in the opcodes table to indicate membership of |
1038 | a combination of ISAs that cannot be expressed using the usual inclusion |
1132 | a combination of ISAs that cannot be expressed using the usual inclusion |
1039 | ordering on the above INSN_* values. */ |
1133 | ordering on the above INSN_* values. */ |
1040 | #define INSN_ISA3_32 10 |
1134 | #define INSN_ISA3_32 16 |
1041 | #define INSN_ISA3_32R2 11 |
1135 | #define INSN_ISA3_32R2 17 |
1042 | #define INSN_ISA4_32 12 |
1136 | #define INSN_ISA4_32 18 |
1043 | #define INSN_ISA4_32R2 13 |
1137 | #define INSN_ISA4_32R2 19 |
1044 | #define INSN_ISA5_32R2 14 |
1138 | #define INSN_ISA5_32R2 20 |
1045 | 1139 | ||
1046 | /* Given INSN_ISA* values X and Y, where X ranges over INSN_ISA1 through |
1140 | /* The R6 definitions shown below state that they support all previous ISAs. |
1047 | INSN_ISA5_32R2 and Y ranges over INSN_ISA1 through INSN_ISA64R2, |
1141 | This is not actually true as some instructions are removed in R6. |
1048 | this table describes whether at least one of the ISAs described by X |
1142 | The problem is that the removed instructions in R6 come from different |
- | 1143 | ISAs. One approach to solve this would be to describe in the membership |
|
1049 | is/are implemented by ISA Y. (Think of Y as the ISA level supported by |
1144 | field of the opcode table the different ISAs an instruction belongs to. |
- | 1145 | This would require us to create a large amount of different ISA |
|
1050 | a particular core and X as the ISA level(s) at which a certain instruction |
1146 | combinations which is hard to manage. A cleaner approach (which is |
- | 1147 | implemented here) is to say that R6 is an extension of R5 and then to |
|
- | 1148 | deal with the removed instructions by adding instruction exclusions |
|
- | 1149 | for R6 in the opcode table. */ |
|
- | 1150 | ||
- | 1151 | /* Bit INSN_ISA |
|
- | 1152 | ||
- | 1153 | #define ISAF(X) (1 << (INSN_ISA##X - 1)) |
|
- | 1154 | #define INSN_UPTO1 ISAF(1) |
|
- | 1155 | #define INSN_UPTO2 INSN_UPTO1 | ISAF(2) |
|
- | 1156 | #define INSN_UPTO3 INSN_UPTO2 | ISAF(3) | ISAF(3_32) | ISAF(3_32R2) |
|
- | 1157 | #define INSN_UPTO4 INSN_UPTO3 | ISAF(4) | ISAF(4_32) | ISAF(4_32R2) |
|
- | 1158 | #define INSN_UPTO5 INSN_UPTO4 | ISAF(5) | ISAF(5_32R2) |
|
- | 1159 | #define INSN_UPTO32 INSN_UPTO2 | ISAF(32) | ISAF(3_32) | ISAF(4_32) |
|
- | 1160 | #define INSN_UPTO32R2 INSN_UPTO32 | ISAF(32R2) \ |
|
- | 1161 | | ISAF(3_32R2) | ISAF(4_32R2) | ISAF(5_32R2) |
|
- | 1162 | #define INSN_UPTO32R3 INSN_UPTO32R2 | ISAF(32R3) |
|
- | 1163 | #define INSN_UPTO32R5 INSN_UPTO32R3 | ISAF(32R5) |
|
- | 1164 | #define INSN_UPTO32R6 INSN_UPTO32R5 | ISAF(32R6) |
|
- | 1165 | #define INSN_UPTO64 INSN_UPTO5 | ISAF(64) | ISAF(32) |
|
- | 1166 | #define INSN_UPTO64R2 INSN_UPTO64 | ISAF(64R2) | ISAF(32R2) |
|
- | 1167 | #define INSN_UPTO64R3 INSN_UPTO64R2 | ISAF(64R3) | ISAF(32R3) |
|
- | 1168 | #define INSN_UPTO64R5 INSN_UPTO64R3 | ISAF(64R5) | ISAF(32R5) |
|
- | 1169 | #define INSN_UPTO64R6 INSN_UPTO64R5 | ISAF(64R6) | ISAF(32R6) |
|
1051 | is defined.) The ISA(s) described by X is/are implemented by Y iff |
1170 | |
- | 1171 | /* The same information in table form: bit INSN_ISA |
|
- | 1172 | INSN_UPTO |
|
- | 1173 | static const unsigned int mips_isa_table[] = { |
|
- | 1174 | INSN_UPTO1, |
|
- | 1175 | INSN_UPTO2, |
|
- | 1176 | INSN_UPTO3, |
|
- | 1177 | INSN_UPTO4, |
|
- | 1178 | INSN_UPTO5, |
|
- | 1179 | INSN_UPTO32, |
|
1052 | (mips_isa_table[(Y & INSN_ISA_MASK) - 1] >> ((X & INSN_ISA_MASK) - 1)) & 1 |
1180 | INSN_UPTO32R2, |
- | 1181 | INSN_UPTO32R3, |
|
- | 1182 | INSN_UPTO32R5, |
|
- | 1183 | INSN_UPTO32R6, |
|
- | 1184 | INSN_UPTO64, |
|
- | 1185 | INSN_UPTO64R2, |
|
- | 1186 | INSN_UPTO64R3, |
|
- | 1187 | INSN_UPTO64R5, |
|
Line 1053... | Line 1188... | ||
1053 | is non-zero. */ |
1188 | INSN_UPTO64R6 |
1054 | static const unsigned int mips_isa_table[] = |
1189 | }; |
Line 1055... | Line 1190... | ||
1055 | { 0x0001, 0x0003, 0x0607, 0x1e0f, 0x3e1f, 0x0a23, 0x3e63, 0x3ebf, 0x3fff }; |
1190 | #undef ISAF |
1056 | 1191 | ||
1057 | /* Masks used for Chip specific instructions. */ |
1192 | /* Masks used for Chip specific instructions. */ |
1058 | #define INSN_CHIP_MASK 0xc3ff0f20 |
1193 | #define INSN_CHIP_MASK 0xc3ff0f20 |
- | 1194 | ||
Line 1059... | Line 1195... | ||
1059 | 1195 | /* Cavium Networks Octeon instructions. */ |
|
1060 | /* Cavium Networks Octeon instructions. */ |
1196 | #define INSN_OCTEON 0x00000800 |
Line 1061... | Line 1197... | ||
1061 | #define INSN_OCTEON 0x00000800 |
1197 | #define INSN_OCTEONP 0x00000200 |
Line 1113... | Line 1249... | ||
1113 | /* SmartMIPS ASE */ |
1249 | /* SmartMIPS ASE */ |
1114 | #define ASE_SMARTMIPS 0x00000100 |
1250 | #define ASE_SMARTMIPS 0x00000100 |
1115 | /* Virtualization ASE */ |
1251 | /* Virtualization ASE */ |
1116 | #define ASE_VIRT 0x00000200 |
1252 | #define ASE_VIRT 0x00000200 |
1117 | #define ASE_VIRT64 0x00000400 |
1253 | #define ASE_VIRT64 0x00000400 |
- | 1254 | /* MSA Extension */ |
|
- | 1255 | #define ASE_MSA 0x00000800 |
|
- | 1256 | #define ASE_MSA64 0x00001000 |
|
- | 1257 | /* eXtended Physical Address (XPA) Extension. */ |
|
- | 1258 | #define ASE_XPA 0x00002000 |
|
Line 1118... | Line 1259... | ||
1118 | 1259 | ||
Line 1119... | Line 1260... | ||
1119 | /* MIPS ISA defines, use instead of hardcoding ISA level. */ |
1260 | /* MIPS ISA defines, use instead of hardcoding ISA level. */ |
1120 | 1261 | ||
Line 1127... | Line 1268... | ||
1127 | 1268 | ||
1128 | #define ISA_MIPS32 INSN_ISA32 |
1269 | #define ISA_MIPS32 INSN_ISA32 |
Line 1129... | Line 1270... | ||
1129 | #define ISA_MIPS64 INSN_ISA64 |
1270 | #define ISA_MIPS64 INSN_ISA64 |
- | 1271 | ||
- | 1272 | #define ISA_MIPS32R2 INSN_ISA32R2 |
|
1130 | 1273 | #define ISA_MIPS32R3 INSN_ISA32R3 |
|
- | 1274 | #define ISA_MIPS32R5 INSN_ISA32R5 |
|
- | 1275 | #define ISA_MIPS64R2 INSN_ISA64R2 |
|
Line -... | Line 1276... | ||
- | 1276 | #define ISA_MIPS64R3 INSN_ISA64R3 |
|
- | 1277 | #define ISA_MIPS64R5 INSN_ISA64R5 |
|
Line 1131... | Line 1278... | ||
1131 | #define ISA_MIPS32R2 INSN_ISA32R2 |
1278 | |
1132 | #define ISA_MIPS64R2 INSN_ISA64R2 |
1279 | #define ISA_MIPS32R6 INSN_ISA32R6 |
1133 | 1280 | #define ISA_MIPS64R6 INSN_ISA64R6 |
|
1134 | 1281 | ||
Line 1159... | Line 1306... | ||
1159 | #define CPU_R14000 14000 |
1306 | #define CPU_R14000 14000 |
1160 | #define CPU_R16000 16000 |
1307 | #define CPU_R16000 16000 |
1161 | #define CPU_MIPS16 16 |
1308 | #define CPU_MIPS16 16 |
1162 | #define CPU_MIPS32 32 |
1309 | #define CPU_MIPS32 32 |
1163 | #define CPU_MIPS32R2 33 |
1310 | #define CPU_MIPS32R2 33 |
- | 1311 | #define CPU_MIPS32R3 34 |
|
- | 1312 | #define CPU_MIPS32R5 36 |
|
- | 1313 | #define CPU_MIPS32R6 37 |
|
1164 | #define CPU_MIPS5 5 |
1314 | #define CPU_MIPS5 5 |
1165 | #define CPU_MIPS64 64 |
1315 | #define CPU_MIPS64 64 |
1166 | #define CPU_MIPS64R2 65 |
1316 | #define CPU_MIPS64R2 65 |
- | 1317 | #define CPU_MIPS64R3 66 |
|
- | 1318 | #define CPU_MIPS64R5 68 |
|
- | 1319 | #define CPU_MIPS64R6 69 |
|
1167 | #define CPU_SB1 12310201 /* octal 'SB', 01. */ |
1320 | #define CPU_SB1 12310201 /* octal 'SB', 01. */ |
1168 | #define CPU_LOONGSON_2E 3001 |
1321 | #define CPU_LOONGSON_2E 3001 |
1169 | #define CPU_LOONGSON_2F 3002 |
1322 | #define CPU_LOONGSON_2F 3002 |
1170 | #define CPU_LOONGSON_3A 3003 |
1323 | #define CPU_LOONGSON_3A 3003 |
1171 | #define CPU_OCTEON 6501 |
1324 | #define CPU_OCTEON 6501 |
1172 | #define CPU_OCTEONP 6601 |
1325 | #define CPU_OCTEONP 6601 |
1173 | #define CPU_OCTEON2 6502 |
1326 | #define CPU_OCTEON2 6502 |
- | 1327 | #define CPU_OCTEON3 6503 |
|
1174 | #define CPU_XLR 887682 /* decimal 'XLR' */ |
1328 | #define CPU_XLR 887682 /* decimal 'XLR' */ |
Line 1175... | Line 1329... | ||
1175 | 1329 | ||
Line 1176... | Line 1330... | ||
1176 | /* Return true if the given CPU is included in INSN_* mask MASK. */ |
1330 | /* Return true if the given CPU is included in INSN_* mask MASK. */ |
Line 1234... | Line 1388... | ||
1234 | return (mask & INSN_OCTEONP) != 0; |
1388 | return (mask & INSN_OCTEONP) != 0; |
Line 1235... | Line 1389... | ||
1235 | 1389 | ||
1236 | case CPU_OCTEON2: |
1390 | case CPU_OCTEON2: |
Line -... | Line 1391... | ||
- | 1391 | return (mask & INSN_OCTEON2) != 0; |
|
- | 1392 | ||
- | 1393 | case CPU_OCTEON3: |
|
1237 | return (mask & INSN_OCTEON2) != 0; |
1394 | return (mask & INSN_OCTEON3) != 0; |
1238 | 1395 | ||
Line -... | Line 1396... | ||
- | 1396 | case CPU_XLR: |
|
- | 1397 | return (mask & INSN_XLR) != 0; |
|
- | 1398 | ||
- | 1399 | case CPU_MIPS32R6: |
|
- | 1400 | return (mask & INSN_ISA_MASK) == INSN_ISA32R6; |
|
- | 1401 | ||
- | 1402 | case CPU_MIPS64R6: |
|
1239 | case CPU_XLR: |
1403 | return ((mask & INSN_ISA_MASK) == INSN_ISA32R6) |
1240 | return (mask & INSN_XLR) != 0; |
1404 | || ((mask & INSN_ISA_MASK) == INSN_ISA64R6); |
1241 | 1405 | ||
1242 | default: |
1406 | default: |
Line 1974... | Line 2138... | ||
1974 | "w" 5-bit same register used as both target and destination |
2138 | "w" 5-bit same register used as both target and destination |
1975 | (MICROMIPSOP_*_RT) |
2139 | (MICROMIPSOP_*_RT) |
1976 | "y" 5-bit source 3 register for ALNV.PS (MICROMIPSOP_*_RS3) |
2140 | "y" 5-bit source 3 register for ALNV.PS (MICROMIPSOP_*_RS3) |
1977 | "z" must be zero register |
2141 | "z" must be zero register |
1978 | "C" 23-bit coprocessor function code (MICROMIPSOP_*_COPZ) |
2142 | "C" 23-bit coprocessor function code (MICROMIPSOP_*_COPZ) |
1979 | "B" 10-bit syscall/wait function code (MICROMIPSOP_*_CODE10) |
- | |
1980 | "K" 5-bit Hardware Register (RDHWR instruction) (MICROMIPSOP_*_RS) |
2143 | "K" 5-bit Hardware Register (RDHWR instruction) (MICROMIPSOP_*_RS) |
Line 1981... | Line 2144... | ||
1981 | 2144 | ||
1982 | "+A" 5-bit INS/EXT/DINS/DEXT/DINSM/DEXTM position, which becomes |
2145 | "+A" 5-bit INS/EXT/DINS/DEXT/DINSM/DEXTM position, which becomes |
1983 | LSB (MICROMIPSOP_*_EXTLSB). |
2146 | LSB (MICROMIPSOP_*_EXTLSB). |
Line 1999... | Line 2162... | ||
1999 | Requires that "+A" or "+E" occur first to set position. |
2162 | Requires that "+A" or "+E" occur first to set position. |
2000 | Enforces: 32 < (pos+size) <= 64. |
2163 | Enforces: 32 < (pos+size) <= 64. |
2001 | "+H" 5-bit DEXTU size, which becomes MSBD (MICROMIPSOP_*_EXTMSBD). |
2164 | "+H" 5-bit DEXTU size, which becomes MSBD (MICROMIPSOP_*_EXTMSBD). |
2002 | Requires that "+A" or "+E" occur first to set position. |
2165 | Requires that "+A" or "+E" occur first to set position. |
2003 | Enforces: 32 < (pos+size) <= 64. |
2166 | Enforces: 32 < (pos+size) <= 64. |
- | 2167 | "+J" 10-bit SYSCALL/WAIT/SDBBP/HYPCALL function code |
|
- | 2168 | (MICROMIPSOP_*_CODE10) |
|
Line 2004... | Line 2169... | ||
2004 | 2169 | ||
2005 | PC-relative addition (ADDIUPC) instruction: |
2170 | PC-relative addition (ADDIUPC) instruction: |
2006 | "mQ" 23-bit offset (-4194304 .. 4194303) << 2 (MICROMIPSOP_*_IMMQ) |
2171 | "mQ" 23-bit offset (-4194304 .. 4194303) << 2 (MICROMIPSOP_*_IMMQ) |
Line 2042... | Line 2207... | ||
2042 | "^" 5-bit unsigned immediate (MICROMIPSOP_*_RD) |
2207 | "^" 5-bit unsigned immediate (MICROMIPSOP_*_RD) |
Line 2043... | Line 2208... | ||
2043 | 2208 | ||
2044 | microMIPS Enhanced VA Scheme: |
2209 | microMIPS Enhanced VA Scheme: |
Line -... | Line 2210... | ||
- | 2210 | "+j" 9-bit signed offset in bit 0 (OP_*_EVAOFFSET) |
|
- | 2211 | ||
- | 2212 | MSA Extension: |
|
- | 2213 | "+d" 5-bit MSA register (FD) |
|
- | 2214 | "+e" 5-bit MSA register (FS) |
|
- | 2215 | "+h" 5-bit MSA register (FT) |
|
- | 2216 | "+k" 5-bit GPR at bit 6 |
|
- | 2217 | "+l" 5-bit MSA control register at bit 6 |
|
- | 2218 | "+n" 5-bit MSA control register at bit 11 |
|
- | 2219 | "+o" 4-bit vector element index at bit 16 |
|
- | 2220 | "+u" 3-bit vector element index at bit 16 |
|
- | 2221 | "+v" 2-bit vector element index at bit 16 |
|
- | 2222 | "+w" 1-bit vector element index at bit 16 |
|
- | 2223 | "+x" 5-bit shift amount at bit 16 |
|
- | 2224 | "+T" (-512 .. 511) << 0 at bit 16 |
|
- | 2225 | "+U" (-512 .. 511) << 1 at bit 16 |
|
- | 2226 | "+V" (-512 .. 511) << 2 at bit 16 |
|
- | 2227 | "+W" (-512 .. 511) << 3 at bit 16 |
|
- | 2228 | "+~" 2 bit LSA/DLSA shift amount from 1 to 4 at bit 6 |
|
- | 2229 | "+!" 3 bit unsigned bit position at bit 16 |
|
- | 2230 | "+@" 4 bit unsigned bit position at bit 16 |
|
- | 2231 | "+#" 6 bit unsigned bit position at bit 16 |
|
- | 2232 | "+$" 5 bit unsigned immediate at bit 16 |
|
- | 2233 | "+%" 5 bit signed immediate at bit 16 |
|
- | 2234 | "+^" 10 bit signed immediate at bit 11 |
|
- | 2235 | "+&" 0 vector element index |
|
- | 2236 | "+*" 5-bit register vector element index at bit 16 |
|
2045 | "+j" 9-bit signed offset in bit 0 (OP_*_EVAOFFSET) |
2237 | "+|" 8-bit mask at bit 16 |
2046 | 2238 | ||
2047 | Other: |
2239 | Other: |
2048 | "()" parens surrounding optional value |
2240 | "()" parens surrounding optional value |
2049 | "," separates operands |
2241 | "," separates operands |
Line 2050... | Line 2242... | ||
2050 | "+" start of extension sequence |
2242 | "+" start of extension sequence |
2051 | "m" start of microMIPS extension sequence |
2243 | "m" start of microMIPS extension sequence |
2052 | 2244 | ||
2053 | Characters used so far, for quick reference when adding more: |
2245 | Characters used so far, for quick reference when adding more: |
2054 | "12345678 0" |
2246 | "12345678 0" |
Line 2055... | Line 2247... | ||
2055 | "<>(),+.@\^|~" |
2247 | "<>(),+-.@\^|~" |
2056 | "ABCDEFGHI KLMN RST V " |
2248 | "ABCDEFGHI KLMN RST V " |
2057 | "abcd f hijklmnopqrstuvw yz" |
2249 | "abcd f hijklmnopqrstuvw yz" |
2058 | 2250 | ||
2059 | Extension character sequences used so far ("+" followed by the |
2251 | Extension character sequences used so far ("+" followed by the |
2060 | following), for quick reference when adding more: |
2252 | following), for quick reference when adding more: |
Line 2061... | Line 2253... | ||
2061 | "" |
2253 | "" |
2062 | "" |
2254 | "~!@#$%^&*|" |
2063 | "ABCEFGH" |
2255 | "ABCEFGHJTUVW" |
2064 | "ij" |
2256 | "dehijklnouvwx" |
2065 | 2257 | ||
2066 | Extension character sequences used so far ("m" followed by the |
2258 | Extension character sequences used so far ("m" followed by the |
- | 2259 | following), for quick reference when adding more: |
|
- | 2260 | "" |
|
- | 2261 | "" |
|
- | 2262 | " BCDEFGHIJ LMNOPQ U WXYZ" |
|
- | 2263 | " bcdefghij lmn pq st xyz" |
|
- | 2264 | ||
2067 | following), for quick reference when adding more: |
2265 | Extension character sequences used so far ("-" followed by the |
Line 2068... | Line 2266... | ||
2068 | "" |
2266 | following), for quick reference when adding more: |
2069 | "" |
2267 | "" |
2070 | " BCDEFGHIJ LMNOPQ U WXYZ" |
2268 | "" |