1 /* mn10300.h -- Header file for Matsushita 10300 opcode table
2 Copyright (C) 1996-2022 Free Software Foundation, Inc.
3 Written by Jeff Law, Cygnus Support
5 This file is part of GDB, GAS, and the GNU binutils.
7 GDB, GAS, and the GNU binutils are free software; you can redistribute
8 them and/or modify them under the terms of the GNU General Public
9 License as published by the Free Software Foundation; either version 3,
10 or (at your option) any later version.
12 GDB, GAS, and the GNU binutils are distributed in the hope that they
13 will be useful, but WITHOUT ANY WARRANTY; without even the implied
14 warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
15 the GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with this file; see the file COPYING3. If not, write to the Free
19 Software Foundation, 51 Franklin Street - Fifth Floor, Boston,
20 MA 02110-1301, USA. */
25 /* The opcode table is an array of struct mn10300_opcode. */
27 #define MN10300_MAX_OPERANDS 8
30 /* The opcode name. */
33 /* The opcode itself. Those bits which will be filled in with
34 operands are zeroes. */
37 /* The opcode mask. This is used by the disassembler. This is a
38 mask containing ones indicating those bits which must match the
39 opcode field, and zeroes indicating those bits which need not
40 match (and are presumably filled in by operands). */
43 /* A bitmask. For each operand, nonzero if it must not have the same
44 register specification as all other operands with a nonzero bit in
45 this flag. ie 0x81 would indicate that operands 7 and 0 must not
46 match. Note that we count operands from left to right as they appear
47 in the operands specification below. */
48 unsigned int no_match_operands
;
50 /* The format of this opcode. */
53 /* Bitmask indicating what cpu variants this opcode is available on.
54 We assume mn10300 base opcodes are available everywhere, so we only
55 have to note opcodes which are available on other variants. */
58 /* An array of operand codes. Each code is an index into the
59 operand table. They appear in the order which the operands must
60 appear in assembly code, and are terminated by a zero. */
61 unsigned char operands
[MN10300_MAX_OPERANDS
];
64 /* The table itself is sorted by major opcode number, and is otherwise
65 in the order in which the disassembler should consider
67 extern const struct mn10300_opcode mn10300_opcodes
[];
68 extern const int mn10300_num_opcodes
;
71 /* The operands table is an array of struct mn10300_operand. */
73 struct mn10300_operand
75 /* The number of bits in the operand. */
78 /* How far the operand is left shifted in the instruction. */
81 /* One bit syntax flags. */
85 /* Elements in the table are retrieved by indexing with values from
86 the operands field of the mn10300_opcodes table. */
88 extern const struct mn10300_operand mn10300_operands
[];
90 /* Values defined for the flags field of a struct mn10300_operand. */
91 #define MN10300_OPERAND_DREG 0x1
93 #define MN10300_OPERAND_AREG 0x2
95 #define MN10300_OPERAND_SP 0x4
97 #define MN10300_OPERAND_PSW 0x8
99 #define MN10300_OPERAND_MDR 0x10
101 #define MN10300_OPERAND_SIGNED 0x20
103 #define MN10300_OPERAND_PROMOTE 0x40
105 #define MN10300_OPERAND_PAREN 0x80
107 #define MN10300_OPERAND_REPEATED 0x100
109 #define MN10300_OPERAND_EXTENDED 0x200
111 #define MN10300_OPERAND_SPLIT 0x400
113 #define MN10300_OPERAND_REG_LIST 0x800
115 #define MN10300_OPERAND_PCREL 0x1000
117 #define MN10300_OPERAND_MEMADDR 0x2000
119 #define MN10300_OPERAND_RELAX 0x4000
121 #define MN10300_OPERAND_USP 0x8000
123 #define MN10300_OPERAND_SSP 0x10000
125 #define MN10300_OPERAND_MSP 0x20000
127 #define MN10300_OPERAND_PC 0x40000
129 #define MN10300_OPERAND_EPSW 0x80000
131 #define MN10300_OPERAND_RREG 0x100000
133 #define MN10300_OPERAND_XRREG 0x200000
135 #define MN10300_OPERAND_PLUS 0x400000
137 #define MN10300_OPERAND_24BIT 0x800000
139 #define MN10300_OPERAND_FSREG 0x1000000
141 #define MN10300_OPERAND_FDREG 0x2000000
143 #define MN10300_OPERAND_FPCR 0x4000000
145 /* Opcode Formats. */
163 /* Variants of the mn10300 which have additional opcodes. */
170 #endif /* MN10300_H */