(CGEN_INSN_ATTR): New type.
[deliverable/binutils-gdb.git] / include / opcode / mn10300.h
CommitLineData
ae1b99e4 1/* mn10300.h -- Header file for Matsushita 10300 opcode table
20ddeff4 2 Copyright 1996, 1997 Free Software Foundation, Inc.
3072af43
JL
3 Written by Jeff Law, Cygnus Support
4
5This file is part of GDB, GAS, and the GNU binutils.
6
7GDB, GAS, and the GNU binutils are free software; you can redistribute
8them and/or modify them under the terms of the GNU General Public
9License as published by the Free Software Foundation; either version
101, or (at your option) any later version.
11
12GDB, GAS, and the GNU binutils are distributed in the hope that they
13will be useful, but WITHOUT ANY WARRANTY; without even the implied
14warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
15the GNU General Public License for more details.
16
17You should have received a copy of the GNU General Public License
18along with this file; see the file COPYING. If not, write to the Free
19Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
20
ae1b99e4
JL
21#ifndef MN10300_H
22#define MN10300_H
3072af43 23
ae1b99e4 24/* The opcode table is an array of struct mn10300_opcode. */
3072af43 25
ae1b99e4 26struct mn10300_opcode
3072af43
JL
27{
28 /* The opcode name. */
29 const char *name;
30
31 /* The opcode itself. Those bits which will be filled in with
32 operands are zeroes. */
33 unsigned long opcode;
34
35 /* The opcode mask. This is used by the disassembler. This is a
36 mask containing ones indicating those bits which must match the
37 opcode field, and zeroes indicating those bits which need not
38 match (and are presumably filled in by operands). */
39 unsigned long mask;
40
b7850607
JL
41 /* The format of this opcode. */
42 unsigned char format;
43
3072af43
JL
44 /* An array of operand codes. Each code is an index into the
45 operand table. They appear in the order which the operands must
46 appear in assembly code, and are terminated by a zero. */
47 unsigned char operands[8];
48};
49
50/* The table itself is sorted by major opcode number, and is otherwise
51 in the order in which the disassembler should consider
52 instructions. */
ae1b99e4
JL
53extern const struct mn10300_opcode mn10300_opcodes[];
54extern const int mn10300_num_opcodes;
3072af43
JL
55
56\f
35106aae 57/* The operands table is an array of struct mn10300_operand. */
3072af43 58
ae1b99e4 59struct mn10300_operand
3072af43
JL
60{
61 /* The number of bits in the operand. */
62 int bits;
63
64 /* How far the operand is left shifted in the instruction. */
65 int shift;
66
67 /* One bit syntax flags. */
68 int flags;
69};
70
71/* Elements in the table are retrieved by indexing with values from
ae1b99e4 72 the operands field of the mn10300_opcodes table. */
3072af43 73
ae1b99e4 74extern const struct mn10300_operand mn10300_operands[];
3072af43 75
ae1b99e4 76/* Values defined for the flags field of a struct mn10300_operand. */
b7850607
JL
77#define MN10300_OPERAND_DREG 0x1
78
79#define MN10300_OPERAND_AREG 0x2
80
81#define MN10300_OPERAND_SP 0x4
82
83#define MN10300_OPERAND_PSW 0x8
84
85#define MN10300_OPERAND_MDR 0x10
86
87#define MN10300_OPERAND_SIGNED 0x20
3072af43 88
b7850607 89#define MN10300_OPERAND_PROMOTE 0x40
1d574167
JL
90
91#define MN10300_OPERAND_PAREN 0x80
b9c65063
JL
92
93#define MN10300_OPERAND_REPEATED 0x100
94
d13f3991
JL
95#define MN10300_OPERAND_EXTENDED 0x200
96
bd63ee34
JL
97#define MN10300_OPERAND_SPLIT 0x400
98
99#define MN10300_OPERAND_REG_LIST 0x800
100
35106aae
JL
101#define MN10300_OPERAND_PCREL 0x1000
102
103#define MN10300_OPERAND_MEMADDR 0x2000
104
39c65f8d 105#define MN10300_OPERAND_RELAX 0x4000
35106aae 106
20ddeff4
JL
107/* start-sanitize-am33 */
108#define MN10300_OPERAND_USP 0x8000
109
110#define MN10300_OPERAND_SSP 0x10000
111
112#define MN10300_OPERAND_MSP 0x20000
113
114#define MN10300_OPERAND_PC 0x40000
115
116#define MN10300_OPERAND_EPSW 0x80000
117
118#define MN10300_OPERAND_RREG 0x100000
119
120#define MN10300_OPERAND_XRREG 0x200000
121
122#define MN10300_OPERAND_PLUS 0x400000
dc959c75
JL
123
124#define MN10300_OPERAND_24BIT 0x800000
20ddeff4
JL
125/* end-sanitize-am33 */
126
b9c65063
JL
127/* Opcode Formats. */
128#define FMT_S0 1
129#define FMT_S1 2
130#define FMT_S2 3
131#define FMT_S4 4
132#define FMT_S6 5
133#define FMT_D0 6
134#define FMT_D1 7
135#define FMT_D2 8
136#define FMT_D4 9
137#define FMT_D5 10
20ddeff4
JL
138/* start-sanitize-am33 */
139#define FMT_D6 11
140#define FMT_D7 12
dc959c75
JL
141#define FMT_D8 13
142#define FMT_D9 14
143#define FMT_D10 15
8cdfcc1b 144/* end-sanitize-am33 */
b9c65063 145
ae1b99e4 146#endif /* MN10300_H */
This page took 0.095076 seconds and 4 git commands to generate.