root / mips-dis.c @ 263466f5
History | View | Annotate | Download (157.6 kB)
1 | 6643d27e | bellard | /* Print mips instructions for GDB, the GNU debugger, or for objdump.
|
---|---|---|---|
2 | 6643d27e | bellard | Copyright 1989, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
|
3 | 6643d27e | bellard | 2000, 2001, 2002, 2003
|
4 | 6643d27e | bellard | Free Software Foundation, Inc.
|
5 | 6643d27e | bellard | Contributed by Nobuyuki Hikichi(hikichi@sra.co.jp).
|
6 | 6643d27e | bellard | |
7 | 6643d27e | bellard | This file is part of GDB, GAS, and the GNU binutils.
|
8 | 6643d27e | bellard | |
9 | 6643d27e | bellard | This program is free software; you can redistribute it and/or modify
|
10 | 6643d27e | bellard | it under the terms of the GNU General Public License as published by
|
11 | 6643d27e | bellard | the Free Software Foundation; either version 2 of the License, or
|
12 | 6643d27e | bellard | (at your option) any later version.
|
13 | 6643d27e | bellard | |
14 | 6643d27e | bellard | This program is distributed in the hope that it will be useful,
|
15 | 6643d27e | bellard | but WITHOUT ANY WARRANTY; without even the implied warranty of
|
16 | 6643d27e | bellard | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
17 | 6643d27e | bellard | GNU General Public License for more details.
|
18 | 6643d27e | bellard | |
19 | 6643d27e | bellard | You should have received a copy of the GNU General Public License
|
20 | 6643d27e | bellard | along with this program; if not, write to the Free Software
|
21 | 6643d27e | bellard | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
22 | 6643d27e | bellard | |
23 | 6643d27e | bellard | #include "dis-asm.h" |
24 | 6643d27e | bellard | |
25 | 6643d27e | bellard | /* mips.h. Mips opcode list for GDB, the GNU debugger.
|
26 | 6643d27e | bellard | Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
|
27 | 6643d27e | bellard | Free Software Foundation, Inc.
|
28 | 6643d27e | bellard | Contributed by Ralph Campbell and OSF
|
29 | 6643d27e | bellard | Commented and modified by Ian Lance Taylor, Cygnus Support
|
30 | 6643d27e | bellard | |
31 | 6643d27e | bellard | This file is part of GDB, GAS, and the GNU binutils.
|
32 | 6643d27e | bellard | |
33 | 6643d27e | bellard | GDB, GAS, and the GNU binutils are free software; you can redistribute
|
34 | 6643d27e | bellard | them and/or modify them under the terms of the GNU General Public
|
35 | 6643d27e | bellard | License as published by the Free Software Foundation; either version
|
36 | 6643d27e | bellard | 1, or (at your option) any later version.
|
37 | 6643d27e | bellard | |
38 | 6643d27e | bellard | GDB, GAS, and the GNU binutils are distributed in the hope that they
|
39 | 6643d27e | bellard | will be useful, but WITHOUT ANY WARRANTY; without even the implied
|
40 | 6643d27e | bellard | warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
|
41 | 6643d27e | bellard | the GNU General Public License for more details.
|
42 | 6643d27e | bellard | |
43 | 6643d27e | bellard | You should have received a copy of the GNU General Public License
|
44 | 6643d27e | bellard | along with this file; see the file COPYING. If not, write to the Free
|
45 | 6643d27e | bellard | Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
46 | 6643d27e | bellard | |
47 | 6643d27e | bellard | /* mips.h. Mips opcode list for GDB, the GNU debugger.
|
48 | 6643d27e | bellard | Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
|
49 | 6643d27e | bellard | Free Software Foundation, Inc.
|
50 | 6643d27e | bellard | Contributed by Ralph Campbell and OSF
|
51 | 6643d27e | bellard | Commented and modified by Ian Lance Taylor, Cygnus Support
|
52 | 6643d27e | bellard | |
53 | 6643d27e | bellard | This file is part of GDB, GAS, and the GNU binutils.
|
54 | 6643d27e | bellard | |
55 | 6643d27e | bellard | GDB, GAS, and the GNU binutils are free software; you can redistribute
|
56 | 6643d27e | bellard | them and/or modify them under the terms of the GNU General Public
|
57 | 6643d27e | bellard | License as published by the Free Software Foundation; either version
|
58 | 6643d27e | bellard | 1, or (at your option) any later version.
|
59 | 6643d27e | bellard | |
60 | 6643d27e | bellard | GDB, GAS, and the GNU binutils are distributed in the hope that they
|
61 | 6643d27e | bellard | will be useful, but WITHOUT ANY WARRANTY; without even the implied
|
62 | 6643d27e | bellard | warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
|
63 | 6643d27e | bellard | the GNU General Public License for more details.
|
64 | 6643d27e | bellard | |
65 | 6643d27e | bellard | You should have received a copy of the GNU General Public License
|
66 | 6643d27e | bellard | along with this file; see the file COPYING. If not, write to the Free
|
67 | 6643d27e | bellard | Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
68 | 6643d27e | bellard | |
69 | 6643d27e | bellard | /* These are bit masks and shift counts to use to access the various
|
70 | 6643d27e | bellard | fields of an instruction. To retrieve the X field of an
|
71 | 6643d27e | bellard | instruction, use the expression
|
72 | 6643d27e | bellard | (i >> OP_SH_X) & OP_MASK_X
|
73 | 6643d27e | bellard | To set the same field (to j), use
|
74 | 6643d27e | bellard | i = (i &~ (OP_MASK_X << OP_SH_X)) | (j << OP_SH_X)
|
75 | 6643d27e | bellard | |
76 | 6643d27e | bellard | Make sure you use fields that are appropriate for the instruction,
|
77 | 6643d27e | bellard | of course.
|
78 | 6643d27e | bellard | |
79 | 6643d27e | bellard | The 'i' format uses OP, RS, RT and IMMEDIATE.
|
80 | 6643d27e | bellard | |
81 | 6643d27e | bellard | The 'j' format uses OP and TARGET.
|
82 | 6643d27e | bellard | |
83 | 6643d27e | bellard | The 'r' format uses OP, RS, RT, RD, SHAMT and FUNCT.
|
84 | 6643d27e | bellard | |
85 | 6643d27e | bellard | The 'b' format uses OP, RS, RT and DELTA.
|
86 | 6643d27e | bellard | |
87 | 6643d27e | bellard | The floating point 'i' format uses OP, RS, RT and IMMEDIATE.
|
88 | 6643d27e | bellard | |
89 | 6643d27e | bellard | The floating point 'r' format uses OP, FMT, FT, FS, FD and FUNCT.
|
90 | 6643d27e | bellard | |
91 | 6643d27e | bellard | A breakpoint instruction uses OP, CODE and SPEC (10 bits of the
|
92 | 6643d27e | bellard | breakpoint instruction are not defined; Kane says the breakpoint
|
93 | 6643d27e | bellard | code field in BREAK is 20 bits; yet MIPS assemblers and debuggers
|
94 | 6643d27e | bellard | only use ten bits). An optional two-operand form of break/sdbbp
|
95 | 6643d27e | bellard | allows the lower ten bits to be set too, and MIPS32 and later
|
96 | 6643d27e | bellard | architectures allow 20 bits to be set with a signal operand
|
97 | 6643d27e | bellard | (using CODE20).
|
98 | 6643d27e | bellard | |
99 | 6643d27e | bellard | The syscall instruction uses CODE20.
|
100 | 6643d27e | bellard | |
101 | 6643d27e | bellard | The general coprocessor instructions use COPZ. */
|
102 | 6643d27e | bellard | |
103 | 6643d27e | bellard | #define OP_MASK_OP 0x3f |
104 | 6643d27e | bellard | #define OP_SH_OP 26 |
105 | 6643d27e | bellard | #define OP_MASK_RS 0x1f |
106 | 6643d27e | bellard | #define OP_SH_RS 21 |
107 | 6643d27e | bellard | #define OP_MASK_FR 0x1f |
108 | 6643d27e | bellard | #define OP_SH_FR 21 |
109 | 6643d27e | bellard | #define OP_MASK_FMT 0x1f |
110 | 6643d27e | bellard | #define OP_SH_FMT 21 |
111 | 6643d27e | bellard | #define OP_MASK_BCC 0x7 |
112 | 6643d27e | bellard | #define OP_SH_BCC 18 |
113 | 6643d27e | bellard | #define OP_MASK_CODE 0x3ff |
114 | 6643d27e | bellard | #define OP_SH_CODE 16 |
115 | 6643d27e | bellard | #define OP_MASK_CODE2 0x3ff |
116 | 6643d27e | bellard | #define OP_SH_CODE2 6 |
117 | 6643d27e | bellard | #define OP_MASK_RT 0x1f |
118 | 6643d27e | bellard | #define OP_SH_RT 16 |
119 | 6643d27e | bellard | #define OP_MASK_FT 0x1f |
120 | 6643d27e | bellard | #define OP_SH_FT 16 |
121 | 6643d27e | bellard | #define OP_MASK_CACHE 0x1f |
122 | 6643d27e | bellard | #define OP_SH_CACHE 16 |
123 | 6643d27e | bellard | #define OP_MASK_RD 0x1f |
124 | 6643d27e | bellard | #define OP_SH_RD 11 |
125 | 6643d27e | bellard | #define OP_MASK_FS 0x1f |
126 | 6643d27e | bellard | #define OP_SH_FS 11 |
127 | 6643d27e | bellard | #define OP_MASK_PREFX 0x1f |
128 | 6643d27e | bellard | #define OP_SH_PREFX 11 |
129 | 6643d27e | bellard | #define OP_MASK_CCC 0x7 |
130 | 6643d27e | bellard | #define OP_SH_CCC 8 |
131 | 6643d27e | bellard | #define OP_MASK_CODE20 0xfffff /* 20 bit syscall/breakpoint code. */ |
132 | 6643d27e | bellard | #define OP_SH_CODE20 6 |
133 | 6643d27e | bellard | #define OP_MASK_SHAMT 0x1f |
134 | 6643d27e | bellard | #define OP_SH_SHAMT 6 |
135 | 6643d27e | bellard | #define OP_MASK_FD 0x1f |
136 | 6643d27e | bellard | #define OP_SH_FD 6 |
137 | 6643d27e | bellard | #define OP_MASK_TARGET 0x3ffffff |
138 | 6643d27e | bellard | #define OP_SH_TARGET 0 |
139 | 6643d27e | bellard | #define OP_MASK_COPZ 0x1ffffff |
140 | 6643d27e | bellard | #define OP_SH_COPZ 0 |
141 | 6643d27e | bellard | #define OP_MASK_IMMEDIATE 0xffff |
142 | 6643d27e | bellard | #define OP_SH_IMMEDIATE 0 |
143 | 6643d27e | bellard | #define OP_MASK_DELTA 0xffff |
144 | 6643d27e | bellard | #define OP_SH_DELTA 0 |
145 | 6643d27e | bellard | #define OP_MASK_FUNCT 0x3f |
146 | 6643d27e | bellard | #define OP_SH_FUNCT 0 |
147 | 6643d27e | bellard | #define OP_MASK_SPEC 0x3f |
148 | 6643d27e | bellard | #define OP_SH_SPEC 0 |
149 | 6643d27e | bellard | #define OP_SH_LOCC 8 /* FP condition code. */ |
150 | 6643d27e | bellard | #define OP_SH_HICC 18 /* FP condition code. */ |
151 | 6643d27e | bellard | #define OP_MASK_CC 0x7 |
152 | 6643d27e | bellard | #define OP_SH_COP1NORM 25 /* Normal COP1 encoding. */ |
153 | 6643d27e | bellard | #define OP_MASK_COP1NORM 0x1 /* a single bit. */ |
154 | 6643d27e | bellard | #define OP_SH_COP1SPEC 21 /* COP1 encodings. */ |
155 | 6643d27e | bellard | #define OP_MASK_COP1SPEC 0xf |
156 | 6643d27e | bellard | #define OP_MASK_COP1SCLR 0x4 |
157 | 6643d27e | bellard | #define OP_MASK_COP1CMP 0x3 |
158 | 6643d27e | bellard | #define OP_SH_COP1CMP 4 |
159 | 6643d27e | bellard | #define OP_SH_FORMAT 21 /* FP short format field. */ |
160 | 6643d27e | bellard | #define OP_MASK_FORMAT 0x7 |
161 | 6643d27e | bellard | #define OP_SH_TRUE 16 |
162 | 6643d27e | bellard | #define OP_MASK_TRUE 0x1 |
163 | 6643d27e | bellard | #define OP_SH_GE 17 |
164 | 6643d27e | bellard | #define OP_MASK_GE 0x01 |
165 | 6643d27e | bellard | #define OP_SH_UNSIGNED 16 |
166 | 6643d27e | bellard | #define OP_MASK_UNSIGNED 0x1 |
167 | 6643d27e | bellard | #define OP_SH_HINT 16 |
168 | 6643d27e | bellard | #define OP_MASK_HINT 0x1f |
169 | 6643d27e | bellard | #define OP_SH_MMI 0 /* Multimedia (parallel) op. */ |
170 | 6643d27e | bellard | #define OP_MASK_MMI 0x3f |
171 | 6643d27e | bellard | #define OP_SH_MMISUB 6 |
172 | 6643d27e | bellard | #define OP_MASK_MMISUB 0x1f |
173 | 6643d27e | bellard | #define OP_MASK_PERFREG 0x1f /* Performance monitoring. */ |
174 | 6643d27e | bellard | #define OP_SH_PERFREG 1 |
175 | 6643d27e | bellard | #define OP_SH_SEL 0 /* Coprocessor select field. */ |
176 | 6643d27e | bellard | #define OP_MASK_SEL 0x7 /* The sel field of mfcZ and mtcZ. */ |
177 | 6643d27e | bellard | #define OP_SH_CODE19 6 /* 19 bit wait code. */ |
178 | 6643d27e | bellard | #define OP_MASK_CODE19 0x7ffff |
179 | 6643d27e | bellard | #define OP_SH_ALN 21 |
180 | 6643d27e | bellard | #define OP_MASK_ALN 0x7 |
181 | 6643d27e | bellard | #define OP_SH_VSEL 21 |
182 | 6643d27e | bellard | #define OP_MASK_VSEL 0x1f |
183 | 6643d27e | bellard | #define OP_MASK_VECBYTE 0x7 /* Selector field is really 4 bits, |
184 | 6643d27e | bellard | but 0x8-0xf don't select bytes. */
|
185 | 6643d27e | bellard | #define OP_SH_VECBYTE 22 |
186 | 6643d27e | bellard | #define OP_MASK_VECALIGN 0x7 /* Vector byte-align (alni.ob) op. */ |
187 | 6643d27e | bellard | #define OP_SH_VECALIGN 21 |
188 | 6643d27e | bellard | #define OP_MASK_INSMSB 0x1f /* "ins" MSB. */ |
189 | 6643d27e | bellard | #define OP_SH_INSMSB 11 |
190 | 6643d27e | bellard | #define OP_MASK_EXTMSBD 0x1f /* "ext" MSBD. */ |
191 | 6643d27e | bellard | #define OP_SH_EXTMSBD 11 |
192 | 6643d27e | bellard | |
193 | 6643d27e | bellard | #define OP_OP_COP0 0x10 |
194 | 6643d27e | bellard | #define OP_OP_COP1 0x11 |
195 | 6643d27e | bellard | #define OP_OP_COP2 0x12 |
196 | 6643d27e | bellard | #define OP_OP_COP3 0x13 |
197 | 6643d27e | bellard | #define OP_OP_LWC1 0x31 |
198 | 6643d27e | bellard | #define OP_OP_LWC2 0x32 |
199 | 6643d27e | bellard | #define OP_OP_LWC3 0x33 /* a.k.a. pref */ |
200 | 6643d27e | bellard | #define OP_OP_LDC1 0x35 |
201 | 6643d27e | bellard | #define OP_OP_LDC2 0x36 |
202 | 6643d27e | bellard | #define OP_OP_LDC3 0x37 /* a.k.a. ld */ |
203 | 6643d27e | bellard | #define OP_OP_SWC1 0x39 |
204 | 6643d27e | bellard | #define OP_OP_SWC2 0x3a |
205 | 6643d27e | bellard | #define OP_OP_SWC3 0x3b |
206 | 6643d27e | bellard | #define OP_OP_SDC1 0x3d |
207 | 6643d27e | bellard | #define OP_OP_SDC2 0x3e |
208 | 6643d27e | bellard | #define OP_OP_SDC3 0x3f /* a.k.a. sd */ |
209 | 6643d27e | bellard | |
210 | 6643d27e | bellard | /* Values in the 'VSEL' field. */
|
211 | 6643d27e | bellard | #define MDMX_FMTSEL_IMM_QH 0x1d |
212 | 6643d27e | bellard | #define MDMX_FMTSEL_IMM_OB 0x1e |
213 | 6643d27e | bellard | #define MDMX_FMTSEL_VEC_QH 0x15 |
214 | 6643d27e | bellard | #define MDMX_FMTSEL_VEC_OB 0x16 |
215 | 6643d27e | bellard | |
216 | 6643d27e | bellard | /* This structure holds information for a particular instruction. */
|
217 | 6643d27e | bellard | |
218 | 6643d27e | bellard | struct mips_opcode
|
219 | 6643d27e | bellard | { |
220 | 6643d27e | bellard | /* The name of the instruction. */
|
221 | 6643d27e | bellard | const char *name; |
222 | 6643d27e | bellard | /* A string describing the arguments for this instruction. */
|
223 | 6643d27e | bellard | const char *args; |
224 | 6643d27e | bellard | /* The basic opcode for the instruction. When assembling, this
|
225 | 6643d27e | bellard | opcode is modified by the arguments to produce the actual opcode
|
226 | 6643d27e | bellard | that is used. If pinfo is INSN_MACRO, then this is 0. */
|
227 | 6643d27e | bellard | unsigned long match; |
228 | 6643d27e | bellard | /* If pinfo is not INSN_MACRO, then this is a bit mask for the
|
229 | 6643d27e | bellard | relevant portions of the opcode when disassembling. If the
|
230 | 6643d27e | bellard | actual opcode anded with the match field equals the opcode field,
|
231 | 6643d27e | bellard | then we have found the correct instruction. If pinfo is
|
232 | 6643d27e | bellard | INSN_MACRO, then this field is the macro identifier. */
|
233 | 6643d27e | bellard | unsigned long mask; |
234 | 6643d27e | bellard | /* For a macro, this is INSN_MACRO. Otherwise, it is a collection
|
235 | 6643d27e | bellard | of bits describing the instruction, notably any relevant hazard
|
236 | 6643d27e | bellard | information. */
|
237 | 6643d27e | bellard | unsigned long pinfo; |
238 | 6643d27e | bellard | /* A collection of bits describing the instruction sets of which this
|
239 | 6643d27e | bellard | instruction or macro is a member. */
|
240 | 6643d27e | bellard | unsigned long membership; |
241 | 6643d27e | bellard | }; |
242 | 6643d27e | bellard | |
243 | 6643d27e | bellard | /* These are the characters which may appear in the args field of an
|
244 | 6643d27e | bellard | instruction. They appear in the order in which the fields appear
|
245 | 6643d27e | bellard | when the instruction is used. Commas and parentheses in the args
|
246 | 6643d27e | bellard | string are ignored when assembling, and written into the output
|
247 | 6643d27e | bellard | when disassembling.
|
248 | 6643d27e | bellard | |
249 | 6643d27e | bellard | Each of these characters corresponds to a mask field defined above.
|
250 | 6643d27e | bellard | |
251 | 6643d27e | bellard | "<" 5 bit shift amount (OP_*_SHAMT)
|
252 | 6643d27e | bellard | ">" shift amount between 32 and 63, stored after subtracting 32 (OP_*_SHAMT)
|
253 | 6643d27e | bellard | "a" 26 bit target address (OP_*_TARGET)
|
254 | 6643d27e | bellard | "b" 5 bit base register (OP_*_RS)
|
255 | 6643d27e | bellard | "c" 10 bit breakpoint code (OP_*_CODE)
|
256 | 6643d27e | bellard | "d" 5 bit destination register specifier (OP_*_RD)
|
257 | 6643d27e | bellard | "h" 5 bit prefx hint (OP_*_PREFX)
|
258 | 6643d27e | bellard | "i" 16 bit unsigned immediate (OP_*_IMMEDIATE)
|
259 | 6643d27e | bellard | "j" 16 bit signed immediate (OP_*_DELTA)
|
260 | 6643d27e | bellard | "k" 5 bit cache opcode in target register position (OP_*_CACHE)
|
261 | 6643d27e | bellard | Also used for immediate operands in vr5400 vector insns.
|
262 | 6643d27e | bellard | "o" 16 bit signed offset (OP_*_DELTA)
|
263 | 6643d27e | bellard | "p" 16 bit PC relative branch target address (OP_*_DELTA)
|
264 | 6643d27e | bellard | "q" 10 bit extra breakpoint code (OP_*_CODE2)
|
265 | 6643d27e | bellard | "r" 5 bit same register used as both source and target (OP_*_RS)
|
266 | 6643d27e | bellard | "s" 5 bit source register specifier (OP_*_RS)
|
267 | 6643d27e | bellard | "t" 5 bit target register (OP_*_RT)
|
268 | 6643d27e | bellard | "u" 16 bit upper 16 bits of address (OP_*_IMMEDIATE)
|
269 | 6643d27e | bellard | "v" 5 bit same register used as both source and destination (OP_*_RS)
|
270 | 6643d27e | bellard | "w" 5 bit same register used as both target and destination (OP_*_RT)
|
271 | 6643d27e | bellard | "U" 5 bit same destination register in both OP_*_RD and OP_*_RT
|
272 | 6643d27e | bellard | (used by clo and clz)
|
273 | 6643d27e | bellard | "C" 25 bit coprocessor function code (OP_*_COPZ)
|
274 | 6643d27e | bellard | "B" 20 bit syscall/breakpoint function code (OP_*_CODE20)
|
275 | 6643d27e | bellard | "J" 19 bit wait function code (OP_*_CODE19)
|
276 | 6643d27e | bellard | "x" accept and ignore register name
|
277 | 6643d27e | bellard | "z" must be zero register
|
278 | 6643d27e | bellard | "K" 5 bit Hardware Register (rdhwr instruction) (OP_*_RD)
|
279 | 6643d27e | bellard | "+A" 5 bit ins/ext position, which becomes LSB (OP_*_SHAMT).
|
280 | 6643d27e | bellard | Enforces: 0 <= pos < 32.
|
281 | 6643d27e | bellard | "+B" 5 bit ins size, which becomes MSB (OP_*_INSMSB).
|
282 | 6643d27e | bellard | Requires that "+A" or "+E" occur first to set position.
|
283 | 6643d27e | bellard | Enforces: 0 < (pos+size) <= 32.
|
284 | 6643d27e | bellard | "+C" 5 bit ext size, which becomes MSBD (OP_*_EXTMSBD).
|
285 | 6643d27e | bellard | Requires that "+A" or "+E" occur first to set position.
|
286 | 6643d27e | bellard | Enforces: 0 < (pos+size) <= 32.
|
287 | 6643d27e | bellard | (Also used by "dext" w/ different limits, but limits for
|
288 | 6643d27e | bellard | that are checked by the M_DEXT macro.)
|
289 | 6643d27e | bellard | "+E" 5 bit dins/dext position, which becomes LSB-32 (OP_*_SHAMT).
|
290 | 6643d27e | bellard | Enforces: 32 <= pos < 64.
|
291 | 6643d27e | bellard | "+F" 5 bit "dinsm" size, which becomes MSB-32 (OP_*_INSMSB).
|
292 | 6643d27e | bellard | Requires that "+A" or "+E" occur first to set position.
|
293 | 6643d27e | bellard | Enforces: 32 < (pos+size) <= 64.
|
294 | 6643d27e | bellard | "+G" 5 bit "dextm" size, which becomes MSBD-32 (OP_*_EXTMSBD).
|
295 | 6643d27e | bellard | Requires that "+A" or "+E" occur first to set position.
|
296 | 6643d27e | bellard | Enforces: 32 < (pos+size) <= 64.
|
297 | 6643d27e | bellard | "+H" 5 bit "dextu" size, which becomes MSBD (OP_*_EXTMSBD).
|
298 | 6643d27e | bellard | Requires that "+A" or "+E" occur first to set position.
|
299 | 6643d27e | bellard | Enforces: 32 < (pos+size) <= 64.
|
300 | 6643d27e | bellard | |
301 | 6643d27e | bellard | Floating point instructions:
|
302 | 6643d27e | bellard | "D" 5 bit destination register (OP_*_FD)
|
303 | 6643d27e | bellard | "M" 3 bit compare condition code (OP_*_CCC) (only used for mips4 and up)
|
304 | 6643d27e | bellard | "N" 3 bit branch condition code (OP_*_BCC) (only used for mips4 and up)
|
305 | 6643d27e | bellard | "S" 5 bit fs source 1 register (OP_*_FS)
|
306 | 6643d27e | bellard | "T" 5 bit ft source 2 register (OP_*_FT)
|
307 | 6643d27e | bellard | "R" 5 bit fr source 3 register (OP_*_FR)
|
308 | 6643d27e | bellard | "V" 5 bit same register used as floating source and destination (OP_*_FS)
|
309 | 6643d27e | bellard | "W" 5 bit same register used as floating target and destination (OP_*_FT)
|
310 | 6643d27e | bellard | |
311 | 6643d27e | bellard | Coprocessor instructions:
|
312 | 6643d27e | bellard | "E" 5 bit target register (OP_*_RT)
|
313 | 6643d27e | bellard | "G" 5 bit destination register (OP_*_RD)
|
314 | 6643d27e | bellard | "H" 3 bit sel field for (d)mtc* and (d)mfc* (OP_*_SEL)
|
315 | 6643d27e | bellard | "P" 5 bit performance-monitor register (OP_*_PERFREG)
|
316 | 6643d27e | bellard | "e" 5 bit vector register byte specifier (OP_*_VECBYTE)
|
317 | 6643d27e | bellard | "%" 3 bit immediate vr5400 vector alignment operand (OP_*_VECALIGN)
|
318 | 6643d27e | bellard | see also "k" above
|
319 | 6643d27e | bellard | "+D" Combined destination register ("G") and sel ("H") for CP0 ops,
|
320 | 6643d27e | bellard | for pretty-printing in disassembly only.
|
321 | 6643d27e | bellard | |
322 | 6643d27e | bellard | Macro instructions:
|
323 | 6643d27e | bellard | "A" General 32 bit expression
|
324 | 6643d27e | bellard | "I" 32 bit immediate (value placed in imm_expr).
|
325 | 6643d27e | bellard | "+I" 32 bit immediate (value placed in imm2_expr).
|
326 | 6643d27e | bellard | "F" 64 bit floating point constant in .rdata
|
327 | 6643d27e | bellard | "L" 64 bit floating point constant in .lit8
|
328 | 6643d27e | bellard | "f" 32 bit floating point constant
|
329 | 6643d27e | bellard | "l" 32 bit floating point constant in .lit4
|
330 | 6643d27e | bellard | |
331 | 6643d27e | bellard | MDMX instruction operands (note that while these use the FP register
|
332 | 6643d27e | bellard | fields, they accept both $fN and $vN names for the registers):
|
333 | 6643d27e | bellard | "O" MDMX alignment offset (OP_*_ALN)
|
334 | 6643d27e | bellard | "Q" MDMX vector/scalar/immediate source (OP_*_VSEL and OP_*_FT)
|
335 | 6643d27e | bellard | "X" MDMX destination register (OP_*_FD)
|
336 | 6643d27e | bellard | "Y" MDMX source register (OP_*_FS)
|
337 | 6643d27e | bellard | "Z" MDMX source register (OP_*_FT)
|
338 | 6643d27e | bellard | |
339 | 6643d27e | bellard | Other:
|
340 | 6643d27e | bellard | "()" parens surrounding optional value
|
341 | 6643d27e | bellard | "," separates operands
|
342 | 6643d27e | bellard | "[]" brackets around index for vector-op scalar operand specifier (vr5400)
|
343 | 6643d27e | bellard | "+" Start of extension sequence.
|
344 | 6643d27e | bellard | |
345 | 6643d27e | bellard | Characters used so far, for quick reference when adding more:
|
346 | 6643d27e | bellard | "%[]<>(),+"
|
347 | 6643d27e | bellard | "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
|
348 | 6643d27e | bellard | "abcdefhijklopqrstuvwxz"
|
349 | 6643d27e | bellard | |
350 | 6643d27e | bellard | Extension character sequences used so far ("+" followed by the
|
351 | 6643d27e | bellard | following), for quick reference when adding more:
|
352 | 6643d27e | bellard | "ABCDEFGHI"
|
353 | 6643d27e | bellard | */
|
354 | 6643d27e | bellard | |
355 | 6643d27e | bellard | /* These are the bits which may be set in the pinfo field of an
|
356 | 6643d27e | bellard | instructions, if it is not equal to INSN_MACRO. */
|
357 | 6643d27e | bellard | |
358 | 6643d27e | bellard | /* Modifies the general purpose register in OP_*_RD. */
|
359 | 6643d27e | bellard | #define INSN_WRITE_GPR_D 0x00000001 |
360 | 6643d27e | bellard | /* Modifies the general purpose register in OP_*_RT. */
|
361 | 6643d27e | bellard | #define INSN_WRITE_GPR_T 0x00000002 |
362 | 6643d27e | bellard | /* Modifies general purpose register 31. */
|
363 | 6643d27e | bellard | #define INSN_WRITE_GPR_31 0x00000004 |
364 | 6643d27e | bellard | /* Modifies the floating point register in OP_*_FD. */
|
365 | 6643d27e | bellard | #define INSN_WRITE_FPR_D 0x00000008 |
366 | 6643d27e | bellard | /* Modifies the floating point register in OP_*_FS. */
|
367 | 6643d27e | bellard | #define INSN_WRITE_FPR_S 0x00000010 |
368 | 6643d27e | bellard | /* Modifies the floating point register in OP_*_FT. */
|
369 | 6643d27e | bellard | #define INSN_WRITE_FPR_T 0x00000020 |
370 | 6643d27e | bellard | /* Reads the general purpose register in OP_*_RS. */
|
371 | 6643d27e | bellard | #define INSN_READ_GPR_S 0x00000040 |
372 | 6643d27e | bellard | /* Reads the general purpose register in OP_*_RT. */
|
373 | 6643d27e | bellard | #define INSN_READ_GPR_T 0x00000080 |
374 | 6643d27e | bellard | /* Reads the floating point register in OP_*_FS. */
|
375 | 6643d27e | bellard | #define INSN_READ_FPR_S 0x00000100 |
376 | 6643d27e | bellard | /* Reads the floating point register in OP_*_FT. */
|
377 | 6643d27e | bellard | #define INSN_READ_FPR_T 0x00000200 |
378 | 6643d27e | bellard | /* Reads the floating point register in OP_*_FR. */
|
379 | 6643d27e | bellard | #define INSN_READ_FPR_R 0x00000400 |
380 | 6643d27e | bellard | /* Modifies coprocessor condition code. */
|
381 | 6643d27e | bellard | #define INSN_WRITE_COND_CODE 0x00000800 |
382 | 6643d27e | bellard | /* Reads coprocessor condition code. */
|
383 | 6643d27e | bellard | #define INSN_READ_COND_CODE 0x00001000 |
384 | 6643d27e | bellard | /* TLB operation. */
|
385 | 6643d27e | bellard | #define INSN_TLB 0x00002000 |
386 | 6643d27e | bellard | /* Reads coprocessor register other than floating point register. */
|
387 | 6643d27e | bellard | #define INSN_COP 0x00004000 |
388 | 6643d27e | bellard | /* Instruction loads value from memory, requiring delay. */
|
389 | 6643d27e | bellard | #define INSN_LOAD_MEMORY_DELAY 0x00008000 |
390 | 6643d27e | bellard | /* Instruction loads value from coprocessor, requiring delay. */
|
391 | 6643d27e | bellard | #define INSN_LOAD_COPROC_DELAY 0x00010000 |
392 | 6643d27e | bellard | /* Instruction has unconditional branch delay slot. */
|
393 | 6643d27e | bellard | #define INSN_UNCOND_BRANCH_DELAY 0x00020000 |
394 | 6643d27e | bellard | /* Instruction has conditional branch delay slot. */
|
395 | 6643d27e | bellard | #define INSN_COND_BRANCH_DELAY 0x00040000 |
396 | 6643d27e | bellard | /* Conditional branch likely: if branch not taken, insn nullified. */
|
397 | 6643d27e | bellard | #define INSN_COND_BRANCH_LIKELY 0x00080000 |
398 | 6643d27e | bellard | /* Moves to coprocessor register, requiring delay. */
|
399 | 6643d27e | bellard | #define INSN_COPROC_MOVE_DELAY 0x00100000 |
400 | 6643d27e | bellard | /* Loads coprocessor register from memory, requiring delay. */
|
401 | 6643d27e | bellard | #define INSN_COPROC_MEMORY_DELAY 0x00200000 |
402 | 6643d27e | bellard | /* Reads the HI register. */
|
403 | 6643d27e | bellard | #define INSN_READ_HI 0x00400000 |
404 | 6643d27e | bellard | /* Reads the LO register. */
|
405 | 6643d27e | bellard | #define INSN_READ_LO 0x00800000 |
406 | 6643d27e | bellard | /* Modifies the HI register. */
|
407 | 6643d27e | bellard | #define INSN_WRITE_HI 0x01000000 |
408 | 6643d27e | bellard | /* Modifies the LO register. */
|
409 | 6643d27e | bellard | #define INSN_WRITE_LO 0x02000000 |
410 | 6643d27e | bellard | /* Takes a trap (easier to keep out of delay slot). */
|
411 | 6643d27e | bellard | #define INSN_TRAP 0x04000000 |
412 | 6643d27e | bellard | /* Instruction stores value into memory. */
|
413 | 6643d27e | bellard | #define INSN_STORE_MEMORY 0x08000000 |
414 | 6643d27e | bellard | /* Instruction uses single precision floating point. */
|
415 | 6643d27e | bellard | #define FP_S 0x10000000 |
416 | 6643d27e | bellard | /* Instruction uses double precision floating point. */
|
417 | 6643d27e | bellard | #define FP_D 0x20000000 |
418 | 6643d27e | bellard | /* Instruction is part of the tx39's integer multiply family. */
|
419 | 6643d27e | bellard | #define INSN_MULT 0x40000000 |
420 | 6643d27e | bellard | /* Instruction synchronize shared memory. */
|
421 | 6643d27e | bellard | #define INSN_SYNC 0x80000000 |
422 | 6643d27e | bellard | /* Instruction reads MDMX accumulator. XXX FIXME: No bits left! */
|
423 | 6643d27e | bellard | #define INSN_READ_MDMX_ACC 0 |
424 | 6643d27e | bellard | /* Instruction writes MDMX accumulator. XXX FIXME: No bits left! */
|
425 | 6643d27e | bellard | #define INSN_WRITE_MDMX_ACC 0 |
426 | 6643d27e | bellard | |
427 | 6643d27e | bellard | /* Instruction is actually a macro. It should be ignored by the
|
428 | 6643d27e | bellard | disassembler, and requires special treatment by the assembler. */
|
429 | 6643d27e | bellard | #define INSN_MACRO 0xffffffff |
430 | 6643d27e | bellard | |
431 | 6643d27e | bellard | /* Masks used to mark instructions to indicate which MIPS ISA level
|
432 | 6643d27e | bellard | they were introduced in. ISAs, as defined below, are logical
|
433 | 6643d27e | bellard | ORs of these bits, indicating that they support the instructions
|
434 | 6643d27e | bellard | defined at the given level. */
|
435 | 6643d27e | bellard | |
436 | 6643d27e | bellard | #define INSN_ISA_MASK 0x00000fff |
437 | 6643d27e | bellard | #define INSN_ISA1 0x00000001 |
438 | 6643d27e | bellard | #define INSN_ISA2 0x00000002 |
439 | 6643d27e | bellard | #define INSN_ISA3 0x00000004 |
440 | 6643d27e | bellard | #define INSN_ISA4 0x00000008 |
441 | 6643d27e | bellard | #define INSN_ISA5 0x00000010 |
442 | 6643d27e | bellard | #define INSN_ISA32 0x00000020 |
443 | 6643d27e | bellard | #define INSN_ISA64 0x00000040 |
444 | 6643d27e | bellard | #define INSN_ISA32R2 0x00000080 |
445 | 6643d27e | bellard | #define INSN_ISA64R2 0x00000100 |
446 | 6643d27e | bellard | |
447 | 6643d27e | bellard | /* Masks used for MIPS-defined ASEs. */
|
448 | 6643d27e | bellard | #define INSN_ASE_MASK 0x0000f000 |
449 | 6643d27e | bellard | |
450 | 6643d27e | bellard | /* MIPS 16 ASE */
|
451 | 6643d27e | bellard | #define INSN_MIPS16 0x00002000 |
452 | 6643d27e | bellard | /* MIPS-3D ASE */
|
453 | 6643d27e | bellard | #define INSN_MIPS3D 0x00004000 |
454 | 6643d27e | bellard | /* MDMX ASE */
|
455 | 6643d27e | bellard | #define INSN_MDMX 0x00008000 |
456 | 6643d27e | bellard | |
457 | 6643d27e | bellard | /* Chip specific instructions. These are bitmasks. */
|
458 | 6643d27e | bellard | |
459 | 6643d27e | bellard | /* MIPS R4650 instruction. */
|
460 | 6643d27e | bellard | #define INSN_4650 0x00010000 |
461 | 6643d27e | bellard | /* LSI R4010 instruction. */
|
462 | 6643d27e | bellard | #define INSN_4010 0x00020000 |
463 | 6643d27e | bellard | /* NEC VR4100 instruction. */
|
464 | 6643d27e | bellard | #define INSN_4100 0x00040000 |
465 | 6643d27e | bellard | /* Toshiba R3900 instruction. */
|
466 | 6643d27e | bellard | #define INSN_3900 0x00080000 |
467 | 6643d27e | bellard | /* MIPS R10000 instruction. */
|
468 | 6643d27e | bellard | #define INSN_10000 0x00100000 |
469 | 6643d27e | bellard | /* Broadcom SB-1 instruction. */
|
470 | 6643d27e | bellard | #define INSN_SB1 0x00200000 |
471 | 6643d27e | bellard | /* NEC VR4111/VR4181 instruction. */
|
472 | 6643d27e | bellard | #define INSN_4111 0x00400000 |
473 | 6643d27e | bellard | /* NEC VR4120 instruction. */
|
474 | 6643d27e | bellard | #define INSN_4120 0x00800000 |
475 | 6643d27e | bellard | /* NEC VR5400 instruction. */
|
476 | 6643d27e | bellard | #define INSN_5400 0x01000000 |
477 | 6643d27e | bellard | /* NEC VR5500 instruction. */
|
478 | 6643d27e | bellard | #define INSN_5500 0x02000000 |
479 | 6643d27e | bellard | |
480 | 6643d27e | bellard | /* MIPS ISA defines, use instead of hardcoding ISA level. */
|
481 | 6643d27e | bellard | |
482 | 6643d27e | bellard | #define ISA_UNKNOWN 0 /* Gas internal use. */ |
483 | 6643d27e | bellard | #define ISA_MIPS1 (INSN_ISA1)
|
484 | 6643d27e | bellard | #define ISA_MIPS2 (ISA_MIPS1 | INSN_ISA2)
|
485 | 6643d27e | bellard | #define ISA_MIPS3 (ISA_MIPS2 | INSN_ISA3)
|
486 | 6643d27e | bellard | #define ISA_MIPS4 (ISA_MIPS3 | INSN_ISA4)
|
487 | 6643d27e | bellard | #define ISA_MIPS5 (ISA_MIPS4 | INSN_ISA5)
|
488 | 6643d27e | bellard | |
489 | 6643d27e | bellard | #define ISA_MIPS32 (ISA_MIPS2 | INSN_ISA32)
|
490 | 6643d27e | bellard | #define ISA_MIPS64 (ISA_MIPS5 | INSN_ISA32 | INSN_ISA64)
|
491 | 6643d27e | bellard | |
492 | 6643d27e | bellard | #define ISA_MIPS32R2 (ISA_MIPS32 | INSN_ISA32R2)
|
493 | 6643d27e | bellard | #define ISA_MIPS64R2 (ISA_MIPS64 | INSN_ISA32R2 | INSN_ISA64R2)
|
494 | 6643d27e | bellard | |
495 | 6643d27e | bellard | |
496 | 6643d27e | bellard | /* CPU defines, use instead of hardcoding processor number. Keep this
|
497 | 6643d27e | bellard | in sync with bfd/archures.c in order for machine selection to work. */
|
498 | 6643d27e | bellard | #define CPU_UNKNOWN 0 /* Gas internal use. */ |
499 | 6643d27e | bellard | #define CPU_R3000 3000 |
500 | 6643d27e | bellard | #define CPU_R3900 3900 |
501 | 6643d27e | bellard | #define CPU_R4000 4000 |
502 | 6643d27e | bellard | #define CPU_R4010 4010 |
503 | 6643d27e | bellard | #define CPU_VR4100 4100 |
504 | 6643d27e | bellard | #define CPU_R4111 4111 |
505 | 6643d27e | bellard | #define CPU_VR4120 4120 |
506 | 6643d27e | bellard | #define CPU_R4300 4300 |
507 | 6643d27e | bellard | #define CPU_R4400 4400 |
508 | 6643d27e | bellard | #define CPU_R4600 4600 |
509 | 6643d27e | bellard | #define CPU_R4650 4650 |
510 | 6643d27e | bellard | #define CPU_R5000 5000 |
511 | 6643d27e | bellard | #define CPU_VR5400 5400 |
512 | 6643d27e | bellard | #define CPU_VR5500 5500 |
513 | 6643d27e | bellard | #define CPU_R6000 6000 |
514 | 6643d27e | bellard | #define CPU_RM7000 7000 |
515 | 6643d27e | bellard | #define CPU_R8000 8000 |
516 | 6643d27e | bellard | #define CPU_R10000 10000 |
517 | 6643d27e | bellard | #define CPU_R12000 12000 |
518 | 6643d27e | bellard | #define CPU_MIPS16 16 |
519 | 6643d27e | bellard | #define CPU_MIPS32 32 |
520 | 6643d27e | bellard | #define CPU_MIPS32R2 33 |
521 | 6643d27e | bellard | #define CPU_MIPS5 5 |
522 | 6643d27e | bellard | #define CPU_MIPS64 64 |
523 | 6643d27e | bellard | #define CPU_MIPS64R2 65 |
524 | 6643d27e | bellard | #define CPU_SB1 12310201 /* octal 'SB', 01. */ |
525 | 6643d27e | bellard | |
526 | 6643d27e | bellard | /* Test for membership in an ISA including chip specific ISAs. INSN
|
527 | 6643d27e | bellard | is pointer to an element of the opcode table; ISA is the specified
|
528 | 6643d27e | bellard | ISA/ASE bitmask to test against; and CPU is the CPU specific ISA to
|
529 | 6643d27e | bellard | test, or zero if no CPU specific ISA test is desired. */
|
530 | 6643d27e | bellard | |
531 | 42fe4044 | bellard | #if 0
|
532 | 6643d27e | bellard | #define OPCODE_IS_MEMBER(insn, isa, cpu) \
|
533 | 6643d27e | bellard | (((insn)->membership & isa) != 0 \
|
534 | 6643d27e | bellard | || (cpu == CPU_R4650 && ((insn)->membership & INSN_4650) != 0) \
|
535 | 6643d27e | bellard | || (cpu == CPU_RM7000 && ((insn)->membership & INSN_4650) != 0) \
|
536 | 6643d27e | bellard | || (cpu == CPU_R4010 && ((insn)->membership & INSN_4010) != 0) \
|
537 | 6643d27e | bellard | || (cpu == CPU_VR4100 && ((insn)->membership & INSN_4100) != 0) \
|
538 | 6643d27e | bellard | || (cpu == CPU_R3900 && ((insn)->membership & INSN_3900) != 0) \
|
539 | 6643d27e | bellard | || ((cpu == CPU_R10000 || cpu == CPU_R12000) \
|
540 | 6643d27e | bellard | && ((insn)->membership & INSN_10000) != 0) \
|
541 | 6643d27e | bellard | || (cpu == CPU_SB1 && ((insn)->membership & INSN_SB1) != 0) \
|
542 | 6643d27e | bellard | || (cpu == CPU_R4111 && ((insn)->membership & INSN_4111) != 0) \
|
543 | 6643d27e | bellard | || (cpu == CPU_VR4120 && ((insn)->membership & INSN_4120) != 0) \
|
544 | 6643d27e | bellard | || (cpu == CPU_VR5400 && ((insn)->membership & INSN_5400) != 0) \
|
545 | 6643d27e | bellard | || (cpu == CPU_VR5500 && ((insn)->membership & INSN_5500) != 0) \
|
546 | 6643d27e | bellard | || 0) /* Please keep this term for easier source merging. */
|
547 | 42fe4044 | bellard | #else
|
548 | 42fe4044 | bellard | #define OPCODE_IS_MEMBER(insn, isa, cpu) \
|
549 | 42fe4044 | bellard | (1 != 0) |
550 | 42fe4044 | bellard | #endif
|
551 | 6643d27e | bellard | |
552 | 6643d27e | bellard | /* This is a list of macro expanded instructions.
|
553 | 6643d27e | bellard | |
554 | 6643d27e | bellard | _I appended means immediate
|
555 | 6643d27e | bellard | _A appended means address
|
556 | 6643d27e | bellard | _AB appended means address with base register
|
557 | 6643d27e | bellard | _D appended means 64 bit floating point constant
|
558 | 6643d27e | bellard | _S appended means 32 bit floating point constant. */
|
559 | 6643d27e | bellard | |
560 | 6643d27e | bellard | enum
|
561 | 6643d27e | bellard | { |
562 | 6643d27e | bellard | M_ABS, |
563 | 6643d27e | bellard | M_ADD_I, |
564 | 6643d27e | bellard | M_ADDU_I, |
565 | 6643d27e | bellard | M_AND_I, |
566 | 6643d27e | bellard | M_BEQ, |
567 | 6643d27e | bellard | M_BEQ_I, |
568 | 6643d27e | bellard | M_BEQL_I, |
569 | 6643d27e | bellard | M_BGE, |
570 | 6643d27e | bellard | M_BGEL, |
571 | 6643d27e | bellard | M_BGE_I, |
572 | 6643d27e | bellard | M_BGEL_I, |
573 | 6643d27e | bellard | M_BGEU, |
574 | 6643d27e | bellard | M_BGEUL, |
575 | 6643d27e | bellard | M_BGEU_I, |
576 | 6643d27e | bellard | M_BGEUL_I, |
577 | 6643d27e | bellard | M_BGT, |
578 | 6643d27e | bellard | M_BGTL, |
579 | 6643d27e | bellard | M_BGT_I, |
580 | 6643d27e | bellard | M_BGTL_I, |
581 | 6643d27e | bellard | M_BGTU, |
582 | 6643d27e | bellard | M_BGTUL, |
583 | 6643d27e | bellard | M_BGTU_I, |
584 | 6643d27e | bellard | M_BGTUL_I, |
585 | 6643d27e | bellard | M_BLE, |
586 | 6643d27e | bellard | M_BLEL, |
587 | 6643d27e | bellard | M_BLE_I, |
588 | 6643d27e | bellard | M_BLEL_I, |
589 | 6643d27e | bellard | M_BLEU, |
590 | 6643d27e | bellard | M_BLEUL, |
591 | 6643d27e | bellard | M_BLEU_I, |
592 | 6643d27e | bellard | M_BLEUL_I, |
593 | 6643d27e | bellard | M_BLT, |
594 | 6643d27e | bellard | M_BLTL, |
595 | 6643d27e | bellard | M_BLT_I, |
596 | 6643d27e | bellard | M_BLTL_I, |
597 | 6643d27e | bellard | M_BLTU, |
598 | 6643d27e | bellard | M_BLTUL, |
599 | 6643d27e | bellard | M_BLTU_I, |
600 | 6643d27e | bellard | M_BLTUL_I, |
601 | 6643d27e | bellard | M_BNE, |
602 | 6643d27e | bellard | M_BNE_I, |
603 | 6643d27e | bellard | M_BNEL_I, |
604 | 6643d27e | bellard | M_DABS, |
605 | 6643d27e | bellard | M_DADD_I, |
606 | 6643d27e | bellard | M_DADDU_I, |
607 | 6643d27e | bellard | M_DDIV_3, |
608 | 6643d27e | bellard | M_DDIV_3I, |
609 | 6643d27e | bellard | M_DDIVU_3, |
610 | 6643d27e | bellard | M_DDIVU_3I, |
611 | 6643d27e | bellard | M_DEXT, |
612 | 6643d27e | bellard | M_DINS, |
613 | 6643d27e | bellard | M_DIV_3, |
614 | 6643d27e | bellard | M_DIV_3I, |
615 | 6643d27e | bellard | M_DIVU_3, |
616 | 6643d27e | bellard | M_DIVU_3I, |
617 | 6643d27e | bellard | M_DLA_AB, |
618 | 6643d27e | bellard | M_DLCA_AB, |
619 | 6643d27e | bellard | M_DLI, |
620 | 6643d27e | bellard | M_DMUL, |
621 | 6643d27e | bellard | M_DMUL_I, |
622 | 6643d27e | bellard | M_DMULO, |
623 | 6643d27e | bellard | M_DMULO_I, |
624 | 6643d27e | bellard | M_DMULOU, |
625 | 6643d27e | bellard | M_DMULOU_I, |
626 | 6643d27e | bellard | M_DREM_3, |
627 | 6643d27e | bellard | M_DREM_3I, |
628 | 6643d27e | bellard | M_DREMU_3, |
629 | 6643d27e | bellard | M_DREMU_3I, |
630 | 6643d27e | bellard | M_DSUB_I, |
631 | 6643d27e | bellard | M_DSUBU_I, |
632 | 6643d27e | bellard | M_DSUBU_I_2, |
633 | 6643d27e | bellard | M_J_A, |
634 | 6643d27e | bellard | M_JAL_1, |
635 | 6643d27e | bellard | M_JAL_2, |
636 | 6643d27e | bellard | M_JAL_A, |
637 | 6643d27e | bellard | M_L_DOB, |
638 | 6643d27e | bellard | M_L_DAB, |
639 | 6643d27e | bellard | M_LA_AB, |
640 | 6643d27e | bellard | M_LB_A, |
641 | 6643d27e | bellard | M_LB_AB, |
642 | 6643d27e | bellard | M_LBU_A, |
643 | 6643d27e | bellard | M_LBU_AB, |
644 | 6643d27e | bellard | M_LCA_AB, |
645 | 6643d27e | bellard | M_LD_A, |
646 | 6643d27e | bellard | M_LD_OB, |
647 | 6643d27e | bellard | M_LD_AB, |
648 | 6643d27e | bellard | M_LDC1_AB, |
649 | 6643d27e | bellard | M_LDC2_AB, |
650 | 6643d27e | bellard | M_LDC3_AB, |
651 | 6643d27e | bellard | M_LDL_AB, |
652 | 6643d27e | bellard | M_LDR_AB, |
653 | 6643d27e | bellard | M_LH_A, |
654 | 6643d27e | bellard | M_LH_AB, |
655 | 6643d27e | bellard | M_LHU_A, |
656 | 6643d27e | bellard | M_LHU_AB, |
657 | 6643d27e | bellard | M_LI, |
658 | 6643d27e | bellard | M_LI_D, |
659 | 6643d27e | bellard | M_LI_DD, |
660 | 6643d27e | bellard | M_LI_S, |
661 | 6643d27e | bellard | M_LI_SS, |
662 | 6643d27e | bellard | M_LL_AB, |
663 | 6643d27e | bellard | M_LLD_AB, |
664 | 6643d27e | bellard | M_LS_A, |
665 | 6643d27e | bellard | M_LW_A, |
666 | 6643d27e | bellard | M_LW_AB, |
667 | 6643d27e | bellard | M_LWC0_A, |
668 | 6643d27e | bellard | M_LWC0_AB, |
669 | 6643d27e | bellard | M_LWC1_A, |
670 | 6643d27e | bellard | M_LWC1_AB, |
671 | 6643d27e | bellard | M_LWC2_A, |
672 | 6643d27e | bellard | M_LWC2_AB, |
673 | 6643d27e | bellard | M_LWC3_A, |
674 | 6643d27e | bellard | M_LWC3_AB, |
675 | 6643d27e | bellard | M_LWL_A, |
676 | 6643d27e | bellard | M_LWL_AB, |
677 | 6643d27e | bellard | M_LWR_A, |
678 | 6643d27e | bellard | M_LWR_AB, |
679 | 6643d27e | bellard | M_LWU_AB, |
680 | 6643d27e | bellard | M_MOVE, |
681 | 6643d27e | bellard | M_MUL, |
682 | 6643d27e | bellard | M_MUL_I, |
683 | 6643d27e | bellard | M_MULO, |
684 | 6643d27e | bellard | M_MULO_I, |
685 | 6643d27e | bellard | M_MULOU, |
686 | 6643d27e | bellard | M_MULOU_I, |
687 | 6643d27e | bellard | M_NOR_I, |
688 | 6643d27e | bellard | M_OR_I, |
689 | 6643d27e | bellard | M_REM_3, |
690 | 6643d27e | bellard | M_REM_3I, |
691 | 6643d27e | bellard | M_REMU_3, |
692 | 6643d27e | bellard | M_REMU_3I, |
693 | 6643d27e | bellard | M_DROL, |
694 | 6643d27e | bellard | M_ROL, |
695 | 6643d27e | bellard | M_DROL_I, |
696 | 6643d27e | bellard | M_ROL_I, |
697 | 6643d27e | bellard | M_DROR, |
698 | 6643d27e | bellard | M_ROR, |
699 | 6643d27e | bellard | M_DROR_I, |
700 | 6643d27e | bellard | M_ROR_I, |
701 | 6643d27e | bellard | M_S_DA, |
702 | 6643d27e | bellard | M_S_DOB, |
703 | 6643d27e | bellard | M_S_DAB, |
704 | 6643d27e | bellard | M_S_S, |
705 | 6643d27e | bellard | M_SC_AB, |
706 | 6643d27e | bellard | M_SCD_AB, |
707 | 6643d27e | bellard | M_SD_A, |
708 | 6643d27e | bellard | M_SD_OB, |
709 | 6643d27e | bellard | M_SD_AB, |
710 | 6643d27e | bellard | M_SDC1_AB, |
711 | 6643d27e | bellard | M_SDC2_AB, |
712 | 6643d27e | bellard | M_SDC3_AB, |
713 | 6643d27e | bellard | M_SDL_AB, |
714 | 6643d27e | bellard | M_SDR_AB, |
715 | 6643d27e | bellard | M_SEQ, |
716 | 6643d27e | bellard | M_SEQ_I, |
717 | 6643d27e | bellard | M_SGE, |
718 | 6643d27e | bellard | M_SGE_I, |
719 | 6643d27e | bellard | M_SGEU, |
720 | 6643d27e | bellard | M_SGEU_I, |
721 | 6643d27e | bellard | M_SGT, |
722 | 6643d27e | bellard | M_SGT_I, |
723 | 6643d27e | bellard | M_SGTU, |
724 | 6643d27e | bellard | M_SGTU_I, |
725 | 6643d27e | bellard | M_SLE, |
726 | 6643d27e | bellard | M_SLE_I, |
727 | 6643d27e | bellard | M_SLEU, |
728 | 6643d27e | bellard | M_SLEU_I, |
729 | 6643d27e | bellard | M_SLT_I, |
730 | 6643d27e | bellard | M_SLTU_I, |
731 | 6643d27e | bellard | M_SNE, |
732 | 6643d27e | bellard | M_SNE_I, |
733 | 6643d27e | bellard | M_SB_A, |
734 | 6643d27e | bellard | M_SB_AB, |
735 | 6643d27e | bellard | M_SH_A, |
736 | 6643d27e | bellard | M_SH_AB, |
737 | 6643d27e | bellard | M_SW_A, |
738 | 6643d27e | bellard | M_SW_AB, |
739 | 6643d27e | bellard | M_SWC0_A, |
740 | 6643d27e | bellard | M_SWC0_AB, |
741 | 6643d27e | bellard | M_SWC1_A, |
742 | 6643d27e | bellard | M_SWC1_AB, |
743 | 6643d27e | bellard | M_SWC2_A, |
744 | 6643d27e | bellard | M_SWC2_AB, |
745 | 6643d27e | bellard | M_SWC3_A, |
746 | 6643d27e | bellard | M_SWC3_AB, |
747 | 6643d27e | bellard | M_SWL_A, |
748 | 6643d27e | bellard | M_SWL_AB, |
749 | 6643d27e | bellard | M_SWR_A, |
750 | 6643d27e | bellard | M_SWR_AB, |
751 | 6643d27e | bellard | M_SUB_I, |
752 | 6643d27e | bellard | M_SUBU_I, |
753 | 6643d27e | bellard | M_SUBU_I_2, |
754 | 6643d27e | bellard | M_TEQ_I, |
755 | 6643d27e | bellard | M_TGE_I, |
756 | 6643d27e | bellard | M_TGEU_I, |
757 | 6643d27e | bellard | M_TLT_I, |
758 | 6643d27e | bellard | M_TLTU_I, |
759 | 6643d27e | bellard | M_TNE_I, |
760 | 6643d27e | bellard | M_TRUNCWD, |
761 | 6643d27e | bellard | M_TRUNCWS, |
762 | 6643d27e | bellard | M_ULD, |
763 | 6643d27e | bellard | M_ULD_A, |
764 | 6643d27e | bellard | M_ULH, |
765 | 6643d27e | bellard | M_ULH_A, |
766 | 6643d27e | bellard | M_ULHU, |
767 | 6643d27e | bellard | M_ULHU_A, |
768 | 6643d27e | bellard | M_ULW, |
769 | 6643d27e | bellard | M_ULW_A, |
770 | 6643d27e | bellard | M_USH, |
771 | 6643d27e | bellard | M_USH_A, |
772 | 6643d27e | bellard | M_USW, |
773 | 6643d27e | bellard | M_USW_A, |
774 | 6643d27e | bellard | M_USD, |
775 | 6643d27e | bellard | M_USD_A, |
776 | 6643d27e | bellard | M_XOR_I, |
777 | 6643d27e | bellard | M_COP0, |
778 | 6643d27e | bellard | M_COP1, |
779 | 6643d27e | bellard | M_COP2, |
780 | 6643d27e | bellard | M_COP3, |
781 | 6643d27e | bellard | M_NUM_MACROS |
782 | 6643d27e | bellard | }; |
783 | 6643d27e | bellard | |
784 | 6643d27e | bellard | |
785 | 6643d27e | bellard | /* The order of overloaded instructions matters. Label arguments and
|
786 | 6643d27e | bellard | register arguments look the same. Instructions that can have either
|
787 | 6643d27e | bellard | for arguments must apear in the correct order in this table for the
|
788 | 6643d27e | bellard | assembler to pick the right one. In other words, entries with
|
789 | 6643d27e | bellard | immediate operands must apear after the same instruction with
|
790 | 6643d27e | bellard | registers.
|
791 | 6643d27e | bellard | |
792 | 6643d27e | bellard | Many instructions are short hand for other instructions (i.e., The
|
793 | 6643d27e | bellard | jal <register> instruction is short for jalr <register>). */
|
794 | 6643d27e | bellard | |
795 | 6643d27e | bellard | extern const struct mips_opcode mips_builtin_opcodes[]; |
796 | 6643d27e | bellard | extern const int bfd_mips_num_builtin_opcodes; |
797 | 6643d27e | bellard | extern struct mips_opcode *mips_opcodes; |
798 | 6643d27e | bellard | extern int bfd_mips_num_opcodes; |
799 | 6643d27e | bellard | #define NUMOPCODES bfd_mips_num_opcodes
|
800 | 6643d27e | bellard | |
801 | 6643d27e | bellard | |
802 | 6643d27e | bellard | /* The rest of this file adds definitions for the mips16 TinyRISC
|
803 | 6643d27e | bellard | processor. */
|
804 | 6643d27e | bellard | |
805 | 6643d27e | bellard | /* These are the bitmasks and shift counts used for the different
|
806 | 6643d27e | bellard | fields in the instruction formats. Other than OP, no masks are
|
807 | 6643d27e | bellard | provided for the fixed portions of an instruction, since they are
|
808 | 6643d27e | bellard | not needed.
|
809 | 6643d27e | bellard | |
810 | 6643d27e | bellard | The I format uses IMM11.
|
811 | 6643d27e | bellard | |
812 | 6643d27e | bellard | The RI format uses RX and IMM8.
|
813 | 6643d27e | bellard | |
814 | 6643d27e | bellard | The RR format uses RX, and RY.
|
815 | 6643d27e | bellard | |
816 | 6643d27e | bellard | The RRI format uses RX, RY, and IMM5.
|
817 | 6643d27e | bellard | |
818 | 6643d27e | bellard | The RRR format uses RX, RY, and RZ.
|
819 | 6643d27e | bellard | |
820 | 6643d27e | bellard | The RRI_A format uses RX, RY, and IMM4.
|
821 | 6643d27e | bellard | |
822 | 6643d27e | bellard | The SHIFT format uses RX, RY, and SHAMT.
|
823 | 6643d27e | bellard | |
824 | 6643d27e | bellard | The I8 format uses IMM8.
|
825 | 6643d27e | bellard | |
826 | 6643d27e | bellard | The I8_MOVR32 format uses RY and REGR32.
|
827 | 6643d27e | bellard | |
828 | 6643d27e | bellard | The IR_MOV32R format uses REG32R and MOV32Z.
|
829 | 6643d27e | bellard | |
830 | 6643d27e | bellard | The I64 format uses IMM8.
|
831 | 6643d27e | bellard | |
832 | 6643d27e | bellard | The RI64 format uses RY and IMM5.
|
833 | 6643d27e | bellard | */
|
834 | 6643d27e | bellard | |
835 | 6643d27e | bellard | #define MIPS16OP_MASK_OP 0x1f |
836 | 6643d27e | bellard | #define MIPS16OP_SH_OP 11 |
837 | 6643d27e | bellard | #define MIPS16OP_MASK_IMM11 0x7ff |
838 | 6643d27e | bellard | #define MIPS16OP_SH_IMM11 0 |
839 | 6643d27e | bellard | #define MIPS16OP_MASK_RX 0x7 |
840 | 6643d27e | bellard | #define MIPS16OP_SH_RX 8 |
841 | 6643d27e | bellard | #define MIPS16OP_MASK_IMM8 0xff |
842 | 6643d27e | bellard | #define MIPS16OP_SH_IMM8 0 |
843 | 6643d27e | bellard | #define MIPS16OP_MASK_RY 0x7 |
844 | 6643d27e | bellard | #define MIPS16OP_SH_RY 5 |
845 | 6643d27e | bellard | #define MIPS16OP_MASK_IMM5 0x1f |
846 | 6643d27e | bellard | #define MIPS16OP_SH_IMM5 0 |
847 | 6643d27e | bellard | #define MIPS16OP_MASK_RZ 0x7 |
848 | 6643d27e | bellard | #define MIPS16OP_SH_RZ 2 |
849 | 6643d27e | bellard | #define MIPS16OP_MASK_IMM4 0xf |
850 | 6643d27e | bellard | #define MIPS16OP_SH_IMM4 0 |
851 | 6643d27e | bellard | #define MIPS16OP_MASK_REGR32 0x1f |
852 | 6643d27e | bellard | #define MIPS16OP_SH_REGR32 0 |
853 | 6643d27e | bellard | #define MIPS16OP_MASK_REG32R 0x1f |
854 | 6643d27e | bellard | #define MIPS16OP_SH_REG32R 3 |
855 | 6643d27e | bellard | #define MIPS16OP_EXTRACT_REG32R(i) ((((i) >> 5) & 7) | ((i) & 0x18)) |
856 | 6643d27e | bellard | #define MIPS16OP_MASK_MOVE32Z 0x7 |
857 | 6643d27e | bellard | #define MIPS16OP_SH_MOVE32Z 0 |
858 | 6643d27e | bellard | #define MIPS16OP_MASK_IMM6 0x3f |
859 | 6643d27e | bellard | #define MIPS16OP_SH_IMM6 5 |
860 | 6643d27e | bellard | |
861 | 6643d27e | bellard | /* These are the characters which may appears in the args field of an
|
862 | 6643d27e | bellard | instruction. They appear in the order in which the fields appear
|
863 | 6643d27e | bellard | when the instruction is used. Commas and parentheses in the args
|
864 | 6643d27e | bellard | string are ignored when assembling, and written into the output
|
865 | 6643d27e | bellard | when disassembling.
|
866 | 6643d27e | bellard | |
867 | 6643d27e | bellard | "y" 3 bit register (MIPS16OP_*_RY)
|
868 | 6643d27e | bellard | "x" 3 bit register (MIPS16OP_*_RX)
|
869 | 6643d27e | bellard | "z" 3 bit register (MIPS16OP_*_RZ)
|
870 | 6643d27e | bellard | "Z" 3 bit register (MIPS16OP_*_MOVE32Z)
|
871 | 6643d27e | bellard | "v" 3 bit same register as source and destination (MIPS16OP_*_RX)
|
872 | 6643d27e | bellard | "w" 3 bit same register as source and destination (MIPS16OP_*_RY)
|
873 | 6643d27e | bellard | "0" zero register ($0)
|
874 | 6643d27e | bellard | "S" stack pointer ($sp or $29)
|
875 | 6643d27e | bellard | "P" program counter
|
876 | 6643d27e | bellard | "R" return address register ($ra or $31)
|
877 | 6643d27e | bellard | "X" 5 bit MIPS register (MIPS16OP_*_REGR32)
|
878 | 6643d27e | bellard | "Y" 5 bit MIPS register (MIPS16OP_*_REG32R)
|
879 | 6643d27e | bellard | "6" 6 bit unsigned break code (MIPS16OP_*_IMM6)
|
880 | 6643d27e | bellard | "a" 26 bit jump address
|
881 | 6643d27e | bellard | "e" 11 bit extension value
|
882 | 6643d27e | bellard | "l" register list for entry instruction
|
883 | 6643d27e | bellard | "L" register list for exit instruction
|
884 | 6643d27e | bellard | |
885 | 6643d27e | bellard | The remaining codes may be extended. Except as otherwise noted,
|
886 | 6643d27e | bellard | the full extended operand is a 16 bit signed value.
|
887 | 6643d27e | bellard | "<" 3 bit unsigned shift count * 0 (MIPS16OP_*_RZ) (full 5 bit unsigned)
|
888 | 6643d27e | bellard | ">" 3 bit unsigned shift count * 0 (MIPS16OP_*_RX) (full 5 bit unsigned)
|
889 | 6643d27e | bellard | "[" 3 bit unsigned shift count * 0 (MIPS16OP_*_RZ) (full 6 bit unsigned)
|
890 | 6643d27e | bellard | "]" 3 bit unsigned shift count * 0 (MIPS16OP_*_RX) (full 6 bit unsigned)
|
891 | 6643d27e | bellard | "4" 4 bit signed immediate * 0 (MIPS16OP_*_IMM4) (full 15 bit signed)
|
892 | 6643d27e | bellard | "5" 5 bit unsigned immediate * 0 (MIPS16OP_*_IMM5)
|
893 | 6643d27e | bellard | "H" 5 bit unsigned immediate * 2 (MIPS16OP_*_IMM5)
|
894 | 6643d27e | bellard | "W" 5 bit unsigned immediate * 4 (MIPS16OP_*_IMM5)
|
895 | 6643d27e | bellard | "D" 5 bit unsigned immediate * 8 (MIPS16OP_*_IMM5)
|
896 | 6643d27e | bellard | "j" 5 bit signed immediate * 0 (MIPS16OP_*_IMM5)
|
897 | 6643d27e | bellard | "8" 8 bit unsigned immediate * 0 (MIPS16OP_*_IMM8)
|
898 | 6643d27e | bellard | "V" 8 bit unsigned immediate * 4 (MIPS16OP_*_IMM8)
|
899 | 6643d27e | bellard | "C" 8 bit unsigned immediate * 8 (MIPS16OP_*_IMM8)
|
900 | 6643d27e | bellard | "U" 8 bit unsigned immediate * 0 (MIPS16OP_*_IMM8) (full 16 bit unsigned)
|
901 | 6643d27e | bellard | "k" 8 bit signed immediate * 0 (MIPS16OP_*_IMM8)
|
902 | 6643d27e | bellard | "K" 8 bit signed immediate * 8 (MIPS16OP_*_IMM8)
|
903 | 6643d27e | bellard | "p" 8 bit conditional branch address (MIPS16OP_*_IMM8)
|
904 | 6643d27e | bellard | "q" 11 bit branch address (MIPS16OP_*_IMM11)
|
905 | 6643d27e | bellard | "A" 8 bit PC relative address * 4 (MIPS16OP_*_IMM8)
|
906 | 6643d27e | bellard | "B" 5 bit PC relative address * 8 (MIPS16OP_*_IMM5)
|
907 | 6643d27e | bellard | "E" 5 bit PC relative address * 4 (MIPS16OP_*_IMM5)
|
908 | 6643d27e | bellard | */
|
909 | 6643d27e | bellard | |
910 | 6643d27e | bellard | /* For the mips16, we use the same opcode table format and a few of
|
911 | 6643d27e | bellard | the same flags. However, most of the flags are different. */
|
912 | 6643d27e | bellard | |
913 | 6643d27e | bellard | /* Modifies the register in MIPS16OP_*_RX. */
|
914 | 6643d27e | bellard | #define MIPS16_INSN_WRITE_X 0x00000001 |
915 | 6643d27e | bellard | /* Modifies the register in MIPS16OP_*_RY. */
|
916 | 6643d27e | bellard | #define MIPS16_INSN_WRITE_Y 0x00000002 |
917 | 6643d27e | bellard | /* Modifies the register in MIPS16OP_*_RZ. */
|
918 | 6643d27e | bellard | #define MIPS16_INSN_WRITE_Z 0x00000004 |
919 | 6643d27e | bellard | /* Modifies the T ($24) register. */
|
920 | 6643d27e | bellard | #define MIPS16_INSN_WRITE_T 0x00000008 |
921 | 6643d27e | bellard | /* Modifies the SP ($29) register. */
|
922 | 6643d27e | bellard | #define MIPS16_INSN_WRITE_SP 0x00000010 |
923 | 6643d27e | bellard | /* Modifies the RA ($31) register. */
|
924 | 6643d27e | bellard | #define MIPS16_INSN_WRITE_31 0x00000020 |
925 | 6643d27e | bellard | /* Modifies the general purpose register in MIPS16OP_*_REG32R. */
|
926 | 6643d27e | bellard | #define MIPS16_INSN_WRITE_GPR_Y 0x00000040 |
927 | 6643d27e | bellard | /* Reads the register in MIPS16OP_*_RX. */
|
928 | 6643d27e | bellard | #define MIPS16_INSN_READ_X 0x00000080 |
929 | 6643d27e | bellard | /* Reads the register in MIPS16OP_*_RY. */
|
930 | 6643d27e | bellard | #define MIPS16_INSN_READ_Y 0x00000100 |
931 | 6643d27e | bellard | /* Reads the register in MIPS16OP_*_MOVE32Z. */
|
932 | 6643d27e | bellard | #define MIPS16_INSN_READ_Z 0x00000200 |
933 | 6643d27e | bellard | /* Reads the T ($24) register. */
|
934 | 6643d27e | bellard | #define MIPS16_INSN_READ_T 0x00000400 |
935 | 6643d27e | bellard | /* Reads the SP ($29) register. */
|
936 | 6643d27e | bellard | #define MIPS16_INSN_READ_SP 0x00000800 |
937 | 6643d27e | bellard | /* Reads the RA ($31) register. */
|
938 | 6643d27e | bellard | #define MIPS16_INSN_READ_31 0x00001000 |
939 | 6643d27e | bellard | /* Reads the program counter. */
|
940 | 6643d27e | bellard | #define MIPS16_INSN_READ_PC 0x00002000 |
941 | 6643d27e | bellard | /* Reads the general purpose register in MIPS16OP_*_REGR32. */
|
942 | 6643d27e | bellard | #define MIPS16_INSN_READ_GPR_X 0x00004000 |
943 | 6643d27e | bellard | /* Is a branch insn. */
|
944 | 6643d27e | bellard | #define MIPS16_INSN_BRANCH 0x00010000 |
945 | 6643d27e | bellard | |
946 | 6643d27e | bellard | /* The following flags have the same value for the mips16 opcode
|
947 | 6643d27e | bellard | table:
|
948 | 6643d27e | bellard | INSN_UNCOND_BRANCH_DELAY
|
949 | 6643d27e | bellard | INSN_COND_BRANCH_DELAY
|
950 | 6643d27e | bellard | INSN_COND_BRANCH_LIKELY (never used)
|
951 | 6643d27e | bellard | INSN_READ_HI
|
952 | 6643d27e | bellard | INSN_READ_LO
|
953 | 6643d27e | bellard | INSN_WRITE_HI
|
954 | 6643d27e | bellard | INSN_WRITE_LO
|
955 | 6643d27e | bellard | INSN_TRAP
|
956 | 6643d27e | bellard | INSN_ISA3
|
957 | 6643d27e | bellard | */
|
958 | 6643d27e | bellard | |
959 | 6643d27e | bellard | extern const struct mips_opcode mips16_opcodes[]; |
960 | 6643d27e | bellard | extern const int bfd_mips16_num_opcodes; |
961 | 6643d27e | bellard | |
962 | 6643d27e | bellard | /* Short hand so the lines aren't too long. */
|
963 | 6643d27e | bellard | |
964 | 6643d27e | bellard | #define LDD INSN_LOAD_MEMORY_DELAY
|
965 | 6643d27e | bellard | #define LCD INSN_LOAD_COPROC_DELAY
|
966 | 6643d27e | bellard | #define UBD INSN_UNCOND_BRANCH_DELAY
|
967 | 6643d27e | bellard | #define CBD INSN_COND_BRANCH_DELAY
|
968 | 6643d27e | bellard | #define COD INSN_COPROC_MOVE_DELAY
|
969 | 6643d27e | bellard | #define CLD INSN_COPROC_MEMORY_DELAY
|
970 | 6643d27e | bellard | #define CBL INSN_COND_BRANCH_LIKELY
|
971 | 6643d27e | bellard | #define TRAP INSN_TRAP
|
972 | 6643d27e | bellard | #define SM INSN_STORE_MEMORY
|
973 | 6643d27e | bellard | |
974 | 6643d27e | bellard | #define WR_d INSN_WRITE_GPR_D
|
975 | 6643d27e | bellard | #define WR_t INSN_WRITE_GPR_T
|
976 | 6643d27e | bellard | #define WR_31 INSN_WRITE_GPR_31
|
977 | 6643d27e | bellard | #define WR_D INSN_WRITE_FPR_D
|
978 | 6643d27e | bellard | #define WR_T INSN_WRITE_FPR_T
|
979 | 6643d27e | bellard | #define WR_S INSN_WRITE_FPR_S
|
980 | 6643d27e | bellard | #define RD_s INSN_READ_GPR_S
|
981 | 6643d27e | bellard | #define RD_b INSN_READ_GPR_S
|
982 | 6643d27e | bellard | #define RD_t INSN_READ_GPR_T
|
983 | 6643d27e | bellard | #define RD_S INSN_READ_FPR_S
|
984 | 6643d27e | bellard | #define RD_T INSN_READ_FPR_T
|
985 | 6643d27e | bellard | #define RD_R INSN_READ_FPR_R
|
986 | 6643d27e | bellard | #define WR_CC INSN_WRITE_COND_CODE
|
987 | 6643d27e | bellard | #define RD_CC INSN_READ_COND_CODE
|
988 | 6643d27e | bellard | #define RD_C0 INSN_COP
|
989 | 6643d27e | bellard | #define RD_C1 INSN_COP
|
990 | 6643d27e | bellard | #define RD_C2 INSN_COP
|
991 | 6643d27e | bellard | #define RD_C3 INSN_COP
|
992 | 6643d27e | bellard | #define WR_C0 INSN_COP
|
993 | 6643d27e | bellard | #define WR_C1 INSN_COP
|
994 | 6643d27e | bellard | #define WR_C2 INSN_COP
|
995 | 6643d27e | bellard | #define WR_C3 INSN_COP
|
996 | 6643d27e | bellard | |
997 | 6643d27e | bellard | #define WR_HI INSN_WRITE_HI
|
998 | 6643d27e | bellard | #define RD_HI INSN_READ_HI
|
999 | 6643d27e | bellard | #define MOD_HI WR_HI|RD_HI
|
1000 | 6643d27e | bellard | |
1001 | 6643d27e | bellard | #define WR_LO INSN_WRITE_LO
|
1002 | 6643d27e | bellard | #define RD_LO INSN_READ_LO
|
1003 | 6643d27e | bellard | #define MOD_LO WR_LO|RD_LO
|
1004 | 6643d27e | bellard | |
1005 | 6643d27e | bellard | #define WR_HILO WR_HI|WR_LO
|
1006 | 6643d27e | bellard | #define RD_HILO RD_HI|RD_LO
|
1007 | 6643d27e | bellard | #define MOD_HILO WR_HILO|RD_HILO
|
1008 | 6643d27e | bellard | |
1009 | 6643d27e | bellard | #define IS_M INSN_MULT
|
1010 | 6643d27e | bellard | |
1011 | 6643d27e | bellard | #define WR_MACC INSN_WRITE_MDMX_ACC
|
1012 | 6643d27e | bellard | #define RD_MACC INSN_READ_MDMX_ACC
|
1013 | 6643d27e | bellard | |
1014 | 6643d27e | bellard | #define I1 INSN_ISA1
|
1015 | 6643d27e | bellard | #define I2 INSN_ISA2
|
1016 | 6643d27e | bellard | #define I3 INSN_ISA3
|
1017 | 6643d27e | bellard | #define I4 INSN_ISA4
|
1018 | 6643d27e | bellard | #define I5 INSN_ISA5
|
1019 | 6643d27e | bellard | #define I32 INSN_ISA32
|
1020 | 6643d27e | bellard | #define I64 INSN_ISA64
|
1021 | 6643d27e | bellard | #define I33 INSN_ISA32R2
|
1022 | 6643d27e | bellard | #define I65 INSN_ISA64R2
|
1023 | 6643d27e | bellard | |
1024 | 6643d27e | bellard | /* MIPS64 MIPS-3D ASE support. */
|
1025 | 6643d27e | bellard | #define I16 INSN_MIPS16
|
1026 | 6643d27e | bellard | |
1027 | 6643d27e | bellard | /* MIPS64 MIPS-3D ASE support. */
|
1028 | 6643d27e | bellard | #define M3D INSN_MIPS3D
|
1029 | 6643d27e | bellard | |
1030 | 6643d27e | bellard | /* MIPS64 MDMX ASE support. */
|
1031 | 6643d27e | bellard | #define MX INSN_MDMX
|
1032 | 6643d27e | bellard | |
1033 | 6643d27e | bellard | #define P3 INSN_4650
|
1034 | 6643d27e | bellard | #define L1 INSN_4010
|
1035 | 6643d27e | bellard | #define V1 (INSN_4100 | INSN_4111 | INSN_4120)
|
1036 | 6643d27e | bellard | #define T3 INSN_3900
|
1037 | 6643d27e | bellard | #define M1 INSN_10000
|
1038 | 6643d27e | bellard | #define SB1 INSN_SB1
|
1039 | 6643d27e | bellard | #define N411 INSN_4111
|
1040 | 6643d27e | bellard | #define N412 INSN_4120
|
1041 | 6643d27e | bellard | #define N5 (INSN_5400 | INSN_5500)
|
1042 | 6643d27e | bellard | #define N54 INSN_5400
|
1043 | 6643d27e | bellard | #define N55 INSN_5500
|
1044 | 6643d27e | bellard | |
1045 | 6643d27e | bellard | #define G1 (T3 \
|
1046 | 6643d27e | bellard | ) |
1047 | 6643d27e | bellard | |
1048 | 6643d27e | bellard | #define G2 (T3 \
|
1049 | 6643d27e | bellard | ) |
1050 | 6643d27e | bellard | |
1051 | 6643d27e | bellard | #define G3 (I4 \
|
1052 | 6643d27e | bellard | ) |
1053 | 6643d27e | bellard | |
1054 | 6643d27e | bellard | /* The order of overloaded instructions matters. Label arguments and
|
1055 | 6643d27e | bellard | register arguments look the same. Instructions that can have either
|
1056 | 6643d27e | bellard | for arguments must apear in the correct order in this table for the
|
1057 | 6643d27e | bellard | assembler to pick the right one. In other words, entries with
|
1058 | 6643d27e | bellard | immediate operands must apear after the same instruction with
|
1059 | 6643d27e | bellard | registers.
|
1060 | 6643d27e | bellard | |
1061 | 6643d27e | bellard | Because of the lookup algorithm used, entries with the same opcode
|
1062 | 6643d27e | bellard | name must be contiguous.
|
1063 | 6643d27e | bellard |
|
1064 | 6643d27e | bellard | Many instructions are short hand for other instructions (i.e., The
|
1065 | 6643d27e | bellard | jal <register> instruction is short for jalr <register>). */
|
1066 | 6643d27e | bellard | |
1067 | 6643d27e | bellard | const struct mips_opcode mips_builtin_opcodes[] = |
1068 | 6643d27e | bellard | { |
1069 | 6643d27e | bellard | /* These instructions appear first so that the disassembler will find
|
1070 | 6643d27e | bellard | them first. The assemblers uses a hash table based on the
|
1071 | 6643d27e | bellard | instruction name anyhow. */
|
1072 | 6643d27e | bellard | /* name, args, match, mask, pinfo, membership */
|
1073 | 6643d27e | bellard | {"pref", "k,o(b)", 0xcc000000, 0xfc000000, RD_b, I4|I32|G3 }, |
1074 | 6643d27e | bellard | {"prefx", "h,t(b)", 0x4c00000f, 0xfc0007ff, RD_b|RD_t, I4 }, |
1075 | 6643d27e | bellard | {"nop", "", 0x00000000, 0xffffffff, 0, I1 }, /* sll */ |
1076 | 6643d27e | bellard | {"ssnop", "", 0x00000040, 0xffffffff, 0, I32|N55 }, /* sll */ |
1077 | 6643d27e | bellard | {"ehb", "", 0x000000c0, 0xffffffff, 0, I33 }, /* sll */ |
1078 | 6643d27e | bellard | {"li", "t,j", 0x24000000, 0xffe00000, WR_t, I1 }, /* addiu */ |
1079 | 6643d27e | bellard | {"li", "t,i", 0x34000000, 0xffe00000, WR_t, I1 }, /* ori */ |
1080 | 6643d27e | bellard | {"li", "t,I", 0, (int) M_LI, INSN_MACRO, I1 }, |
1081 | 6643d27e | bellard | {"move", "d,s", 0, (int) M_MOVE, INSN_MACRO, I1 }, |
1082 | 6643d27e | bellard | {"move", "d,s", 0x0000002d, 0xfc1f07ff, WR_d|RD_s, I3 },/* daddu */ |
1083 | 6643d27e | bellard | {"move", "d,s", 0x00000021, 0xfc1f07ff, WR_d|RD_s, I1 },/* addu */ |
1084 | 6643d27e | bellard | {"move", "d,s", 0x00000025, 0xfc1f07ff, WR_d|RD_s, I1 },/* or */ |
1085 | 6643d27e | bellard | {"b", "p", 0x10000000, 0xffff0000, UBD, I1 },/* beq 0,0 */ |
1086 | 6643d27e | bellard | {"b", "p", 0x04010000, 0xffff0000, UBD, I1 },/* bgez 0 */ |
1087 | 6643d27e | bellard | {"bal", "p", 0x04110000, 0xffff0000, UBD|WR_31, I1 },/* bgezal 0*/ |
1088 | 6643d27e | bellard | |
1089 | 6643d27e | bellard | {"abs", "d,v", 0, (int) M_ABS, INSN_MACRO, I1 }, |
1090 | 6643d27e | bellard | {"abs.s", "D,V", 0x46000005, 0xffff003f, WR_D|RD_S|FP_S, I1 }, |
1091 | 6643d27e | bellard | {"abs.d", "D,V", 0x46200005, 0xffff003f, WR_D|RD_S|FP_D, I1 }, |
1092 | 6643d27e | bellard | {"abs.ps", "D,V", 0x46c00005, 0xffff003f, WR_D|RD_S|FP_D, I5 }, |
1093 | 6643d27e | bellard | {"add", "d,v,t", 0x00000020, 0xfc0007ff, WR_d|RD_s|RD_t, I1 }, |
1094 | 6643d27e | bellard | {"add", "t,r,I", 0, (int) M_ADD_I, INSN_MACRO, I1 }, |
1095 | 6643d27e | bellard | {"add.s", "D,V,T", 0x46000000, 0xffe0003f, WR_D|RD_S|RD_T|FP_S, I1 }, |
1096 | 6643d27e | bellard | {"add.d", "D,V,T", 0x46200000, 0xffe0003f, WR_D|RD_S|RD_T|FP_D, I1 }, |
1097 | 6643d27e | bellard | {"add.ob", "X,Y,Q", 0x7800000b, 0xfc20003f, WR_D|RD_S|RD_T|FP_D, MX|SB1 }, |
1098 | 6643d27e | bellard | {"add.ob", "D,S,T", 0x4ac0000b, 0xffe0003f, WR_D|RD_S|RD_T, N54 }, |
1099 | 6643d27e | bellard | {"add.ob", "D,S,T[e]", 0x4800000b, 0xfe20003f, WR_D|RD_S|RD_T, N54 }, |
1100 | 6643d27e | bellard | {"add.ob", "D,S,k", 0x4bc0000b, 0xffe0003f, WR_D|RD_S|RD_T, N54 }, |
1101 | 6643d27e | bellard | {"add.ps", "D,V,T", 0x46c00000, 0xffe0003f, WR_D|RD_S|RD_T|FP_D, I5 }, |
1102 | 6643d27e | bellard | {"add.qh", "X,Y,Q", 0x7820000b, 0xfc20003f, WR_D|RD_S|RD_T|FP_D, MX }, |
1103 | 6643d27e | bellard | {"adda.ob", "Y,Q", 0x78000037, 0xfc2007ff, WR_MACC|RD_S|RD_T|FP_D, MX|SB1 }, |
1104 | 6643d27e | bellard | {"adda.qh", "Y,Q", 0x78200037, 0xfc2007ff, WR_MACC|RD_S|RD_T|FP_D, MX }, |
1105 | 6643d27e | bellard | {"addi", "t,r,j", 0x20000000, 0xfc000000, WR_t|RD_s, I1 }, |
1106 | 6643d27e | bellard | {"addiu", "t,r,j", 0x24000000, 0xfc000000, WR_t|RD_s, I1 }, |
1107 | 6643d27e | bellard | {"addl.ob", "Y,Q", 0x78000437, 0xfc2007ff, WR_MACC|RD_S|RD_T|FP_D, MX|SB1 }, |
1108 | 6643d27e | bellard | {"addl.qh", "Y,Q", 0x78200437, 0xfc2007ff, WR_MACC|RD_S|RD_T|FP_D, MX }, |
1109 | 6643d27e | bellard | {"addr.ps", "D,S,T", 0x46c00018, 0xffe0003f, WR_D|RD_S|RD_T|FP_D, M3D }, |
1110 | 6643d27e | bellard | {"addu", "d,v,t", 0x00000021, 0xfc0007ff, WR_d|RD_s|RD_t, I1 }, |
1111 | 6643d27e | bellard | {"addu", "t,r,I", 0, (int) M_ADDU_I, INSN_MACRO, I1 }, |
1112 | 6643d27e | bellard | {"alni.ob", "X,Y,Z,O", 0x78000018, 0xff00003f, WR_D|RD_S|RD_T|FP_D, MX|SB1 }, |
1113 | 6643d27e | bellard | {"alni.ob", "D,S,T,%", 0x48000018, 0xff00003f, WR_D|RD_S|RD_T, N54 }, |
1114 | 6643d27e | bellard | {"alni.qh", "X,Y,Z,O", 0x7800001a, 0xff00003f, WR_D|RD_S|RD_T|FP_D, MX }, |
1115 | 6643d27e | bellard | {"alnv.ps", "D,V,T,s", 0x4c00001e, 0xfc00003f, WR_D|RD_S|RD_T|FP_D, I5 }, |
1116 | 6643d27e | bellard | {"alnv.ob", "X,Y,Z,s", 0x78000019, 0xfc00003f, WR_D|RD_S|RD_T|RD_s|FP_D, MX|SB1 }, |
1117 | 6643d27e | bellard | {"alnv.qh", "X,Y,Z,s", 0x7800001b, 0xfc00003f, WR_D|RD_S|RD_T|RD_s|FP_D, MX }, |
1118 | 6643d27e | bellard | {"and", "d,v,t", 0x00000024, 0xfc0007ff, WR_d|RD_s|RD_t, I1 }, |
1119 | 6643d27e | bellard | {"and", "t,r,I", 0, (int) M_AND_I, INSN_MACRO, I1 }, |
1120 | 6643d27e | bellard | {"and.ob", "X,Y,Q", 0x7800000c, 0xfc20003f, WR_D|RD_S|RD_T|FP_D, MX|SB1 }, |
1121 | 6643d27e | bellard | {"and.ob", "D,S,T", 0x4ac0000c, 0xffe0003f, WR_D|RD_S|RD_T, N54 }, |
1122 | 6643d27e | bellard | {"and.ob", "D,S,T[e]", 0x4800000c, 0xfe20003f, WR_D|RD_S|RD_T, N54 }, |
1123 | 6643d27e | bellard | {"and.ob", "D,S,k", 0x4bc0000c, 0xffe0003f, WR_D|RD_S|RD_T, N54 }, |
1124 | 6643d27e | bellard | {"and.qh", "X,Y,Q", 0x7820000c, 0xfc20003f, WR_D|RD_S|RD_T|FP_D, MX }, |
1125 | 6643d27e | bellard | {"andi", "t,r,i", 0x30000000, 0xfc000000, WR_t|RD_s, I1 }, |
1126 | 6643d27e | bellard | /* b is at the top of the table. */
|
1127 | 6643d27e | bellard | /* bal is at the top of the table. */
|
1128 | 6643d27e | bellard | {"bc0f", "p", 0x41000000, 0xffff0000, CBD|RD_CC, I1 }, |
1129 | 6643d27e | bellard | {"bc0fl", "p", 0x41020000, 0xffff0000, CBL|RD_CC, I2|T3 }, |
1130 | 6643d27e | bellard | {"bc0t", "p", 0x41010000, 0xffff0000, CBD|RD_CC, I1 }, |
1131 | 6643d27e | bellard | {"bc0tl", "p", 0x41030000, 0xffff0000, CBL|RD_CC, I2|T3 }, |
1132 | 6643d27e | bellard | {"bc1any2f", "N,p", 0x45200000, 0xffe30000, CBD|RD_CC|FP_S, M3D }, |
1133 | 6643d27e | bellard | {"bc1any2t", "N,p", 0x45210000, 0xffe30000, CBD|RD_CC|FP_S, M3D }, |
1134 | 6643d27e | bellard | {"bc1any4f", "N,p", 0x45400000, 0xffe30000, CBD|RD_CC|FP_S, M3D }, |
1135 | 6643d27e | bellard | {"bc1any4t", "N,p", 0x45410000, 0xffe30000, CBD|RD_CC|FP_S, M3D }, |
1136 | 6643d27e | bellard | {"bc1f", "p", 0x45000000, 0xffff0000, CBD|RD_CC|FP_S, I1 }, |
1137 | 6643d27e | bellard | {"bc1f", "N,p", 0x45000000, 0xffe30000, CBD|RD_CC|FP_S, I4|I32 }, |
1138 | 6643d27e | bellard | {"bc1fl", "p", 0x45020000, 0xffff0000, CBL|RD_CC|FP_S, I2|T3 }, |
1139 | 6643d27e | bellard | {"bc1fl", "N,p", 0x45020000, 0xffe30000, CBL|RD_CC|FP_S, I4|I32 }, |
1140 | 6643d27e | bellard | {"bc1t", "p", 0x45010000, 0xffff0000, CBD|RD_CC|FP_S, I1 }, |
1141 | 6643d27e | bellard | {"bc1t", "N,p", 0x45010000, 0xffe30000, CBD|RD_CC|FP_S, I4|I32 }, |
1142 | 6643d27e | bellard | {"bc1tl", "p", 0x45030000, 0xffff0000, CBL|RD_CC|FP_S, I2|T3 }, |
1143 | 6643d27e | bellard | {"bc1tl", "N,p", 0x45030000, 0xffe30000, CBL|RD_CC|FP_S, I4|I32 }, |
1144 | 6643d27e | bellard | /* bc2* are at the bottom of the table. */
|
1145 | 6643d27e | bellard | {"bc3f", "p", 0x4d000000, 0xffff0000, CBD|RD_CC, I1 }, |
1146 | 6643d27e | bellard | {"bc3fl", "p", 0x4d020000, 0xffff0000, CBL|RD_CC, I2|T3 }, |
1147 | 6643d27e | bellard | {"bc3t", "p", 0x4d010000, 0xffff0000, CBD|RD_CC, I1 }, |
1148 | 6643d27e | bellard | {"bc3tl", "p", 0x4d030000, 0xffff0000, CBL|RD_CC, I2|T3 }, |
1149 | 6643d27e | bellard | {"beqz", "s,p", 0x10000000, 0xfc1f0000, CBD|RD_s, I1 }, |
1150 | 6643d27e | bellard | {"beqzl", "s,p", 0x50000000, 0xfc1f0000, CBL|RD_s, I2|T3 }, |
1151 | 6643d27e | bellard | {"beq", "s,t,p", 0x10000000, 0xfc000000, CBD|RD_s|RD_t, I1 }, |
1152 | 6643d27e | bellard | {"beq", "s,I,p", 0, (int) M_BEQ_I, INSN_MACRO, I1 }, |
1153 | 6643d27e | bellard | {"beql", "s,t,p", 0x50000000, 0xfc000000, CBL|RD_s|RD_t, I2|T3 }, |
1154 | 6643d27e | bellard | {"beql", "s,I,p", 0, (int) M_BEQL_I, INSN_MACRO, I2|T3 }, |
1155 | 6643d27e | bellard | {"bge", "s,t,p", 0, (int) M_BGE, INSN_MACRO, I1 }, |
1156 | 6643d27e | bellard | {"bge", "s,I,p", 0, (int) M_BGE_I, INSN_MACRO, I1 }, |
1157 | 6643d27e | bellard | {"bgel", "s,t,p", 0, (int) M_BGEL, INSN_MACRO, I2|T3 }, |
1158 | 6643d27e | bellard | {"bgel", "s,I,p", 0, (int) M_BGEL_I, INSN_MACRO, I2|T3 }, |
1159 | 6643d27e | bellard | {"bgeu", "s,t,p", 0, (int) M_BGEU, INSN_MACRO, I1 }, |
1160 | 6643d27e | bellard | {"bgeu", "s,I,p", 0, (int) M_BGEU_I, INSN_MACRO, I1 }, |
1161 | 6643d27e | bellard | {"bgeul", "s,t,p", 0, (int) M_BGEUL, INSN_MACRO, I2|T3 }, |
1162 | 6643d27e | bellard | {"bgeul", "s,I,p", 0, (int) M_BGEUL_I, INSN_MACRO, I2|T3 }, |
1163 | 6643d27e | bellard | {"bgez", "s,p", 0x04010000, 0xfc1f0000, CBD|RD_s, I1 }, |
1164 | 6643d27e | bellard | {"bgezl", "s,p", 0x04030000, 0xfc1f0000, CBL|RD_s, I2|T3 }, |
1165 | 6643d27e | bellard | {"bgezal", "s,p", 0x04110000, 0xfc1f0000, CBD|RD_s|WR_31, I1 }, |
1166 | 6643d27e | bellard | {"bgezall", "s,p", 0x04130000, 0xfc1f0000, CBL|RD_s|WR_31, I2|T3 }, |
1167 | 6643d27e | bellard | {"bgt", "s,t,p", 0, (int) M_BGT, INSN_MACRO, I1 }, |
1168 | 6643d27e | bellard | {"bgt", "s,I,p", 0, (int) M_BGT_I, INSN_MACRO, I1 }, |
1169 | 6643d27e | bellard | {"bgtl", "s,t,p", 0, (int) M_BGTL, INSN_MACRO, I2|T3 }, |
1170 | 6643d27e | bellard | {"bgtl", "s,I,p", 0, (int) M_BGTL_I, INSN_MACRO, I2|T3 }, |
1171 | 6643d27e | bellard | {"bgtu", "s,t,p", 0, (int) M_BGTU, INSN_MACRO, I1 }, |
1172 | 6643d27e | bellard | {"bgtu", "s,I,p", 0, (int) M_BGTU_I, INSN_MACRO, I1 }, |
1173 | 6643d27e | bellard | {"bgtul", "s,t,p", 0, (int) M_BGTUL, INSN_MACRO, I2|T3 }, |
1174 | 6643d27e | bellard | {"bgtul", "s,I,p", 0, (int) M_BGTUL_I, INSN_MACRO, I2|T3 }, |
1175 | 6643d27e | bellard | {"bgtz", "s,p", 0x1c000000, 0xfc1f0000, CBD|RD_s, I1 }, |
1176 | 6643d27e | bellard | {"bgtzl", "s,p", 0x5c000000, 0xfc1f0000, CBL|RD_s, I2|T3 }, |
1177 | 6643d27e | bellard | {"ble", "s,t,p", 0, (int) M_BLE, INSN_MACRO, I1 }, |
1178 | 6643d27e | bellard | {"ble", "s,I,p", 0, (int) M_BLE_I, INSN_MACRO, I1 }, |
1179 | 6643d27e | bellard | {"blel", "s,t,p", 0, (int) M_BLEL, INSN_MACRO, I2|T3 }, |
1180 | 6643d27e | bellard | {"blel", "s,I,p", 0, (int) M_BLEL_I, INSN_MACRO, I2|T3 }, |
1181 | 6643d27e | bellard | {"bleu", "s,t,p", 0, (int) M_BLEU, INSN_MACRO, I1 }, |
1182 | 6643d27e | bellard | {"bleu", "s,I,p", 0, (int) M_BLEU_I, INSN_MACRO, I1 }, |
1183 | 6643d27e | bellard | {"bleul", "s,t,p", 0, (int) M_BLEUL, INSN_MACRO, I2|T3 }, |
1184 | 6643d27e | bellard | {"bleul", "s,I,p", 0, (int) M_BLEUL_I, INSN_MACRO, I2|T3 }, |
1185 | 6643d27e | bellard | {"blez", "s,p", 0x18000000, 0xfc1f0000, CBD|RD_s, I1 }, |
1186 | 6643d27e | bellard | {"blezl", "s,p", 0x58000000, 0xfc1f0000, CBL|RD_s, I2|T3 }, |
1187 | 6643d27e | bellard | {"blt", "s,t,p", 0, (int) M_BLT, INSN_MACRO, I1 }, |
1188 | 6643d27e | bellard | {"blt", "s,I,p", 0, (int) M_BLT_I, INSN_MACRO, I1 }, |
1189 | 6643d27e | bellard | {"bltl", "s,t,p", 0, (int) M_BLTL, INSN_MACRO, I2|T3 }, |
1190 | 6643d27e | bellard | {"bltl", "s,I,p", 0, (int) M_BLTL_I, INSN_MACRO, I2|T3 }, |
1191 | 6643d27e | bellard | {"bltu", "s,t,p", 0, (int) M_BLTU, INSN_MACRO, I1 }, |
1192 | 6643d27e | bellard | {"bltu", "s,I,p", 0, (int) M_BLTU_I, INSN_MACRO, I1 }, |
1193 | 6643d27e | bellard | {"bltul", "s,t,p", 0, (int) M_BLTUL, INSN_MACRO, I2|T3 }, |
1194 | 6643d27e | bellard | {"bltul", "s,I,p", 0, (int) M_BLTUL_I, INSN_MACRO, I2|T3 }, |
1195 | 6643d27e | bellard | {"bltz", "s,p", 0x04000000, 0xfc1f0000, CBD|RD_s, I1 }, |
1196 | 6643d27e | bellard | {"bltzl", "s,p", 0x04020000, 0xfc1f0000, CBL|RD_s, I2|T3 }, |
1197 | 6643d27e | bellard | {"bltzal", "s,p", 0x04100000, 0xfc1f0000, CBD|RD_s|WR_31, I1 }, |
1198 | 6643d27e | bellard | {"bltzall", "s,p", 0x04120000, 0xfc1f0000, CBL|RD_s|WR_31, I2|T3 }, |
1199 | 6643d27e | bellard | {"bnez", "s,p", 0x14000000, 0xfc1f0000, CBD|RD_s, I1 }, |
1200 | 6643d27e | bellard | {"bnezl", "s,p", 0x54000000, 0xfc1f0000, CBL|RD_s, I2|T3 }, |
1201 | 6643d27e | bellard | {"bne", "s,t,p", 0x14000000, 0xfc000000, CBD|RD_s|RD_t, I1 }, |
1202 | 6643d27e | bellard | {"bne", "s,I,p", 0, (int) M_BNE_I, INSN_MACRO, I1 }, |
1203 | 6643d27e | bellard | {"bnel", "s,t,p", 0x54000000, 0xfc000000, CBL|RD_s|RD_t, I2|T3 }, |
1204 | 6643d27e | bellard | {"bnel", "s,I,p", 0, (int) M_BNEL_I, INSN_MACRO, I2|T3 }, |
1205 | 6643d27e | bellard | {"break", "", 0x0000000d, 0xffffffff, TRAP, I1 }, |
1206 | 6643d27e | bellard | {"break", "c", 0x0000000d, 0xfc00ffff, TRAP, I1 }, |
1207 | 6643d27e | bellard | {"break", "c,q", 0x0000000d, 0xfc00003f, TRAP, I1 }, |
1208 | 6643d27e | bellard | {"c.f.d", "S,T", 0x46200030, 0xffe007ff, RD_S|RD_T|WR_CC|FP_D, I1 }, |
1209 | 6643d27e | bellard | {"c.f.d", "M,S,T", 0x46200030, 0xffe000ff, RD_S|RD_T|WR_CC|FP_D, I4|I32 }, |
1210 | 6643d27e | bellard | {"c.f.s", "S,T", 0x46000030, 0xffe007ff, RD_S|RD_T|WR_CC|FP_S, I1 }, |
1211 | 6643d27e | bellard | {"c.f.s", "M,S,T", 0x46000030, 0xffe000ff, RD_S|RD_T|WR_CC|FP_S, I4|I32 }, |
1212 | 6643d27e | bellard | {"c.f.ps", "S,T", 0x46c00030, 0xffe007ff, RD_S|RD_T|WR_CC|FP_D, I5 }, |
1213 | 6643d27e | bellard | {"c.f.ps", "M,S,T", 0x46c00030, 0xffe000ff, RD_S|RD_T|WR_CC|FP_D, I5 }, |
1214 | 6643d27e | bellard | {"c.un.d", "S,T", 0x46200031, 0xffe007ff, RD_S|RD_T|WR_CC|FP_D, I1 }, |
1215 | 6643d27e | bellard | {"c.un.d", "M,S,T", 0x46200031, 0xffe000ff, RD_S|RD_T|WR_CC|FP_D, I4|I32 }, |
1216 | 6643d27e | bellard | {"c.un.s", "S,T", 0x46000031, 0xffe007ff, RD_S|RD_T|WR_CC|FP_S, I1 }, |
1217 | 6643d27e | bellard | {"c.un.s", "M,S,T", 0x46000031, 0xffe000ff, RD_S|RD_T|WR_CC|FP_S, I4|I32 }, |
1218 | 6643d27e | bellard | {"c.un.ps", "S,T", 0x46c00031, 0xffe007ff, RD_S|RD_T|WR_CC|FP_D, I5 }, |
1219 | 6643d27e | bellard | {"c.un.ps", "M,S,T", 0x46c00031, 0xffe000ff, RD_S|RD_T|WR_CC|FP_D, I5 }, |
1220 | 6643d27e | bellard | {"c.eq.d", "S,T", 0x46200032, 0xffe007ff, RD_S|RD_T|WR_CC|FP_D, I1 }, |
1221 | 6643d27e | bellard | {"c.eq.d", "M,S,T", 0x46200032, 0xffe000ff, RD_S|RD_T|WR_CC|FP_D, I4|I32 }, |
1222 | 6643d27e | bellard | {"c.eq.s", "S,T", 0x46000032, 0xffe007ff, RD_S|RD_T|WR_CC|FP_S, I1 }, |
1223 | 6643d27e | bellard | {"c.eq.s", "M,S,T", 0x46000032, 0xffe000ff, RD_S|RD_T|WR_CC|FP_S, I4|I32 }, |
1224 | 6643d27e | bellard | {"c.eq.ob", "Y,Q", 0x78000001, 0xfc2007ff, WR_CC|RD_S|RD_T|FP_D, MX|SB1 }, |
1225 | 6643d27e | bellard | {"c.eq.ob", "S,T", 0x4ac00001, 0xffe007ff, WR_CC|RD_S|RD_T, N54 }, |
1226 | 6643d27e | bellard | {"c.eq.ob", "S,T[e]", 0x48000001, 0xfe2007ff, WR_CC|RD_S|RD_T, N54 }, |
1227 | 6643d27e | bellard | {"c.eq.ob", "S,k", 0x4bc00001, 0xffe007ff, WR_CC|RD_S|RD_T, N54 }, |
1228 | 6643d27e | bellard | {"c.eq.ps", "S,T", 0x46c00032, 0xffe007ff, RD_S|RD_T|WR_CC|FP_D, I5 }, |
1229 | 6643d27e | bellard | {"c.eq.ps", "M,S,T", 0x46c00032, 0xffe000ff, RD_S|RD_T|WR_CC|FP_D, I5 }, |
1230 | 6643d27e | bellard | {"c.eq.qh", "Y,Q", 0x78200001, 0xfc2007ff, WR_CC|RD_S|RD_T|FP_D, MX }, |
1231 | 6643d27e | bellard | {"c.ueq.d", "S,T", 0x46200033, 0xffe007ff, RD_S|RD_T|WR_CC|FP_D, I1 }, |
1232 | 6643d27e | bellard | {"c.ueq.d", "M,S,T", 0x46200033, 0xffe000ff, RD_S|RD_T|WR_CC|FP_D, I4|I32 }, |
1233 | 6643d27e | bellard | {"c.ueq.s", "S,T", 0x46000033, 0xffe007ff, RD_S|RD_T|WR_CC|FP_S, I1 }, |
1234 | 6643d27e | bellard | {"c.ueq.s", "M,S,T", 0x46000033, 0xffe000ff, RD_S|RD_T|WR_CC|FP_S, I4|I32 }, |
1235 | 6643d27e | bellard | {"c.ueq.ps","S,T", 0x46c00033, 0xffe007ff, RD_S|RD_T|WR_CC|FP_D, I5 }, |
1236 | 6643d27e | bellard | {"c.ueq.ps","M,S,T", 0x46c00033, 0xffe000ff, RD_S|RD_T|WR_CC|FP_D, I5 }, |
1237 | 6643d27e | bellard | {"c.olt.d", "S,T", 0x46200034, 0xffe007ff, RD_S|RD_T|WR_CC|FP_D, I1 }, |
1238 | 6643d27e | bellard | {"c.olt.d", "M,S,T", 0x46200034, 0xffe000ff, RD_S|RD_T|WR_CC|FP_D, I4|I32 }, |
1239 | 6643d27e | bellard | {"c.olt.s", "S,T", 0x46000034, 0xffe007ff, RD_S|RD_T|WR_CC|FP_S, I1 }, |
1240 | 6643d27e | bellard | {"c.olt.s", "M,S,T", 0x46000034, 0xffe000ff, RD_S|RD_T|WR_CC|FP_S, I4|I32 }, |
1241 | 6643d27e | bellard | {"c.olt.ps","S,T", 0x46c00034, 0xffe007ff, RD_S|RD_T|WR_CC|FP_D, I5 }, |
1242 | 6643d27e | bellard | {"c.olt.ps","M,S,T", 0x46c00034, 0xffe000ff, RD_S|RD_T|WR_CC|FP_D, I5 }, |
1243 | 6643d27e | bellard | {"c.ult.d", "S,T", 0x46200035, 0xffe007ff, RD_S|RD_T|WR_CC|FP_D, I1 }, |
1244 | 6643d27e | bellard | {"c.ult.d", "M,S,T", 0x46200035, 0xffe000ff, RD_S|RD_T|WR_CC|FP_D, I4|I32 }, |
1245 | 6643d27e | bellard | {"c.ult.s", "S,T", 0x46000035, 0xffe007ff, RD_S|RD_T|WR_CC|FP_S, I1 }, |
1246 | 6643d27e | bellard | {"c.ult.s", "M,S,T", 0x46000035, 0xffe000ff, RD_S|RD_T|WR_CC|FP_S, I4|I32 }, |
1247 | 6643d27e | bellard | {"c.ult.ps","S,T", 0x46c00035, 0xffe007ff, RD_S|RD_T|WR_CC|FP_D, I5 }, |
1248 | 6643d27e | bellard | {"c.ult.ps","M,S,T", 0x46c00035, 0xffe000ff, RD_S|RD_T|WR_CC|FP_D, I5 }, |
1249 | 6643d27e | bellard | {"c.ole.d", "S,T", 0x46200036, 0xffe007ff, RD_S|RD_T|WR_CC|FP_D, I1 }, |
1250 | 6643d27e | bellard | {"c.ole.d", "M,S,T", 0x46200036, 0xffe000ff, RD_S|RD_T|WR_CC|FP_D, I4|I32 }, |
1251 | 6643d27e | bellard | {"c.ole.s", "S,T", 0x46000036, 0xffe007ff, RD_S|RD_T|WR_CC|FP_S, I1 }, |
1252 | 6643d27e | bellard | {"c.ole.s", "M,S,T", 0x46000036, 0xffe000ff, RD_S|RD_T|WR_CC|FP_S, I4|I32 }, |
1253 | 6643d27e | bellard | {"c.ole.ps","S,T", 0x46c00036, 0xffe007ff, RD_S|RD_T|WR_CC|FP_D, I5 }, |
1254 | 6643d27e | bellard | {"c.ole.ps","M,S,T", 0x46c00036, 0xffe000ff, RD_S|RD_T|WR_CC|FP_D, I5 }, |
1255 | 6643d27e | bellard | {"c.ule.d", "S,T", 0x46200037, 0xffe007ff, RD_S|RD_T|WR_CC|FP_D, I1 }, |
1256 | 6643d27e | bellard | {"c.ule.d", "M,S,T", 0x46200037, 0xffe000ff, RD_S|RD_T|WR_CC|FP_D, I4|I32 }, |
1257 | 6643d27e | bellard | {"c.ule.s", "S,T", 0x46000037, 0xffe007ff, RD_S|RD_T|WR_CC|FP_S, I1 }, |
1258 | 6643d27e | bellard | {"c.ule.s", "M,S,T", 0x46000037, 0xffe000ff, RD_S|RD_T|WR_CC|FP_S, I4|I32 }, |
1259 | 6643d27e | bellard | {"c.ule.ps","S,T", 0x46c00037, 0xffe007ff, RD_S|RD_T|WR_CC|FP_D, I5 }, |
1260 | 6643d27e | bellard | {"c.ule.ps","M,S,T", 0x46c00037, 0xffe000ff, RD_S|RD_T|WR_CC|FP_D, I5 }, |
1261 | 6643d27e | bellard | {"c.sf.d", "S,T", 0x46200038, 0xffe007ff, RD_S|RD_T|WR_CC|FP_D, I1 }, |
1262 | 6643d27e | bellard | {"c.sf.d", "M,S,T", 0x46200038, 0xffe000ff, RD_S|RD_T|WR_CC|FP_D, I4|I32 }, |
1263 | 6643d27e | bellard | {"c.sf.s", "S,T", 0x46000038, 0xffe007ff, RD_S|RD_T|WR_CC|FP_S, I1 }, |
1264 | 6643d27e | bellard | {"c.sf.s", "M,S,T", 0x46000038, 0xffe000ff, RD_S|RD_T|WR_CC|FP_S, I4|I32 }, |
1265 | 6643d27e | bellard | {"c.sf.ps", "S,T", 0x46c00038, 0xffe007ff, RD_S|RD_T|WR_CC|FP_D, I5 }, |
1266 | 6643d27e | bellard | {"c.sf.ps", "M,S,T", 0x46c00038, 0xffe000ff, RD_S|RD_T|WR_CC|FP_D, I5 }, |
1267 | 6643d27e | bellard | {"c.ngle.d","S,T", 0x46200039, 0xffe007ff, RD_S|RD_T|WR_CC|FP_D, I1 }, |
1268 | 6643d27e | bellard | {"c.ngle.d","M,S,T", 0x46200039, 0xffe000ff, RD_S|RD_T|WR_CC|FP_D, I4|I32 }, |
1269 | 6643d27e | bellard | {"c.ngle.s","S,T", 0x46000039, 0xffe007ff, RD_S|RD_T|WR_CC|FP_S, I1 }, |
1270 | 6643d27e | bellard | {"c.ngle.s","M,S,T", 0x46000039, 0xffe000ff, RD_S|RD_T|WR_CC|FP_S, I4|I32 }, |
1271 | 6643d27e | bellard | {"c.ngle.ps","S,T", 0x46c00039, 0xffe007ff, RD_S|RD_T|WR_CC|FP_D, I5 }, |
1272 | 6643d27e | bellard | {"c.ngle.ps","M,S,T", 0x46c00039, 0xffe000ff, RD_S|RD_T|WR_CC|FP_D, I5 }, |
1273 | 6643d27e | bellard | {"c.seq.d", "S,T", 0x4620003a, 0xffe007ff, RD_S|RD_T|WR_CC|FP_D, I1 }, |
1274 | 6643d27e | bellard | {"c.seq.d", "M,S,T", 0x4620003a, 0xffe000ff, RD_S|RD_T|WR_CC|FP_D, I4|I32 }, |
1275 | 6643d27e | bellard | {"c.seq.s", "S,T", 0x4600003a, 0xffe007ff, RD_S|RD_T|WR_CC|FP_S, I1 }, |
1276 | 6643d27e | bellard | {"c.seq.s", "M,S,T", 0x4600003a, 0xffe000ff, RD_S|RD_T|WR_CC|FP_S, I4|I32 }, |
1277 | 6643d27e | bellard | {"c.seq.ps","S,T", 0x46c0003a, 0xffe007ff, RD_S|RD_T|WR_CC|FP_D, I5 }, |
1278 | 6643d27e | bellard | {"c.seq.ps","M,S,T", 0x46c0003a, 0xffe000ff, RD_S|RD_T|WR_CC|FP_D, I5 }, |
1279 | 6643d27e | bellard | {"c.ngl.d", "S,T", 0x4620003b, 0xffe007ff, RD_S|RD_T|WR_CC|FP_D, I1 }, |
1280 | 6643d27e | bellard | {"c.ngl.d", "M,S,T", 0x4620003b, 0xffe000ff, RD_S|RD_T|WR_CC|FP_D, I4|I32 }, |
1281 | 6643d27e | bellard | {"c.ngl.s", "S,T", 0x4600003b, 0xffe007ff, RD_S|RD_T|WR_CC|FP_S, I1 }, |
1282 | 6643d27e | bellard | {"c.ngl.s", "M,S,T", 0x4600003b, 0xffe000ff, RD_S|RD_T|WR_CC|FP_S, I4|I32 }, |
1283 | 6643d27e | bellard | {"c.ngl.ps","S,T", 0x46c0003b, 0xffe007ff, RD_S|RD_T|WR_CC|FP_D, I5 }, |
1284 | 6643d27e | bellard | {"c.ngl.ps","M,S,T", 0x46c0003b, 0xffe000ff, RD_S|RD_T|WR_CC|FP_D, I5 }, |
1285 | 6643d27e | bellard | {"c.lt.d", "S,T", 0x4620003c, 0xffe007ff, RD_S|RD_T|WR_CC|FP_D, I1 }, |
1286 | 6643d27e | bellard | {"c.lt.d", "M,S,T", 0x4620003c, 0xffe000ff, RD_S|RD_T|WR_CC|FP_D, I4|I32 }, |
1287 | 6643d27e | bellard | {"c.lt.s", "S,T", 0x4600003c, 0xffe007ff, RD_S|RD_T|WR_CC|FP_S, I1 }, |
1288 | 6643d27e | bellard | {"c.lt.s", "M,S,T", 0x4600003c, 0xffe000ff, RD_S|RD_T|WR_CC|FP_S, I4|I32 }, |
1289 | 6643d27e | bellard | {"c.lt.ob", "Y,Q", 0x78000004, 0xfc2007ff, WR_CC|RD_S|RD_T|FP_D, MX|SB1 }, |
1290 | 6643d27e | bellard | {"c.lt.ob", "S,T", 0x4ac00004, 0xffe007ff, WR_CC|RD_S|RD_T, N54 }, |
1291 | 6643d27e | bellard | {"c.lt.ob", "S,T[e]", 0x48000004, 0xfe2007ff, WR_CC|RD_S|RD_T, N54 }, |
1292 | 6643d27e | bellard | {"c.lt.ob", "S,k", 0x4bc00004, 0xffe007ff, WR_CC|RD_S|RD_T, N54 }, |
1293 | 6643d27e | bellard | {"c.lt.ps", "S,T", 0x46c0003c, 0xffe007ff, RD_S|RD_T|WR_CC|FP_D, I5 }, |
1294 | 6643d27e | bellard | {"c.lt.ps", "M,S,T", 0x46c0003c, 0xffe000ff, RD_S|RD_T|WR_CC|FP_D, I5 }, |
1295 | 6643d27e | bellard | {"c.lt.qh", "Y,Q", 0x78200004, 0xfc2007ff, WR_CC|RD_S|RD_T|FP_D, MX }, |
1296 | 6643d27e | bellard | {"c.nge.d", "S,T", 0x4620003d, 0xffe007ff, RD_S|RD_T|WR_CC|FP_D, I1 }, |
1297 | 6643d27e | bellard | {"c.nge.d", "M,S,T", 0x4620003d, 0xffe000ff, RD_S|RD_T|WR_CC|FP_D, I4|I32 }, |
1298 | 6643d27e | bellard | {"c.nge.s", "S,T", 0x4600003d, 0xffe007ff, RD_S|RD_T|WR_CC|FP_S, I1 }, |
1299 | 6643d27e | bellard | {"c.nge.s", "M,S,T", 0x4600003d, 0xffe000ff, RD_S|RD_T|WR_CC|FP_S, I4|I32 }, |
1300 | 6643d27e | bellard | {"c.nge.ps","S,T", 0x46c0003d, 0xffe007ff, RD_S|RD_T|WR_CC|FP_D, I5 }, |
1301 | 6643d27e | bellard | {"c.nge.ps","M,S,T", 0x46c0003d, 0xffe000ff, RD_S|RD_T|WR_CC|FP_D, I5 }, |
1302 | 6643d27e | bellard | {"c.le.d", "S,T", 0x4620003e, 0xffe007ff, RD_S|RD_T|WR_CC|FP_D, I1 }, |
1303 | 6643d27e | bellard | {"c.le.d", "M,S,T", 0x4620003e, 0xffe000ff, RD_S|RD_T|WR_CC|FP_D, I4|I32 }, |
1304 | 6643d27e | bellard | {"c.le.s", "S,T", 0x4600003e, 0xffe007ff, RD_S|RD_T|WR_CC|FP_S, I1 }, |
1305 | 6643d27e | bellard | {"c.le.s", "M,S,T", 0x4600003e, 0xffe000ff, RD_S|RD_T|WR_CC|FP_S, I4|I32 }, |
1306 | 6643d27e | bellard | {"c.le.ob", "Y,Q", 0x78000005, 0xfc2007ff, WR_CC|RD_S|RD_T|FP_D, MX|SB1 }, |
1307 | 6643d27e | bellard | {"c.le.ob", "S,T", 0x4ac00005, 0xffe007ff, WR_CC|RD_S|RD_T, N54 }, |
1308 | 6643d27e | bellard | {"c.le.ob", "S,T[e]", 0x48000005, 0xfe2007ff, WR_CC|RD_S|RD_T, N54 }, |
1309 | 6643d27e | bellard | {"c.le.ob", "S,k", 0x4bc00005, 0xffe007ff, WR_CC|RD_S|RD_T, N54 }, |
1310 | 6643d27e | bellard | {"c.le.ps", "S,T", 0x46c0003e, 0xffe007ff, RD_S|RD_T|WR_CC|FP_D, I5 }, |
1311 | 6643d27e | bellard | {"c.le.ps", "M,S,T", 0x46c0003e, 0xffe000ff, RD_S|RD_T|WR_CC|FP_D, I5 }, |
1312 | 6643d27e | bellard | {"c.le.qh", "Y,Q", 0x78200005, 0xfc2007ff, WR_CC|RD_S|RD_T|FP_D, MX }, |
1313 | 6643d27e | bellard | {"c.ngt.d", "S,T", 0x4620003f, 0xffe007ff, RD_S|RD_T|WR_CC|FP_D, I1 }, |
1314 | 6643d27e | bellard | {"c.ngt.d", "M,S,T", 0x4620003f, 0xffe000ff, RD_S|RD_T|WR_CC|FP_D, I4|I32 }, |
1315 | 6643d27e | bellard | {"c.ngt.s", "S,T", 0x4600003f, 0xffe007ff, RD_S|RD_T|WR_CC|FP_S, I1 }, |
1316 | 6643d27e | bellard | {"c.ngt.s", "M,S,T", 0x4600003f, 0xffe000ff, RD_S|RD_T|WR_CC|FP_S, I4|I32 }, |
1317 | 6643d27e | bellard | {"c.ngt.ps","S,T", 0x46c0003f, 0xffe007ff, RD_S|RD_T|WR_CC|FP_D, I5 }, |
1318 | 6643d27e | bellard | {"c.ngt.ps","M,S,T", 0x46c0003f, 0xffe000ff, RD_S|RD_T|WR_CC|FP_D, I5 }, |
1319 | 6643d27e | bellard | {"cabs.eq.d", "M,S,T", 0x46200072, 0xffe000ff, RD_S|RD_T|WR_CC|FP_D, M3D }, |
1320 | 6643d27e | bellard | {"cabs.eq.ps", "M,S,T", 0x46c00072, 0xffe000ff, RD_S|RD_T|WR_CC|FP_D, M3D }, |
1321 | 6643d27e | bellard | {"cabs.eq.s", "M,S,T", 0x46000072, 0xffe000ff, RD_S|RD_T|WR_CC|FP_S, M3D }, |
1322 | 6643d27e | bellard | {"cabs.f.d", "M,S,T", 0x46200070, 0xffe000ff, RD_S|RD_T|WR_CC|FP_D, M3D }, |
1323 | 6643d27e | bellard | {"cabs.f.ps", "M,S,T", 0x46c00070, 0xffe000ff, RD_S|RD_T|WR_CC|FP_D, M3D }, |
1324 | 6643d27e | bellard | {"cabs.f.s", "M,S,T", 0x46000070, 0xffe000ff, RD_S|RD_T|WR_CC|FP_S, M3D }, |
1325 | 6643d27e | bellard | {"cabs.le.d", "M,S,T", 0x4620007e, 0xffe000ff, RD_S|RD_T|WR_CC|FP_D, M3D }, |
1326 | 6643d27e | bellard | {"cabs.le.ps", "M,S,T", 0x46c0007e, 0xffe000ff, RD_S|RD_T|WR_CC|FP_D, M3D }, |
1327 | 6643d27e | bellard | {"cabs.le.s", "M,S,T", 0x4600007e, 0xffe000ff, RD_S|RD_T|WR_CC|FP_S, M3D }, |
1328 | 6643d27e | bellard | {"cabs.lt.d", "M,S,T", 0x4620007c, 0xffe000ff, RD_S|RD_T|WR_CC|FP_D, M3D }, |
1329 | 6643d27e | bellard | {"cabs.lt.ps", "M,S,T", 0x46c0007c, 0xffe000ff, RD_S|RD_T|WR_CC|FP_D, M3D }, |
1330 | 6643d27e | bellard | {"cabs.lt.s", "M,S,T", 0x4600007c, 0xffe000ff, RD_S|RD_T|WR_CC|FP_S, M3D }, |
1331 | 6643d27e | bellard | {"cabs.nge.d", "M,S,T", 0x4620007d, 0xffe000ff, RD_S|RD_T|WR_CC|FP_D, M3D }, |
1332 | 6643d27e | bellard | {"cabs.nge.ps","M,S,T", 0x46c0007d, 0xffe000ff, RD_S|RD_T|WR_CC|FP_D, M3D }, |
1333 | 6643d27e | bellard | {"cabs.nge.s", "M,S,T", 0x4600007d, 0xffe000ff, RD_S|RD_T|WR_CC|FP_S, M3D }, |
1334 | 6643d27e | bellard | {"cabs.ngl.d", "M,S,T", 0x4620007b, 0xffe000ff, RD_S|RD_T|WR_CC|FP_D, M3D }, |
1335 | 6643d27e | bellard | {"cabs.ngl.ps","M,S,T", 0x46c0007b, 0xffe000ff, RD_S|RD_T|WR_CC|FP_D, M3D }, |
1336 | 6643d27e | bellard | {"cabs.ngl.s", "M,S,T", 0x4600007b, 0xffe000ff, RD_S|RD_T|WR_CC|FP_S, M3D }, |
1337 | 6643d27e | bellard | {"cabs.ngle.d","M,S,T", 0x46200079, 0xffe000ff, RD_S|RD_T|WR_CC|FP_D, M3D }, |
1338 | 6643d27e | bellard | {"cabs.ngle.ps","M,S,T",0x46c00079, 0xffe000ff, RD_S|RD_T|WR_CC|FP_D, M3D }, |
1339 | 6643d27e | bellard | {"cabs.ngle.s","M,S,T", 0x46000079, 0xffe000ff, RD_S|RD_T|WR_CC|FP_S, M3D }, |
1340 | 6643d27e | bellard | {"cabs.ngt.d", "M,S,T", 0x4620007f, 0xffe000ff, RD_S|RD_T|WR_CC|FP_D, M3D }, |
1341 | 6643d27e | bellard | {"cabs.ngt.ps","M,S,T", 0x46c0007f, 0xffe000ff, RD_S|RD_T|WR_CC|FP_D, M3D }, |
1342 | 6643d27e | bellard | {"cabs.ngt.s", "M,S,T", 0x4600007f, 0xffe000ff, RD_S|RD_T|WR_CC|FP_S, M3D }, |
1343 | 6643d27e | bellard | {"cabs.ole.d", "M,S,T", 0x46200076, 0xffe000ff, RD_S|RD_T|WR_CC|FP_D, M3D }, |
1344 | 6643d27e | bellard | {"cabs.ole.ps","M,S,T", 0x46c00076, 0xffe000ff, RD_S|RD_T|WR_CC|FP_D, M3D }, |
1345 | 6643d27e | bellard | {"cabs.ole.s", "M,S,T", 0x46000076, 0xffe000ff, RD_S|RD_T|WR_CC|FP_S, M3D }, |
1346 | 6643d27e | bellard | {"cabs.olt.d", "M,S,T", 0x46200074, 0xffe000ff, RD_S|RD_T|WR_CC|FP_D, M3D }, |
1347 | 6643d27e | bellard | {"cabs.olt.ps","M,S,T", 0x46c00074, 0xffe000ff, RD_S|RD_T|WR_CC|FP_D, M3D }, |
1348 | 6643d27e | bellard | {"cabs.olt.s", "M,S,T", 0x46000074, 0xffe000ff, RD_S|RD_T|WR_CC|FP_S, M3D }, |
1349 | 6643d27e | bellard | {"cabs.seq.d", "M,S,T", 0x4620007a, 0xffe000ff, RD_S|RD_T|WR_CC|FP_D, M3D }, |
1350 | 6643d27e | bellard | {"cabs.seq.ps","M,S,T", 0x46c0007a, 0xffe000ff, RD_S|RD_T|WR_CC|FP_D, M3D }, |
1351 | 6643d27e | bellard | {"cabs.seq.s", "M,S,T", 0x4600007a, 0xffe000ff, RD_S|RD_T|WR_CC|FP_S, M3D }, |
1352 | 6643d27e | bellard | {"cabs.sf.d", "M,S,T", 0x46200078, 0xffe000ff, RD_S|RD_T|WR_CC|FP_D, M3D }, |
1353 | 6643d27e | bellard | {"cabs.sf.ps", "M,S,T", 0x46c00078, 0xffe000ff, RD_S|RD_T|WR_CC|FP_D, M3D }, |
1354 | 6643d27e | bellard | {"cabs.sf.s", "M,S,T", 0x46000078, 0xffe000ff, RD_S|RD_T|WR_CC|FP_S, M3D }, |
1355 | 6643d27e | bellard | {"cabs.ueq.d", "M,S,T", 0x46200073, 0xffe000ff, RD_S|RD_T|WR_CC|FP_D, M3D }, |
1356 | 6643d27e | bellard | {"cabs.ueq.ps","M,S,T", 0x46c00073, 0xffe000ff, RD_S|RD_T|WR_CC|FP_D, M3D }, |
1357 | 6643d27e | bellard | {"cabs.ueq.s", "M,S,T", 0x46000073, 0xffe000ff, RD_S|RD_T|WR_CC|FP_S, M3D }, |
1358 | 6643d27e | bellard | {"cabs.ule.d", "M,S,T", 0x46200077, 0xffe000ff, RD_S|RD_T|WR_CC|FP_D, M3D }, |
1359 | 6643d27e | bellard | {"cabs.ule.ps","M,S,T", 0x46c00077, 0xffe000ff, RD_S|RD_T|WR_CC|FP_D, M3D }, |
1360 | 6643d27e | bellard | {"cabs.ule.s", "M,S,T", 0x46000077, 0xffe000ff, RD_S|RD_T|WR_CC|FP_S, M3D }, |
1361 | 6643d27e | bellard | {"cabs.ult.d", "M,S,T", 0x46200075, 0xffe000ff, RD_S|RD_T|WR_CC|FP_D, M3D }, |
1362 | 6643d27e | bellard | {"cabs.ult.ps","M,S,T", 0x46c00075, 0xffe000ff, RD_S|RD_T|WR_CC|FP_D, M3D }, |
1363 | 6643d27e | bellard | {"cabs.ult.s", "M,S,T", 0x46000075, 0xffe000ff, RD_S|RD_T|WR_CC|FP_S, M3D }, |
1364 | 6643d27e | bellard | {"cabs.un.d", "M,S,T", 0x46200071, 0xffe000ff, RD_S|RD_T|WR_CC|FP_D, M3D }, |
1365 | 6643d27e | bellard | {"cabs.un.ps", "M,S,T", 0x46c00071, 0xffe000ff, RD_S|RD_T|WR_CC|FP_D, M3D }, |
1366 | 6643d27e | bellard | {"cabs.un.s", "M,S,T", 0x46000071, 0xffe000ff, RD_S|RD_T|WR_CC|FP_S, M3D }, |
1367 | 6643d27e | bellard | {"cache", "k,o(b)", 0xbc000000, 0xfc000000, RD_b, I3|I32|T3}, |
1368 | 6643d27e | bellard | {"ceil.l.d", "D,S", 0x4620000a, 0xffff003f, WR_D|RD_S|FP_D, I3 }, |
1369 | 6643d27e | bellard | {"ceil.l.s", "D,S", 0x4600000a, 0xffff003f, WR_D|RD_S|FP_S, I3 }, |
1370 | 6643d27e | bellard | {"ceil.w.d", "D,S", 0x4620000e, 0xffff003f, WR_D|RD_S|FP_D, I2 }, |
1371 | 6643d27e | bellard | {"ceil.w.s", "D,S", 0x4600000e, 0xffff003f, WR_D|RD_S|FP_S, I2 }, |
1372 | 6643d27e | bellard | {"cfc0", "t,G", 0x40400000, 0xffe007ff, LCD|WR_t|RD_C0, I1 }, |
1373 | 6643d27e | bellard | {"cfc1", "t,G", 0x44400000, 0xffe007ff, LCD|WR_t|RD_C1|FP_S, I1 }, |
1374 | 6643d27e | bellard | {"cfc1", "t,S", 0x44400000, 0xffe007ff, LCD|WR_t|RD_C1|FP_S, I1 }, |
1375 | 6643d27e | bellard | /* cfc2 is at the bottom of the table. */
|
1376 | 6643d27e | bellard | {"cfc3", "t,G", 0x4c400000, 0xffe007ff, LCD|WR_t|RD_C3, I1 }, |
1377 | 6643d27e | bellard | {"clo", "U,s", 0x70000021, 0xfc0007ff, WR_d|WR_t|RD_s, I32|N55 }, |
1378 | 6643d27e | bellard | {"clz", "U,s", 0x70000020, 0xfc0007ff, WR_d|WR_t|RD_s, I32|N55 }, |
1379 | 6643d27e | bellard | {"ctc0", "t,G", 0x40c00000, 0xffe007ff, COD|RD_t|WR_CC, I1 }, |
1380 | 6643d27e | bellard | {"ctc1", "t,G", 0x44c00000, 0xffe007ff, COD|RD_t|WR_CC|FP_S, I1 }, |
1381 | 6643d27e | bellard | {"ctc1", "t,S", 0x44c00000, 0xffe007ff, COD|RD_t|WR_CC|FP_S, I1 }, |
1382 | 6643d27e | bellard | /* ctc2 is at the bottom of the table. */
|
1383 | 6643d27e | bellard | {"ctc3", "t,G", 0x4cc00000, 0xffe007ff, COD|RD_t|WR_CC, I1 }, |
1384 | 6643d27e | bellard | {"cvt.d.l", "D,S", 0x46a00021, 0xffff003f, WR_D|RD_S|FP_D, I3 }, |
1385 | 6643d27e | bellard | {"cvt.d.s", "D,S", 0x46000021, 0xffff003f, WR_D|RD_S|FP_D|FP_S, I1 }, |
1386 | 6643d27e | bellard | {"cvt.d.w", "D,S", 0x46800021, 0xffff003f, WR_D|RD_S|FP_D, I1 }, |
1387 | 6643d27e | bellard | {"cvt.l.d", "D,S", 0x46200025, 0xffff003f, WR_D|RD_S|FP_D, I3 }, |
1388 | 6643d27e | bellard | {"cvt.l.s", "D,S", 0x46000025, 0xffff003f, WR_D|RD_S|FP_S, I3 }, |
1389 | 6643d27e | bellard | {"cvt.s.l", "D,S", 0x46a00020, 0xffff003f, WR_D|RD_S|FP_S, I3 }, |
1390 | 6643d27e | bellard | {"cvt.s.d", "D,S", 0x46200020, 0xffff003f, WR_D|RD_S|FP_S|FP_D, I1 }, |
1391 | 6643d27e | bellard | {"cvt.s.w", "D,S", 0x46800020, 0xffff003f, WR_D|RD_S|FP_S, I1 }, |
1392 | 6643d27e | bellard | {"cvt.s.pl","D,S", 0x46c00028, 0xffff003f, WR_D|RD_S|FP_S|FP_D, I5 }, |
1393 | 6643d27e | bellard | {"cvt.s.pu","D,S", 0x46c00020, 0xffff003f, WR_D|RD_S|FP_S|FP_D, I5 }, |
1394 | 6643d27e | bellard | {"cvt.w.d", "D,S", 0x46200024, 0xffff003f, WR_D|RD_S|FP_D, I1 }, |
1395 | 6643d27e | bellard | {"cvt.w.s", "D,S", 0x46000024, 0xffff003f, WR_D|RD_S|FP_S, I1 }, |
1396 | 6643d27e | bellard | {"cvt.ps.pw", "D,S", 0x46800026, 0xffff003f, WR_D|RD_S|FP_S|FP_D, M3D }, |
1397 | 6643d27e | bellard | {"cvt.ps.s","D,V,T", 0x46000026, 0xffe0003f, WR_D|RD_S|RD_T|FP_D, I5 }, |
1398 | 6643d27e | bellard | {"cvt.pw.ps", "D,S", 0x46c00024, 0xffff003f, WR_D|RD_S|FP_S|FP_D, M3D }, |
1399 | 6643d27e | bellard | {"dabs", "d,v", 0, (int) M_DABS, INSN_MACRO, I3 }, |
1400 | 6643d27e | bellard | {"dadd", "d,v,t", 0x0000002c, 0xfc0007ff, WR_d|RD_s|RD_t, I3 }, |
1401 | 6643d27e | bellard | {"dadd", "t,r,I", 0, (int) M_DADD_I, INSN_MACRO, I3 }, |
1402 | 6643d27e | bellard | {"daddi", "t,r,j", 0x60000000, 0xfc000000, WR_t|RD_s, I3 }, |
1403 | 6643d27e | bellard | {"daddiu", "t,r,j", 0x64000000, 0xfc000000, WR_t|RD_s, I3 }, |
1404 | 6643d27e | bellard | {"daddu", "d,v,t", 0x0000002d, 0xfc0007ff, WR_d|RD_s|RD_t, I3 }, |
1405 | 6643d27e | bellard | {"daddu", "t,r,I", 0, (int) M_DADDU_I, INSN_MACRO, I3 }, |
1406 | 6643d27e | bellard | {"dbreak", "", 0x7000003f, 0xffffffff, 0, N5 }, |
1407 | 6643d27e | bellard | {"dclo", "U,s", 0x70000025, 0xfc0007ff, RD_s|WR_d|WR_t, I64|N55 }, |
1408 | 6643d27e | bellard | {"dclz", "U,s", 0x70000024, 0xfc0007ff, RD_s|WR_d|WR_t, I64|N55 }, |
1409 | 6643d27e | bellard | /* dctr and dctw are used on the r5000. */
|
1410 | 6643d27e | bellard | {"dctr", "o(b)", 0xbc050000, 0xfc1f0000, RD_b, I3 }, |
1411 | 6643d27e | bellard | {"dctw", "o(b)", 0xbc090000, 0xfc1f0000, RD_b, I3 }, |
1412 | 6643d27e | bellard | {"deret", "", 0x4200001f, 0xffffffff, 0, I32|G2 }, |
1413 | 6643d27e | bellard | {"dext", "t,r,I,+I", 0, (int) M_DEXT, INSN_MACRO, I65 }, |
1414 | 6643d27e | bellard | {"dext", "t,r,+A,+C", 0x7c000003, 0xfc00003f, WR_t|RD_s, I65 }, |
1415 | 6643d27e | bellard | {"dextm", "t,r,+A,+G", 0x7c000001, 0xfc00003f, WR_t|RD_s, I65 }, |
1416 | 6643d27e | bellard | {"dextu", "t,r,+E,+H", 0x7c000002, 0xfc00003f, WR_t|RD_s, I65 }, |
1417 | 6643d27e | bellard | /* For ddiv, see the comments about div. */
|
1418 | 6643d27e | bellard | {"ddiv", "z,s,t", 0x0000001e, 0xfc00ffff, RD_s|RD_t|WR_HILO, I3 }, |
1419 | 6643d27e | bellard | {"ddiv", "d,v,t", 0, (int) M_DDIV_3, INSN_MACRO, I3 }, |
1420 | 6643d27e | bellard | {"ddiv", "d,v,I", 0, (int) M_DDIV_3I, INSN_MACRO, I3 }, |
1421 | 6643d27e | bellard | /* For ddivu, see the comments about div. */
|
1422 | 6643d27e | bellard | {"ddivu", "z,s,t", 0x0000001f, 0xfc00ffff, RD_s|RD_t|WR_HILO, I3 }, |
1423 | 6643d27e | bellard | {"ddivu", "d,v,t", 0, (int) M_DDIVU_3, INSN_MACRO, I3 }, |
1424 | 6643d27e | bellard | {"ddivu", "d,v,I", 0, (int) M_DDIVU_3I, INSN_MACRO, I3 }, |
1425 | 6643d27e | bellard | {"di", "", 0x41606000, 0xffffffff, WR_t|WR_C0, I33 }, |
1426 | 6643d27e | bellard | {"di", "t", 0x41606000, 0xffe0ffff, WR_t|WR_C0, I33 }, |
1427 | 6643d27e | bellard | {"dins", "t,r,I,+I", 0, (int) M_DINS, INSN_MACRO, I65 }, |
1428 | 6643d27e | bellard | {"dins", "t,r,+A,+B", 0x7c000007, 0xfc00003f, WR_t|RD_s, I65 }, |
1429 | 6643d27e | bellard | {"dinsm", "t,r,+A,+F", 0x7c000005, 0xfc00003f, WR_t|RD_s, I65 }, |
1430 | 6643d27e | bellard | {"dinsu", "t,r,+E,+F", 0x7c000006, 0xfc00003f, WR_t|RD_s, I65 }, |
1431 | 6643d27e | bellard | /* The MIPS assembler treats the div opcode with two operands as
|
1432 | 6643d27e | bellard | though the first operand appeared twice (the first operand is both
|
1433 | 6643d27e | bellard | a source and a destination). To get the div machine instruction,
|
1434 | 6643d27e | bellard | you must use an explicit destination of $0. */
|
1435 | 6643d27e | bellard | {"div", "z,s,t", 0x0000001a, 0xfc00ffff, RD_s|RD_t|WR_HILO, I1 }, |
1436 | 6643d27e | bellard | {"div", "z,t", 0x0000001a, 0xffe0ffff, RD_s|RD_t|WR_HILO, I1 }, |
1437 | 6643d27e | bellard | {"div", "d,v,t", 0, (int) M_DIV_3, INSN_MACRO, I1 }, |
1438 | 6643d27e | bellard | {"div", "d,v,I", 0, (int) M_DIV_3I, INSN_MACRO, I1 }, |
1439 | 6643d27e | bellard | {"div.d", "D,V,T", 0x46200003, 0xffe0003f, WR_D|RD_S|RD_T|FP_D, I1 }, |
1440 | 6643d27e | bellard | {"div.s", "D,V,T", 0x46000003, 0xffe0003f, WR_D|RD_S|RD_T|FP_S, I1 }, |
1441 | 6643d27e | bellard | {"div.ps", "D,V,T", 0x46c00003, 0xffe0003f, WR_D|RD_S|RD_T|FP_D, SB1 }, |
1442 | 6643d27e | bellard | /* For divu, see the comments about div. */
|
1443 | 6643d27e | bellard | {"divu", "z,s,t", 0x0000001b, 0xfc00ffff, RD_s|RD_t|WR_HILO, I1 }, |
1444 | 6643d27e | bellard | {"divu", "z,t", 0x0000001b, 0xffe0ffff, RD_s|RD_t|WR_HILO, I1 }, |
1445 | 6643d27e | bellard | {"divu", "d,v,t", 0, (int) M_DIVU_3, INSN_MACRO, I1 }, |
1446 | 6643d27e | bellard | {"divu", "d,v,I", 0, (int) M_DIVU_3I, INSN_MACRO, I1 }, |
1447 | 6643d27e | bellard | {"dla", "t,A(b)", 0, (int) M_DLA_AB, INSN_MACRO, I3 }, |
1448 | 6643d27e | bellard | {"dlca", "t,A(b)", 0, (int) M_DLCA_AB, INSN_MACRO, I3 }, |
1449 | 6643d27e | bellard | {"dli", "t,j", 0x24000000, 0xffe00000, WR_t, I3 }, /* addiu */ |
1450 | 6643d27e | bellard | {"dli", "t,i", 0x34000000, 0xffe00000, WR_t, I3 }, /* ori */ |
1451 | 6643d27e | bellard | {"dli", "t,I", 0, (int) M_DLI, INSN_MACRO, I3 }, |
1452 | 6643d27e | bellard | {"dmacc", "d,s,t", 0x00000029, 0xfc0007ff, RD_s|RD_t|WR_LO|WR_d, N412 }, |
1453 | 6643d27e | bellard | {"dmacchi", "d,s,t", 0x00000229, 0xfc0007ff, RD_s|RD_t|WR_LO|WR_d, N412 }, |
1454 | 6643d27e | bellard | {"dmacchis", "d,s,t", 0x00000629, 0xfc0007ff, RD_s|RD_t|WR_LO|WR_d, N412 }, |
1455 | 6643d27e | bellard | {"dmacchiu", "d,s,t", 0x00000269, 0xfc0007ff, RD_s|RD_t|WR_LO|WR_d, N412 }, |
1456 | 6643d27e | bellard | {"dmacchius", "d,s,t", 0x00000669, 0xfc0007ff, RD_s|RD_t|WR_LO|WR_d, N412 }, |
1457 | 6643d27e | bellard | {"dmaccs", "d,s,t", 0x00000429, 0xfc0007ff, RD_s|RD_t|WR_LO|WR_d, N412 }, |
1458 | 6643d27e | bellard | {"dmaccu", "d,s,t", 0x00000069, 0xfc0007ff, RD_s|RD_t|WR_LO|WR_d, N412 }, |
1459 | 6643d27e | bellard | {"dmaccus", "d,s,t", 0x00000469, 0xfc0007ff, RD_s|RD_t|WR_LO|WR_d, N412 }, |
1460 | 6643d27e | bellard | {"dmadd16", "s,t", 0x00000029, 0xfc00ffff, RD_s|RD_t|MOD_LO, N411 }, |
1461 | 6643d27e | bellard | {"dmfc0", "t,G", 0x40200000, 0xffe007ff, LCD|WR_t|RD_C0, I3 }, |
1462 | 6643d27e | bellard | {"dmfc0", "t,+D", 0x40200000, 0xffe007f8, LCD|WR_t|RD_C0, I64 }, |
1463 | 6643d27e | bellard | {"dmfc0", "t,G,H", 0x40200000, 0xffe007f8, LCD|WR_t|RD_C0, I64 }, |
1464 | 6643d27e | bellard | {"dmtc0", "t,G", 0x40a00000, 0xffe007ff, COD|RD_t|WR_C0|WR_CC, I3 }, |
1465 | 6643d27e | bellard | {"dmtc0", "t,+D", 0x40a00000, 0xffe007f8, COD|RD_t|WR_C0|WR_CC, I64 }, |
1466 | 6643d27e | bellard | {"dmtc0", "t,G,H", 0x40a00000, 0xffe007f8, COD|RD_t|WR_C0|WR_CC, I64 }, |
1467 | 6643d27e | bellard | {"dmfc1", "t,S", 0x44200000, 0xffe007ff, LCD|WR_t|RD_S|FP_S, I3 }, |
1468 | 6643d27e | bellard | {"dmfc1", "t,G", 0x44200000, 0xffe007ff, LCD|WR_t|RD_S|FP_S, I3 }, |
1469 | 6643d27e | bellard | {"dmtc1", "t,S", 0x44a00000, 0xffe007ff, COD|RD_t|WR_S|FP_S, I3 }, |
1470 | 6643d27e | bellard | {"dmtc1", "t,G", 0x44a00000, 0xffe007ff, COD|RD_t|WR_S|FP_S, I3 }, |
1471 | 6643d27e | bellard | /* dmfc2 is at the bottom of the table. */
|
1472 | 6643d27e | bellard | /* dmtc2 is at the bottom of the table. */
|
1473 | 6643d27e | bellard | {"dmfc3", "t,G", 0x4c200000, 0xffe007ff, LCD|WR_t|RD_C3, I3 }, |
1474 | 6643d27e | bellard | {"dmfc3", "t,G,H", 0x4c200000, 0xffe007f8, LCD|WR_t|RD_C3, I64 }, |
1475 | 6643d27e | bellard | {"dmtc3", "t,G", 0x4ca00000, 0xffe007ff, COD|RD_t|WR_C3|WR_CC, I3 }, |
1476 | 6643d27e | bellard | {"dmtc3", "t,G,H", 0x4ca00000, 0xffe007f8, COD|RD_t|WR_C3|WR_CC, I64 }, |
1477 | 6643d27e | bellard | {"dmul", "d,v,t", 0, (int) M_DMUL, INSN_MACRO, I3 }, |
1478 | 6643d27e | bellard | {"dmul", "d,v,I", 0, (int) M_DMUL_I, INSN_MACRO, I3 }, |
1479 | 6643d27e | bellard | {"dmulo", "d,v,t", 0, (int) M_DMULO, INSN_MACRO, I3 }, |
1480 | 6643d27e | bellard | {"dmulo", "d,v,I", 0, (int) M_DMULO_I, INSN_MACRO, I3 }, |
1481 | 6643d27e | bellard | {"dmulou", "d,v,t", 0, (int) M_DMULOU, INSN_MACRO, I3 }, |
1482 | 6643d27e | bellard | {"dmulou", "d,v,I", 0, (int) M_DMULOU_I, INSN_MACRO, I3 }, |
1483 | 6643d27e | bellard | {"dmult", "s,t", 0x0000001c, 0xfc00ffff, RD_s|RD_t|WR_HILO, I3 }, |
1484 | 6643d27e | bellard | {"dmultu", "s,t", 0x0000001d, 0xfc00ffff, RD_s|RD_t|WR_HILO, I3 }, |
1485 | 6643d27e | bellard | {"dneg", "d,w", 0x0000002e, 0xffe007ff, WR_d|RD_t, I3 }, /* dsub 0 */ |
1486 | 6643d27e | bellard | {"dnegu", "d,w", 0x0000002f, 0xffe007ff, WR_d|RD_t, I3 }, /* dsubu 0*/ |
1487 | 6643d27e | bellard | {"drem", "z,s,t", 0x0000001e, 0xfc00ffff, RD_s|RD_t|WR_HILO, I3 }, |
1488 | 6643d27e | bellard | {"drem", "d,v,t", 3, (int) M_DREM_3, INSN_MACRO, I3 }, |
1489 | 6643d27e | bellard | {"drem", "d,v,I", 3, (int) M_DREM_3I, INSN_MACRO, I3 }, |
1490 | 6643d27e | bellard | {"dremu", "z,s,t", 0x0000001f, 0xfc00ffff, RD_s|RD_t|WR_HILO, I3 }, |
1491 | 6643d27e | bellard | {"dremu", "d,v,t", 3, (int) M_DREMU_3, INSN_MACRO, I3 }, |
1492 | 6643d27e | bellard | {"dremu", "d,v,I", 3, (int) M_DREMU_3I, INSN_MACRO, I3 }, |
1493 | 6643d27e | bellard | {"dret", "", 0x7000003e, 0xffffffff, 0, N5 }, |
1494 | 6643d27e | bellard | {"drol", "d,v,t", 0, (int) M_DROL, INSN_MACRO, I3 }, |
1495 | 6643d27e | bellard | {"drol", "d,v,I", 0, (int) M_DROL_I, INSN_MACRO, I3 }, |
1496 | 6643d27e | bellard | {"dror", "d,v,t", 0, (int) M_DROR, INSN_MACRO, I3 }, |
1497 | 6643d27e | bellard | {"dror", "d,v,I", 0, (int) M_DROR_I, INSN_MACRO, I3 }, |
1498 | 6643d27e | bellard | {"dror", "d,w,<", 0x0020003a, 0xffe0003f, WR_d|RD_t, N5|I65 }, |
1499 | 6643d27e | bellard | {"drorv", "d,t,s", 0x00000056, 0xfc0007ff, RD_t|RD_s|WR_d, N5|I65 }, |
1500 | 6643d27e | bellard | {"dror32", "d,w,<", 0x0020003e, 0xffe0003f, WR_d|RD_t, N5|I65 }, |
1501 | 6643d27e | bellard | {"drotl", "d,v,t", 0, (int) M_DROL, INSN_MACRO, I65 }, |
1502 | 6643d27e | bellard | {"drotl", "d,v,I", 0, (int) M_DROL_I, INSN_MACRO, I65 }, |
1503 | 6643d27e | bellard | {"drotr", "d,v,t", 0, (int) M_DROR, INSN_MACRO, I65 }, |
1504 | 6643d27e | bellard | {"drotr", "d,v,I", 0, (int) M_DROR_I, INSN_MACRO, I65 }, |
1505 | 6643d27e | bellard | {"drotrv", "d,t,s", 0x00000056, 0xfc0007ff, RD_t|RD_s|WR_d, I65 }, |
1506 | 6643d27e | bellard | {"drotr32", "d,w,<", 0x0020003e, 0xffe0003f, WR_d|RD_t, I65 }, |
1507 | 6643d27e | bellard | {"dsbh", "d,w", 0x7c0000a4, 0xffe007ff, WR_d|RD_t, I65 }, |
1508 | 6643d27e | bellard | {"dshd", "d,w", 0x7c000164, 0xffe007ff, WR_d|RD_t, I65 }, |
1509 | 6643d27e | bellard | {"dsllv", "d,t,s", 0x00000014, 0xfc0007ff, WR_d|RD_t|RD_s, I3 }, |
1510 | 6643d27e | bellard | {"dsll32", "d,w,<", 0x0000003c, 0xffe0003f, WR_d|RD_t, I3 }, |
1511 | 6643d27e | bellard | {"dsll", "d,w,s", 0x00000014, 0xfc0007ff, WR_d|RD_t|RD_s, I3 }, /* dsllv */ |
1512 | 6643d27e | bellard | {"dsll", "d,w,>", 0x0000003c, 0xffe0003f, WR_d|RD_t, I3 }, /* dsll32 */ |
1513 | 6643d27e | bellard | {"dsll", "d,w,<", 0x00000038, 0xffe0003f, WR_d|RD_t, I3 }, |
1514 | 6643d27e | bellard | {"dsrav", "d,t,s", 0x00000017, 0xfc0007ff, WR_d|RD_t|RD_s, I3 }, |
1515 | 6643d27e | bellard | {"dsra32", "d,w,<", 0x0000003f, 0xffe0003f, WR_d|RD_t, I3 }, |
1516 | 6643d27e | bellard | {"dsra", "d,w,s", 0x00000017, 0xfc0007ff, WR_d|RD_t|RD_s, I3 }, /* dsrav */ |
1517 | 6643d27e | bellard | {"dsra", "d,w,>", 0x0000003f, 0xffe0003f, WR_d|RD_t, I3 }, /* dsra32 */ |
1518 | 6643d27e | bellard | {"dsra", "d,w,<", 0x0000003b, 0xffe0003f, WR_d|RD_t, I3 }, |
1519 | 6643d27e | bellard | {"dsrlv", "d,t,s", 0x00000016, 0xfc0007ff, WR_d|RD_t|RD_s, I3 }, |
1520 | 6643d27e | bellard | {"dsrl32", "d,w,<", 0x0000003e, 0xffe0003f, WR_d|RD_t, I3 }, |
1521 | 6643d27e | bellard | {"dsrl", "d,w,s", 0x00000016, 0xfc0007ff, WR_d|RD_t|RD_s, I3 }, /* dsrlv */ |
1522 | 6643d27e | bellard | {"dsrl", "d,w,>", 0x0000003e, 0xffe0003f, WR_d|RD_t, I3 }, /* dsrl32 */ |
1523 | 6643d27e | bellard | {"dsrl", "d,w,<", 0x0000003a, 0xffe0003f, WR_d|RD_t, I3 }, |
1524 | 6643d27e | bellard | {"dsub", "d,v,t", 0x0000002e, 0xfc0007ff, WR_d|RD_s|RD_t, I3 }, |
1525 | 6643d27e | bellard | {"dsub", "d,v,I", 0, (int) M_DSUB_I, INSN_MACRO, I3 }, |
1526 | 6643d27e | bellard | {"dsubu", "d,v,t", 0x0000002f, 0xfc0007ff, WR_d|RD_s|RD_t, I3 }, |
1527 | 6643d27e | bellard | {"dsubu", "d,v,I", 0, (int) M_DSUBU_I, INSN_MACRO, I3 }, |
1528 | 6643d27e | bellard | {"ei", "", 0x41606020, 0xffffffff, WR_t|WR_C0, I33 }, |
1529 | 6643d27e | bellard | {"ei", "t", 0x41606020, 0xffe0ffff, WR_t|WR_C0, I33 }, |
1530 | 6643d27e | bellard | {"eret", "", 0x42000018, 0xffffffff, 0, I3|I32 }, |
1531 | 6643d27e | bellard | {"ext", "t,r,+A,+C", 0x7c000000, 0xfc00003f, WR_t|RD_s, I33 }, |
1532 | 6643d27e | bellard | {"floor.l.d", "D,S", 0x4620000b, 0xffff003f, WR_D|RD_S|FP_D, I3 }, |
1533 | 6643d27e | bellard | {"floor.l.s", "D,S", 0x4600000b, 0xffff003f, WR_D|RD_S|FP_S, I3 }, |
1534 | 6643d27e | bellard | {"floor.w.d", "D,S", 0x4620000f, 0xffff003f, WR_D|RD_S|FP_D, I2 }, |
1535 | 6643d27e | bellard | {"floor.w.s", "D,S", 0x4600000f, 0xffff003f, WR_D|RD_S|FP_S, I2 }, |
1536 | 6643d27e | bellard | {"flushi", "", 0xbc010000, 0xffffffff, 0, L1 }, |
1537 | 6643d27e | bellard | {"flushd", "", 0xbc020000, 0xffffffff, 0, L1 }, |
1538 | 6643d27e | bellard | {"flushid", "", 0xbc030000, 0xffffffff, 0, L1 }, |
1539 | 6643d27e | bellard | {"hibernate","", 0x42000023, 0xffffffff, 0, V1 }, |
1540 | 6643d27e | bellard | {"ins", "t,r,+A,+B", 0x7c000004, 0xfc00003f, WR_t|RD_s, I33 }, |
1541 | 6643d27e | bellard | {"jr", "s", 0x00000008, 0xfc1fffff, UBD|RD_s, I1 }, |
1542 | 6643d27e | bellard | {"jr.hb", "s", 0x00000408, 0xfc1fffff, UBD|RD_s, I33 }, |
1543 | 6643d27e | bellard | {"j", "s", 0x00000008, 0xfc1fffff, UBD|RD_s, I1 }, /* jr */ |
1544 | 6643d27e | bellard | /* SVR4 PIC code requires special handling for j, so it must be a
|
1545 | 6643d27e | bellard | macro. */
|
1546 | 6643d27e | bellard | {"j", "a", 0, (int) M_J_A, INSN_MACRO, I1 }, |
1547 | 6643d27e | bellard | /* This form of j is used by the disassembler and internally by the
|
1548 | 6643d27e | bellard | assembler, but will never match user input (because the line above
|
1549 | 6643d27e | bellard | will match first). */
|
1550 | 6643d27e | bellard | {"j", "a", 0x08000000, 0xfc000000, UBD, I1 }, |
1551 | 6643d27e | bellard | {"jalr", "s", 0x0000f809, 0xfc1fffff, UBD|RD_s|WR_d, I1 }, |
1552 | 6643d27e | bellard | {"jalr", "d,s", 0x00000009, 0xfc1f07ff, UBD|RD_s|WR_d, I1 }, |
1553 | 6643d27e | bellard | {"jalr.hb", "s", 0x0000fc09, 0xfc1fffff, UBD|RD_s|WR_d, I33 }, |
1554 | 6643d27e | bellard | {"jalr.hb", "d,s", 0x00000409, 0xfc1f07ff, UBD|RD_s|WR_d, I33 }, |
1555 | 6643d27e | bellard | /* SVR4 PIC code requires special handling for jal, so it must be a
|
1556 | 6643d27e | bellard | macro. */
|
1557 | 6643d27e | bellard | {"jal", "d,s", 0, (int) M_JAL_2, INSN_MACRO, I1 }, |
1558 | 6643d27e | bellard | {"jal", "s", 0, (int) M_JAL_1, INSN_MACRO, I1 }, |
1559 | 6643d27e | bellard | {"jal", "a", 0, (int) M_JAL_A, INSN_MACRO, I1 }, |
1560 | 6643d27e | bellard | /* This form of jal is used by the disassembler and internally by the
|
1561 | 6643d27e | bellard | assembler, but will never match user input (because the line above
|
1562 | 6643d27e | bellard | will match first). */
|
1563 | 6643d27e | bellard | {"jal", "a", 0x0c000000, 0xfc000000, UBD|WR_31, I1 }, |
1564 | 6643d27e | bellard | {"jalx", "a", 0x74000000, 0xfc000000, UBD|WR_31, I16 }, |
1565 | 6643d27e | bellard | {"la", "t,A(b)", 0, (int) M_LA_AB, INSN_MACRO, I1 }, |
1566 | 6643d27e | bellard | {"lb", "t,o(b)", 0x80000000, 0xfc000000, LDD|RD_b|WR_t, I1 }, |
1567 | 6643d27e | bellard | {"lb", "t,A(b)", 0, (int) M_LB_AB, INSN_MACRO, I1 }, |
1568 | 6643d27e | bellard | {"lbu", "t,o(b)", 0x90000000, 0xfc000000, LDD|RD_b|WR_t, I1 }, |
1569 | 6643d27e | bellard | {"lbu", "t,A(b)", 0, (int) M_LBU_AB, INSN_MACRO, I1 }, |
1570 | 6643d27e | bellard | {"lca", "t,A(b)", 0, (int) M_LCA_AB, INSN_MACRO, I1 }, |
1571 | 6643d27e | bellard | {"ld", "t,o(b)", 0xdc000000, 0xfc000000, WR_t|RD_b, I3 }, |
1572 | 6643d27e | bellard | {"ld", "t,o(b)", 0, (int) M_LD_OB, INSN_MACRO, I1 }, |
1573 | 6643d27e | bellard | {"ld", "t,A(b)", 0, (int) M_LD_AB, INSN_MACRO, I1 }, |
1574 | 6643d27e | bellard | {"ldc1", "T,o(b)", 0xd4000000, 0xfc000000, CLD|RD_b|WR_T|FP_D, I2 }, |
1575 | 6643d27e | bellard | {"ldc1", "E,o(b)", 0xd4000000, 0xfc000000, CLD|RD_b|WR_T|FP_D, I2 }, |
1576 | 6643d27e | bellard | {"ldc1", "T,A(b)", 0, (int) M_LDC1_AB, INSN_MACRO, I2 }, |
1577 | 6643d27e | bellard | {"ldc1", "E,A(b)", 0, (int) M_LDC1_AB, INSN_MACRO, I2 }, |
1578 | 6643d27e | bellard | {"l.d", "T,o(b)", 0xd4000000, 0xfc000000, CLD|RD_b|WR_T|FP_D, I2 }, /* ldc1 */ |
1579 | 6643d27e | bellard | {"l.d", "T,o(b)", 0, (int) M_L_DOB, INSN_MACRO, I1 }, |
1580 | 6643d27e | bellard | {"l.d", "T,A(b)", 0, (int) M_L_DAB, INSN_MACRO, I1 }, |
1581 | 6643d27e | bellard | {"ldc2", "E,o(b)", 0xd8000000, 0xfc000000, CLD|RD_b|WR_CC, I2 }, |
1582 | 6643d27e | bellard | {"ldc2", "E,A(b)", 0, (int) M_LDC2_AB, INSN_MACRO, I2 }, |
1583 | 6643d27e | bellard | {"ldc3", "E,o(b)", 0xdc000000, 0xfc000000, CLD|RD_b|WR_CC, I2 }, |
1584 | 6643d27e | bellard | {"ldc3", "E,A(b)", 0, (int) M_LDC3_AB, INSN_MACRO, I2 }, |
1585 | 6643d27e | bellard | {"ldl", "t,o(b)", 0x68000000, 0xfc000000, LDD|WR_t|RD_b, I3 }, |
1586 | 6643d27e | bellard | {"ldl", "t,A(b)", 0, (int) M_LDL_AB, INSN_MACRO, I3 }, |
1587 | 6643d27e | bellard | {"ldr", "t,o(b)", 0x6c000000, 0xfc000000, LDD|WR_t|RD_b, I3 }, |
1588 | 6643d27e | bellard | {"ldr", "t,A(b)", 0, (int) M_LDR_AB, INSN_MACRO, I3 }, |
1589 | 6643d27e | bellard | {"ldxc1", "D,t(b)", 0x4c000001, 0xfc00f83f, LDD|WR_D|RD_t|RD_b, I4 }, |
1590 | 6643d27e | bellard | {"lh", "t,o(b)", 0x84000000, 0xfc000000, LDD|RD_b|WR_t, I1 }, |
1591 | 6643d27e | bellard | {"lh", "t,A(b)", 0, (int) M_LH_AB, INSN_MACRO, I1 }, |
1592 | 6643d27e | bellard | {"lhu", "t,o(b)", 0x94000000, 0xfc000000, LDD|RD_b|WR_t, I1 }, |
1593 | 6643d27e | bellard | {"lhu", "t,A(b)", 0, (int) M_LHU_AB, INSN_MACRO, I1 }, |
1594 | 6643d27e | bellard | /* li is at the start of the table. */
|
1595 | 6643d27e | bellard | {"li.d", "t,F", 0, (int) M_LI_D, INSN_MACRO, I1 }, |
1596 | 6643d27e | bellard | {"li.d", "T,L", 0, (int) M_LI_DD, INSN_MACRO, I1 }, |
1597 | 6643d27e | bellard | {"li.s", "t,f", 0, (int) M_LI_S, INSN_MACRO, I1 }, |
1598 | 6643d27e | bellard | {"li.s", "T,l", 0, (int) M_LI_SS, INSN_MACRO, I1 }, |
1599 | 6643d27e | bellard | {"ll", "t,o(b)", 0xc0000000, 0xfc000000, LDD|RD_b|WR_t, I2 }, |
1600 | 6643d27e | bellard | {"ll", "t,A(b)", 0, (int) M_LL_AB, INSN_MACRO, I2 }, |
1601 | 6643d27e | bellard | {"lld", "t,o(b)", 0xd0000000, 0xfc000000, LDD|RD_b|WR_t, I3 }, |
1602 | 6643d27e | bellard | {"lld", "t,A(b)", 0, (int) M_LLD_AB, INSN_MACRO, I3 }, |
1603 | 6643d27e | bellard | {"lui", "t,u", 0x3c000000, 0xffe00000, WR_t, I1 }, |
1604 | 6643d27e | bellard | {"luxc1", "D,t(b)", 0x4c000005, 0xfc00f83f, LDD|WR_D|RD_t|RD_b, I5|N55 }, |
1605 | 6643d27e | bellard | {"lw", "t,o(b)", 0x8c000000, 0xfc000000, LDD|RD_b|WR_t, I1 }, |
1606 | 6643d27e | bellard | {"lw", "t,A(b)", 0, (int) M_LW_AB, INSN_MACRO, I1 }, |
1607 | 6643d27e | bellard | {"lwc0", "E,o(b)", 0xc0000000, 0xfc000000, CLD|RD_b|WR_CC, I1 }, |
1608 | 6643d27e | bellard | {"lwc0", "E,A(b)", 0, (int) M_LWC0_AB, INSN_MACRO, I1 }, |
1609 | 6643d27e | bellard | {"lwc1", "T,o(b)", 0xc4000000, 0xfc000000, CLD|RD_b|WR_T|FP_S, I1 }, |
1610 | 6643d27e | bellard | {"lwc1", "E,o(b)", 0xc4000000, 0xfc000000, CLD|RD_b|WR_T|FP_S, I1 }, |
1611 | 6643d27e | bellard | {"lwc1", "T,A(b)", 0, (int) M_LWC1_AB, INSN_MACRO, I1 }, |
1612 | 6643d27e | bellard | {"lwc1", "E,A(b)", 0, (int) M_LWC1_AB, INSN_MACRO, I1 }, |
1613 | 6643d27e | bellard | {"l.s", "T,o(b)", 0xc4000000, 0xfc000000, CLD|RD_b|WR_T|FP_S, I1 }, /* lwc1 */ |
1614 | 6643d27e | bellard | {"l.s", "T,A(b)", 0, (int) M_LWC1_AB, INSN_MACRO, I1 }, |
1615 | 6643d27e | bellard | {"lwc2", "E,o(b)", 0xc8000000, 0xfc000000, CLD|RD_b|WR_CC, I1 }, |
1616 | 6643d27e | bellard | {"lwc2", "E,A(b)", 0, (int) M_LWC2_AB, INSN_MACRO, I1 }, |
1617 | 6643d27e | bellard | {"lwc3", "E,o(b)", 0xcc000000, 0xfc000000, CLD|RD_b|WR_CC, I1 }, |
1618 | 6643d27e | bellard | {"lwc3", "E,A(b)", 0, (int) M_LWC3_AB, INSN_MACRO, I1 }, |
1619 | 6643d27e | bellard | {"lwl", "t,o(b)", 0x88000000, 0xfc000000, LDD|RD_b|WR_t, I1 }, |
1620 | 6643d27e | bellard | {"lwl", "t,A(b)", 0, (int) M_LWL_AB, INSN_MACRO, I1 }, |
1621 | 6643d27e | bellard | {"lcache", "t,o(b)", 0x88000000, 0xfc000000, LDD|RD_b|WR_t, I2 }, /* same */ |
1622 | 6643d27e | bellard | {"lcache", "t,A(b)", 0, (int) M_LWL_AB, INSN_MACRO, I2 }, /* as lwl */ |
1623 | 6643d27e | bellard | {"lwr", "t,o(b)", 0x98000000, 0xfc000000, LDD|RD_b|WR_t, I1 }, |
1624 | 6643d27e | bellard | {"lwr", "t,A(b)", 0, (int) M_LWR_AB, INSN_MACRO, I1 }, |
1625 | 6643d27e | bellard | {"flush", "t,o(b)", 0x98000000, 0xfc000000, LDD|RD_b|WR_t, I2 }, /* same */ |
1626 | 6643d27e | bellard | {"flush", "t,A(b)", 0, (int) M_LWR_AB, INSN_MACRO, I2 }, /* as lwr */ |
1627 | 6643d27e | bellard | {"lwu", "t,o(b)", 0x9c000000, 0xfc000000, LDD|RD_b|WR_t, I3 }, |
1628 | 6643d27e | bellard | {"lwu", "t,A(b)", 0, (int) M_LWU_AB, INSN_MACRO, I3 }, |
1629 | 6643d27e | bellard | {"lwxc1", "D,t(b)", 0x4c000000, 0xfc00f83f, LDD|WR_D|RD_t|RD_b, I4 }, |
1630 | 6643d27e | bellard | {"macc", "d,s,t", 0x00000028, 0xfc0007ff, RD_s|RD_t|WR_HILO|WR_d, N412 }, |
1631 | 6643d27e | bellard | {"macc", "d,s,t", 0x00000158, 0xfc0007ff, RD_s|RD_t|WR_HILO|WR_d, N5 }, |
1632 | 6643d27e | bellard | {"maccs", "d,s,t", 0x00000428, 0xfc0007ff, RD_s|RD_t|WR_HILO|WR_d, N412 }, |
1633 | 6643d27e | bellard | {"macchi", "d,s,t", 0x00000228, 0xfc0007ff, RD_s|RD_t|WR_HILO|WR_d, N412 }, |
1634 | 6643d27e | bellard | {"macchi", "d,s,t", 0x00000358, 0xfc0007ff, RD_s|RD_t|WR_HILO|WR_d, N5 }, |
1635 | 6643d27e | bellard | {"macchis", "d,s,t", 0x00000628, 0xfc0007ff, RD_s|RD_t|WR_HILO|WR_d, N412 }, |
1636 | 6643d27e | bellard | {"macchiu", "d,s,t", 0x00000268, 0xfc0007ff, RD_s|RD_t|WR_HILO|WR_d, N412 }, |
1637 | 6643d27e | bellard | {"macchiu", "d,s,t", 0x00000359, 0xfc0007ff, RD_s|RD_t|WR_HILO|WR_d, N5 }, |
1638 | 6643d27e | bellard | {"macchius","d,s,t", 0x00000668, 0xfc0007ff, RD_s|RD_t|WR_HILO|WR_d, N412 }, |
1639 | 6643d27e | bellard | {"maccu", "d,s,t", 0x00000068, 0xfc0007ff, RD_s|RD_t|WR_HILO|WR_d, N412 }, |
1640 | 6643d27e | bellard | {"maccu", "d,s,t", 0x00000159, 0xfc0007ff, RD_s|RD_t|WR_HILO|WR_d, N5 }, |
1641 | 6643d27e | bellard | {"maccus", "d,s,t", 0x00000468, 0xfc0007ff, RD_s|RD_t|WR_HILO|WR_d, N412 }, |
1642 | 6643d27e | bellard | {"mad", "s,t", 0x70000000, 0xfc00ffff, RD_s|RD_t|MOD_HILO, P3 }, |
1643 | 6643d27e | bellard | {"madu", "s,t", 0x70000001, 0xfc00ffff, RD_s|RD_t|MOD_HILO, P3 }, |
1644 | 6643d27e | bellard | {"madd.d", "D,R,S,T", 0x4c000021, 0xfc00003f, RD_R|RD_S|RD_T|WR_D|FP_D, I4 }, |
1645 | 6643d27e | bellard | {"madd.s", "D,R,S,T", 0x4c000020, 0xfc00003f, RD_R|RD_S|RD_T|WR_D|FP_S, I4 }, |
1646 | 6643d27e | bellard | {"madd.ps", "D,R,S,T", 0x4c000026, 0xfc00003f, RD_R|RD_S|RD_T|WR_D|FP_D, I5 }, |
1647 | 6643d27e | bellard | {"madd", "s,t", 0x0000001c, 0xfc00ffff, RD_s|RD_t|WR_HILO, L1 }, |
1648 | 6643d27e | bellard | {"madd", "s,t", 0x70000000, 0xfc00ffff, RD_s|RD_t|MOD_HILO, I32|N55}, |
1649 | 6643d27e | bellard | {"madd", "s,t", 0x70000000, 0xfc00ffff, RD_s|RD_t|WR_HILO|IS_M, G1 }, |
1650 | 6643d27e | bellard | {"madd", "d,s,t", 0x70000000, 0xfc0007ff, RD_s|RD_t|WR_HILO|WR_d|IS_M, G1 }, |
1651 | 6643d27e | bellard | {"maddu", "s,t", 0x0000001d, 0xfc00ffff, RD_s|RD_t|WR_HILO, L1 }, |
1652 | 6643d27e | bellard | {"maddu", "s,t", 0x70000001, 0xfc00ffff, RD_s|RD_t|MOD_HILO, I32|N55}, |
1653 | 6643d27e | bellard | {"maddu", "s,t", 0x70000001, 0xfc00ffff, RD_s|RD_t|WR_HILO|IS_M, G1 }, |
1654 | 6643d27e | bellard | {"maddu", "d,s,t", 0x70000001, 0xfc0007ff, RD_s|RD_t|WR_HILO|WR_d|IS_M, G1 }, |
1655 | 6643d27e | bellard | {"madd16", "s,t", 0x00000028, 0xfc00ffff, RD_s|RD_t|MOD_HILO, N411 }, |
1656 | 6643d27e | bellard | {"max.ob", "X,Y,Q", 0x78000007, 0xfc20003f, WR_D|RD_S|RD_T|FP_D, MX|SB1 }, |
1657 | 6643d27e | bellard | {"max.ob", "D,S,T", 0x4ac00007, 0xffe0003f, WR_D|RD_S|RD_T, N54 }, |
1658 | 6643d27e | bellard | {"max.ob", "D,S,T[e]", 0x48000007, 0xfe20003f, WR_D|RD_S|RD_T, N54 }, |
1659 | 6643d27e | bellard | {"max.ob", "D,S,k", 0x4bc00007, 0xffe0003f, WR_D|RD_S|RD_T, N54 }, |
1660 | 6643d27e | bellard | {"max.qh", "X,Y,Q", 0x78200007, 0xfc20003f, WR_D|RD_S|RD_T|FP_D, MX }, |
1661 | 6643d27e | bellard | {"mfpc", "t,P", 0x4000c801, 0xffe0ffc1, LCD|WR_t|RD_C0, M1|N5 }, |
1662 | 6643d27e | bellard | {"mfps", "t,P", 0x4000c800, 0xffe0ffc1, LCD|WR_t|RD_C0, M1|N5 }, |
1663 | 6643d27e | bellard | {"mfc0", "t,G", 0x40000000, 0xffe007ff, LCD|WR_t|RD_C0, I1 }, |
1664 | 6643d27e | bellard | {"mfc0", "t,+D", 0x40000000, 0xffe007f8, LCD|WR_t|RD_C0, I32 }, |
1665 | 6643d27e | bellard | {"mfc0", "t,G,H", 0x40000000, 0xffe007f8, LCD|WR_t|RD_C0, I32 }, |
1666 | 6643d27e | bellard | {"mfc1", "t,S", 0x44000000, 0xffe007ff, LCD|WR_t|RD_S|FP_S, I1 }, |
1667 | 6643d27e | bellard | {"mfc1", "t,G", 0x44000000, 0xffe007ff, LCD|WR_t|RD_S|FP_S, I1 }, |
1668 | 6643d27e | bellard | {"mfhc1", "t,S", 0x44600000, 0xffe007ff, LCD|WR_t|RD_S|FP_S, I33 }, |
1669 | 6643d27e | bellard | {"mfhc1", "t,G", 0x44600000, 0xffe007ff, LCD|WR_t|RD_S|FP_S, I33 }, |
1670 | 6643d27e | bellard | /* mfc2 is at the bottom of the table. */
|
1671 | 6643d27e | bellard | /* mfhc2 is at the bottom of the table. */
|
1672 | 6643d27e | bellard | {"mfc3", "t,G", 0x4c000000, 0xffe007ff, LCD|WR_t|RD_C3, I1 }, |
1673 | 6643d27e | bellard | {"mfc3", "t,G,H", 0x4c000000, 0xffe007f8, LCD|WR_t|RD_C3, I32 }, |
1674 | 6643d27e | bellard | {"mfdr", "t,G", 0x7000003d, 0xffe007ff, LCD|WR_t|RD_C0, N5 }, |
1675 | 6643d27e | bellard | {"mfhi", "d", 0x00000010, 0xffff07ff, WR_d|RD_HI, I1 }, |
1676 | 6643d27e | bellard | {"mflo", "d", 0x00000012, 0xffff07ff, WR_d|RD_LO, I1 }, |
1677 | 6643d27e | bellard | {"min.ob", "X,Y,Q", 0x78000006, 0xfc20003f, WR_D|RD_S|RD_T|FP_D, MX|SB1 }, |
1678 | 6643d27e | bellard | {"min.ob", "D,S,T", 0x4ac00006, 0xffe0003f, WR_D|RD_S|RD_T, N54 }, |
1679 | 6643d27e | bellard | {"min.ob", "D,S,T[e]", 0x48000006, 0xfe20003f, WR_D|RD_S|RD_T, N54 }, |
1680 | 6643d27e | bellard | {"min.ob", "D,S,k", 0x4bc00006, 0xffe0003f, WR_D|RD_S|RD_T, N54 }, |
1681 | 6643d27e | bellard | {"min.qh", "X,Y,Q", 0x78200006, 0xfc20003f, WR_D|RD_S|RD_T|FP_D, MX }, |
1682 | 6643d27e | bellard | {"mov.d", "D,S", 0x46200006, 0xffff003f, WR_D|RD_S|FP_D, I1 }, |
1683 | 6643d27e | bellard | {"mov.s", "D,S", 0x46000006, 0xffff003f, WR_D|RD_S|FP_S, I1 }, |
1684 | 6643d27e | bellard | {"mov.ps", "D,S", 0x46c00006, 0xffff003f, WR_D|RD_S|FP_D, I5 }, |
1685 | 6643d27e | bellard | {"movf", "d,s,N", 0x00000001, 0xfc0307ff, WR_d|RD_s|RD_CC|FP_D|FP_S, I4|I32}, |
1686 | 6643d27e | bellard | {"movf.d", "D,S,N", 0x46200011, 0xffe3003f, WR_D|RD_S|RD_CC|FP_D, I4|I32 }, |
1687 | 6643d27e | bellard | {"movf.l", "D,S,N", 0x46a00011, 0xffe3003f, WR_D|RD_S|RD_CC|FP_D, MX|SB1 }, |
1688 | 6643d27e | bellard | {"movf.l", "X,Y,N", 0x46a00011, 0xffe3003f, WR_D|RD_S|RD_CC|FP_D, MX|SB1 }, |
1689 | 6643d27e | bellard | {"movf.s", "D,S,N", 0x46000011, 0xffe3003f, WR_D|RD_S|RD_CC|FP_S, I4|I32 }, |
1690 | 6643d27e | bellard | {"movf.ps", "D,S,N", 0x46c00011, 0xffe3003f, WR_D|RD_S|RD_CC|FP_D, I5 }, |
1691 | 6643d27e | bellard | {"movn", "d,v,t", 0x0000000b, 0xfc0007ff, WR_d|RD_s|RD_t, I4|I32 }, |
1692 | 6643d27e | bellard | {"ffc", "d,v", 0x0000000b, 0xfc1f07ff, WR_d|RD_s, L1 }, |
1693 | 6643d27e | bellard | {"movn.d", "D,S,t", 0x46200013, 0xffe0003f, WR_D|RD_S|RD_t|FP_D, I4|I32 }, |
1694 | 6643d27e | bellard | {"movn.l", "D,S,t", 0x46a00013, 0xffe0003f, WR_D|RD_S|RD_t|FP_D, MX|SB1 }, |
1695 | 6643d27e | bellard | {"movn.l", "X,Y,t", 0x46a00013, 0xffe0003f, WR_D|RD_S|RD_t|FP_D, MX|SB1 }, |
1696 | 6643d27e | bellard | {"movn.s", "D,S,t", 0x46000013, 0xffe0003f, WR_D|RD_S|RD_t|FP_S, I4|I32 }, |
1697 | 6643d27e | bellard | {"movn.ps", "D,S,t", 0x46c00013, 0xffe0003f, WR_D|RD_S|RD_t|FP_D, I5 }, |
1698 | 6643d27e | bellard | {"movt", "d,s,N", 0x00010001, 0xfc0307ff, WR_d|RD_s|RD_CC, I4|I32 }, |
1699 | 6643d27e | bellard | {"movt.d", "D,S,N", 0x46210011, 0xffe3003f, WR_D|RD_S|RD_CC|FP_D, I4|I32 }, |
1700 | 6643d27e | bellard | {"movt.l", "D,S,N", 0x46a10011, 0xffe3003f, WR_D|RD_S|RD_CC|FP_D, MX|SB1 }, |
1701 | 6643d27e | bellard | {"movt.l", "X,Y,N", 0x46a10011, 0xffe3003f, WR_D|RD_S|RD_CC|FP_D, MX|SB1 }, |
1702 | 6643d27e | bellard | {"movt.s", "D,S,N", 0x46010011, 0xffe3003f, WR_D|RD_S|RD_CC|FP_S, I4|I32 }, |
1703 | 6643d27e | bellard | {"movt.ps", "D,S,N", 0x46c10011, 0xffe3003f, WR_D|RD_S|RD_CC|FP_D, I5 }, |
1704 | 6643d27e | bellard | {"movz", "d,v,t", 0x0000000a, 0xfc0007ff, WR_d|RD_s|RD_t, I4|I32 }, |
1705 | 6643d27e | bellard | {"ffs", "d,v", 0x0000000a, 0xfc1f07ff, WR_d|RD_s, L1 }, |
1706 | 6643d27e | bellard | {"movz.d", "D,S,t", 0x46200012, 0xffe0003f, WR_D|RD_S|RD_t|FP_D, I4|I32 }, |
1707 | 6643d27e | bellard | {"movz.l", "D,S,t", 0x46a00012, 0xffe0003f, WR_D|RD_S|RD_t|FP_D, MX|SB1 }, |
1708 | 6643d27e | bellard | {"movz.l", "X,Y,t", 0x46a00012, 0xffe0003f, WR_D|RD_S|RD_t|FP_D, MX|SB1 }, |
1709 | 6643d27e | bellard | {"movz.s", "D,S,t", 0x46000012, 0xffe0003f, WR_D|RD_S|RD_t|FP_S, I4|I32 }, |
1710 | 6643d27e | bellard | {"movz.ps", "D,S,t", 0x46c00012, 0xffe0003f, WR_D|RD_S|RD_t|FP_D, I5 }, |
1711 | 6643d27e | bellard | {"msac", "d,s,t", 0x000001d8, 0xfc0007ff, RD_s|RD_t|WR_HILO|WR_d, N5 }, |
1712 | 6643d27e | bellard | {"msacu", "d,s,t", 0x000001d9, 0xfc0007ff, RD_s|RD_t|WR_HILO|WR_d, N5 }, |
1713 | 6643d27e | bellard | {"msachi", "d,s,t", 0x000003d8, 0xfc0007ff, RD_s|RD_t|WR_HILO|WR_d, N5 }, |
1714 | 6643d27e | bellard | {"msachiu", "d,s,t", 0x000003d9, 0xfc0007ff, RD_s|RD_t|WR_HILO|WR_d, N5 }, |
1715 | 6643d27e | bellard | /* move is at the top of the table. */
|
1716 | 6643d27e | bellard | {"msgn.qh", "X,Y,Q", 0x78200000, 0xfc20003f, WR_D|RD_S|RD_T|FP_D, MX }, |
1717 | 6643d27e | bellard | {"msub.d", "D,R,S,T", 0x4c000029, 0xfc00003f, RD_R|RD_S|RD_T|WR_D|FP_D, I4 }, |
1718 | 6643d27e | bellard | {"msub.s", "D,R,S,T", 0x4c000028, 0xfc00003f, RD_R|RD_S|RD_T|WR_D|FP_S, I4 }, |
1719 | 6643d27e | bellard | {"msub.ps", "D,R,S,T", 0x4c00002e, 0xfc00003f, RD_R|RD_S|RD_T|WR_D|FP_D, I5 }, |
1720 | 6643d27e | bellard | {"msub", "s,t", 0x0000001e, 0xfc00ffff, RD_s|RD_t|WR_HILO, L1 }, |
1721 | 6643d27e | bellard | {"msub", "s,t", 0x70000004, 0xfc00ffff, RD_s|RD_t|MOD_HILO, I32|N55 }, |
1722 | 6643d27e | bellard | {"msubu", "s,t", 0x0000001f, 0xfc00ffff, RD_s|RD_t|WR_HILO, L1 }, |
1723 | 6643d27e | bellard | {"msubu", "s,t", 0x70000005, 0xfc00ffff, RD_s|RD_t|MOD_HILO, I32|N55 }, |
1724 | 6643d27e | bellard | {"mtpc", "t,P", 0x4080c801, 0xffe0ffc1, COD|RD_t|WR_C0, M1|N5 }, |
1725 | 6643d27e | bellard | {"mtps", "t,P", 0x4080c800, 0xffe0ffc1, COD|RD_t|WR_C0, M1|N5 }, |
1726 | 6643d27e | bellard | {"mtc0", "t,G", 0x40800000, 0xffe007ff, COD|RD_t|WR_C0|WR_CC, I1 }, |
1727 | 6643d27e | bellard | {"mtc0", "t,+D", 0x40800000, 0xffe007f8, COD|RD_t|WR_C0|WR_CC, I32 }, |
1728 | 6643d27e | bellard | {"mtc0", "t,G,H", 0x40800000, 0xffe007f8, COD|RD_t|WR_C0|WR_CC, I32 }, |
1729 | 6643d27e | bellard | {"mtc1", "t,S", 0x44800000, 0xffe007ff, COD|RD_t|WR_S|FP_S, I1 }, |
1730 | 6643d27e | bellard | {"mtc1", "t,G", 0x44800000, 0xffe007ff, COD|RD_t|WR_S|FP_S, I1 }, |
1731 | 6643d27e | bellard | {"mthc1", "t,S", 0x44e00000, 0xffe007ff, COD|RD_t|WR_S|FP_S, I33 }, |
1732 | 6643d27e | bellard | {"mthc1", "t,G", 0x44e00000, 0xffe007ff, COD|RD_t|WR_S|FP_S, I33 }, |
1733 | 6643d27e | bellard | /* mtc2 is at the bottom of the table. */
|
1734 | 6643d27e | bellard | /* mthc2 is at the bottom of the table. */
|
1735 | 6643d27e | bellard | {"mtc3", "t,G", 0x4c800000, 0xffe007ff, COD|RD_t|WR_C3|WR_CC, I1 }, |
1736 | 6643d27e | bellard | {"mtc3", "t,G,H", 0x4c800000, 0xffe007f8, COD|RD_t|WR_C3|WR_CC, I32 }, |
1737 | 6643d27e | bellard | {"mtdr", "t,G", 0x7080003d, 0xffe007ff, COD|RD_t|WR_C0, N5 }, |
1738 | 6643d27e | bellard | {"mthi", "s", 0x00000011, 0xfc1fffff, RD_s|WR_HI, I1 }, |
1739 | 6643d27e | bellard | {"mtlo", "s", 0x00000013, 0xfc1fffff, RD_s|WR_LO, I1 }, |
1740 | 6643d27e | bellard | {"mul.d", "D,V,T", 0x46200002, 0xffe0003f, WR_D|RD_S|RD_T|FP_D, I1 }, |
1741 | 6643d27e | bellard | {"mul.s", "D,V,T", 0x46000002, 0xffe0003f, WR_D|RD_S|RD_T|FP_S, I1 }, |
1742 | 6643d27e | bellard | {"mul.ob", "X,Y,Q", 0x78000030, 0xfc20003f, WR_D|RD_S|RD_T|FP_D, MX|SB1 }, |
1743 | 6643d27e | bellard | {"mul.ob", "D,S,T", 0x4ac00030, 0xffe0003f, WR_D|RD_S|RD_T, N54 }, |
1744 | 6643d27e | bellard | {"mul.ob", "D,S,T[e]", 0x48000030, 0xfe20003f, WR_D|RD_S|RD_T, N54 }, |
1745 | 6643d27e | bellard | {"mul.ob", "D,S,k", 0x4bc00030, 0xffe0003f, WR_D|RD_S|RD_T, N54 }, |
1746 | 6643d27e | bellard | {"mul.ps", "D,V,T", 0x46c00002, 0xffe0003f, WR_D|RD_S|RD_T|FP_D, I5 }, |
1747 | 6643d27e | bellard | {"mul.qh", "X,Y,Q", 0x78200030, 0xfc20003f, WR_D|RD_S|RD_T|FP_D, MX }, |
1748 | 6643d27e | bellard | {"mul", "d,v,t", 0x70000002, 0xfc0007ff, WR_d|RD_s|RD_t|WR_HILO, I32|P3|N55}, |
1749 | 6643d27e | bellard | {"mul", "d,s,t", 0x00000058, 0xfc0007ff, RD_s|RD_t|WR_HILO|WR_d, N54 }, |
1750 | 6643d27e | bellard | {"mul", "d,v,t", 0, (int) M_MUL, INSN_MACRO, I1 }, |
1751 | 6643d27e | bellard | {"mul", "d,v,I", 0, (int) M_MUL_I, INSN_MACRO, I1 }, |
1752 | 6643d27e | bellard | {"mula.ob", "Y,Q", 0x78000033, 0xfc2007ff, WR_MACC|RD_S|RD_T|FP_D, MX|SB1 }, |
1753 | 6643d27e | bellard | {"mula.ob", "S,T", 0x4ac00033, 0xffe007ff, WR_CC|RD_S|RD_T, N54 }, |
1754 | 6643d27e | bellard | {"mula.ob", "S,T[e]", 0x48000033, 0xfe2007ff, WR_CC|RD_S|RD_T, N54 }, |
1755 | 6643d27e | bellard | {"mula.ob", "S,k", 0x4bc00033, 0xffe007ff, WR_CC|RD_S|RD_T, N54 }, |
1756 | 6643d27e | bellard | {"mula.qh", "Y,Q", 0x78200033, 0xfc2007ff, WR_MACC|RD_S|RD_T|FP_D, MX }, |
1757 | 6643d27e | bellard | {"mulhi", "d,s,t", 0x00000258, 0xfc0007ff, RD_s|RD_t|WR_HILO|WR_d, N5 }, |
1758 | 6643d27e | bellard | {"mulhiu", "d,s,t", 0x00000259, 0xfc0007ff, RD_s|RD_t|WR_HILO|WR_d, N5 }, |
1759 | 6643d27e | bellard | {"mull.ob", "Y,Q", 0x78000433, 0xfc2007ff, WR_MACC|RD_S|RD_T|FP_D, MX|SB1 }, |
1760 | 6643d27e | bellard | {"mull.ob", "S,T", 0x4ac00433, 0xffe007ff, WR_CC|RD_S|RD_T, N54 }, |
1761 | 6643d27e | bellard | {"mull.ob", "S,T[e]", 0x48000433, 0xfe2007ff, WR_CC|RD_S|RD_T, N54 }, |
1762 | 6643d27e | bellard | {"mull.ob", "S,k", 0x4bc00433, 0xffe007ff, WR_CC|RD_S|RD_T, N54 }, |
1763 | 6643d27e | bellard | {"mull.qh", "Y,Q", 0x78200433, 0xfc2007ff, WR_MACC|RD_S|RD_T|FP_D, MX }, |
1764 | 6643d27e | bellard | {"mulo", "d,v,t", 0, (int) M_MULO, INSN_MACRO, I1 }, |
1765 | 6643d27e | bellard | {"mulo", "d,v,I", 0, (int) M_MULO_I, INSN_MACRO, I1 }, |
1766 | 6643d27e | bellard | {"mulou", "d,v,t", 0, (int) M_MULOU, INSN_MACRO, I1 }, |
1767 | 6643d27e | bellard | {"mulou", "d,v,I", 0, (int) M_MULOU_I, INSN_MACRO, I1 }, |
1768 | 6643d27e | bellard | {"mulr.ps", "D,S,T", 0x46c0001a, 0xffe0003f, WR_D|RD_S|RD_T|FP_D, M3D }, |
1769 | 6643d27e | bellard | {"muls", "d,s,t", 0x000000d8, 0xfc0007ff, RD_s|RD_t|WR_HILO|WR_d, N5 }, |
1770 | 6643d27e | bellard | {"mulsu", "d,s,t", 0x000000d9, 0xfc0007ff, RD_s|RD_t|WR_HILO|WR_d, N5 }, |
1771 | 6643d27e | bellard | {"mulshi", "d,s,t", 0x000002d8, 0xfc0007ff, RD_s|RD_t|WR_HILO|WR_d, N5 }, |
1772 | 6643d27e | bellard | {"mulshiu", "d,s,t", 0x000002d9, 0xfc0007ff, RD_s|RD_t|WR_HILO|WR_d, N5 }, |
1773 | 6643d27e | bellard | {"muls.ob", "Y,Q", 0x78000032, 0xfc2007ff, WR_MACC|RD_S|RD_T|FP_D, MX|SB1 }, |
1774 | 6643d27e | bellard | {"muls.ob", "S,T", 0x4ac00032, 0xffe007ff, WR_CC|RD_S|RD_T, N54 }, |
1775 | 6643d27e | bellard | {"muls.ob", "S,T[e]", 0x48000032, 0xfe2007ff, WR_CC|RD_S|RD_T, N54 }, |
1776 | 6643d27e | bellard | {"muls.ob", "S,k", 0x4bc00032, 0xffe007ff, WR_CC|RD_S|RD_T, N54 }, |
1777 | 6643d27e | bellard | {"muls.qh", "Y,Q", 0x78200032, 0xfc2007ff, WR_MACC|RD_S|RD_T|FP_D, MX }, |
1778 | 6643d27e | bellard | {"mulsl.ob", "Y,Q", 0x78000432, 0xfc2007ff, WR_MACC|RD_S|RD_T|FP_D, MX|SB1 }, |
1779 | 6643d27e | bellard | {"mulsl.ob", "S,T", 0x4ac00432, 0xffe007ff, WR_CC|RD_S|RD_T, N54 }, |
1780 | 6643d27e | bellard | {"mulsl.ob", "S,T[e]", 0x48000432, 0xfe2007ff, WR_CC|RD_S|RD_T, N54 }, |
1781 | 6643d27e | bellard | {"mulsl.ob", "S,k", 0x4bc00432, 0xffe007ff, WR_CC|RD_S|RD_T, N54 }, |
1782 | 6643d27e | bellard | {"mulsl.qh", "Y,Q", 0x78200432, 0xfc2007ff, WR_MACC|RD_S|RD_T|FP_D, MX }, |
1783 | 6643d27e | bellard | {"mult", "s,t", 0x00000018, 0xfc00ffff, RD_s|RD_t|WR_HILO|IS_M, I1 }, |
1784 | 6643d27e | bellard | {"mult", "d,s,t", 0x00000018, 0xfc0007ff, RD_s|RD_t|WR_HILO|WR_d|IS_M, G1 }, |
1785 | 6643d27e | bellard | {"multu", "s,t", 0x00000019, 0xfc00ffff, RD_s|RD_t|WR_HILO|IS_M, I1 }, |
1786 | 6643d27e | bellard | {"multu", "d,s,t", 0x00000019, 0xfc0007ff, RD_s|RD_t|WR_HILO|WR_d|IS_M, G1 }, |
1787 | 6643d27e | bellard | {"mulu", "d,s,t", 0x00000059, 0xfc0007ff, RD_s|RD_t|WR_HILO|WR_d, N5 }, |
1788 | 6643d27e | bellard | {"neg", "d,w", 0x00000022, 0xffe007ff, WR_d|RD_t, I1 }, /* sub 0 */ |
1789 | 6643d27e | bellard | {"negu", "d,w", 0x00000023, 0xffe007ff, WR_d|RD_t, I1 }, /* subu 0 */ |
1790 | 6643d27e | bellard | {"neg.d", "D,V", 0x46200007, 0xffff003f, WR_D|RD_S|FP_D, I1 }, |
1791 | 6643d27e | bellard | {"neg.s", "D,V", 0x46000007, 0xffff003f, WR_D|RD_S|FP_S, I1 }, |
1792 | 6643d27e | bellard | {"neg.ps", "D,V", 0x46c00007, 0xffff003f, WR_D|RD_S|FP_D, I5 }, |
1793 | 6643d27e | bellard | {"nmadd.d", "D,R,S,T", 0x4c000031, 0xfc00003f, RD_R|RD_S|RD_T|WR_D|FP_D, I4 }, |
1794 | 6643d27e | bellard | {"nmadd.s", "D,R,S,T", 0x4c000030, 0xfc00003f, RD_R|RD_S|RD_T|WR_D|FP_S, I4 }, |
1795 | 6643d27e | bellard | {"nmadd.ps","D,R,S,T", 0x4c000036, 0xfc00003f, RD_R|RD_S|RD_T|WR_D|FP_D, I5 }, |
1796 | 6643d27e | bellard | {"nmsub.d", "D,R,S,T", 0x4c000039, 0xfc00003f, RD_R|RD_S|RD_T|WR_D|FP_D, I4 }, |
1797 | 6643d27e | bellard | {"nmsub.s", "D,R,S,T", 0x4c000038, 0xfc00003f, RD_R|RD_S|RD_T|WR_D|FP_S, I4 }, |
1798 | 6643d27e | bellard | {"nmsub.ps","D,R,S,T", 0x4c00003e, 0xfc00003f, RD_R|RD_S|RD_T|WR_D|FP_D, I5 }, |
1799 | 6643d27e | bellard | /* nop is at the start of the table. */
|
1800 | 6643d27e | bellard | {"nor", "d,v,t", 0x00000027, 0xfc0007ff, WR_d|RD_s|RD_t, I1 }, |
1801 | 6643d27e | bellard | {"nor", "t,r,I", 0, (int) M_NOR_I, INSN_MACRO, I1 }, |
1802 | 6643d27e | bellard | {"nor.ob", "X,Y,Q", 0x7800000f, 0xfc20003f, WR_D|RD_S|RD_T|FP_D, MX|SB1 }, |
1803 | 6643d27e | bellard | {"nor.ob", "D,S,T", 0x4ac0000f, 0xffe0003f, WR_D|RD_S|RD_T, N54 }, |
1804 | 6643d27e | bellard | {"nor.ob", "D,S,T[e]", 0x4800000f, 0xfe20003f, WR_D|RD_S|RD_T, N54 }, |
1805 | 6643d27e | bellard | {"nor.ob", "D,S,k", 0x4bc0000f, 0xffe0003f, WR_D|RD_S|RD_T, N54 }, |
1806 | 6643d27e | bellard | {"nor.qh", "X,Y,Q", 0x7820000f, 0xfc20003f, WR_D|RD_S|RD_T|FP_D, MX }, |
1807 | 6643d27e | bellard | {"not", "d,v", 0x00000027, 0xfc1f07ff, WR_d|RD_s|RD_t, I1 },/*nor d,s,0*/ |
1808 | 6643d27e | bellard | {"or", "d,v,t", 0x00000025, 0xfc0007ff, WR_d|RD_s|RD_t, I1 }, |
1809 | 6643d27e | bellard | {"or", "t,r,I", 0, (int) M_OR_I, INSN_MACRO, I1 }, |
1810 | 6643d27e | bellard | {"or.ob", "X,Y,Q", 0x7800000e, 0xfc20003f, WR_D|RD_S|RD_T|FP_D, MX|SB1 }, |
1811 | 6643d27e | bellard | {"or.ob", "D,S,T", 0x4ac0000e, 0xffe0003f, WR_D|RD_S|RD_T, N54 }, |
1812 | 6643d27e | bellard | {"or.ob", "D,S,T[e]", 0x4800000e, 0xfe20003f, WR_D|RD_S|RD_T, N54 }, |
1813 | 6643d27e | bellard | {"or.ob", "D,S,k", 0x4bc0000e, 0xffe0003f, WR_D|RD_S|RD_T, N54 }, |
1814 | 6643d27e | bellard | {"or.qh", "X,Y,Q", 0x7820000e, 0xfc20003f, WR_D|RD_S|RD_T|FP_D, MX }, |
1815 | 6643d27e | bellard | {"ori", "t,r,i", 0x34000000, 0xfc000000, WR_t|RD_s, I1 }, |
1816 | 6643d27e | bellard | {"pabsdiff.ob", "X,Y,Q",0x78000009, 0xfc20003f, WR_D|RD_S|RD_T|FP_D, SB1 }, |
1817 | 6643d27e | bellard | {"pabsdiffc.ob", "Y,Q", 0x78000035, 0xfc2007ff, WR_MACC|RD_S|RD_T|FP_D, SB1 }, |
1818 | 6643d27e | bellard | {"pavg.ob", "X,Y,Q", 0x78000008, 0xfc20003f, WR_D|RD_S|RD_T|FP_D, SB1 }, |
1819 | 6643d27e | bellard | {"pickf.ob", "X,Y,Q", 0x78000002, 0xfc20003f, WR_D|RD_S|RD_T|FP_D, MX|SB1 }, |
1820 | 6643d27e | bellard | {"pickf.ob", "D,S,T", 0x4ac00002, 0xffe0003f, WR_D|RD_S|RD_T, N54 }, |
1821 | 6643d27e | bellard | {"pickf.ob", "D,S,T[e]",0x48000002, 0xfe20003f, WR_D|RD_S|RD_T, N54 }, |
1822 | 6643d27e | bellard | {"pickf.ob", "D,S,k", 0x4bc00002, 0xffe0003f, WR_D|RD_S|RD_T, N54 }, |
1823 | 6643d27e | bellard | {"pickf.qh", "X,Y,Q", 0x78200002, 0xfc20003f, WR_D|RD_S|RD_T|FP_D, MX }, |
1824 | 6643d27e | bellard | {"pickt.ob", "X,Y,Q", 0x78000003, 0xfc20003f, WR_D|RD_S|RD_T|FP_D, MX|SB1 }, |
1825 | 6643d27e | bellard | {"pickt.ob", "D,S,T", 0x4ac00003, 0xffe0003f, WR_D|RD_S|RD_T, N54 }, |
1826 | 6643d27e | bellard | {"pickt.ob", "D,S,T[e]",0x48000003, 0xfe20003f, WR_D|RD_S|RD_T, N54 }, |
1827 | 6643d27e | bellard | {"pickt.ob", "D,S,k", 0x4bc00003, 0xffe0003f, WR_D|RD_S|RD_T, N54 }, |
1828 | 6643d27e | bellard | {"pickt.qh", "X,Y,Q", 0x78200003, 0xfc20003f, WR_D|RD_S|RD_T|FP_D, MX }, |
1829 | 6643d27e | bellard | {"pll.ps", "D,V,T", 0x46c0002c, 0xffe0003f, WR_D|RD_S|RD_T|FP_D, I5 }, |
1830 | 6643d27e | bellard | {"plu.ps", "D,V,T", 0x46c0002d, 0xffe0003f, WR_D|RD_S|RD_T|FP_D, I5 }, |
1831 | 6643d27e | bellard | /* pref and prefx are at the start of the table. */
|
1832 | 6643d27e | bellard | {"pul.ps", "D,V,T", 0x46c0002e, 0xffe0003f, WR_D|RD_S|RD_T|FP_D, I5 }, |
1833 | 6643d27e | bellard | {"puu.ps", "D,V,T", 0x46c0002f, 0xffe0003f, WR_D|RD_S|RD_T|FP_D, I5 }, |
1834 | 6643d27e | bellard | {"rach.ob", "X", 0x7a00003f, 0xfffff83f, WR_D|RD_MACC|FP_D, MX|SB1 }, |
1835 | 6643d27e | bellard | {"rach.ob", "D", 0x4a00003f, 0xfffff83f, WR_D, N54 }, |
1836 | 6643d27e | bellard | {"rach.qh", "X", 0x7a20003f, 0xfffff83f, WR_D|RD_MACC|FP_D, MX }, |
1837 | 6643d27e | bellard | {"racl.ob", "X", 0x7800003f, 0xfffff83f, WR_D|RD_MACC|FP_D, MX|SB1 }, |
1838 | 6643d27e | bellard | {"racl.ob", "D", 0x4800003f, 0xfffff83f, WR_D, N54 }, |
1839 | 6643d27e | bellard | {"racl.qh", "X", 0x7820003f, 0xfffff83f, WR_D|RD_MACC|FP_D, MX }, |
1840 | 6643d27e | bellard | {"racm.ob", "X", 0x7900003f, 0xfffff83f, WR_D|RD_MACC|FP_D, MX|SB1 }, |
1841 | 6643d27e | bellard | {"racm.ob", "D", 0x4900003f, 0xfffff83f, WR_D, N54 }, |
1842 | 6643d27e | bellard | {"racm.qh", "X", 0x7920003f, 0xfffff83f, WR_D|RD_MACC|FP_D, MX }, |
1843 | 6643d27e | bellard | {"recip.d", "D,S", 0x46200015, 0xffff003f, WR_D|RD_S|FP_D, I4 }, |
1844 | 6643d27e | bellard | {"recip.ps","D,S", 0x46c00015, 0xffff003f, WR_D|RD_S|FP_D, SB1 }, |
1845 | 6643d27e | bellard | {"recip.s", "D,S", 0x46000015, 0xffff003f, WR_D|RD_S|FP_S, I4 }, |
1846 | 6643d27e | bellard | {"recip1.d", "D,S", 0x4620001d, 0xffff003f, WR_D|RD_S|FP_D, M3D }, |
1847 | 6643d27e | bellard | {"recip1.ps", "D,S", 0x46c0001d, 0xffff003f, WR_D|RD_S|FP_S, M3D }, |
1848 | 6643d27e | bellard | {"recip1.s", "D,S", 0x4600001d, 0xffff003f, WR_D|RD_S|FP_S, M3D }, |
1849 | 6643d27e | bellard | {"recip2.d", "D,S,T", 0x4620001c, 0xffe0003f, WR_D|RD_S|RD_T|FP_D, M3D }, |
1850 | 6643d27e | bellard | {"recip2.ps", "D,S,T", 0x46c0001c, 0xffe0003f, WR_D|RD_S|RD_T|FP_S, M3D }, |
1851 | 6643d27e | bellard | {"recip2.s", "D,S,T", 0x4600001c, 0xffe0003f, WR_D|RD_S|RD_T|FP_S, M3D }, |
1852 | 6643d27e | bellard | {"rem", "z,s,t", 0x0000001a, 0xfc00ffff, RD_s|RD_t|WR_HILO, I1 }, |
1853 | 6643d27e | bellard | {"rem", "d,v,t", 0, (int) M_REM_3, INSN_MACRO, I1 }, |
1854 | 6643d27e | bellard | {"rem", "d,v,I", 0, (int) M_REM_3I, INSN_MACRO, I1 }, |
1855 | 6643d27e | bellard | {"remu", "z,s,t", 0x0000001b, 0xfc00ffff, RD_s|RD_t|WR_HILO, I1 }, |
1856 | 6643d27e | bellard | {"remu", "d,v,t", 0, (int) M_REMU_3, INSN_MACRO, I1 }, |
1857 | 6643d27e | bellard | {"remu", "d,v,I", 0, (int) M_REMU_3I, INSN_MACRO, I1 }, |
1858 | 6643d27e | bellard | {"rdhwr", "t,K", 0x7c00003b, 0xffe007ff, WR_t, I33 }, |
1859 | 6643d27e | bellard | {"rdpgpr", "d,w", 0x41400000, 0xffe007ff, WR_d, I33 }, |
1860 | 6643d27e | bellard | {"rfe", "", 0x42000010, 0xffffffff, 0, I1|T3 }, |
1861 | 6643d27e | bellard | {"rnas.qh", "X,Q", 0x78200025, 0xfc20f83f, WR_D|RD_MACC|RD_T|FP_D, MX }, |
1862 | 6643d27e | bellard | {"rnau.ob", "X,Q", 0x78000021, 0xfc20f83f, WR_D|RD_MACC|RD_T|FP_D, MX|SB1 }, |
1863 | 6643d27e | bellard | {"rnau.qh", "X,Q", 0x78200021, 0xfc20f83f, WR_D|RD_MACC|RD_T|FP_D, MX }, |
1864 | 6643d27e | bellard | {"rnes.qh", "X,Q", 0x78200026, 0xfc20f83f, WR_D|RD_MACC|RD_T|FP_D, MX }, |
1865 | 6643d27e | bellard | {"rneu.ob", "X,Q", 0x78000022, 0xfc20f83f, WR_D|RD_MACC|RD_T|FP_D, MX|SB1 }, |
1866 | 6643d27e | bellard | {"rneu.qh", "X,Q", 0x78200022, 0xfc20f83f, WR_D|RD_MACC|RD_T|FP_D, MX }, |
1867 | 6643d27e | bellard | {"rol", "d,v,t", 0, (int) M_ROL, INSN_MACRO, I1 }, |
1868 | 6643d27e | bellard | {"rol", "d,v,I", 0, (int) M_ROL_I, INSN_MACRO, I1 }, |
1869 | 6643d27e | bellard | {"ror", "d,v,t", 0, (int) M_ROR, INSN_MACRO, I1 }, |
1870 | 6643d27e | bellard | {"ror", "d,v,I", 0, (int) M_ROR_I, INSN_MACRO, I1 }, |
1871 | 6643d27e | bellard | {"ror", "d,w,<", 0x00200002, 0xffe0003f, WR_d|RD_t, N5|I33 }, |
1872 | 6643d27e | bellard | {"rorv", "d,t,s", 0x00000046, 0xfc0007ff, RD_t|RD_s|WR_d, N5|I33 }, |
1873 | 6643d27e | bellard | {"rotl", "d,v,t", 0, (int) M_ROL, INSN_MACRO, I33 }, |
1874 | 6643d27e | bellard | {"rotl", "d,v,I", 0, (int) M_ROL_I, INSN_MACRO, I33 }, |
1875 | 6643d27e | bellard | {"rotr", "d,v,t", 0, (int) M_ROR, INSN_MACRO, I33 }, |
1876 | 6643d27e | bellard | {"rotr", "d,v,I", 0, (int) M_ROR_I, INSN_MACRO, I33 }, |
1877 | 6643d27e | bellard | {"rotrv", "d,t,s", 0x00000046, 0xfc0007ff, RD_t|RD_s|WR_d, I33 }, |
1878 | 6643d27e | bellard | {"round.l.d", "D,S", 0x46200008, 0xffff003f, WR_D|RD_S|FP_D, I3 }, |
1879 | 6643d27e | bellard | {"round.l.s", "D,S", 0x46000008, 0xffff003f, WR_D|RD_S|FP_S, I3 }, |
1880 | 6643d27e | bellard | {"round.w.d", "D,S", 0x4620000c, 0xffff003f, WR_D|RD_S|FP_D, I2 }, |
1881 | 6643d27e | bellard | {"round.w.s", "D,S", 0x4600000c, 0xffff003f, WR_D|RD_S|FP_S, I2 }, |
1882 | 6643d27e | bellard | {"rsqrt.d", "D,S", 0x46200016, 0xffff003f, WR_D|RD_S|FP_D, I4 }, |
1883 | 6643d27e | bellard | {"rsqrt.ps","D,S", 0x46c00016, 0xffff003f, WR_D|RD_S|FP_D, SB1 }, |
1884 | 6643d27e | bellard | {"rsqrt.s", "D,S", 0x46000016, 0xffff003f, WR_D|RD_S|FP_S, I4 }, |
1885 | 6643d27e | bellard | {"rsqrt1.d", "D,S", 0x4620001e, 0xffff003f, WR_D|RD_S|FP_D, M3D }, |
1886 | 6643d27e | bellard | {"rsqrt1.ps", "D,S", 0x46c0001e, 0xffff003f, WR_D|RD_S|FP_S, M3D }, |
1887 | 6643d27e | bellard | {"rsqrt1.s", "D,S", 0x4600001e, 0xffff003f, WR_D|RD_S|FP_S, M3D }, |
1888 | 6643d27e | bellard | {"rsqrt2.d", "D,S,T", 0x4620001f, 0xffe0003f, WR_D|RD_S|RD_T|FP_D, M3D }, |
1889 | 6643d27e | bellard | {"rsqrt2.ps", "D,S,T", 0x46c0001f, 0xffe0003f, WR_D|RD_S|RD_T|FP_S, M3D }, |
1890 | 6643d27e | bellard | {"rsqrt2.s", "D,S,T", 0x4600001f, 0xffe0003f, WR_D|RD_S|RD_T|FP_S, M3D }, |
1891 | 6643d27e | bellard | {"rzs.qh", "X,Q", 0x78200024, 0xfc20f83f, WR_D|RD_MACC|RD_T|FP_D, MX }, |
1892 | 6643d27e | bellard | {"rzu.ob", "X,Q", 0x78000020, 0xfc20f83f, WR_D|RD_MACC|RD_T|FP_D, MX|SB1 }, |
1893 | 6643d27e | bellard | {"rzu.ob", "D,k", 0x4bc00020, 0xffe0f83f, WR_D|RD_S|RD_T, N54 }, |
1894 | 6643d27e | bellard | {"rzu.qh", "X,Q", 0x78200020, 0xfc20f83f, WR_D|RD_MACC|RD_T|FP_D, MX }, |
1895 | 6643d27e | bellard | {"sb", "t,o(b)", 0xa0000000, 0xfc000000, SM|RD_t|RD_b, I1 }, |
1896 | 6643d27e | bellard | {"sb", "t,A(b)", 0, (int) M_SB_AB, INSN_MACRO, I1 }, |
1897 | 6643d27e | bellard | {"sc", "t,o(b)", 0xe0000000, 0xfc000000, SM|RD_t|WR_t|RD_b, I2 }, |
1898 | 6643d27e | bellard | {"sc", "t,A(b)", 0, (int) M_SC_AB, INSN_MACRO, I2 }, |
1899 | 6643d27e | bellard | {"scd", "t,o(b)", 0xf0000000, 0xfc000000, SM|RD_t|WR_t|RD_b, I3 }, |
1900 | 6643d27e | bellard | {"scd", "t,A(b)", 0, (int) M_SCD_AB, INSN_MACRO, I3 }, |
1901 | 6643d27e | bellard | {"sd", "t,o(b)", 0xfc000000, 0xfc000000, SM|RD_t|RD_b, I3 }, |
1902 | 6643d27e | bellard | {"sd", "t,o(b)", 0, (int) M_SD_OB, INSN_MACRO, I1 }, |
1903 | 6643d27e | bellard | {"sd", "t,A(b)", 0, (int) M_SD_AB, INSN_MACRO, I1 }, |
1904 | 6643d27e | bellard | {"sdbbp", "", 0x0000000e, 0xffffffff, TRAP, G2 }, |
1905 | 6643d27e | bellard | {"sdbbp", "c", 0x0000000e, 0xfc00ffff, TRAP, G2 }, |
1906 | 6643d27e | bellard | {"sdbbp", "c,q", 0x0000000e, 0xfc00003f, TRAP, G2 }, |
1907 | 6643d27e | bellard | {"sdbbp", "", 0x7000003f, 0xffffffff, TRAP, I32 }, |
1908 | 6643d27e | bellard | {"sdbbp", "B", 0x7000003f, 0xfc00003f, TRAP, I32 }, |
1909 | 6643d27e | bellard | {"sdc1", "T,o(b)", 0xf4000000, 0xfc000000, SM|RD_T|RD_b|FP_D, I2 }, |
1910 | 6643d27e | bellard | {"sdc1", "E,o(b)", 0xf4000000, 0xfc000000, SM|RD_T|RD_b|FP_D, I2 }, |
1911 | 6643d27e | bellard | {"sdc1", "T,A(b)", 0, (int) M_SDC1_AB, INSN_MACRO, I2 }, |
1912 | 6643d27e | bellard | {"sdc1", "E,A(b)", 0, (int) M_SDC1_AB, INSN_MACRO, I2 }, |
1913 | 6643d27e | bellard | {"sdc2", "E,o(b)", 0xf8000000, 0xfc000000, SM|RD_C2|RD_b, I2 }, |
1914 | 6643d27e | bellard | {"sdc2", "E,A(b)", 0, (int) M_SDC2_AB, INSN_MACRO, I2 }, |
1915 | 6643d27e | bellard | {"sdc3", "E,o(b)", 0xfc000000, 0xfc000000, SM|RD_C3|RD_b, I2 }, |
1916 | 6643d27e | bellard | {"sdc3", "E,A(b)", 0, (int) M_SDC3_AB, INSN_MACRO, I2 }, |
1917 | 6643d27e | bellard | {"s.d", "T,o(b)", 0xf4000000, 0xfc000000, SM|RD_T|RD_b|FP_D, I2 }, |
1918 | 6643d27e | bellard | {"s.d", "T,o(b)", 0, (int) M_S_DOB, INSN_MACRO, I1 }, |
1919 | 6643d27e | bellard | {"s.d", "T,A(b)", 0, (int) M_S_DAB, INSN_MACRO, I1 }, |
1920 | 6643d27e | bellard | {"sdl", "t,o(b)", 0xb0000000, 0xfc000000, SM|RD_t|RD_b, I3 }, |
1921 | 6643d27e | bellard | {"sdl", "t,A(b)", 0, (int) M_SDL_AB, INSN_MACRO, I3 }, |
1922 | 6643d27e | bellard | {"sdr", "t,o(b)", 0xb4000000, 0xfc000000, SM|RD_t|RD_b, I3 }, |
1923 | 6643d27e | bellard | {"sdr", "t,A(b)", 0, (int) M_SDR_AB, INSN_MACRO, I3 }, |
1924 | 6643d27e | bellard | {"sdxc1", "S,t(b)", 0x4c000009, 0xfc0007ff, SM|RD_S|RD_t|RD_b, I4 }, |
1925 | 6643d27e | bellard | {"seb", "d,w", 0x7c000420, 0xffe007ff, WR_d|RD_t, I33 }, |
1926 | 6643d27e | bellard | {"seh", "d,w", 0x7c000620, 0xffe007ff, WR_d|RD_t, I33 }, |
1927 | 6643d27e | bellard | {"selsl", "d,v,t", 0x00000005, 0xfc0007ff, WR_d|RD_s|RD_t, L1 }, |
1928 | 6643d27e | bellard | {"selsr", "d,v,t", 0x00000001, 0xfc0007ff, WR_d|RD_s|RD_t, L1 }, |
1929 | 6643d27e | bellard | {"seq", "d,v,t", 0, (int) M_SEQ, INSN_MACRO, I1 }, |
1930 | 6643d27e | bellard | {"seq", "d,v,I", 0, (int) M_SEQ_I, INSN_MACRO, I1 }, |
1931 | 6643d27e | bellard | {"sge", "d,v,t", 0, (int) M_SGE, INSN_MACRO, I1 }, |
1932 | 6643d27e | bellard | {"sge", "d,v,I", 0, (int) M_SGE_I, INSN_MACRO, I1 }, |
1933 | 6643d27e | bellard | {"sgeu", "d,v,t", 0, (int) M_SGEU, INSN_MACRO, I1 }, |
1934 | 6643d27e | bellard | {"sgeu", "d,v,I", 0, (int) M_SGEU_I, INSN_MACRO, I1 }, |
1935 | 6643d27e | bellard | {"sgt", "d,v,t", 0, (int) M_SGT, INSN_MACRO, I1 }, |
1936 | 6643d27e | bellard | {"sgt", "d,v,I", 0, (int) M_SGT_I, INSN_MACRO, I1 }, |
1937 | 6643d27e | bellard | {"sgtu", "d,v,t", 0, (int) M_SGTU, INSN_MACRO, I1 }, |
1938 | 6643d27e | bellard | {"sgtu", "d,v,I", 0, (int) M_SGTU_I, INSN_MACRO, I1 }, |
1939 | 6643d27e | bellard | {"sh", "t,o(b)", 0xa4000000, 0xfc000000, SM|RD_t|RD_b, I1 }, |
1940 | 6643d27e | bellard | {"sh", "t,A(b)", 0, (int) M_SH_AB, INSN_MACRO, I1 }, |
1941 | 6643d27e | bellard | {"shfl.bfla.qh", "X,Y,Z", 0x7a20001f, 0xffe0003f, WR_D|RD_S|RD_T|FP_D, MX }, |
1942 | 6643d27e | bellard | {"shfl.mixh.ob", "X,Y,Z", 0x7980001f, 0xffe0003f, WR_D|RD_S|RD_T|FP_D, MX|SB1 }, |
1943 | 6643d27e | bellard | {"shfl.mixh.ob", "D,S,T", 0x4980001f, 0xffe0003f, WR_D|RD_S|RD_T, N54 }, |
1944 | 6643d27e | bellard | {"shfl.mixh.qh", "X,Y,Z", 0x7820001f, 0xffe0003f, WR_D|RD_S|RD_T|FP_D, MX }, |
1945 | 6643d27e | bellard | {"shfl.mixl.ob", "X,Y,Z", 0x79c0001f, 0xffe0003f, WR_D|RD_S|RD_T|FP_D, MX|SB1 }, |
1946 | 6643d27e | bellard | {"shfl.mixl.ob", "D,S,T", 0x49c0001f, 0xffe0003f, WR_D|RD_S|RD_T, N54 }, |
1947 | 6643d27e | bellard | {"shfl.mixl.qh", "X,Y,Z", 0x78a0001f, 0xffe0003f, WR_D|RD_S|RD_T|FP_D, MX }, |
1948 | 6643d27e | bellard | {"shfl.pach.ob", "X,Y,Z", 0x7900001f, 0xffe0003f, WR_D|RD_S|RD_T|FP_D, MX|SB1 }, |
1949 | 6643d27e | bellard | {"shfl.pach.ob", "D,S,T", 0x4900001f, 0xffe0003f, WR_D|RD_S|RD_T, N54 }, |
1950 | 6643d27e | bellard | {"shfl.pach.qh", "X,Y,Z", 0x7920001f, 0xffe0003f, WR_D|RD_S|RD_T|FP_D, MX }, |
1951 | 6643d27e | bellard | {"shfl.pacl.ob", "D,S,T", 0x4940001f, 0xffe0003f, WR_D|RD_S|RD_T, N54 }, |
1952 | 6643d27e | bellard | {"shfl.repa.qh", "X,Y,Z", 0x7b20001f, 0xffe0003f, WR_D|RD_S|RD_T|FP_D, MX }, |
1953 | 6643d27e | bellard | {"shfl.repb.qh", "X,Y,Z", 0x7ba0001f, 0xffe0003f, WR_D|RD_S|RD_T|FP_D, MX }, |
1954 | 6643d27e | bellard | {"shfl.upsl.ob", "X,Y,Z", 0x78c0001f, 0xffe0003f, WR_D|RD_S|RD_T|FP_D, MX|SB1 }, |
1955 | 6643d27e | bellard | {"sle", "d,v,t", 0, (int) M_SLE, INSN_MACRO, I1 }, |
1956 | 6643d27e | bellard | {"sle", "d,v,I", 0, (int) M_SLE_I, INSN_MACRO, I1 }, |
1957 | 6643d27e | bellard | {"sleu", "d,v,t", 0, (int) M_SLEU, INSN_MACRO, I1 }, |
1958 | 6643d27e | bellard | {"sleu", "d,v,I", 0, (int) M_SLEU_I, INSN_MACRO, I1 }, |
1959 | 6643d27e | bellard | {"sllv", "d,t,s", 0x00000004, 0xfc0007ff, WR_d|RD_t|RD_s, I1 }, |
1960 | 6643d27e | bellard | {"sll", "d,w,s", 0x00000004, 0xfc0007ff, WR_d|RD_t|RD_s, I1 }, /* sllv */ |
1961 | 6643d27e | bellard | {"sll", "d,w,<", 0x00000000, 0xffe0003f, WR_d|RD_t, I1 }, |
1962 | 6643d27e | bellard | {"sll.ob", "X,Y,Q", 0x78000010, 0xfc20003f, WR_D|RD_S|RD_T|FP_D, MX|SB1 }, |
1963 | 6643d27e | bellard | {"sll.ob", "D,S,T[e]", 0x48000010, 0xfe20003f, WR_D|RD_S|RD_T, N54 }, |
1964 | 6643d27e | bellard | {"sll.ob", "D,S,k", 0x4bc00010, 0xffe0003f, WR_D|RD_S|RD_T, N54 }, |
1965 | 6643d27e | bellard | {"sll.qh", "X,Y,Q", 0x78200010, 0xfc20003f, WR_D|RD_S|RD_T|FP_D, MX }, |
1966 | 6643d27e | bellard | {"slt", "d,v,t", 0x0000002a, 0xfc0007ff, WR_d|RD_s|RD_t, I1 }, |
1967 | 6643d27e | bellard | {"slt", "d,v,I", 0, (int) M_SLT_I, INSN_MACRO, I1 }, |
1968 | 6643d27e | bellard | {"slti", "t,r,j", 0x28000000, 0xfc000000, WR_t|RD_s, I1 }, |
1969 | 6643d27e | bellard | {"sltiu", "t,r,j", 0x2c000000, 0xfc000000, WR_t|RD_s, I1 }, |
1970 | 6643d27e | bellard | {"sltu", "d,v,t", 0x0000002b, 0xfc0007ff, WR_d|RD_s|RD_t, I1 }, |
1971 | 6643d27e | bellard | {"sltu", "d,v,I", 0, (int) M_SLTU_I, INSN_MACRO, I1 }, |
1972 | 6643d27e | bellard | {"sne", "d,v,t", 0, (int) M_SNE, INSN_MACRO, I1 }, |
1973 | 6643d27e | bellard | {"sne", "d,v,I", 0, (int) M_SNE_I, INSN_MACRO, I1 }, |
1974 | 6643d27e | bellard | {"sqrt.d", "D,S", 0x46200004, 0xffff003f, WR_D|RD_S|FP_D, I2 }, |
1975 | 6643d27e | bellard | {"sqrt.s", "D,S", 0x46000004, 0xffff003f, WR_D|RD_S|FP_S, I2 }, |
1976 | 6643d27e | bellard | {"sqrt.ps", "D,S", 0x46c00004, 0xffff003f, WR_D|RD_S|FP_D, SB1 }, |
1977 | 6643d27e | bellard | {"srav", "d,t,s", 0x00000007, 0xfc0007ff, WR_d|RD_t|RD_s, I1 }, |
1978 | 6643d27e | bellard | {"sra", "d,w,s", 0x00000007, 0xfc0007ff, WR_d|RD_t|RD_s, I1 }, /* srav */ |
1979 | 6643d27e | bellard | {"sra", "d,w,<", 0x00000003, 0xffe0003f, WR_d|RD_t, I1 }, |
1980 | 6643d27e | bellard | {"sra.qh", "X,Y,Q", 0x78200013, 0xfc20003f, WR_D|RD_S|RD_T|FP_D, MX }, |
1981 | 6643d27e | bellard | {"srlv", "d,t,s", 0x00000006, 0xfc0007ff, WR_d|RD_t|RD_s, I1 }, |
1982 | 6643d27e | bellard | {"srl", "d,w,s", 0x00000006, 0xfc0007ff, WR_d|RD_t|RD_s, I1 }, /* srlv */ |
1983 | 6643d27e | bellard | {"srl", "d,w,<", 0x00000002, 0xffe0003f, WR_d|RD_t, I1 }, |
1984 | 6643d27e | bellard | {"srl.ob", "X,Y,Q", 0x78000012, 0xfc20003f, WR_D|RD_S|RD_T|FP_D, MX|SB1 }, |
1985 | 6643d27e | bellard | {"srl.ob", "D,S,T[e]", 0x48000012, 0xfe20003f, WR_D|RD_S|RD_T, N54 }, |
1986 | 6643d27e | bellard | {"srl.ob", "D,S,k", 0x4bc00012, 0xffe0003f, WR_D|RD_S|RD_T, N54 }, |
1987 | 6643d27e | bellard | {"srl.qh", "X,Y,Q", 0x78200012, 0xfc20003f, WR_D|RD_S|RD_T|FP_D, MX }, |
1988 | 6643d27e | bellard | /* ssnop is at the start of the table. */
|
1989 | 6643d27e | bellard | {"standby", "", 0x42000021, 0xffffffff, 0, V1 }, |
1990 | 6643d27e | bellard | {"sub", "d,v,t", 0x00000022, 0xfc0007ff, WR_d|RD_s|RD_t, I1 }, |
1991 | 6643d27e | bellard | {"sub", "d,v,I", 0, (int) M_SUB_I, INSN_MACRO, I1 }, |
1992 | 6643d27e | bellard | {"sub.d", "D,V,T", 0x46200001, 0xffe0003f, WR_D|RD_S|RD_T|FP_D, I1 }, |
1993 | 6643d27e | bellard | {"sub.s", "D,V,T", 0x46000001, 0xffe0003f, WR_D|RD_S|RD_T|FP_S, I1 }, |
1994 | 6643d27e | bellard | {"sub.ob", "X,Y,Q", 0x7800000a, 0xfc20003f, WR_D|RD_S|RD_T|FP_D, MX|SB1 }, |
1995 | 6643d27e | bellard | {"sub.ob", "D,S,T", 0x4ac0000a, 0xffe0003f, WR_D|RD_S|RD_T, N54 }, |
1996 | 6643d27e | bellard | {"sub.ob", "D,S,T[e]", 0x4800000a, 0xfe20003f, WR_D|RD_S|RD_T, N54 }, |
1997 | 6643d27e | bellard | {"sub.ob", "D,S,k", 0x4bc0000a, 0xffe0003f, WR_D|RD_S|RD_T, N54 }, |
1998 | 6643d27e | bellard | {"sub.ps", "D,V,T", 0x46c00001, 0xffe0003f, WR_D|RD_S|RD_T|FP_D, I5 }, |
1999 | 6643d27e | bellard | {"sub.qh", "X,Y,Q", 0x7820000a, 0xfc20003f, WR_D|RD_S|RD_T|FP_D, MX }, |
2000 | 6643d27e | bellard | {"suba.ob", "Y,Q", 0x78000036, 0xfc2007ff, WR_MACC|RD_S|RD_T|FP_D, MX|SB1 }, |
2001 | 6643d27e | bellard | {"suba.qh", "Y,Q", 0x78200036, 0xfc2007ff, WR_MACC|RD_S|RD_T|FP_D, MX }, |
2002 | 6643d27e | bellard | {"subl.ob", "Y,Q", 0x78000436, 0xfc2007ff, WR_MACC|RD_S|RD_T|FP_D, MX|SB1 }, |
2003 | 6643d27e | bellard | {"subl.qh", "Y,Q", 0x78200436, 0xfc2007ff, WR_MACC|RD_S|RD_T|FP_D, MX }, |
2004 | 6643d27e | bellard | {"subu", "d,v,t", 0x00000023, 0xfc0007ff, WR_d|RD_s|RD_t, I1 }, |
2005 | 6643d27e | bellard | {"subu", "d,v,I", 0, (int) M_SUBU_I, INSN_MACRO, I1 }, |
2006 | 6643d27e | bellard | {"suspend", "", 0x42000022, 0xffffffff, 0, V1 }, |
2007 | 6643d27e | bellard | {"suxc1", "S,t(b)", 0x4c00000d, 0xfc0007ff, SM|RD_S|RD_t|RD_b, I5|N55 }, |
2008 | 6643d27e | bellard | {"sw", "t,o(b)", 0xac000000, 0xfc000000, SM|RD_t|RD_b, I1 }, |
2009 | 6643d27e | bellard | {"sw", "t,A(b)", 0, (int) M_SW_AB, INSN_MACRO, I1 }, |
2010 | 6643d27e | bellard | {"swc0", "E,o(b)", 0xe0000000, 0xfc000000, SM|RD_C0|RD_b, I1 }, |
2011 | 6643d27e | bellard | {"swc0", "E,A(b)", 0, (int) M_SWC0_AB, INSN_MACRO, I1 }, |
2012 | 6643d27e | bellard | {"swc1", "T,o(b)", 0xe4000000, 0xfc000000, SM|RD_T|RD_b|FP_S, I1 }, |
2013 | 6643d27e | bellard | {"swc1", "E,o(b)", 0xe4000000, 0xfc000000, SM|RD_T|RD_b|FP_S, I1 }, |
2014 | 6643d27e | bellard | {"swc1", "T,A(b)", 0, (int) M_SWC1_AB, INSN_MACRO, I1 }, |
2015 | 6643d27e | bellard | {"swc1", "E,A(b)", 0, (int) M_SWC1_AB, INSN_MACRO, I1 }, |
2016 | 6643d27e | bellard | {"s.s", "T,o(b)", 0xe4000000, 0xfc000000, SM|RD_T|RD_b|FP_S, I1 }, /* swc1 */ |
2017 | 6643d27e | bellard | {"s.s", "T,A(b)", 0, (int) M_SWC1_AB, INSN_MACRO, I1 }, |
2018 | 6643d27e | bellard | {"swc2", "E,o(b)", 0xe8000000, 0xfc000000, SM|RD_C2|RD_b, I1 }, |
2019 | 6643d27e | bellard | {"swc2", "E,A(b)", 0, (int) M_SWC2_AB, INSN_MACRO, I1 }, |
2020 | 6643d27e | bellard | {"swc3", "E,o(b)", 0xec000000, 0xfc000000, SM|RD_C3|RD_b, I1 }, |
2021 | 6643d27e | bellard | {"swc3", "E,A(b)", 0, (int) M_SWC3_AB, INSN_MACRO, I1 }, |
2022 | 6643d27e | bellard | {"swl", "t,o(b)", 0xa8000000, 0xfc000000, SM|RD_t|RD_b, I1 }, |
2023 | 6643d27e | bellard | {"swl", "t,A(b)", 0, (int) M_SWL_AB, INSN_MACRO, I1 }, |
2024 | 6643d27e | bellard | {"scache", "t,o(b)", 0xa8000000, 0xfc000000, RD_t|RD_b, I2 }, /* same */ |
2025 | 6643d27e | bellard | {"scache", "t,A(b)", 0, (int) M_SWL_AB, INSN_MACRO, I2 }, /* as swl */ |
2026 | 6643d27e | bellard | {"swr", "t,o(b)", 0xb8000000, 0xfc000000, SM|RD_t|RD_b, I1 }, |
2027 | 6643d27e | bellard | {"swr", "t,A(b)", 0, (int) M_SWR_AB, INSN_MACRO, I1 }, |
2028 | 6643d27e | bellard | {"invalidate", "t,o(b)",0xb8000000, 0xfc000000, RD_t|RD_b, I2 }, /* same */ |
2029 | 6643d27e | bellard | {"invalidate", "t,A(b)",0, (int) M_SWR_AB, INSN_MACRO, I2 }, /* as swr */ |
2030 | 6643d27e | bellard | {"swxc1", "S,t(b)", 0x4c000008, 0xfc0007ff, SM|RD_S|RD_t|RD_b, I4 }, |
2031 | 6643d27e | bellard | {"sync", "", 0x0000000f, 0xffffffff, INSN_SYNC, I2|G1 }, |
2032 | 6643d27e | bellard | {"sync.p", "", 0x0000040f, 0xffffffff, INSN_SYNC, I2 }, |
2033 | 6643d27e | bellard | {"sync.l", "", 0x0000000f, 0xffffffff, INSN_SYNC, I2 }, |
2034 | 6643d27e | bellard | {"synci", "o(b)", 0x041f0000, 0xfc1f0000, SM|RD_b, I33 }, |
2035 | 6643d27e | bellard | {"syscall", "", 0x0000000c, 0xffffffff, TRAP, I1 }, |
2036 | 6643d27e | bellard | {"syscall", "B", 0x0000000c, 0xfc00003f, TRAP, I1 }, |
2037 | 6643d27e | bellard | {"teqi", "s,j", 0x040c0000, 0xfc1f0000, RD_s|TRAP, I2 }, |
2038 | 6643d27e | bellard | {"teq", "s,t", 0x00000034, 0xfc00ffff, RD_s|RD_t|TRAP, I2 }, |
2039 | 6643d27e | bellard | {"teq", "s,t,q", 0x00000034, 0xfc00003f, RD_s|RD_t|TRAP, I2 }, |
2040 | 6643d27e | bellard | {"teq", "s,j", 0x040c0000, 0xfc1f0000, RD_s|TRAP, I2 }, /* teqi */ |
2041 | 6643d27e | bellard | {"teq", "s,I", 0, (int) M_TEQ_I, INSN_MACRO, I2 }, |
2042 | 6643d27e | bellard | {"tgei", "s,j", 0x04080000, 0xfc1f0000, RD_s|TRAP, I2 }, |
2043 | 6643d27e | bellard | {"tge", "s,t", 0x00000030, 0xfc00ffff, RD_s|RD_t|TRAP, I2 }, |
2044 | 6643d27e | bellard | {"tge", "s,t,q", 0x00000030, 0xfc00003f, RD_s|RD_t|TRAP, I2 }, |
2045 | 6643d27e | bellard | {"tge", "s,j", 0x04080000, 0xfc1f0000, RD_s|TRAP, I2 }, /* tgei */ |
2046 | 6643d27e | bellard | {"tge", "s,I", 0, (int) M_TGE_I, INSN_MACRO, I2 }, |
2047 | 6643d27e | bellard | {"tgeiu", "s,j", 0x04090000, 0xfc1f0000, RD_s|TRAP, I2 }, |
2048 | 6643d27e | bellard | {"tgeu", "s,t", 0x00000031, 0xfc00ffff, RD_s|RD_t|TRAP, I2 }, |
2049 | 6643d27e | bellard | {"tgeu", "s,t,q", 0x00000031, 0xfc00003f, RD_s|RD_t|TRAP, I2 }, |
2050 | 6643d27e | bellard | {"tgeu", "s,j", 0x04090000, 0xfc1f0000, RD_s|TRAP, I2 }, /* tgeiu */ |
2051 | 6643d27e | bellard | {"tgeu", "s,I", 0, (int) M_TGEU_I, INSN_MACRO, I2 }, |
2052 | 6643d27e | bellard | {"tlbp", "", 0x42000008, 0xffffffff, INSN_TLB, I1 }, |
2053 | 6643d27e | bellard | {"tlbr", "", 0x42000001, 0xffffffff, INSN_TLB, I1 }, |
2054 | 6643d27e | bellard | {"tlbwi", "", 0x42000002, 0xffffffff, INSN_TLB, I1 }, |
2055 | 6643d27e | bellard | {"tlbwr", "", 0x42000006, 0xffffffff, INSN_TLB, I1 }, |
2056 | 6643d27e | bellard | {"tlti", "s,j", 0x040a0000, 0xfc1f0000, RD_s|TRAP, I2 }, |
2057 | 6643d27e | bellard | {"tlt", "s,t", 0x00000032, 0xfc00ffff, RD_s|RD_t|TRAP, I2 }, |
2058 | 6643d27e | bellard | {"tlt", "s,t,q", 0x00000032, 0xfc00003f, RD_s|RD_t|TRAP, I2 }, |
2059 | 6643d27e | bellard | {"tlt", "s,j", 0x040a0000, 0xfc1f0000, RD_s|TRAP, I2 }, /* tlti */ |
2060 | 6643d27e | bellard | {"tlt", "s,I", 0, (int) M_TLT_I, INSN_MACRO, I2 }, |
2061 | 6643d27e | bellard | {"tltiu", "s,j", 0x040b0000, 0xfc1f0000, RD_s|TRAP, I2 }, |
2062 | 6643d27e | bellard | {"tltu", "s,t", 0x00000033, 0xfc00ffff, RD_s|RD_t|TRAP, I2 }, |
2063 | 6643d27e | bellard | {"tltu", "s,t,q", 0x00000033, 0xfc00003f, RD_s|RD_t|TRAP, I2 }, |
2064 | 6643d27e | bellard | {"tltu", "s,j", 0x040b0000, 0xfc1f0000, RD_s|TRAP, I2 }, /* tltiu */ |
2065 | 6643d27e | bellard | {"tltu", "s,I", 0, (int) M_TLTU_I, INSN_MACRO, I2 }, |
2066 | 6643d27e | bellard | {"tnei", "s,j", 0x040e0000, 0xfc1f0000, RD_s|TRAP, I2 }, |
2067 | 6643d27e | bellard | {"tne", "s,t", 0x00000036, 0xfc00ffff, RD_s|RD_t|TRAP, I2 }, |
2068 | 6643d27e | bellard | {"tne", "s,t,q", 0x00000036, 0xfc00003f, RD_s|RD_t|TRAP, I2 }, |
2069 | 6643d27e | bellard | {"tne", "s,j", 0x040e0000, 0xfc1f0000, RD_s|TRAP, I2 }, /* tnei */ |
2070 | 6643d27e | bellard | {"tne", "s,I", 0, (int) M_TNE_I, INSN_MACRO, I2 }, |
2071 | 6643d27e | bellard | {"trunc.l.d", "D,S", 0x46200009, 0xffff003f, WR_D|RD_S|FP_D, I3 }, |
2072 | 6643d27e | bellard | {"trunc.l.s", "D,S", 0x46000009, 0xffff003f, WR_D|RD_S|FP_S, I3 }, |
2073 | 6643d27e | bellard | {"trunc.w.d", "D,S", 0x4620000d, 0xffff003f, WR_D|RD_S|FP_D, I2 }, |
2074 | 6643d27e | bellard | {"trunc.w.d", "D,S,x", 0x4620000d, 0xffff003f, WR_D|RD_S|FP_D, I2 }, |
2075 | 6643d27e | bellard | {"trunc.w.d", "D,S,t", 0, (int) M_TRUNCWD, INSN_MACRO, I1 }, |
2076 | 6643d27e | bellard | {"trunc.w.s", "D,S", 0x4600000d, 0xffff003f, WR_D|RD_S|FP_S, I2 }, |
2077 | 6643d27e | bellard | {"trunc.w.s", "D,S,x", 0x4600000d, 0xffff003f, WR_D|RD_S|FP_S, I2 }, |
2078 | 6643d27e | bellard | {"trunc.w.s", "D,S,t", 0, (int) M_TRUNCWS, INSN_MACRO, I1 }, |
2079 | 6643d27e | bellard | {"uld", "t,o(b)", 0, (int) M_ULD, INSN_MACRO, I3 }, |
2080 | 6643d27e | bellard | {"uld", "t,A(b)", 0, (int) M_ULD_A, INSN_MACRO, I3 }, |
2081 | 6643d27e | bellard | {"ulh", "t,o(b)", 0, (int) M_ULH, INSN_MACRO, I1 }, |
2082 | 6643d27e | bellard | {"ulh", "t,A(b)", 0, (int) M_ULH_A, INSN_MACRO, I1 }, |
2083 | 6643d27e | bellard | {"ulhu", "t,o(b)", 0, (int) M_ULHU, INSN_MACRO, I1 }, |
2084 | 6643d27e | bellard | {"ulhu", "t,A(b)", 0, (int) M_ULHU_A, INSN_MACRO, I1 }, |
2085 | 6643d27e | bellard | {"ulw", "t,o(b)", 0, (int) M_ULW, INSN_MACRO, I1 }, |
2086 | 6643d27e | bellard | {"ulw", "t,A(b)", 0, (int) M_ULW_A, INSN_MACRO, I1 }, |
2087 | 6643d27e | bellard | {"usd", "t,o(b)", 0, (int) M_USD, INSN_MACRO, I3 }, |
2088 | 6643d27e | bellard | {"usd", "t,A(b)", 0, (int) M_USD_A, INSN_MACRO, I3 }, |
2089 | 6643d27e | bellard | {"ush", "t,o(b)", 0, (int) M_USH, INSN_MACRO, I1 }, |
2090 | 6643d27e | bellard | {"ush", "t,A(b)", 0, (int) M_USH_A, INSN_MACRO, I1 }, |
2091 | 6643d27e | bellard | {"usw", "t,o(b)", 0, (int) M_USW, INSN_MACRO, I1 }, |
2092 | 6643d27e | bellard | {"usw", "t,A(b)", 0, (int) M_USW_A, INSN_MACRO, I1 }, |
2093 | 6643d27e | bellard | {"wach.ob", "Y", 0x7a00003e, 0xffff07ff, WR_MACC|RD_S|FP_D, MX|SB1 }, |
2094 | 6643d27e | bellard | {"wach.ob", "S", 0x4a00003e, 0xffff07ff, RD_S, N54 }, |
2095 | 6643d27e | bellard | {"wach.qh", "Y", 0x7a20003e, 0xffff07ff, WR_MACC|RD_S|FP_D, MX }, |
2096 | 6643d27e | bellard | {"wacl.ob", "Y,Z", 0x7800003e, 0xffe007ff, WR_MACC|RD_S|RD_T|FP_D, MX|SB1 }, |
2097 | 6643d27e | bellard | {"wacl.ob", "S,T", 0x4800003e, 0xffe007ff, RD_S|RD_T, N54 }, |
2098 | 6643d27e | bellard | {"wacl.qh", "Y,Z", 0x7820003e, 0xffe007ff, WR_MACC|RD_S|RD_T|FP_D, MX }, |
2099 | 6643d27e | bellard | {"wait", "", 0x42000020, 0xffffffff, TRAP, I3|I32 }, |
2100 | 6643d27e | bellard | {"wait", "J", 0x42000020, 0xfe00003f, TRAP, I32|N55 }, |
2101 | 6643d27e | bellard | {"waiti", "", 0x42000020, 0xffffffff, TRAP, L1 }, |
2102 | 6643d27e | bellard | {"wb", "o(b)", 0xbc040000, 0xfc1f0000, SM|RD_b, L1 }, |
2103 | 6643d27e | bellard | {"wrpgpr", "d,w", 0x41c00000, 0xffe007ff, RD_t, I33 }, |
2104 | 6643d27e | bellard | {"wsbh", "d,w", 0x7c0000a0, 0xffe007ff, WR_d|RD_t, I33 }, |
2105 | 6643d27e | bellard | {"xor", "d,v,t", 0x00000026, 0xfc0007ff, WR_d|RD_s|RD_t, I1 }, |
2106 | 6643d27e | bellard | {"xor", "t,r,I", 0, (int) M_XOR_I, INSN_MACRO, I1 }, |
2107 | 6643d27e | bellard | {"xor.ob", "X,Y,Q", 0x7800000d, 0xfc20003f, WR_D|RD_S|RD_T|FP_D, MX|SB1 }, |
2108 | 6643d27e | bellard | {"xor.ob", "D,S,T", 0x4ac0000d, 0xffe0003f, WR_D|RD_S|RD_T, N54 }, |
2109 | 6643d27e | bellard | {"xor.ob", "D,S,T[e]", 0x4800000d, 0xfe20003f, WR_D|RD_S|RD_T, N54 }, |
2110 | 6643d27e | bellard | {"xor.ob", "D,S,k", 0x4bc0000d, 0xffe0003f, WR_D|RD_S|RD_T, N54 }, |
2111 | 6643d27e | bellard | {"xor.qh", "X,Y,Q", 0x7820000d, 0xfc20003f, WR_D|RD_S|RD_T|FP_D, MX }, |
2112 | 6643d27e | bellard | {"xori", "t,r,i", 0x38000000, 0xfc000000, WR_t|RD_s, I1 }, |
2113 | 6643d27e | bellard | |
2114 | 6643d27e | bellard | /* Coprocessor 2 move/branch operations overlap with VR5400 .ob format
|
2115 | 6643d27e | bellard | instructions so they are here for the latters to take precedence. */
|
2116 | 6643d27e | bellard | {"bc2f", "p", 0x49000000, 0xffff0000, CBD|RD_CC, I1 }, |
2117 | 6643d27e | bellard | {"bc2fl", "p", 0x49020000, 0xffff0000, CBL|RD_CC, I2|T3 }, |
2118 | 6643d27e | bellard | {"bc2t", "p", 0x49010000, 0xffff0000, CBD|RD_CC, I1 }, |
2119 | 6643d27e | bellard | {"bc2tl", "p", 0x49030000, 0xffff0000, CBL|RD_CC, I2|T3 }, |
2120 | 6643d27e | bellard | {"cfc2", "t,G", 0x48400000, 0xffe007ff, LCD|WR_t|RD_C2, I1 }, |
2121 | 6643d27e | bellard | {"ctc2", "t,G", 0x48c00000, 0xffe007ff, COD|RD_t|WR_CC, I1 }, |
2122 | 6643d27e | bellard | {"dmfc2", "t,G", 0x48200000, 0xffe007ff, LCD|WR_t|RD_C2, I3 }, |
2123 | 6643d27e | bellard | {"dmfc2", "t,G,H", 0x48200000, 0xffe007f8, LCD|WR_t|RD_C2, I64 }, |
2124 | 6643d27e | bellard | {"dmtc2", "t,G", 0x48a00000, 0xffe007ff, COD|RD_t|WR_C2|WR_CC, I3 }, |
2125 | 6643d27e | bellard | {"dmtc2", "t,G,H", 0x48a00000, 0xffe007f8, COD|RD_t|WR_C2|WR_CC, I64 }, |
2126 | 6643d27e | bellard | {"mfc2", "t,G", 0x48000000, 0xffe007ff, LCD|WR_t|RD_C2, I1 }, |
2127 | 6643d27e | bellard | {"mfc2", "t,G,H", 0x48000000, 0xffe007f8, LCD|WR_t|RD_C2, I32 }, |
2128 | 6643d27e | bellard | {"mfhc2", "t,i", 0x48600000, 0xffe00000, LCD|WR_t|RD_C2, I33 }, |
2129 | 6643d27e | bellard | {"mtc2", "t,G", 0x48800000, 0xffe007ff, COD|RD_t|WR_C2|WR_CC, I1 }, |
2130 | 6643d27e | bellard | {"mtc2", "t,G,H", 0x48800000, 0xffe007f8, COD|RD_t|WR_C2|WR_CC, I32 }, |
2131 | 6643d27e | bellard | {"mthc2", "t,i", 0x48e00000, 0xffe00000, COD|RD_t|WR_C2|WR_CC, I33 }, |
2132 | 6643d27e | bellard | |
2133 | 6643d27e | bellard | /* No hazard protection on coprocessor instructions--they shouldn't
|
2134 | 6643d27e | bellard | change the state of the processor and if they do it's up to the
|
2135 | 6643d27e | bellard | user to put in nops as necessary. These are at the end so that the
|
2136 | 6643d27e | bellard | disassembler recognizes more specific versions first. */
|
2137 | 6643d27e | bellard | {"c0", "C", 0x42000000, 0xfe000000, 0, I1 }, |
2138 | 6643d27e | bellard | {"c1", "C", 0x46000000, 0xfe000000, 0, I1 }, |
2139 | 6643d27e | bellard | {"c2", "C", 0x4a000000, 0xfe000000, 0, I1 }, |
2140 | 6643d27e | bellard | {"c3", "C", 0x4e000000, 0xfe000000, 0, I1 }, |
2141 | 6643d27e | bellard | {"cop0", "C", 0, (int) M_COP0, INSN_MACRO, I1 }, |
2142 | 6643d27e | bellard | {"cop1", "C", 0, (int) M_COP1, INSN_MACRO, I1 }, |
2143 | 6643d27e | bellard | {"cop2", "C", 0, (int) M_COP2, INSN_MACRO, I1 }, |
2144 | 6643d27e | bellard | {"cop3", "C", 0, (int) M_COP3, INSN_MACRO, I1 }, |
2145 | 6643d27e | bellard | |
2146 | 6643d27e | bellard | /* Conflicts with the 4650's "mul" instruction. Nobody's using the
|
2147 | 6643d27e | bellard | 4010 any more, so move this insn out of the way. If the object
|
2148 | 6643d27e | bellard | format gave us more info, we could do this right. */
|
2149 | 6643d27e | bellard | {"addciu", "t,r,j", 0x70000000, 0xfc000000, WR_t|RD_s, L1 }, |
2150 | 6643d27e | bellard | }; |
2151 | 6643d27e | bellard | |
2152 | 6643d27e | bellard | #define MIPS_NUM_OPCODES \
|
2153 | 6643d27e | bellard | ((sizeof mips_builtin_opcodes) / (sizeof (mips_builtin_opcodes[0]))) |
2154 | 6643d27e | bellard | const int bfd_mips_num_builtin_opcodes = MIPS_NUM_OPCODES; |
2155 | 6643d27e | bellard | |
2156 | 6643d27e | bellard | /* const removed from the following to allow for dynamic extensions to the
|
2157 | 6643d27e | bellard | * built-in instruction set. */
|
2158 | 6643d27e | bellard | struct mips_opcode *mips_opcodes =
|
2159 | 6643d27e | bellard | (struct mips_opcode *) mips_builtin_opcodes;
|
2160 | 6643d27e | bellard | int bfd_mips_num_opcodes = MIPS_NUM_OPCODES;
|
2161 | 6643d27e | bellard | #undef MIPS_NUM_OPCODES
|
2162 | 6643d27e | bellard | |
2163 | 6643d27e | bellard | /* Mips instructions are at maximum this many bytes long. */
|
2164 | 6643d27e | bellard | #define INSNLEN 4 |
2165 | 6643d27e | bellard | |
2166 | 6643d27e | bellard | static void set_default_mips_dis_options |
2167 | 6643d27e | bellard | PARAMS ((struct disassemble_info *));
|
2168 | 6643d27e | bellard | static void parse_mips_dis_option |
2169 | 6643d27e | bellard | PARAMS ((const char *, unsigned int)); |
2170 | 6643d27e | bellard | static void parse_mips_dis_options |
2171 | 6643d27e | bellard | PARAMS ((const char *)); |
2172 | 6643d27e | bellard | static int _print_insn_mips |
2173 | 6643d27e | bellard | PARAMS ((bfd_vma, struct disassemble_info *, enum bfd_endian)); |
2174 | 6643d27e | bellard | static int print_insn_mips |
2175 | 6643d27e | bellard | PARAMS ((bfd_vma, unsigned long int, struct disassemble_info *)); |
2176 | 6643d27e | bellard | static void print_insn_args |
2177 | 6643d27e | bellard | PARAMS ((const char *, unsigned long, bfd_vma, struct disassemble_info *)); |
2178 | 6643d27e | bellard | #if 0
|
2179 | 6643d27e | bellard | static int print_insn_mips16
|
2180 | 6643d27e | bellard | PARAMS ((bfd_vma, struct disassemble_info *));
|
2181 | 6643d27e | bellard | #endif
|
2182 | 6643d27e | bellard | #if 0
|
2183 | 6643d27e | bellard | static int is_newabi
|
2184 | 6643d27e | bellard | PARAMS ((Elf32_Ehdr *));
|
2185 | 6643d27e | bellard | #endif
|
2186 | 6643d27e | bellard | #if 0
|
2187 | 6643d27e | bellard | static void print_mips16_insn_arg
|
2188 | 6643d27e | bellard | PARAMS ((int, const struct mips_opcode *, int, bfd_boolean, int, bfd_vma,
|
2189 | 6643d27e | bellard | struct disassemble_info *));
|
2190 | 6643d27e | bellard | #endif
|
2191 | 6643d27e | bellard | |
2192 | 6643d27e | bellard | /* FIXME: These should be shared with gdb somehow. */
|
2193 | 6643d27e | bellard | |
2194 | 6643d27e | bellard | struct mips_cp0sel_name {
|
2195 | 6643d27e | bellard | unsigned int cp0reg; |
2196 | 6643d27e | bellard | unsigned int sel; |
2197 | 6643d27e | bellard | const char * const name; |
2198 | 6643d27e | bellard | }; |
2199 | 6643d27e | bellard | |
2200 | 6643d27e | bellard | /* The mips16 register names. */
|
2201 | 6643d27e | bellard | static const char * const mips16_reg_names[] = { |
2202 | 6643d27e | bellard | "s0", "s1", "v0", "v1", "a0", "a1", "a2", "a3" |
2203 | 6643d27e | bellard | }; |
2204 | 6643d27e | bellard | |
2205 | 6643d27e | bellard | static const char * const mips_gpr_names_numeric[32] = { |
2206 | 6643d27e | bellard | "$0", "$1", "$2", "$3", "$4", "$5", "$6", "$7", |
2207 | 6643d27e | bellard | "$8", "$9", "$10", "$11", "$12", "$13", "$14", "$15", |
2208 | 6643d27e | bellard | "$16", "$17", "$18", "$19", "$20", "$21", "$22", "$23", |
2209 | 6643d27e | bellard | "$24", "$25", "$26", "$27", "$28", "$29", "$30", "$31" |
2210 | 6643d27e | bellard | }; |
2211 | 6643d27e | bellard | |
2212 | 6643d27e | bellard | static const char * const mips_gpr_names_oldabi[32] = { |
2213 | 6643d27e | bellard | "zero", "at", "v0", "v1", "a0", "a1", "a2", "a3", |
2214 | 6643d27e | bellard | "t0", "t1", "t2", "t3", "t4", "t5", "t6", "t7", |
2215 | 6643d27e | bellard | "s0", "s1", "s2", "s3", "s4", "s5", "s6", "s7", |
2216 | 6643d27e | bellard | "t8", "t9", "k0", "k1", "gp", "sp", "s8", "ra" |
2217 | 6643d27e | bellard | }; |
2218 | 6643d27e | bellard | |
2219 | 6643d27e | bellard | static const char * const mips_gpr_names_newabi[32] = { |
2220 | 6643d27e | bellard | "zero", "at", "v0", "v1", "a0", "a1", "a2", "a3", |
2221 | 6643d27e | bellard | "a4", "a5", "a6", "a7", "t0", "t1", "t2", "t3", |
2222 | 6643d27e | bellard | "s0", "s1", "s2", "s3", "s4", "s5", "s6", "s7", |
2223 | 6643d27e | bellard | "t8", "t9", "k0", "k1", "gp", "sp", "s8", "ra" |
2224 | 6643d27e | bellard | }; |
2225 | 6643d27e | bellard | |
2226 | 6643d27e | bellard | static const char * const mips_fpr_names_numeric[32] = { |
2227 | 6643d27e | bellard | "$f0", "$f1", "$f2", "$f3", "$f4", "$f5", "$f6", "$f7", |
2228 | 6643d27e | bellard | "$f8", "$f9", "$f10", "$f11", "$f12", "$f13", "$f14", "$f15", |
2229 | 6643d27e | bellard | "$f16", "$f17", "$f18", "$f19", "$f20", "$f21", "$f22", "$f23", |
2230 | 6643d27e | bellard | "$f24", "$f25", "$f26", "$f27", "$f28", "$f29", "$f30", "$f31" |
2231 | 6643d27e | bellard | }; |
2232 | 6643d27e | bellard | |
2233 | 6643d27e | bellard | static const char * const mips_fpr_names_32[32] = { |
2234 | 6643d27e | bellard | "fv0", "fv0f", "fv1", "fv1f", "ft0", "ft0f", "ft1", "ft1f", |
2235 | 6643d27e | bellard | "ft2", "ft2f", "ft3", "ft3f", "fa0", "fa0f", "fa1", "fa1f", |
2236 | 6643d27e | bellard | "ft4", "ft4f", "ft5", "ft5f", "fs0", "fs0f", "fs1", "fs1f", |
2237 | 6643d27e | bellard | "fs2", "fs2f", "fs3", "fs3f", "fs4", "fs4f", "fs5", "fs5f" |
2238 | 6643d27e | bellard | }; |
2239 | 6643d27e | bellard | |
2240 | 6643d27e | bellard | static const char * const mips_fpr_names_n32[32] = { |
2241 | 6643d27e | bellard | "fv0", "ft14", "fv1", "ft15", "ft0", "ft1", "ft2", "ft3", |
2242 | 6643d27e | bellard | "ft4", "ft5", "ft6", "ft7", "fa0", "fa1", "fa2", "fa3", |
2243 | 6643d27e | bellard | "fa4", "fa5", "fa6", "fa7", "fs0", "ft8", "fs1", "ft9", |
2244 | 6643d27e | bellard | "fs2", "ft10", "fs3", "ft11", "fs4", "ft12", "fs5", "ft13" |
2245 | 6643d27e | bellard | }; |
2246 | 6643d27e | bellard | |
2247 | 6643d27e | bellard | static const char * const mips_fpr_names_64[32] = { |
2248 | 6643d27e | bellard | "fv0", "ft12", "fv1", "ft13", "ft0", "ft1", "ft2", "ft3", |
2249 | 6643d27e | bellard | "ft4", "ft5", "ft6", "ft7", "fa0", "fa1", "fa2", "fa3", |
2250 | 6643d27e | bellard | "fa4", "fa5", "fa6", "fa7", "ft8", "ft9", "ft10", "ft11", |
2251 | 6643d27e | bellard | "fs0", "fs1", "fs2", "fs3", "fs4", "fs5", "fs6", "fs7" |
2252 | 6643d27e | bellard | }; |
2253 | 6643d27e | bellard | |
2254 | 6643d27e | bellard | static const char * const mips_cp0_names_numeric[32] = { |
2255 | 6643d27e | bellard | "$0", "$1", "$2", "$3", "$4", "$5", "$6", "$7", |
2256 | 6643d27e | bellard | "$8", "$9", "$10", "$11", "$12", "$13", "$14", "$15", |
2257 | 6643d27e | bellard | "$16", "$17", "$18", "$19", "$20", "$21", "$22", "$23", |
2258 | 6643d27e | bellard | "$24", "$25", "$26", "$27", "$28", "$29", "$30", "$31" |
2259 | 6643d27e | bellard | }; |
2260 | 6643d27e | bellard | |
2261 | 6643d27e | bellard | static const char * const mips_cp0_names_mips3264[32] = { |
2262 | 6643d27e | bellard | "c0_index", "c0_random", "c0_entrylo0", "c0_entrylo1", |
2263 | 6643d27e | bellard | "c0_context", "c0_pagemask", "c0_wired", "$7", |
2264 | 6643d27e | bellard | "c0_badvaddr", "c0_count", "c0_entryhi", "c0_compare", |
2265 | 6643d27e | bellard | "c0_status", "c0_cause", "c0_epc", "c0_prid", |
2266 | 6643d27e | bellard | "c0_config", "c0_lladdr", "c0_watchlo", "c0_watchhi", |
2267 | 6643d27e | bellard | "c0_xcontext", "$21", "$22", "c0_debug", |
2268 | 6643d27e | bellard | "c0_depc", "c0_perfcnt", "c0_errctl", "c0_cacheerr", |
2269 | 6643d27e | bellard | "c0_taglo", "c0_taghi", "c0_errorepc", "c0_desave", |
2270 | 6643d27e | bellard | }; |
2271 | 6643d27e | bellard | |
2272 | 6643d27e | bellard | static const struct mips_cp0sel_name mips_cp0sel_names_mips3264[] = { |
2273 | 6643d27e | bellard | { 16, 1, "c0_config1" }, |
2274 | 6643d27e | bellard | { 16, 2, "c0_config2" }, |
2275 | 6643d27e | bellard | { 16, 3, "c0_config3" }, |
2276 | 6643d27e | bellard | { 18, 1, "c0_watchlo,1" }, |
2277 | 6643d27e | bellard | { 18, 2, "c0_watchlo,2" }, |
2278 | 6643d27e | bellard | { 18, 3, "c0_watchlo,3" }, |
2279 | 6643d27e | bellard | { 18, 4, "c0_watchlo,4" }, |
2280 | 6643d27e | bellard | { 18, 5, "c0_watchlo,5" }, |
2281 | 6643d27e | bellard | { 18, 6, "c0_watchlo,6" }, |
2282 | 6643d27e | bellard | { 18, 7, "c0_watchlo,7" }, |
2283 | 6643d27e | bellard | { 19, 1, "c0_watchhi,1" }, |
2284 | 6643d27e | bellard | { 19, 2, "c0_watchhi,2" }, |
2285 | 6643d27e | bellard | { 19, 3, "c0_watchhi,3" }, |
2286 | 6643d27e | bellard | { 19, 4, "c0_watchhi,4" }, |
2287 | 6643d27e | bellard | { 19, 5, "c0_watchhi,5" }, |
2288 | 6643d27e | bellard | { 19, 6, "c0_watchhi,6" }, |
2289 | 6643d27e | bellard | { 19, 7, "c0_watchhi,7" }, |
2290 | 6643d27e | bellard | { 25, 1, "c0_perfcnt,1" }, |
2291 | 6643d27e | bellard | { 25, 2, "c0_perfcnt,2" }, |
2292 | 6643d27e | bellard | { 25, 3, "c0_perfcnt,3" }, |
2293 | 6643d27e | bellard | { 25, 4, "c0_perfcnt,4" }, |
2294 | 6643d27e | bellard | { 25, 5, "c0_perfcnt,5" }, |
2295 | 6643d27e | bellard | { 25, 6, "c0_perfcnt,6" }, |
2296 | 6643d27e | bellard | { 25, 7, "c0_perfcnt,7" }, |
2297 | 6643d27e | bellard | { 27, 1, "c0_cacheerr,1" }, |
2298 | 6643d27e | bellard | { 27, 2, "c0_cacheerr,2" }, |
2299 | 6643d27e | bellard | { 27, 3, "c0_cacheerr,3" }, |
2300 | 6643d27e | bellard | { 28, 1, "c0_datalo" }, |
2301 | 6643d27e | bellard | { 29, 1, "c0_datahi" } |
2302 | 6643d27e | bellard | }; |
2303 | 6643d27e | bellard | |
2304 | 6643d27e | bellard | static const char * const mips_cp0_names_mips3264r2[32] = { |
2305 | 6643d27e | bellard | "c0_index", "c0_random", "c0_entrylo0", "c0_entrylo1", |
2306 | 6643d27e | bellard | "c0_context", "c0_pagemask", "c0_wired", "c0_hwrena", |
2307 | 6643d27e | bellard | "c0_badvaddr", "c0_count", "c0_entryhi", "c0_compare", |
2308 | 6643d27e | bellard | "c0_status", "c0_cause", "c0_epc", "c0_prid", |
2309 | 6643d27e | bellard | "c0_config", "c0_lladdr", "c0_watchlo", "c0_watchhi", |
2310 | 6643d27e | bellard | "c0_xcontext", "$21", "$22", "c0_debug", |
2311 | 6643d27e | bellard | "c0_depc", "c0_perfcnt", "c0_errctl", "c0_cacheerr", |
2312 | 6643d27e | bellard | "c0_taglo", "c0_taghi", "c0_errorepc", "c0_desave", |
2313 | 6643d27e | bellard | }; |
2314 | 6643d27e | bellard | |
2315 | 6643d27e | bellard | static const struct mips_cp0sel_name mips_cp0sel_names_mips3264r2[] = { |
2316 | 6643d27e | bellard | { 4, 1, "c0_contextconfig" }, |
2317 | 6643d27e | bellard | { 5, 1, "c0_pagegrain" }, |
2318 | 6643d27e | bellard | { 12, 1, "c0_intctl" }, |
2319 | 6643d27e | bellard | { 12, 2, "c0_srsctl" }, |
2320 | 6643d27e | bellard | { 12, 3, "c0_srsmap" }, |
2321 | 6643d27e | bellard | { 15, 1, "c0_ebase" }, |
2322 | 6643d27e | bellard | { 16, 1, "c0_config1" }, |
2323 | 6643d27e | bellard | { 16, 2, "c0_config2" }, |
2324 | 6643d27e | bellard | { 16, 3, "c0_config3" }, |
2325 | 6643d27e | bellard | { 18, 1, "c0_watchlo,1" }, |
2326 | 6643d27e | bellard | { 18, 2, "c0_watchlo,2" }, |
2327 | 6643d27e | bellard | { 18, 3, "c0_watchlo,3" }, |
2328 | 6643d27e | bellard | { 18, 4, "c0_watchlo,4" }, |
2329 | 6643d27e | bellard | { 18, 5, "c0_watchlo,5" }, |
2330 | 6643d27e | bellard | { 18, 6, "c0_watchlo,6" }, |
2331 | 6643d27e | bellard | { 18, 7, "c0_watchlo,7" }, |
2332 | 6643d27e | bellard | { 19, 1, "c0_watchhi,1" }, |
2333 | 6643d27e | bellard | { 19, 2, "c0_watchhi,2" }, |
2334 | 6643d27e | bellard | { 19, 3, "c0_watchhi,3" }, |
2335 | 6643d27e | bellard | { 19, 4, "c0_watchhi,4" }, |
2336 | 6643d27e | bellard | { 19, 5, "c0_watchhi,5" }, |
2337 | 6643d27e | bellard | { 19, 6, "c0_watchhi,6" }, |
2338 | 6643d27e | bellard | { 19, 7, "c0_watchhi,7" }, |
2339 | 6643d27e | bellard | { 23, 1, "c0_tracecontrol" }, |
2340 | 6643d27e | bellard | { 23, 2, "c0_tracecontrol2" }, |
2341 | 6643d27e | bellard | { 23, 3, "c0_usertracedata" }, |
2342 | 6643d27e | bellard | { 23, 4, "c0_tracebpc" }, |
2343 | 6643d27e | bellard | { 25, 1, "c0_perfcnt,1" }, |
2344 | 6643d27e | bellard | { 25, 2, "c0_perfcnt,2" }, |
2345 | 6643d27e | bellard | { 25, 3, "c0_perfcnt,3" }, |
2346 | 6643d27e | bellard | { 25, 4, "c0_perfcnt,4" }, |
2347 | 6643d27e | bellard | { 25, 5, "c0_perfcnt,5" }, |
2348 | 6643d27e | bellard | { 25, 6, "c0_perfcnt,6" }, |
2349 | 6643d27e | bellard | { 25, 7, "c0_perfcnt,7" }, |
2350 | 6643d27e | bellard | { 27, 1, "c0_cacheerr,1" }, |
2351 | 6643d27e | bellard | { 27, 2, "c0_cacheerr,2" }, |
2352 | 6643d27e | bellard | { 27, 3, "c0_cacheerr,3" }, |
2353 | 6643d27e | bellard | { 28, 1, "c0_datalo" }, |
2354 | 6643d27e | bellard | { 28, 2, "c0_taglo1" }, |
2355 | 6643d27e | bellard | { 28, 3, "c0_datalo1" }, |
2356 | 6643d27e | bellard | { 28, 4, "c0_taglo2" }, |
2357 | 6643d27e | bellard | { 28, 5, "c0_datalo2" }, |
2358 | 6643d27e | bellard | { 28, 6, "c0_taglo3" }, |
2359 | 6643d27e | bellard | { 28, 7, "c0_datalo3" }, |
2360 | 6643d27e | bellard | { 29, 1, "c0_datahi" }, |
2361 | 6643d27e | bellard | { 29, 2, "c0_taghi1" }, |
2362 | 6643d27e | bellard | { 29, 3, "c0_datahi1" }, |
2363 | 6643d27e | bellard | { 29, 4, "c0_taghi2" }, |
2364 | 6643d27e | bellard | { 29, 5, "c0_datahi2" }, |
2365 | 6643d27e | bellard | { 29, 6, "c0_taghi3" }, |
2366 | 6643d27e | bellard | { 29, 7, "c0_datahi3" }, |
2367 | 6643d27e | bellard | }; |
2368 | 6643d27e | bellard | |
2369 | 6643d27e | bellard | /* SB-1: MIPS64 (mips_cp0_names_mips3264) with minor mods. */
|
2370 | 6643d27e | bellard | static const char * const mips_cp0_names_sb1[32] = { |
2371 | 6643d27e | bellard | "c0_index", "c0_random", "c0_entrylo0", "c0_entrylo1", |
2372 | 6643d27e | bellard | "c0_context", "c0_pagemask", "c0_wired", "$7", |
2373 | 6643d27e | bellard | "c0_badvaddr", "c0_count", "c0_entryhi", "c0_compare", |
2374 | 6643d27e | bellard | "c0_status", "c0_cause", "c0_epc", "c0_prid", |
2375 | 6643d27e | bellard | "c0_config", "c0_lladdr", "c0_watchlo", "c0_watchhi", |
2376 | 6643d27e | bellard | "c0_xcontext", "$21", "$22", "c0_debug", |
2377 | 6643d27e | bellard | "c0_depc", "c0_perfcnt", "c0_errctl", "c0_cacheerr_i", |
2378 | 6643d27e | bellard | "c0_taglo_i", "c0_taghi_i", "c0_errorepc", "c0_desave", |
2379 | 6643d27e | bellard | }; |
2380 | 6643d27e | bellard | |
2381 | 6643d27e | bellard | static const struct mips_cp0sel_name mips_cp0sel_names_sb1[] = { |
2382 | 6643d27e | bellard | { 16, 1, "c0_config1" }, |
2383 | 6643d27e | bellard | { 18, 1, "c0_watchlo,1" }, |
2384 | 6643d27e | bellard | { 19, 1, "c0_watchhi,1" }, |
2385 | 6643d27e | bellard | { 22, 0, "c0_perftrace" }, |
2386 | 6643d27e | bellard | { 23, 3, "c0_edebug" }, |
2387 | 6643d27e | bellard | { 25, 1, "c0_perfcnt,1" }, |
2388 | 6643d27e | bellard | { 25, 2, "c0_perfcnt,2" }, |
2389 | 6643d27e | bellard | { 25, 3, "c0_perfcnt,3" }, |
2390 | 6643d27e | bellard | { 25, 4, "c0_perfcnt,4" }, |
2391 | 6643d27e | bellard | { 25, 5, "c0_perfcnt,5" }, |
2392 | 6643d27e | bellard | { 25, 6, "c0_perfcnt,6" }, |
2393 | 6643d27e | bellard | { 25, 7, "c0_perfcnt,7" }, |
2394 | 6643d27e | bellard | { 26, 1, "c0_buserr_pa" }, |
2395 | 6643d27e | bellard | { 27, 1, "c0_cacheerr_d" }, |
2396 | 6643d27e | bellard | { 27, 3, "c0_cacheerr_d_pa" }, |
2397 | 6643d27e | bellard | { 28, 1, "c0_datalo_i" }, |
2398 | 6643d27e | bellard | { 28, 2, "c0_taglo_d" }, |
2399 | 6643d27e | bellard | { 28, 3, "c0_datalo_d" }, |
2400 | 6643d27e | bellard | { 29, 1, "c0_datahi_i" }, |
2401 | 6643d27e | bellard | { 29, 2, "c0_taghi_d" }, |
2402 | 6643d27e | bellard | { 29, 3, "c0_datahi_d" }, |
2403 | 6643d27e | bellard | }; |
2404 | 6643d27e | bellard | |
2405 | 6643d27e | bellard | static const char * const mips_hwr_names_numeric[32] = { |
2406 | 6643d27e | bellard | "$0", "$1", "$2", "$3", "$4", "$5", "$6", "$7", |
2407 | 6643d27e | bellard | "$8", "$9", "$10", "$11", "$12", "$13", "$14", "$15", |
2408 | 6643d27e | bellard | "$16", "$17", "$18", "$19", "$20", "$21", "$22", "$23", |
2409 | 6643d27e | bellard | "$24", "$25", "$26", "$27", "$28", "$29", "$30", "$31" |
2410 | 6643d27e | bellard | }; |
2411 | 6643d27e | bellard | |
2412 | 6643d27e | bellard | static const char * const mips_hwr_names_mips3264r2[32] = { |
2413 | 6643d27e | bellard | "hwr_cpunum", "hwr_synci_step", "hwr_cc", "hwr_ccres", |
2414 | 6643d27e | bellard | "$4", "$5", "$6", "$7", |
2415 | 6643d27e | bellard | "$8", "$9", "$10", "$11", "$12", "$13", "$14", "$15", |
2416 | 6643d27e | bellard | "$16", "$17", "$18", "$19", "$20", "$21", "$22", "$23", |
2417 | 6643d27e | bellard | "$24", "$25", "$26", "$27", "$28", "$29", "$30", "$31" |
2418 | 6643d27e | bellard | }; |
2419 | 6643d27e | bellard | |
2420 | 6643d27e | bellard | struct mips_abi_choice {
|
2421 | 6643d27e | bellard | const char *name; |
2422 | 6643d27e | bellard | const char * const *gpr_names; |
2423 | 6643d27e | bellard | const char * const *fpr_names; |
2424 | 6643d27e | bellard | }; |
2425 | 6643d27e | bellard | |
2426 | 6643d27e | bellard | struct mips_abi_choice mips_abi_choices[] = {
|
2427 | 6643d27e | bellard | { "numeric", mips_gpr_names_numeric, mips_fpr_names_numeric },
|
2428 | 6643d27e | bellard | { "32", mips_gpr_names_oldabi, mips_fpr_names_32 },
|
2429 | 6643d27e | bellard | { "n32", mips_gpr_names_newabi, mips_fpr_names_n32 },
|
2430 | 6643d27e | bellard | { "64", mips_gpr_names_newabi, mips_fpr_names_64 },
|
2431 | 6643d27e | bellard | }; |
2432 | 6643d27e | bellard | |
2433 | 6643d27e | bellard | struct mips_arch_choice {
|
2434 | 6643d27e | bellard | const char *name; |
2435 | 6643d27e | bellard | int bfd_mach_valid;
|
2436 | 6643d27e | bellard | unsigned long bfd_mach; |
2437 | 6643d27e | bellard | int processor;
|
2438 | 6643d27e | bellard | int isa;
|
2439 | 6643d27e | bellard | const char * const *cp0_names; |
2440 | 6643d27e | bellard | const struct mips_cp0sel_name *cp0sel_names; |
2441 | 6643d27e | bellard | unsigned int cp0sel_names_len; |
2442 | 6643d27e | bellard | const char * const *hwr_names; |
2443 | 6643d27e | bellard | }; |
2444 | 6643d27e | bellard | |
2445 | 6643d27e | bellard | #define bfd_mach_mips3000 3000 |
2446 | 6643d27e | bellard | #define bfd_mach_mips3900 3900 |
2447 | 6643d27e | bellard | #define bfd_mach_mips4000 4000 |
2448 | 6643d27e | bellard | #define bfd_mach_mips4010 4010 |
2449 | 6643d27e | bellard | #define bfd_mach_mips4100 4100 |
2450 | 6643d27e | bellard | #define bfd_mach_mips4111 4111 |
2451 | 6643d27e | bellard | #define bfd_mach_mips4120 4120 |
2452 | 6643d27e | bellard | #define bfd_mach_mips4300 4300 |
2453 | 6643d27e | bellard | #define bfd_mach_mips4400 4400 |
2454 | 6643d27e | bellard | #define bfd_mach_mips4600 4600 |
2455 | 6643d27e | bellard | #define bfd_mach_mips4650 4650 |
2456 | 6643d27e | bellard | #define bfd_mach_mips5000 5000 |
2457 | 6643d27e | bellard | #define bfd_mach_mips5400 5400 |
2458 | 6643d27e | bellard | #define bfd_mach_mips5500 5500 |
2459 | 6643d27e | bellard | #define bfd_mach_mips6000 6000 |
2460 | 6643d27e | bellard | #define bfd_mach_mips7000 7000 |
2461 | 6643d27e | bellard | #define bfd_mach_mips8000 8000 |
2462 | 6643d27e | bellard | #define bfd_mach_mips10000 10000 |
2463 | 6643d27e | bellard | #define bfd_mach_mips12000 12000 |
2464 | 6643d27e | bellard | #define bfd_mach_mips16 16 |
2465 | 6643d27e | bellard | #define bfd_mach_mips5 5 |
2466 | 6643d27e | bellard | #define bfd_mach_mips_sb1 12310201 /* octal 'SB', 01 */ |
2467 | 6643d27e | bellard | #define bfd_mach_mipsisa32 32 |
2468 | 6643d27e | bellard | #define bfd_mach_mipsisa32r2 33 |
2469 | 6643d27e | bellard | #define bfd_mach_mipsisa64 64 |
2470 | 6643d27e | bellard | #define bfd_mach_mipsisa64r2 65 |
2471 | 6643d27e | bellard | |
2472 | 6643d27e | bellard | #define ARRAY_SIZE(a) (sizeof(a) / sizeof(a[0])) |
2473 | 6643d27e | bellard | |
2474 | 6643d27e | bellard | const struct mips_arch_choice mips_arch_choices[] = { |
2475 | 6643d27e | bellard | { "numeric", 0, 0, 0, 0, |
2476 | 6643d27e | bellard | mips_cp0_names_numeric, NULL, 0, mips_hwr_names_numeric }, |
2477 | 6643d27e | bellard | |
2478 | 6643d27e | bellard | { "r3000", 1, bfd_mach_mips3000, CPU_R3000, ISA_MIPS1, |
2479 | 6643d27e | bellard | mips_cp0_names_numeric, NULL, 0, mips_hwr_names_numeric }, |
2480 | 6643d27e | bellard | { "r3900", 1, bfd_mach_mips3900, CPU_R3900, ISA_MIPS1, |
2481 | 6643d27e | bellard | mips_cp0_names_numeric, NULL, 0, mips_hwr_names_numeric }, |
2482 | 6643d27e | bellard | { "r4000", 1, bfd_mach_mips4000, CPU_R4000, ISA_MIPS3, |
2483 | 6643d27e | bellard | mips_cp0_names_numeric, NULL, 0, mips_hwr_names_numeric }, |
2484 | 6643d27e | bellard | { "r4010", 1, bfd_mach_mips4010, CPU_R4010, ISA_MIPS2, |
2485 | 6643d27e | bellard | mips_cp0_names_numeric, NULL, 0, mips_hwr_names_numeric }, |
2486 | 6643d27e | bellard | { "vr4100", 1, bfd_mach_mips4100, CPU_VR4100, ISA_MIPS3, |
2487 | 6643d27e | bellard | mips_cp0_names_numeric, NULL, 0, mips_hwr_names_numeric }, |
2488 | 6643d27e | bellard | { "vr4111", 1, bfd_mach_mips4111, CPU_R4111, ISA_MIPS3, |
2489 | 6643d27e | bellard | mips_cp0_names_numeric, NULL, 0, mips_hwr_names_numeric }, |
2490 | 6643d27e | bellard | { "vr4120", 1, bfd_mach_mips4120, CPU_VR4120, ISA_MIPS3, |
2491 | 6643d27e | bellard | mips_cp0_names_numeric, NULL, 0, mips_hwr_names_numeric }, |
2492 | 6643d27e | bellard | { "r4300", 1, bfd_mach_mips4300, CPU_R4300, ISA_MIPS3, |
2493 | 6643d27e | bellard | mips_cp0_names_numeric, NULL, 0, mips_hwr_names_numeric }, |
2494 | 6643d27e | bellard | { "r4400", 1, bfd_mach_mips4400, CPU_R4400, ISA_MIPS3, |
2495 | 6643d27e | bellard | mips_cp0_names_numeric, NULL, 0, mips_hwr_names_numeric }, |
2496 | 6643d27e | bellard | { "r4600", 1, bfd_mach_mips4600, CPU_R4600, ISA_MIPS3, |
2497 | 6643d27e | bellard | mips_cp0_names_numeric, NULL, 0, mips_hwr_names_numeric }, |
2498 | 6643d27e | bellard | { "r4650", 1, bfd_mach_mips4650, CPU_R4650, ISA_MIPS3, |
2499 | 6643d27e | bellard | mips_cp0_names_numeric, NULL, 0, mips_hwr_names_numeric }, |
2500 | 6643d27e | bellard | { "r5000", 1, bfd_mach_mips5000, CPU_R5000, ISA_MIPS4, |
2501 | 6643d27e | bellard | mips_cp0_names_numeric, NULL, 0, mips_hwr_names_numeric }, |
2502 | 6643d27e | bellard | { "vr5400", 1, bfd_mach_mips5400, CPU_VR5400, ISA_MIPS4, |
2503 | 6643d27e | bellard | mips_cp0_names_numeric, NULL, 0, mips_hwr_names_numeric }, |
2504 | 6643d27e | bellard | { "vr5500", 1, bfd_mach_mips5500, CPU_VR5500, ISA_MIPS4, |
2505 | 6643d27e | bellard | mips_cp0_names_numeric, NULL, 0, mips_hwr_names_numeric }, |
2506 | 6643d27e | bellard | { "r6000", 1, bfd_mach_mips6000, CPU_R6000, ISA_MIPS2, |
2507 | 6643d27e | bellard | mips_cp0_names_numeric, NULL, 0, mips_hwr_names_numeric }, |
2508 | 6643d27e | bellard | { "rm7000", 1, bfd_mach_mips7000, CPU_RM7000, ISA_MIPS4, |
2509 | 6643d27e | bellard | mips_cp0_names_numeric, NULL, 0, mips_hwr_names_numeric }, |
2510 | 6643d27e | bellard | { "rm9000", 1, bfd_mach_mips7000, CPU_RM7000, ISA_MIPS4, |
2511 | 6643d27e | bellard | mips_cp0_names_numeric, NULL, 0, mips_hwr_names_numeric }, |
2512 | 6643d27e | bellard | { "r8000", 1, bfd_mach_mips8000, CPU_R8000, ISA_MIPS4, |
2513 | 6643d27e | bellard | mips_cp0_names_numeric, NULL, 0, mips_hwr_names_numeric }, |
2514 | 6643d27e | bellard | { "r10000", 1, bfd_mach_mips10000, CPU_R10000, ISA_MIPS4, |
2515 | 6643d27e | bellard | mips_cp0_names_numeric, NULL, 0, mips_hwr_names_numeric }, |
2516 | 6643d27e | bellard | { "r12000", 1, bfd_mach_mips12000, CPU_R12000, ISA_MIPS4, |
2517 | 6643d27e | bellard | mips_cp0_names_numeric, NULL, 0, mips_hwr_names_numeric }, |
2518 | 6643d27e | bellard | { "mips5", 1, bfd_mach_mips5, CPU_MIPS5, ISA_MIPS5, |
2519 | 6643d27e | bellard | mips_cp0_names_numeric, NULL, 0, mips_hwr_names_numeric }, |
2520 | 6643d27e | bellard | |
2521 | 6643d27e | bellard | /* For stock MIPS32, disassemble all applicable MIPS-specified ASEs.
|
2522 | 6643d27e | bellard | Note that MIPS-3D and MDMX are not applicable to MIPS32. (See
|
2523 | 6643d27e | bellard | _MIPS32 Architecture For Programmers Volume I: Introduction to the
|
2524 | 6643d27e | bellard | MIPS32 Architecture_ (MIPS Document Number MD00082, Revision 0.95),
|
2525 | 6643d27e | bellard | page 1. */
|
2526 | 6643d27e | bellard | { "mips32", 1, bfd_mach_mipsisa32, CPU_MIPS32, |
2527 | 6643d27e | bellard | ISA_MIPS32 | INSN_MIPS16, |
2528 | 6643d27e | bellard | mips_cp0_names_mips3264, |
2529 | 6643d27e | bellard | mips_cp0sel_names_mips3264, ARRAY_SIZE (mips_cp0sel_names_mips3264), |
2530 | 6643d27e | bellard | mips_hwr_names_numeric }, |
2531 | 6643d27e | bellard | |
2532 | 6643d27e | bellard | { "mips32r2", 1, bfd_mach_mipsisa32r2, CPU_MIPS32R2, |
2533 | 6643d27e | bellard | ISA_MIPS32R2 | INSN_MIPS16, |
2534 | 6643d27e | bellard | mips_cp0_names_mips3264r2, |
2535 | 6643d27e | bellard | mips_cp0sel_names_mips3264r2, ARRAY_SIZE (mips_cp0sel_names_mips3264r2), |
2536 | 6643d27e | bellard | mips_hwr_names_mips3264r2 }, |
2537 | 6643d27e | bellard | |
2538 | 6643d27e | bellard | /* For stock MIPS64, disassemble all applicable MIPS-specified ASEs. */
|
2539 | 6643d27e | bellard | { "mips64", 1, bfd_mach_mipsisa64, CPU_MIPS64, |
2540 | 6643d27e | bellard | ISA_MIPS64 | INSN_MIPS16 | INSN_MIPS3D | INSN_MDMX, |
2541 | 6643d27e | bellard | mips_cp0_names_mips3264, |
2542 | 6643d27e | bellard | mips_cp0sel_names_mips3264, ARRAY_SIZE (mips_cp0sel_names_mips3264), |
2543 | 6643d27e | bellard | mips_hwr_names_numeric }, |
2544 | 6643d27e | bellard | |
2545 | 6643d27e | bellard | { "mips64r2", 1, bfd_mach_mipsisa64r2, CPU_MIPS64R2, |
2546 | 6643d27e | bellard | ISA_MIPS64R2 | INSN_MIPS16 | INSN_MIPS3D | INSN_MDMX, |
2547 | 6643d27e | bellard | mips_cp0_names_mips3264r2, |
2548 | 6643d27e | bellard | mips_cp0sel_names_mips3264r2, ARRAY_SIZE (mips_cp0sel_names_mips3264r2), |
2549 | 6643d27e | bellard | mips_hwr_names_mips3264r2 }, |
2550 | 6643d27e | bellard | |
2551 | 6643d27e | bellard | { "sb1", 1, bfd_mach_mips_sb1, CPU_SB1, |
2552 | 6643d27e | bellard | ISA_MIPS64 | INSN_MIPS3D | INSN_SB1, |
2553 | 6643d27e | bellard | mips_cp0_names_sb1, |
2554 | 6643d27e | bellard | mips_cp0sel_names_sb1, ARRAY_SIZE (mips_cp0sel_names_sb1), |
2555 | 6643d27e | bellard | mips_hwr_names_numeric }, |
2556 | 6643d27e | bellard | |
2557 | 6643d27e | bellard | /* This entry, mips16, is here only for ISA/processor selection; do
|
2558 | 6643d27e | bellard | not print its name. */
|
2559 | 6643d27e | bellard | { "", 1, bfd_mach_mips16, CPU_MIPS16, ISA_MIPS3 | INSN_MIPS16, |
2560 | 6643d27e | bellard | mips_cp0_names_numeric, NULL, 0, mips_hwr_names_numeric }, |
2561 | 6643d27e | bellard | }; |
2562 | 6643d27e | bellard | |
2563 | 6643d27e | bellard | /* ISA and processor type to disassemble for, and register names to use.
|
2564 | 6643d27e | bellard | set_default_mips_dis_options and parse_mips_dis_options fill in these
|
2565 | 6643d27e | bellard | values. */
|
2566 | 6643d27e | bellard | static int mips_processor; |
2567 | 6643d27e | bellard | static int mips_isa; |
2568 | 6643d27e | bellard | static const char * const *mips_gpr_names; |
2569 | 6643d27e | bellard | static const char * const *mips_fpr_names; |
2570 | 6643d27e | bellard | static const char * const *mips_cp0_names; |
2571 | 6643d27e | bellard | static const struct mips_cp0sel_name *mips_cp0sel_names; |
2572 | 6643d27e | bellard | static int mips_cp0sel_names_len; |
2573 | 6643d27e | bellard | static const char * const *mips_hwr_names; |
2574 | 6643d27e | bellard | |
2575 | 6643d27e | bellard | static const struct mips_abi_choice *choose_abi_by_name |
2576 | 6643d27e | bellard | PARAMS ((const char *, unsigned int)); |
2577 | 6643d27e | bellard | static const struct mips_arch_choice *choose_arch_by_name |
2578 | 6643d27e | bellard | PARAMS ((const char *, unsigned int)); |
2579 | 6643d27e | bellard | static const struct mips_arch_choice *choose_arch_by_number |
2580 | 6643d27e | bellard | PARAMS ((unsigned long)); |
2581 | 6643d27e | bellard | static const struct mips_cp0sel_name *lookup_mips_cp0sel_name |
2582 | 6643d27e | bellard | PARAMS ((const struct mips_cp0sel_name *, unsigned int, unsigned int, |
2583 | 6643d27e | bellard | unsigned int)); |
2584 | 6643d27e | bellard | |
2585 | 6643d27e | bellard | static const struct mips_abi_choice * |
2586 | 6643d27e | bellard | choose_abi_by_name (name, namelen) |
2587 | 6643d27e | bellard | const char *name; |
2588 | 6643d27e | bellard | unsigned int namelen; |
2589 | 6643d27e | bellard | { |
2590 | 6643d27e | bellard | const struct mips_abi_choice *c; |
2591 | 6643d27e | bellard | unsigned int i; |
2592 | 6643d27e | bellard | |
2593 | 6643d27e | bellard | for (i = 0, c = NULL; i < ARRAY_SIZE (mips_abi_choices) && c == NULL; i++) |
2594 | 6643d27e | bellard | { |
2595 | 6643d27e | bellard | if (strncmp (mips_abi_choices[i].name, name, namelen) == 0 |
2596 | 6643d27e | bellard | && strlen (mips_abi_choices[i].name) == namelen) |
2597 | 6643d27e | bellard | c = &mips_abi_choices[i]; |
2598 | 6643d27e | bellard | } |
2599 | 6643d27e | bellard | return c;
|
2600 | 6643d27e | bellard | } |
2601 | 6643d27e | bellard | |
2602 | 6643d27e | bellard | static const struct mips_arch_choice * |
2603 | 6643d27e | bellard | choose_arch_by_name (name, namelen) |
2604 | 6643d27e | bellard | const char *name; |
2605 | 6643d27e | bellard | unsigned int namelen; |
2606 | 6643d27e | bellard | { |
2607 | 6643d27e | bellard | const struct mips_arch_choice *c = NULL; |
2608 | 6643d27e | bellard | unsigned int i; |
2609 | 6643d27e | bellard | |
2610 | 6643d27e | bellard | for (i = 0, c = NULL; i < ARRAY_SIZE (mips_arch_choices) && c == NULL; i++) |
2611 | 6643d27e | bellard | { |
2612 | 6643d27e | bellard | if (strncmp (mips_arch_choices[i].name, name, namelen) == 0 |
2613 | 6643d27e | bellard | && strlen (mips_arch_choices[i].name) == namelen) |
2614 | 6643d27e | bellard | c = &mips_arch_choices[i]; |
2615 | 6643d27e | bellard | } |
2616 | 6643d27e | bellard | return c;
|
2617 | 6643d27e | bellard | } |
2618 | 6643d27e | bellard | |
2619 | 6643d27e | bellard | static const struct mips_arch_choice * |
2620 | 6643d27e | bellard | choose_arch_by_number (mach) |
2621 | 6643d27e | bellard | unsigned long mach; |
2622 | 6643d27e | bellard | { |
2623 | 6643d27e | bellard | static unsigned long hint_bfd_mach; |
2624 | 6643d27e | bellard | static const struct mips_arch_choice *hint_arch_choice; |
2625 | 6643d27e | bellard | const struct mips_arch_choice *c; |
2626 | 6643d27e | bellard | unsigned int i; |
2627 | 6643d27e | bellard | |
2628 | 6643d27e | bellard | /* We optimize this because even if the user specifies no
|
2629 | 6643d27e | bellard | flags, this will be done for every instruction! */
|
2630 | 6643d27e | bellard | if (hint_bfd_mach == mach
|
2631 | 6643d27e | bellard | && hint_arch_choice != NULL
|
2632 | 6643d27e | bellard | && hint_arch_choice->bfd_mach == hint_bfd_mach) |
2633 | 6643d27e | bellard | return hint_arch_choice;
|
2634 | 6643d27e | bellard | |
2635 | 6643d27e | bellard | for (i = 0, c = NULL; i < ARRAY_SIZE (mips_arch_choices) && c == NULL; i++) |
2636 | 6643d27e | bellard | { |
2637 | 6643d27e | bellard | if (mips_arch_choices[i].bfd_mach_valid
|
2638 | 6643d27e | bellard | && mips_arch_choices[i].bfd_mach == mach) |
2639 | 6643d27e | bellard | { |
2640 | 6643d27e | bellard | c = &mips_arch_choices[i]; |
2641 | 6643d27e | bellard | hint_bfd_mach = mach; |
2642 | 6643d27e | bellard | hint_arch_choice = c; |
2643 | 6643d27e | bellard | } |
2644 | 6643d27e | bellard | } |
2645 | 6643d27e | bellard | return c;
|
2646 | 6643d27e | bellard | } |
2647 | 6643d27e | bellard | |
2648 | 6643d27e | bellard | void
|
2649 | 6643d27e | bellard | set_default_mips_dis_options (info) |
2650 | 6643d27e | bellard | struct disassemble_info *info;
|
2651 | 6643d27e | bellard | { |
2652 | 6643d27e | bellard | const struct mips_arch_choice *chosen_arch; |
2653 | 6643d27e | bellard | |
2654 | 6643d27e | bellard | /* Defaults: mipsIII/r3000 (?!), (o)32-style ("oldabi") GPR names,
|
2655 | 6643d27e | bellard | and numeric FPR, CP0 register, and HWR names. */
|
2656 | 6643d27e | bellard | mips_isa = ISA_MIPS3; |
2657 | 6643d27e | bellard | mips_processor = CPU_R3000; |
2658 | 6643d27e | bellard | mips_gpr_names = mips_gpr_names_oldabi; |
2659 | 6643d27e | bellard | mips_fpr_names = mips_fpr_names_numeric; |
2660 | 6643d27e | bellard | mips_cp0_names = mips_cp0_names_numeric; |
2661 | 6643d27e | bellard | mips_cp0sel_names = NULL;
|
2662 | 6643d27e | bellard | mips_cp0sel_names_len = 0;
|
2663 | 6643d27e | bellard | mips_hwr_names = mips_hwr_names_numeric; |
2664 | 6643d27e | bellard | |
2665 | 6643d27e | bellard | /* If an ELF "newabi" binary, use the n32/(n)64 GPR names. */
|
2666 | 6643d27e | bellard | #if 0
|
2667 | 6643d27e | bellard | if (info->flavour == bfd_target_elf_flavour && info->section != NULL)
|
2668 | 6643d27e | bellard | {
|
2669 | 6643d27e | bellard | Elf_Internal_Ehdr *header;
|
2670 | 6643d27e | bellard | |
2671 | 6643d27e | bellard | header = elf_elfheader (info->section->owner);
|
2672 | 6643d27e | bellard | if (is_newabi (header))
|
2673 | 6643d27e | bellard | mips_gpr_names = mips_gpr_names_newabi;
|
2674 | 6643d27e | bellard | }
|
2675 | 6643d27e | bellard | #endif
|
2676 | 6643d27e | bellard | |
2677 | 6643d27e | bellard | /* Set ISA, architecture, and cp0 register names as best we can. */
|
2678 | 6643d27e | bellard | #if ! SYMTAB_AVAILABLE && 0 |
2679 | 6643d27e | bellard | /* This is running out on a target machine, not in a host tool.
|
2680 | 6643d27e | bellard | FIXME: Where does mips_target_info come from? */
|
2681 | 6643d27e | bellard | target_processor = mips_target_info.processor; |
2682 | 6643d27e | bellard | mips_isa = mips_target_info.isa; |
2683 | 6643d27e | bellard | #else
|
2684 | 6643d27e | bellard | chosen_arch = choose_arch_by_number (info->mach); |
2685 | 6643d27e | bellard | if (chosen_arch != NULL) |
2686 | 6643d27e | bellard | { |
2687 | 6643d27e | bellard | mips_processor = chosen_arch->processor; |
2688 | 6643d27e | bellard | mips_isa = chosen_arch->isa; |
2689 | 6643d27e | bellard | mips_cp0_names = chosen_arch->cp0_names; |
2690 | 6643d27e | bellard | mips_cp0sel_names = chosen_arch->cp0sel_names; |
2691 | 6643d27e | bellard | mips_cp0sel_names_len = chosen_arch->cp0sel_names_len; |
2692 | 6643d27e | bellard | mips_hwr_names = chosen_arch->hwr_names; |
2693 | 6643d27e | bellard | } |
2694 | 6643d27e | bellard | #endif
|
2695 | 6643d27e | bellard | } |
2696 | 6643d27e | bellard | |
2697 | 6643d27e | bellard | void
|
2698 | 6643d27e | bellard | parse_mips_dis_option (option, len) |
2699 | 6643d27e | bellard | const char *option; |
2700 | 6643d27e | bellard | unsigned int len; |
2701 | 6643d27e | bellard | { |
2702 | 6643d27e | bellard | unsigned int i, optionlen, vallen; |
2703 | 6643d27e | bellard | const char *val; |
2704 | 6643d27e | bellard | const struct mips_abi_choice *chosen_abi; |
2705 | 6643d27e | bellard | const struct mips_arch_choice *chosen_arch; |
2706 | 6643d27e | bellard | |
2707 | 6643d27e | bellard | /* Look for the = that delimits the end of the option name. */
|
2708 | 6643d27e | bellard | for (i = 0; i < len; i++) |
2709 | 6643d27e | bellard | { |
2710 | 6643d27e | bellard | if (option[i] == '=') |
2711 | 6643d27e | bellard | break;
|
2712 | 6643d27e | bellard | } |
2713 | 6643d27e | bellard | if (i == 0) /* Invalid option: no name before '='. */ |
2714 | 6643d27e | bellard | return;
|
2715 | 6643d27e | bellard | if (i == len) /* Invalid option: no '='. */ |
2716 | 6643d27e | bellard | return;
|
2717 | 6643d27e | bellard | if (i == (len - 1)) /* Invalid option: no value after '='. */ |
2718 | 6643d27e | bellard | return;
|
2719 | 6643d27e | bellard | |
2720 | 6643d27e | bellard | optionlen = i; |
2721 | 6643d27e | bellard | val = option + (optionlen + 1);
|
2722 | 6643d27e | bellard | vallen = len - (optionlen + 1);
|
2723 | 6643d27e | bellard | |
2724 | 6643d27e | bellard | if (strncmp("gpr-names", option, optionlen) == 0 |
2725 | 6643d27e | bellard | && strlen("gpr-names") == optionlen)
|
2726 | 6643d27e | bellard | { |
2727 | 6643d27e | bellard | chosen_abi = choose_abi_by_name (val, vallen); |
2728 | 6643d27e | bellard | if (chosen_abi != NULL) |
2729 | 6643d27e | bellard | mips_gpr_names = chosen_abi->gpr_names; |
2730 | 6643d27e | bellard | return;
|
2731 | 6643d27e | bellard | } |
2732 | 6643d27e | bellard | |
2733 | 6643d27e | bellard | if (strncmp("fpr-names", option, optionlen) == 0 |
2734 | 6643d27e | bellard | && strlen("fpr-names") == optionlen)
|
2735 | 6643d27e | bellard | { |
2736 | 6643d27e | bellard | chosen_abi = choose_abi_by_name (val, vallen); |
2737 | 6643d27e | bellard | if (chosen_abi != NULL) |
2738 | 6643d27e | bellard | mips_fpr_names = chosen_abi->fpr_names; |
2739 | 6643d27e | bellard | return;
|
2740 | 6643d27e | bellard | } |
2741 | 6643d27e | bellard | |
2742 | 6643d27e | bellard | if (strncmp("cp0-names", option, optionlen) == 0 |
2743 | 6643d27e | bellard | && strlen("cp0-names") == optionlen)
|
2744 | 6643d27e | bellard | { |
2745 | 6643d27e | bellard | chosen_arch = choose_arch_by_name (val, vallen); |
2746 | 6643d27e | bellard | if (chosen_arch != NULL) |
2747 | 6643d27e | bellard | { |
2748 | 6643d27e | bellard | mips_cp0_names = chosen_arch->cp0_names; |
2749 | 6643d27e | bellard | mips_cp0sel_names = chosen_arch->cp0sel_names; |
2750 | 6643d27e | bellard | mips_cp0sel_names_len = chosen_arch->cp0sel_names_len; |
2751 | 6643d27e | bellard | } |
2752 | 6643d27e | bellard | return;
|
2753 | 6643d27e | bellard | } |
2754 | 6643d27e | bellard | |
2755 | 6643d27e | bellard | if (strncmp("hwr-names", option, optionlen) == 0 |
2756 | 6643d27e | bellard | && strlen("hwr-names") == optionlen)
|
2757 | 6643d27e | bellard | { |
2758 | 6643d27e | bellard | chosen_arch = choose_arch_by_name (val, vallen); |
2759 | 6643d27e | bellard | if (chosen_arch != NULL) |
2760 | 6643d27e | bellard | mips_hwr_names = chosen_arch->hwr_names; |
2761 | 6643d27e | bellard | return;
|
2762 | 6643d27e | bellard | } |
2763 | 6643d27e | bellard | |
2764 | 6643d27e | bellard | if (strncmp("reg-names", option, optionlen) == 0 |
2765 | 6643d27e | bellard | && strlen("reg-names") == optionlen)
|
2766 | 6643d27e | bellard | { |
2767 | 6643d27e | bellard | /* We check both ABI and ARCH here unconditionally, so
|
2768 | 6643d27e | bellard | that "numeric" will do the desirable thing: select
|
2769 | 6643d27e | bellard | numeric register names for all registers. Other than
|
2770 | 6643d27e | bellard | that, a given name probably won't match both. */
|
2771 | 6643d27e | bellard | chosen_abi = choose_abi_by_name (val, vallen); |
2772 | 6643d27e | bellard | if (chosen_abi != NULL) |
2773 | 6643d27e | bellard | { |
2774 | 6643d27e | bellard | mips_gpr_names = chosen_abi->gpr_names; |
2775 | 6643d27e | bellard | mips_fpr_names = chosen_abi->fpr_names; |
2776 | 6643d27e | bellard | } |
2777 | 6643d27e | bellard | chosen_arch = choose_arch_by_name (val, vallen); |
2778 | 6643d27e | bellard | if (chosen_arch != NULL) |
2779 | 6643d27e | bellard | { |
2780 | 6643d27e | bellard | mips_cp0_names = chosen_arch->cp0_names; |
2781 | 6643d27e | bellard | mips_cp0sel_names = chosen_arch->cp0sel_names; |
2782 | 6643d27e | bellard | mips_cp0sel_names_len = chosen_arch->cp0sel_names_len; |
2783 | 6643d27e | bellard | mips_hwr_names = chosen_arch->hwr_names; |
2784 | 6643d27e | bellard | } |
2785 | 6643d27e | bellard | return;
|
2786 | 6643d27e | bellard | } |
2787 | 6643d27e | bellard | |
2788 | 6643d27e | bellard | /* Invalid option. */
|
2789 | 6643d27e | bellard | } |
2790 | 6643d27e | bellard | |
2791 | 6643d27e | bellard | void
|
2792 | 6643d27e | bellard | parse_mips_dis_options (options) |
2793 | 6643d27e | bellard | const char *options; |
2794 | 6643d27e | bellard | { |
2795 | 6643d27e | bellard | const char *option_end; |
2796 | 6643d27e | bellard | |
2797 | 6643d27e | bellard | if (options == NULL) |
2798 | 6643d27e | bellard | return;
|
2799 | 6643d27e | bellard | |
2800 | 6643d27e | bellard | while (*options != '\0') |
2801 | 6643d27e | bellard | { |
2802 | 6643d27e | bellard | /* Skip empty options. */
|
2803 | 6643d27e | bellard | if (*options == ',') |
2804 | 6643d27e | bellard | { |
2805 | 6643d27e | bellard | options++; |
2806 | 6643d27e | bellard | continue;
|
2807 | 6643d27e | bellard | } |
2808 | 6643d27e | bellard | |
2809 | 6643d27e | bellard | /* We know that *options is neither NUL or a comma. */
|
2810 | 6643d27e | bellard | option_end = options + 1;
|
2811 | 6643d27e | bellard | while (*option_end != ',' && *option_end != '\0') |
2812 | 6643d27e | bellard | option_end++; |
2813 | 6643d27e | bellard | |
2814 | 6643d27e | bellard | parse_mips_dis_option (options, option_end - options); |
2815 | 6643d27e | bellard | |
2816 | 6643d27e | bellard | /* Go on to the next one. If option_end points to a comma, it
|
2817 | 6643d27e | bellard | will be skipped above. */
|
2818 | 6643d27e | bellard | options = option_end; |
2819 | 6643d27e | bellard | } |
2820 | 6643d27e | bellard | } |
2821 | 6643d27e | bellard | |
2822 | 6643d27e | bellard | static const struct mips_cp0sel_name * |
2823 | 6643d27e | bellard | lookup_mips_cp0sel_name(names, len, cp0reg, sel) |
2824 | 6643d27e | bellard | const struct mips_cp0sel_name *names; |
2825 | 6643d27e | bellard | unsigned int len, cp0reg, sel; |
2826 | 6643d27e | bellard | { |
2827 | 6643d27e | bellard | unsigned int i; |
2828 | 6643d27e | bellard | |
2829 | 6643d27e | bellard | for (i = 0; i < len; i++) |
2830 | 6643d27e | bellard | if (names[i].cp0reg == cp0reg && names[i].sel == sel)
|
2831 | 6643d27e | bellard | return &names[i];
|
2832 | 6643d27e | bellard | return NULL; |
2833 | 6643d27e | bellard | } |
2834 | 6643d27e | bellard | |
2835 | 6643d27e | bellard | /* Print insn arguments for 32/64-bit code. */
|
2836 | 6643d27e | bellard | |
2837 | 6643d27e | bellard | static void |
2838 | 6643d27e | bellard | print_insn_args (d, l, pc, info) |
2839 | 6643d27e | bellard | const char *d; |
2840 | 6643d27e | bellard | register unsigned long int l; |
2841 | 6643d27e | bellard | bfd_vma pc; |
2842 | 6643d27e | bellard | struct disassemble_info *info;
|
2843 | 6643d27e | bellard | { |
2844 | 6643d27e | bellard | int op, delta;
|
2845 | 6643d27e | bellard | unsigned int lsb, msb, msbd; |
2846 | 6643d27e | bellard | |
2847 | 6643d27e | bellard | lsb = 0;
|
2848 | 6643d27e | bellard | |
2849 | 6643d27e | bellard | for (; *d != '\0'; d++) |
2850 | 6643d27e | bellard | { |
2851 | 6643d27e | bellard | switch (*d)
|
2852 | 6643d27e | bellard | { |
2853 | 6643d27e | bellard | case ',': |
2854 | 6643d27e | bellard | case '(': |
2855 | 6643d27e | bellard | case ')': |
2856 | 6643d27e | bellard | case '[': |
2857 | 6643d27e | bellard | case ']': |
2858 | 6643d27e | bellard | (*info->fprintf_func) (info->stream, "%c", *d);
|
2859 | 6643d27e | bellard | break;
|
2860 | 6643d27e | bellard | |
2861 | 6643d27e | bellard | case '+': |
2862 | 6643d27e | bellard | /* Extension character; switch for second char. */
|
2863 | 6643d27e | bellard | d++; |
2864 | 6643d27e | bellard | switch (*d)
|
2865 | 6643d27e | bellard | { |
2866 | 6643d27e | bellard | case '\0': |
2867 | 6643d27e | bellard | /* xgettext:c-format */
|
2868 | 6643d27e | bellard | (*info->fprintf_func) (info->stream, |
2869 | 6643d27e | bellard | _("# internal error, incomplete extension sequence (+)"));
|
2870 | 6643d27e | bellard | return;
|
2871 | 6643d27e | bellard | |
2872 | 6643d27e | bellard | case 'A': |
2873 | 6643d27e | bellard | lsb = (l >> OP_SH_SHAMT) & OP_MASK_SHAMT; |
2874 | 6643d27e | bellard | (*info->fprintf_func) (info->stream, "0x%x", lsb);
|
2875 | 6643d27e | bellard | break;
|
2876 | 6643d27e | bellard | |
2877 | 6643d27e | bellard | case 'B': |
2878 | 6643d27e | bellard | msb = (l >> OP_SH_INSMSB) & OP_MASK_INSMSB; |
2879 | 6643d27e | bellard | (*info->fprintf_func) (info->stream, "0x%x", msb - lsb + 1); |
2880 | 6643d27e | bellard | break;
|
2881 | 6643d27e | bellard | |
2882 | 6643d27e | bellard | case 'C': |
2883 | 6643d27e | bellard | case 'H': |
2884 | 6643d27e | bellard | msbd = (l >> OP_SH_EXTMSBD) & OP_MASK_EXTMSBD; |
2885 | 6643d27e | bellard | (*info->fprintf_func) (info->stream, "0x%x", msbd + 1); |
2886 | 6643d27e | bellard | break;
|
2887 | 6643d27e | bellard | |
2888 | 6643d27e | bellard | case 'D': |
2889 | 6643d27e | bellard | { |
2890 | 6643d27e | bellard | const struct mips_cp0sel_name *n; |
2891 | 6643d27e | bellard | unsigned int cp0reg, sel; |
2892 | 6643d27e | bellard | |
2893 | 6643d27e | bellard | cp0reg = (l >> OP_SH_RD) & OP_MASK_RD; |
2894 | 6643d27e | bellard | sel = (l >> OP_SH_SEL) & OP_MASK_SEL; |
2895 | 6643d27e | bellard | |
2896 | 6643d27e | bellard | /* CP0 register including 'sel' code for mtcN (et al.), to be
|
2897 | 6643d27e | bellard | printed textually if known. If not known, print both
|
2898 | 6643d27e | bellard | CP0 register name and sel numerically since CP0 register
|
2899 | 6643d27e | bellard | with sel 0 may have a name unrelated to register being
|
2900 | 6643d27e | bellard | printed. */
|
2901 | 6643d27e | bellard | n = lookup_mips_cp0sel_name(mips_cp0sel_names, |
2902 | 6643d27e | bellard | mips_cp0sel_names_len, cp0reg, sel); |
2903 | 6643d27e | bellard | if (n != NULL) |
2904 | 6643d27e | bellard | (*info->fprintf_func) (info->stream, "%s", n->name);
|
2905 | 6643d27e | bellard | else
|
2906 | 6643d27e | bellard | (*info->fprintf_func) (info->stream, "$%d,%d", cp0reg, sel);
|
2907 | 6643d27e | bellard | break;
|
2908 | 6643d27e | bellard | } |
2909 | 6643d27e | bellard | |
2910 | 6643d27e | bellard | case 'E': |
2911 | 6643d27e | bellard | lsb = ((l >> OP_SH_SHAMT) & OP_MASK_SHAMT) + 32;
|
2912 | 6643d27e | bellard | (*info->fprintf_func) (info->stream, "0x%x", lsb);
|
2913 | 6643d27e | bellard | break;
|
2914 | 6643d27e | bellard | |
2915 | 6643d27e | bellard | case 'F': |
2916 | 6643d27e | bellard | msb = ((l >> OP_SH_INSMSB) & OP_MASK_INSMSB) + 32;
|
2917 | 6643d27e | bellard | (*info->fprintf_func) (info->stream, "0x%x", msb - lsb + 1); |
2918 | 6643d27e | bellard | break;
|
2919 | 6643d27e | bellard | |
2920 | 6643d27e | bellard | case 'G': |
2921 | 6643d27e | bellard | msbd = ((l >> OP_SH_EXTMSBD) & OP_MASK_EXTMSBD) + 32;
|
2922 | 6643d27e | bellard | (*info->fprintf_func) (info->stream, "0x%x", msbd + 1); |
2923 | 6643d27e | bellard | break;
|
2924 | 6643d27e | bellard | |
2925 | 6643d27e | bellard | default:
|
2926 | 6643d27e | bellard | /* xgettext:c-format */
|
2927 | 6643d27e | bellard | (*info->fprintf_func) (info->stream, |
2928 | 6643d27e | bellard | _("# internal error, undefined extension sequence (+%c)"),
|
2929 | 6643d27e | bellard | *d); |
2930 | 6643d27e | bellard | return;
|
2931 | 6643d27e | bellard | } |
2932 | 6643d27e | bellard | break;
|
2933 | 6643d27e | bellard | |
2934 | 6643d27e | bellard | case 's': |
2935 | 6643d27e | bellard | case 'b': |
2936 | 6643d27e | bellard | case 'r': |
2937 | 6643d27e | bellard | case 'v': |
2938 | 6643d27e | bellard | (*info->fprintf_func) (info->stream, "%s",
|
2939 | 6643d27e | bellard | mips_gpr_names[(l >> OP_SH_RS) & OP_MASK_RS]); |
2940 | 6643d27e | bellard | break;
|
2941 | 6643d27e | bellard | |
2942 | 6643d27e | bellard | case 't': |
2943 | 6643d27e | bellard | case 'w': |
2944 | 6643d27e | bellard | (*info->fprintf_func) (info->stream, "%s",
|
2945 | 6643d27e | bellard | mips_gpr_names[(l >> OP_SH_RT) & OP_MASK_RT]); |
2946 | 6643d27e | bellard | break;
|
2947 | 6643d27e | bellard | |
2948 | 6643d27e | bellard | case 'i': |
2949 | 6643d27e | bellard | case 'u': |
2950 | 6643d27e | bellard | (*info->fprintf_func) (info->stream, "0x%x",
|
2951 | 6643d27e | bellard | (l >> OP_SH_IMMEDIATE) & OP_MASK_IMMEDIATE); |
2952 | 6643d27e | bellard | break;
|
2953 | 6643d27e | bellard | |
2954 | 6643d27e | bellard | case 'j': /* Same as i, but sign-extended. */ |
2955 | 6643d27e | bellard | case 'o': |
2956 | 6643d27e | bellard | delta = (l >> OP_SH_DELTA) & OP_MASK_DELTA; |
2957 | 6643d27e | bellard | if (delta & 0x8000) |
2958 | 6643d27e | bellard | delta |= ~0xffff;
|
2959 | 6643d27e | bellard | (*info->fprintf_func) (info->stream, "%d",
|
2960 | 6643d27e | bellard | delta); |
2961 | 6643d27e | bellard | break;
|
2962 | 6643d27e | bellard | |
2963 | 6643d27e | bellard | case 'h': |
2964 | 6643d27e | bellard | (*info->fprintf_func) (info->stream, "0x%x",
|
2965 | 6643d27e | bellard | (unsigned int) ((l >> OP_SH_PREFX) |
2966 | 6643d27e | bellard | & OP_MASK_PREFX)); |
2967 | 6643d27e | bellard | break;
|
2968 | 6643d27e | bellard | |
2969 | 6643d27e | bellard | case 'k': |
2970 | 6643d27e | bellard | (*info->fprintf_func) (info->stream, "0x%x",
|
2971 | 6643d27e | bellard | (unsigned int) ((l >> OP_SH_CACHE) |
2972 | 6643d27e | bellard | & OP_MASK_CACHE)); |
2973 | 6643d27e | bellard | break;
|
2974 | 6643d27e | bellard | |
2975 | 6643d27e | bellard | case 'a': |
2976 | 6643d27e | bellard | info->target = (((pc + 4) & ~(bfd_vma) 0x0fffffff) |
2977 | 6643d27e | bellard | | (((l >> OP_SH_TARGET) & OP_MASK_TARGET) << 2));
|
2978 | 6643d27e | bellard | (*info->print_address_func) (info->target, info); |
2979 | 6643d27e | bellard | break;
|
2980 | 6643d27e | bellard | |
2981 | 6643d27e | bellard | case 'p': |
2982 | 6643d27e | bellard | /* Sign extend the displacement. */
|
2983 | 6643d27e | bellard | delta = (l >> OP_SH_DELTA) & OP_MASK_DELTA; |
2984 | 6643d27e | bellard | if (delta & 0x8000) |
2985 | 6643d27e | bellard | delta |= ~0xffff;
|
2986 | 6643d27e | bellard | info->target = (delta << 2) + pc + INSNLEN;
|
2987 | 6643d27e | bellard | (*info->print_address_func) (info->target, info); |
2988 | 6643d27e | bellard | break;
|
2989 | 6643d27e | bellard | |
2990 | 6643d27e | bellard | case 'd': |
2991 | 6643d27e | bellard | (*info->fprintf_func) (info->stream, "%s",
|
2992 | 6643d27e | bellard | mips_gpr_names[(l >> OP_SH_RD) & OP_MASK_RD]); |
2993 | 6643d27e | bellard | break;
|
2994 | 6643d27e | bellard | |
2995 | 6643d27e | bellard | case 'U': |
2996 | 6643d27e | bellard | { |
2997 | 6643d27e | bellard | /* First check for both rd and rt being equal. */
|
2998 | 6643d27e | bellard | unsigned int reg = (l >> OP_SH_RD) & OP_MASK_RD; |
2999 | 6643d27e | bellard | if (reg == ((l >> OP_SH_RT) & OP_MASK_RT))
|
3000 | 6643d27e | bellard | (*info->fprintf_func) (info->stream, "%s",
|
3001 | 6643d27e | bellard | mips_gpr_names[reg]); |
3002 | 6643d27e | bellard | else
|
3003 | 6643d27e | bellard | { |
3004 | 6643d27e | bellard | /* If one is zero use the other. */
|
3005 | 6643d27e | bellard | if (reg == 0) |
3006 | 6643d27e | bellard | (*info->fprintf_func) (info->stream, "%s",
|
3007 | 6643d27e | bellard | mips_gpr_names[(l >> OP_SH_RT) & OP_MASK_RT]); |
3008 | 6643d27e | bellard | else if (((l >> OP_SH_RT) & OP_MASK_RT) == 0) |
3009 | 6643d27e | bellard | (*info->fprintf_func) (info->stream, "%s",
|
3010 | 6643d27e | bellard | mips_gpr_names[reg]); |
3011 | 6643d27e | bellard | else /* Bogus, result depends on processor. */ |
3012 | 6643d27e | bellard | (*info->fprintf_func) (info->stream, "%s or %s",
|
3013 | 6643d27e | bellard | mips_gpr_names[reg], |
3014 | 6643d27e | bellard | mips_gpr_names[(l >> OP_SH_RT) & OP_MASK_RT]); |
3015 | 6643d27e | bellard | } |
3016 | 6643d27e | bellard | } |
3017 | 6643d27e | bellard | break;
|
3018 | 6643d27e | bellard | |
3019 | 6643d27e | bellard | case 'z': |
3020 | 6643d27e | bellard | (*info->fprintf_func) (info->stream, "%s", mips_gpr_names[0]); |
3021 | 6643d27e | bellard | break;
|
3022 | 6643d27e | bellard | |
3023 | 6643d27e | bellard | case '<': |
3024 | 6643d27e | bellard | (*info->fprintf_func) (info->stream, "0x%x",
|
3025 | 6643d27e | bellard | (l >> OP_SH_SHAMT) & OP_MASK_SHAMT); |
3026 | 6643d27e | bellard | break;
|
3027 | 6643d27e | bellard | |
3028 | 6643d27e | bellard | case 'c': |
3029 | 6643d27e | bellard | (*info->fprintf_func) (info->stream, "0x%x",
|
3030 | 6643d27e | bellard | (l >> OP_SH_CODE) & OP_MASK_CODE); |
3031 | 6643d27e | bellard | break;
|
3032 | 6643d27e | bellard | |
3033 | 6643d27e | bellard | case 'q': |
3034 | 6643d27e | bellard | (*info->fprintf_func) (info->stream, "0x%x",
|
3035 | 6643d27e | bellard | (l >> OP_SH_CODE2) & OP_MASK_CODE2); |
3036 | 6643d27e | bellard | break;
|
3037 | 6643d27e | bellard | |
3038 | 6643d27e | bellard | case 'C': |
3039 | 6643d27e | bellard | (*info->fprintf_func) (info->stream, "0x%x",
|
3040 | 6643d27e | bellard | (l >> OP_SH_COPZ) & OP_MASK_COPZ); |
3041 | 6643d27e | bellard | break;
|
3042 | 6643d27e | bellard | |
3043 | 6643d27e | bellard | case 'B': |
3044 | 6643d27e | bellard | (*info->fprintf_func) (info->stream, "0x%x",
|
3045 | 6643d27e | bellard | (l >> OP_SH_CODE20) & OP_MASK_CODE20); |
3046 | 6643d27e | bellard | break;
|
3047 | 6643d27e | bellard | |
3048 | 6643d27e | bellard | case 'J': |
3049 | 6643d27e | bellard | (*info->fprintf_func) (info->stream, "0x%x",
|
3050 | 6643d27e | bellard | (l >> OP_SH_CODE19) & OP_MASK_CODE19); |
3051 | 6643d27e | bellard | break;
|
3052 | 6643d27e | bellard | |
3053 | 6643d27e | bellard | case 'S': |
3054 | 6643d27e | bellard | case 'V': |
3055 | 6643d27e | bellard | (*info->fprintf_func) (info->stream, "%s",
|
3056 | 6643d27e | bellard | mips_fpr_names[(l >> OP_SH_FS) & OP_MASK_FS]); |
3057 | 6643d27e | bellard | break;
|
3058 | 6643d27e | bellard | |
3059 | 6643d27e | bellard | case 'T': |
3060 | 6643d27e | bellard | case 'W': |
3061 | 6643d27e | bellard | (*info->fprintf_func) (info->stream, "%s",
|
3062 | 6643d27e | bellard | mips_fpr_names[(l >> OP_SH_FT) & OP_MASK_FT]); |
3063 | 6643d27e | bellard | break;
|
3064 | 6643d27e | bellard | |
3065 | 6643d27e | bellard | case 'D': |
3066 | 6643d27e | bellard | (*info->fprintf_func) (info->stream, "%s",
|
3067 | 6643d27e | bellard | mips_fpr_names[(l >> OP_SH_FD) & OP_MASK_FD]); |
3068 | 6643d27e | bellard | break;
|
3069 | 6643d27e | bellard | |
3070 | 6643d27e | bellard | case 'R': |
3071 | 6643d27e | bellard | (*info->fprintf_func) (info->stream, "%s",
|
3072 | 6643d27e | bellard | mips_fpr_names[(l >> OP_SH_FR) & OP_MASK_FR]); |
3073 | 6643d27e | bellard | break;
|
3074 | 6643d27e | bellard | |
3075 | 6643d27e | bellard | case 'E': |
3076 | 6643d27e | bellard | /* Coprocessor register for lwcN instructions, et al.
|
3077 | 6643d27e | bellard | |
3078 | 6643d27e | bellard | Note that there is no load/store cp0 instructions, and
|
3079 | 6643d27e | bellard | that FPU (cp1) instructions disassemble this field using
|
3080 | 6643d27e | bellard | 'T' format. Therefore, until we gain understanding of
|
3081 | 6643d27e | bellard | cp2 register names, we can simply print the register
|
3082 | 6643d27e | bellard | numbers. */
|
3083 | 6643d27e | bellard | (*info->fprintf_func) (info->stream, "$%d",
|
3084 | 6643d27e | bellard | (l >> OP_SH_RT) & OP_MASK_RT); |
3085 | 6643d27e | bellard | break;
|
3086 | 6643d27e | bellard | |
3087 | 6643d27e | bellard | case 'G': |
3088 | 6643d27e | bellard | /* Coprocessor register for mtcN instructions, et al. Note
|
3089 | 6643d27e | bellard | that FPU (cp1) instructions disassemble this field using
|
3090 | 6643d27e | bellard | 'S' format. Therefore, we only need to worry about cp0,
|
3091 | 6643d27e | bellard | cp2, and cp3. */
|
3092 | 6643d27e | bellard | op = (l >> OP_SH_OP) & OP_MASK_OP; |
3093 | 6643d27e | bellard | if (op == OP_OP_COP0)
|
3094 | 6643d27e | bellard | (*info->fprintf_func) (info->stream, "%s",
|
3095 | 6643d27e | bellard | mips_cp0_names[(l >> OP_SH_RD) & OP_MASK_RD]); |
3096 | 6643d27e | bellard | else
|
3097 | 6643d27e | bellard | (*info->fprintf_func) (info->stream, "$%d",
|
3098 | 6643d27e | bellard | (l >> OP_SH_RD) & OP_MASK_RD); |
3099 | 6643d27e | bellard | break;
|
3100 | 6643d27e | bellard | |
3101 | 6643d27e | bellard | case 'K': |
3102 | 6643d27e | bellard | (*info->fprintf_func) (info->stream, "%s",
|
3103 | 6643d27e | bellard | mips_hwr_names[(l >> OP_SH_RD) & OP_MASK_RD]); |
3104 | 6643d27e | bellard | break;
|
3105 | 6643d27e | bellard | |
3106 | 6643d27e | bellard | case 'N': |
3107 | 6643d27e | bellard | (*info->fprintf_func) (info->stream, "$fcc%d",
|
3108 | 6643d27e | bellard | (l >> OP_SH_BCC) & OP_MASK_BCC); |
3109 | 6643d27e | bellard | break;
|
3110 | 6643d27e | bellard | |
3111 | 6643d27e | bellard | case 'M': |
3112 | 6643d27e | bellard | (*info->fprintf_func) (info->stream, "$fcc%d",
|
3113 | 6643d27e | bellard | (l >> OP_SH_CCC) & OP_MASK_CCC); |
3114 | 6643d27e | bellard | break;
|
3115 | 6643d27e | bellard | |
3116 | 6643d27e | bellard | case 'P': |
3117 | 6643d27e | bellard | (*info->fprintf_func) (info->stream, "%d",
|
3118 | 6643d27e | bellard | (l >> OP_SH_PERFREG) & OP_MASK_PERFREG); |
3119 | 6643d27e | bellard | break;
|
3120 | 6643d27e | bellard | |
3121 | 6643d27e | bellard | case 'e': |
3122 | 6643d27e | bellard | (*info->fprintf_func) (info->stream, "%d",
|
3123 | 6643d27e | bellard | (l >> OP_SH_VECBYTE) & OP_MASK_VECBYTE); |
3124 | 6643d27e | bellard | break;
|
3125 | 6643d27e | bellard | |
3126 | 6643d27e | bellard | case '%': |
3127 | 6643d27e | bellard | (*info->fprintf_func) (info->stream, "%d",
|
3128 | 6643d27e | bellard | (l >> OP_SH_VECALIGN) & OP_MASK_VECALIGN); |
3129 | 6643d27e | bellard | break;
|
3130 | 6643d27e | bellard | |
3131 | 6643d27e | bellard | case 'H': |
3132 | 6643d27e | bellard | (*info->fprintf_func) (info->stream, "%d",
|
3133 | 6643d27e | bellard | (l >> OP_SH_SEL) & OP_MASK_SEL); |
3134 | 6643d27e | bellard | break;
|
3135 | 6643d27e | bellard | |
3136 | 6643d27e | bellard | case 'O': |
3137 | 6643d27e | bellard | (*info->fprintf_func) (info->stream, "%d",
|
3138 | 6643d27e | bellard | (l >> OP_SH_ALN) & OP_MASK_ALN); |
3139 | 6643d27e | bellard | break;
|
3140 | 6643d27e | bellard | |
3141 | 6643d27e | bellard | case 'Q': |
3142 | 6643d27e | bellard | { |
3143 | 6643d27e | bellard | unsigned int vsel = (l >> OP_SH_VSEL) & OP_MASK_VSEL; |
3144 | 6643d27e | bellard | if ((vsel & 0x10) == 0) |
3145 | 6643d27e | bellard | { |
3146 | 6643d27e | bellard | int fmt;
|
3147 | 6643d27e | bellard | vsel &= 0x0f;
|
3148 | 6643d27e | bellard | for (fmt = 0; fmt < 3; fmt++, vsel >>= 1) |
3149 | 6643d27e | bellard | if ((vsel & 1) == 0) |
3150 | 6643d27e | bellard | break;
|
3151 | 6643d27e | bellard | (*info->fprintf_func) (info->stream, "$v%d[%d]",
|
3152 | 6643d27e | bellard | (l >> OP_SH_FT) & OP_MASK_FT, |
3153 | 6643d27e | bellard | vsel >> 1);
|
3154 | 6643d27e | bellard | } |
3155 | 6643d27e | bellard | else if ((vsel & 0x08) == 0) |
3156 | 6643d27e | bellard | { |
3157 | 6643d27e | bellard | (*info->fprintf_func) (info->stream, "$v%d",
|
3158 | 6643d27e | bellard | (l >> OP_SH_FT) & OP_MASK_FT); |
3159 | 6643d27e | bellard | } |
3160 | 6643d27e | bellard | else
|
3161 | 6643d27e | bellard | { |
3162 | 6643d27e | bellard | (*info->fprintf_func) (info->stream, "0x%x",
|
3163 | 6643d27e | bellard | (l >> OP_SH_FT) & OP_MASK_FT); |
3164 | 6643d27e | bellard | } |
3165 | 6643d27e | bellard | } |
3166 | 6643d27e | bellard | break;
|
3167 | 6643d27e | bellard | |
3168 | 6643d27e | bellard | case 'X': |
3169 | 6643d27e | bellard | (*info->fprintf_func) (info->stream, "$v%d",
|
3170 | 6643d27e | bellard | (l >> OP_SH_FD) & OP_MASK_FD); |
3171 | 6643d27e | bellard | break;
|
3172 | 6643d27e | bellard | |
3173 | 6643d27e | bellard | case 'Y': |
3174 | 6643d27e | bellard | (*info->fprintf_func) (info->stream, "$v%d",
|
3175 | 6643d27e | bellard | (l >> OP_SH_FS) & OP_MASK_FS); |
3176 | 6643d27e | bellard | break;
|
3177 | 6643d27e | bellard | |
3178 | 6643d27e | bellard | case 'Z': |
3179 | 6643d27e | bellard | (*info->fprintf_func) (info->stream, "$v%d",
|
3180 | 6643d27e | bellard | (l >> OP_SH_FT) & OP_MASK_FT); |
3181 | 6643d27e | bellard | break;
|
3182 | 6643d27e | bellard | |
3183 | 6643d27e | bellard | default:
|
3184 | 6643d27e | bellard | /* xgettext:c-format */
|
3185 | 6643d27e | bellard | (*info->fprintf_func) (info->stream, |
3186 | 6643d27e | bellard | _("# internal error, undefined modifier(%c)"),
|
3187 | 6643d27e | bellard | *d); |
3188 | 6643d27e | bellard | return;
|
3189 | 6643d27e | bellard | } |
3190 | 6643d27e | bellard | } |
3191 | 6643d27e | bellard | } |
3192 | 6643d27e | bellard | |
3193 | 6643d27e | bellard | /* Check if the object uses NewABI conventions. */
|
3194 | 6643d27e | bellard | #if 0
|
3195 | 6643d27e | bellard | static int
|
3196 | 6643d27e | bellard | is_newabi (header)
|
3197 | 6643d27e | bellard | Elf_Internal_Ehdr *header;
|
3198 | 6643d27e | bellard | {
|
3199 | 6643d27e | bellard | /* There are no old-style ABIs which use 64-bit ELF. */
|
3200 | 6643d27e | bellard | if (header->e_ident[EI_CLASS] == ELFCLASS64)
|
3201 | 6643d27e | bellard | return 1;
|
3202 | 6643d27e | bellard | |
3203 | 6643d27e | bellard | /* If a 32-bit ELF file, n32 is a new-style ABI. */
|
3204 | 6643d27e | bellard | if ((header->e_flags & EF_MIPS_ABI2) != 0)
|
3205 | 6643d27e | bellard | return 1;
|
3206 | 6643d27e | bellard | |
3207 | 6643d27e | bellard | return 0;
|
3208 | 6643d27e | bellard | }
|
3209 | 6643d27e | bellard | #endif
|
3210 | 6643d27e | bellard | |
3211 | 6643d27e | bellard | /* Print the mips instruction at address MEMADDR in debugged memory,
|
3212 | 6643d27e | bellard | on using INFO. Returns length of the instruction, in bytes, which is
|
3213 | 6643d27e | bellard | always INSNLEN. BIGENDIAN must be 1 if this is big-endian code, 0 if
|
3214 | 6643d27e | bellard | this is little-endian code. */
|
3215 | 6643d27e | bellard | |
3216 | 6643d27e | bellard | static int |
3217 | 6643d27e | bellard | print_insn_mips (memaddr, word, info) |
3218 | 6643d27e | bellard | bfd_vma memaddr; |
3219 | 6643d27e | bellard | unsigned long int word; |
3220 | 6643d27e | bellard | struct disassemble_info *info;
|
3221 | 6643d27e | bellard | { |
3222 | 6643d27e | bellard | register const struct mips_opcode *op; |
3223 | 6643d27e | bellard | static bfd_boolean init = 0; |
3224 | 6643d27e | bellard | static const struct mips_opcode *mips_hash[OP_MASK_OP + 1]; |
3225 | 6643d27e | bellard | |
3226 | 6643d27e | bellard | /* Build a hash table to shorten the search time. */
|
3227 | 6643d27e | bellard | if (! init)
|
3228 | 6643d27e | bellard | { |
3229 | 6643d27e | bellard | unsigned int i; |
3230 | 6643d27e | bellard | |
3231 | 6643d27e | bellard | for (i = 0; i <= OP_MASK_OP; i++) |
3232 | 6643d27e | bellard | { |
3233 | 6643d27e | bellard | for (op = mips_opcodes; op < &mips_opcodes[NUMOPCODES]; op++)
|
3234 | 6643d27e | bellard | { |
3235 | 6643d27e | bellard | if (op->pinfo == INSN_MACRO)
|
3236 | 6643d27e | bellard | continue;
|
3237 | 6643d27e | bellard | if (i == ((op->match >> OP_SH_OP) & OP_MASK_OP))
|
3238 | 6643d27e | bellard | { |
3239 | 6643d27e | bellard | mips_hash[i] = op; |
3240 | 6643d27e | bellard | break;
|
3241 | 6643d27e | bellard | } |
3242 | 6643d27e | bellard | } |
3243 | 6643d27e | bellard | } |
3244 | 6643d27e | bellard | |
3245 | 6643d27e | bellard | init = 1;
|
3246 | 6643d27e | bellard | } |
3247 | 6643d27e | bellard | |
3248 | 6643d27e | bellard | info->bytes_per_chunk = INSNLEN; |
3249 | 6643d27e | bellard | info->display_endian = info->endian; |
3250 | 6643d27e | bellard | info->insn_info_valid = 1;
|
3251 | 6643d27e | bellard | info->branch_delay_insns = 0;
|
3252 | 6643d27e | bellard | info->data_size = 0;
|
3253 | 6643d27e | bellard | info->insn_type = dis_nonbranch; |
3254 | 6643d27e | bellard | info->target = 0;
|
3255 | 6643d27e | bellard | info->target2 = 0;
|
3256 | 6643d27e | bellard | |
3257 | 6643d27e | bellard | op = mips_hash[(word >> OP_SH_OP) & OP_MASK_OP]; |
3258 | 6643d27e | bellard | if (op != NULL) |
3259 | 6643d27e | bellard | { |
3260 | 6643d27e | bellard | for (; op < &mips_opcodes[NUMOPCODES]; op++)
|
3261 | 6643d27e | bellard | { |
3262 | 6643d27e | bellard | if (op->pinfo != INSN_MACRO && (word & op->mask) == op->match)
|
3263 | 6643d27e | bellard | { |
3264 | 6643d27e | bellard | register const char *d; |
3265 | 6643d27e | bellard | |
3266 | 6643d27e | bellard | /* We always allow to disassemble the jalx instruction. */
|
3267 | 6643d27e | bellard | if (! OPCODE_IS_MEMBER (op, mips_isa, mips_processor)
|
3268 | 6643d27e | bellard | && strcmp (op->name, "jalx"))
|
3269 | 6643d27e | bellard | continue;
|
3270 | 6643d27e | bellard | |
3271 | 6643d27e | bellard | /* Figure out instruction type and branch delay information. */
|
3272 | 6643d27e | bellard | if ((op->pinfo & INSN_UNCOND_BRANCH_DELAY) != 0) |
3273 | 6643d27e | bellard | { |
3274 | 6643d27e | bellard | if ((info->insn_type & INSN_WRITE_GPR_31) != 0) |
3275 | 6643d27e | bellard | info->insn_type = dis_jsr; |
3276 | 6643d27e | bellard | else
|
3277 | 6643d27e | bellard | info->insn_type = dis_branch; |
3278 | 6643d27e | bellard | info->branch_delay_insns = 1;
|
3279 | 6643d27e | bellard | } |
3280 | 6643d27e | bellard | else if ((op->pinfo & (INSN_COND_BRANCH_DELAY |
3281 | 6643d27e | bellard | | INSN_COND_BRANCH_LIKELY)) != 0)
|
3282 | 6643d27e | bellard | { |
3283 | 6643d27e | bellard | if ((info->insn_type & INSN_WRITE_GPR_31) != 0) |
3284 | 6643d27e | bellard | info->insn_type = dis_condjsr; |
3285 | 6643d27e | bellard | else
|
3286 | 6643d27e | bellard | info->insn_type = dis_condbranch; |
3287 | 6643d27e | bellard | info->branch_delay_insns = 1;
|
3288 | 6643d27e | bellard | } |
3289 | 6643d27e | bellard | else if ((op->pinfo & (INSN_STORE_MEMORY |
3290 | 6643d27e | bellard | | INSN_LOAD_MEMORY_DELAY)) != 0)
|
3291 | 6643d27e | bellard | info->insn_type = dis_dref; |
3292 | 6643d27e | bellard | |
3293 | 6643d27e | bellard | (*info->fprintf_func) (info->stream, "%s", op->name);
|
3294 | 6643d27e | bellard | |
3295 | 6643d27e | bellard | d = op->args; |
3296 | 6643d27e | bellard | if (d != NULL && *d != '\0') |
3297 | 6643d27e | bellard | { |
3298 | 6643d27e | bellard | (*info->fprintf_func) (info->stream, "\t");
|
3299 | 6643d27e | bellard | print_insn_args (d, word, memaddr, info); |
3300 | 6643d27e | bellard | } |
3301 | 6643d27e | bellard | |
3302 | 6643d27e | bellard | return INSNLEN;
|
3303 | 6643d27e | bellard | } |
3304 | 6643d27e | bellard | } |
3305 | 6643d27e | bellard | } |
3306 | 6643d27e | bellard | |
3307 | 6643d27e | bellard | /* Handle undefined instructions. */
|
3308 | 6643d27e | bellard | info->insn_type = dis_noninsn; |
3309 | 6643d27e | bellard | (*info->fprintf_func) (info->stream, "0x%x", word);
|
3310 | 6643d27e | bellard | return INSNLEN;
|
3311 | 6643d27e | bellard | } |
3312 | 6643d27e | bellard | |
3313 | 6643d27e | bellard | /* In an environment where we do not know the symbol type of the
|
3314 | 6643d27e | bellard | instruction we are forced to assume that the low order bit of the
|
3315 | 6643d27e | bellard | instructions' address may mark it as a mips16 instruction. If we
|
3316 | 6643d27e | bellard | are single stepping, or the pc is within the disassembled function,
|
3317 | 6643d27e | bellard | this works. Otherwise, we need a clue. Sometimes. */
|
3318 | 6643d27e | bellard | |
3319 | 6643d27e | bellard | static int |
3320 | 6643d27e | bellard | _print_insn_mips (memaddr, info, endianness) |
3321 | 6643d27e | bellard | bfd_vma memaddr; |
3322 | 6643d27e | bellard | struct disassemble_info *info;
|
3323 | 6643d27e | bellard | enum bfd_endian endianness;
|
3324 | 6643d27e | bellard | { |
3325 | 6643d27e | bellard | bfd_byte buffer[INSNLEN]; |
3326 | 6643d27e | bellard | int status;
|
3327 | 6643d27e | bellard | |
3328 | 6643d27e | bellard | set_default_mips_dis_options (info); |
3329 | 6643d27e | bellard | parse_mips_dis_options (info->disassembler_options); |
3330 | 6643d27e | bellard | |
3331 | 6643d27e | bellard | #if 0
|
3332 | 6643d27e | bellard | #if 1
|
3333 | 6643d27e | bellard | /* FIXME: If odd address, this is CLEARLY a mips 16 instruction. */
|
3334 | 6643d27e | bellard | /* Only a few tools will work this way. */
|
3335 | 6643d27e | bellard | if (memaddr & 0x01)
|
3336 | 6643d27e | bellard | return print_insn_mips16 (memaddr, info);
|
3337 | 6643d27e | bellard | #endif
|
3338 | 6643d27e | bellard | |
3339 | 6643d27e | bellard | #if SYMTAB_AVAILABLE
|
3340 | 6643d27e | bellard | if (info->mach == bfd_mach_mips16
|
3341 | 6643d27e | bellard | || (info->flavour == bfd_target_elf_flavour |
3342 | 6643d27e | bellard | && info->symbols != NULL
|
3343 | 6643d27e | bellard | && ((*(elf_symbol_type **) info->symbols)->internal_elf_sym.st_other |
3344 | 6643d27e | bellard | == STO_MIPS16))) |
3345 | 6643d27e | bellard | return print_insn_mips16 (memaddr, info);
|
3346 | 6643d27e | bellard | #endif
|
3347 | 6643d27e | bellard | #endif
|
3348 | 6643d27e | bellard | |
3349 | 6643d27e | bellard | status = (*info->read_memory_func) (memaddr, buffer, INSNLEN, info); |
3350 | 6643d27e | bellard | if (status == 0) |
3351 | 6643d27e | bellard | { |
3352 | 6643d27e | bellard | unsigned long insn; |
3353 | 6643d27e | bellard | |
3354 | 6643d27e | bellard | if (endianness == BFD_ENDIAN_BIG)
|
3355 | 6643d27e | bellard | insn = (unsigned long) bfd_getb32 (buffer); |
3356 | 6643d27e | bellard | else
|
3357 | 6643d27e | bellard | insn = (unsigned long) bfd_getl32 (buffer); |
3358 | 6643d27e | bellard | |
3359 | 6643d27e | bellard | return print_insn_mips (memaddr, insn, info);
|
3360 | 6643d27e | bellard | } |
3361 | 6643d27e | bellard | else
|
3362 | 6643d27e | bellard | { |
3363 | 6643d27e | bellard | (*info->memory_error_func) (status, memaddr, info); |
3364 | 6643d27e | bellard | return -1; |
3365 | 6643d27e | bellard | } |
3366 | 6643d27e | bellard | } |
3367 | 6643d27e | bellard | |
3368 | 6643d27e | bellard | int
|
3369 | 6643d27e | bellard | print_insn_big_mips (memaddr, info) |
3370 | 6643d27e | bellard | bfd_vma memaddr; |
3371 | 6643d27e | bellard | struct disassemble_info *info;
|
3372 | 6643d27e | bellard | { |
3373 | 6643d27e | bellard | return _print_insn_mips (memaddr, info, BFD_ENDIAN_BIG);
|
3374 | 6643d27e | bellard | } |
3375 | 6643d27e | bellard | |
3376 | 6643d27e | bellard | int
|
3377 | 6643d27e | bellard | print_insn_little_mips (memaddr, info) |
3378 | 6643d27e | bellard | bfd_vma memaddr; |
3379 | 6643d27e | bellard | struct disassemble_info *info;
|
3380 | 6643d27e | bellard | { |
3381 | 6643d27e | bellard | return _print_insn_mips (memaddr, info, BFD_ENDIAN_LITTLE);
|
3382 | 6643d27e | bellard | } |
3383 | 6643d27e | bellard | |
3384 | 6643d27e | bellard | /* Disassemble mips16 instructions. */
|
3385 | 6643d27e | bellard | #if 0
|
3386 | 6643d27e | bellard | static int
|
3387 | 6643d27e | bellard | print_insn_mips16 (memaddr, info)
|
3388 | 6643d27e | bellard | bfd_vma memaddr;
|
3389 | 6643d27e | bellard | struct disassemble_info *info;
|
3390 | 6643d27e | bellard | {
|
3391 | 6643d27e | bellard | int status;
|
3392 | 6643d27e | bellard | bfd_byte buffer[2];
|
3393 | 6643d27e | bellard | int length;
|
3394 | 6643d27e | bellard | int insn;
|
3395 | 6643d27e | bellard | bfd_boolean use_extend;
|
3396 | 6643d27e | bellard | int extend = 0;
|
3397 | 6643d27e | bellard | const struct mips_opcode *op, *opend;
|
3398 | 6643d27e | bellard | |
3399 | 6643d27e | bellard | info->bytes_per_chunk = 2;
|
3400 | 6643d27e | bellard | info->display_endian = info->endian;
|
3401 | 6643d27e | bellard | info->insn_info_valid = 1;
|
3402 | 6643d27e | bellard | info->branch_delay_insns = 0;
|
3403 | 6643d27e | bellard | info->data_size = 0;
|
3404 | 6643d27e | bellard | info->insn_type = dis_nonbranch;
|
3405 | 6643d27e | bellard | info->target = 0;
|
3406 | 6643d27e | bellard | info->target2 = 0;
|
3407 | 6643d27e | bellard | |
3408 | 6643d27e | bellard | status = (*info->read_memory_func) (memaddr, buffer, 2, info);
|
3409 | 6643d27e | bellard | if (status != 0)
|
3410 | 6643d27e | bellard | {
|
3411 | 6643d27e | bellard | (*info->memory_error_func) (status, memaddr, info);
|
3412 | 6643d27e | bellard | return -1;
|
3413 | 6643d27e | bellard | }
|
3414 | 6643d27e | bellard | |
3415 | 6643d27e | bellard | length = 2;
|
3416 | 6643d27e | bellard | |
3417 | 6643d27e | bellard | if (info->endian == BFD_ENDIAN_BIG)
|
3418 | 6643d27e | bellard | insn = bfd_getb16 (buffer);
|
3419 | 6643d27e | bellard | else
|
3420 | 6643d27e | bellard | insn = bfd_getl16 (buffer);
|
3421 | 6643d27e | bellard | |
3422 | 6643d27e | bellard | /* Handle the extend opcode specially. */
|
3423 | 6643d27e | bellard | use_extend = FALSE;
|
3424 | 6643d27e | bellard | if ((insn & 0xf800) == 0xf000)
|
3425 | 6643d27e | bellard | {
|
3426 | 6643d27e | bellard | use_extend = TRUE;
|
3427 | 6643d27e | bellard | extend = insn & 0x7ff;
|
3428 | 6643d27e | bellard | |
3429 | 6643d27e | bellard | memaddr += 2;
|
3430 | 6643d27e | bellard | |
3431 | 6643d27e | bellard | status = (*info->read_memory_func) (memaddr, buffer, 2, info);
|
3432 | 6643d27e | bellard | if (status != 0)
|
3433 | 6643d27e | bellard | {
|
3434 | 6643d27e | bellard | (*info->fprintf_func) (info->stream, "extend 0x%x",
|
3435 | 6643d27e | bellard | (unsigned int) extend);
|
3436 | 6643d27e | bellard | (*info->memory_error_func) (status, memaddr, info);
|
3437 | 6643d27e | bellard | return -1;
|
3438 | 6643d27e | bellard | }
|
3439 | 6643d27e | bellard | |
3440 | 6643d27e | bellard | if (info->endian == BFD_ENDIAN_BIG)
|
3441 | 6643d27e | bellard | insn = bfd_getb16 (buffer);
|
3442 | 6643d27e | bellard | else
|
3443 | 6643d27e | bellard | insn = bfd_getl16 (buffer);
|
3444 | 6643d27e | bellard | |
3445 | 6643d27e | bellard | /* Check for an extend opcode followed by an extend opcode. */
|
3446 | 6643d27e | bellard | if ((insn & 0xf800) == 0xf000)
|
3447 | 6643d27e | bellard | {
|
3448 | 6643d27e | bellard | (*info->fprintf_func) (info->stream, "extend 0x%x",
|
3449 | 6643d27e | bellard | (unsigned int) extend);
|
3450 | 6643d27e | bellard | info->insn_type = dis_noninsn;
|
3451 | 6643d27e | bellard | return length;
|
3452 | 6643d27e | bellard | }
|
3453 | 6643d27e | bellard | |
3454 | 6643d27e | bellard | length += 2;
|
3455 | 6643d27e | bellard | }
|
3456 | 6643d27e | bellard | |
3457 | 6643d27e | bellard | /* FIXME: Should probably use a hash table on the major opcode here. */
|
3458 | 6643d27e | bellard | |
3459 | 6643d27e | bellard | opend = mips16_opcodes + bfd_mips16_num_opcodes;
|
3460 | 6643d27e | bellard | for (op = mips16_opcodes; op < opend; op++)
|
3461 | 6643d27e | bellard | {
|
3462 | 6643d27e | bellard | if (op->pinfo != INSN_MACRO && (insn & op->mask) == op->match)
|
3463 | 6643d27e | bellard | {
|
3464 | 6643d27e | bellard | const char *s;
|
3465 | 6643d27e | bellard | |
3466 | 6643d27e | bellard | if (strchr (op->args, 'a') != NULL)
|
3467 | 6643d27e | bellard | {
|
3468 | 6643d27e | bellard | if (use_extend)
|
3469 | 6643d27e | bellard | {
|
3470 | 6643d27e | bellard | (*info->fprintf_func) (info->stream, "extend 0x%x",
|
3471 | 6643d27e | bellard | (unsigned int) extend);
|
3472 | 6643d27e | bellard | info->insn_type = dis_noninsn;
|
3473 | 6643d27e | bellard | return length - 2;
|
3474 | 6643d27e | bellard | }
|
3475 | 6643d27e | bellard | |
3476 | 6643d27e | bellard | use_extend = FALSE;
|
3477 | 6643d27e | bellard | |
3478 | 6643d27e | bellard | memaddr += 2;
|
3479 | 6643d27e | bellard | |
3480 | 6643d27e | bellard | status = (*info->read_memory_func) (memaddr, buffer, 2,
|
3481 | 6643d27e | bellard | info);
|
3482 | 6643d27e | bellard | if (status == 0)
|
3483 | 6643d27e | bellard | {
|
3484 | 6643d27e | bellard | use_extend = TRUE;
|
3485 | 6643d27e | bellard | if (info->endian == BFD_ENDIAN_BIG)
|
3486 | 6643d27e | bellard | extend = bfd_getb16 (buffer);
|
3487 | 6643d27e | bellard | else
|
3488 | 6643d27e | bellard | extend = bfd_getl16 (buffer);
|
3489 | 6643d27e | bellard | length += 2;
|
3490 | 6643d27e | bellard | }
|
3491 | 6643d27e | bellard | }
|
3492 | 6643d27e | bellard | |
3493 | 6643d27e | bellard | (*info->fprintf_func) (info->stream, "%s", op->name);
|
3494 | 6643d27e | bellard | if (op->args[0] != '\0')
|
3495 | 6643d27e | bellard | (*info->fprintf_func) (info->stream, "\t");
|
3496 | 6643d27e | bellard | |
3497 | 6643d27e | bellard | for (s = op->args; *s != '\0'; s++)
|
3498 | 6643d27e | bellard | {
|
3499 | 6643d27e | bellard | if (*s == ','
|
3500 | 6643d27e | bellard | && s[1] == 'w'
|
3501 | 6643d27e | bellard | && (((insn >> MIPS16OP_SH_RX) & MIPS16OP_MASK_RX)
|
3502 | 6643d27e | bellard | == ((insn >> MIPS16OP_SH_RY) & MIPS16OP_MASK_RY)))
|
3503 | 6643d27e | bellard | {
|
3504 | 6643d27e | bellard | /* Skip the register and the comma. */
|
3505 | 6643d27e | bellard | ++s;
|
3506 | 6643d27e | bellard | continue;
|
3507 | 6643d27e | bellard | }
|
3508 | 6643d27e | bellard | if (*s == ','
|
3509 | 6643d27e | bellard | && s[1] == 'v'
|
3510 | 6643d27e | bellard | && (((insn >> MIPS16OP_SH_RZ) & MIPS16OP_MASK_RZ)
|
3511 | 6643d27e | bellard | == ((insn >> MIPS16OP_SH_RX) & MIPS16OP_MASK_RX)))
|
3512 | 6643d27e | bellard | {
|
3513 | 6643d27e | bellard | /* Skip the register and the comma. */
|
3514 | 6643d27e | bellard | ++s;
|
3515 | 6643d27e | bellard | continue;
|
3516 | 6643d27e | bellard | }
|
3517 | 6643d27e | bellard | print_mips16_insn_arg (*s, op, insn, use_extend, extend, memaddr,
|
3518 | 6643d27e | bellard | info);
|
3519 | 6643d27e | bellard | }
|
3520 | 6643d27e | bellard | |
3521 | 6643d27e | bellard | if ((op->pinfo & INSN_UNCOND_BRANCH_DELAY) != 0)
|
3522 | 6643d27e | bellard | {
|
3523 | 6643d27e | bellard | info->branch_delay_insns = 1;
|
3524 | 6643d27e | bellard | if (info->insn_type != dis_jsr)
|
3525 | 6643d27e | bellard | info->insn_type = dis_branch;
|
3526 | 6643d27e | bellard | }
|
3527 | 6643d27e | bellard | |
3528 | 6643d27e | bellard | return length;
|
3529 | 6643d27e | bellard | }
|
3530 | 6643d27e | bellard | }
|
3531 | 6643d27e | bellard | |
3532 | 6643d27e | bellard | if (use_extend)
|
3533 | 6643d27e | bellard | (*info->fprintf_func) (info->stream, "0x%x", extend | 0xf000);
|
3534 | 6643d27e | bellard | (*info->fprintf_func) (info->stream, "0x%x", insn);
|
3535 | 6643d27e | bellard | info->insn_type = dis_noninsn;
|
3536 | 6643d27e | bellard | |
3537 | 6643d27e | bellard | return length;
|
3538 | 6643d27e | bellard | }
|
3539 | 6643d27e | bellard | |
3540 | 6643d27e | bellard | /* Disassemble an operand for a mips16 instruction. */
|
3541 | 6643d27e | bellard | |
3542 | 6643d27e | bellard | static void
|
3543 | 6643d27e | bellard | print_mips16_insn_arg (type, op, l, use_extend, extend, memaddr, info)
|
3544 | 6643d27e | bellard | char type;
|
3545 | 6643d27e | bellard | const struct mips_opcode *op;
|
3546 | 6643d27e | bellard | int l;
|
3547 | 6643d27e | bellard | bfd_boolean use_extend;
|
3548 | 6643d27e | bellard | int extend;
|
3549 | 6643d27e | bellard | bfd_vma memaddr;
|
3550 | 6643d27e | bellard | struct disassemble_info *info;
|
3551 | 6643d27e | bellard | {
|
3552 | 6643d27e | bellard | switch (type)
|
3553 | 6643d27e | bellard | {
|
3554 | 6643d27e | bellard | case ',':
|
3555 | 6643d27e | bellard | case '(':
|
3556 | 6643d27e | bellard | case ')':
|
3557 | 6643d27e | bellard | (*info->fprintf_func) (info->stream, "%c", type);
|
3558 | 6643d27e | bellard | break;
|
3559 | 6643d27e | bellard | |
3560 | 6643d27e | bellard | case 'y':
|
3561 | 6643d27e | bellard | case 'w':
|
3562 | 6643d27e | bellard | (*info->fprintf_func) (info->stream, "%s",
|
3563 | 6643d27e | bellard | mips16_reg_names[((l >> MIPS16OP_SH_RY)
|
3564 | 6643d27e | bellard | & MIPS16OP_MASK_RY)]);
|
3565 | 6643d27e | bellard | break;
|
3566 | 6643d27e | bellard | |
3567 | 6643d27e | bellard | case 'x':
|
3568 | 6643d27e | bellard | case 'v':
|
3569 | 6643d27e | bellard | (*info->fprintf_func) (info->stream, "%s",
|
3570 | 6643d27e | bellard | mips16_reg_names[((l >> MIPS16OP_SH_RX)
|
3571 | 6643d27e | bellard | & MIPS16OP_MASK_RX)]);
|
3572 | 6643d27e | bellard | break;
|
3573 | 6643d27e | bellard | |
3574 | 6643d27e | bellard | case 'z':
|
3575 | 6643d27e | bellard | (*info->fprintf_func) (info->stream, "%s",
|
3576 | 6643d27e | bellard | mips16_reg_names[((l >> MIPS16OP_SH_RZ)
|
3577 | 6643d27e | bellard | & MIPS16OP_MASK_RZ)]);
|
3578 | 6643d27e | bellard | break;
|
3579 | 6643d27e | bellard | |
3580 | 6643d27e | bellard | case 'Z':
|
3581 | 6643d27e | bellard | (*info->fprintf_func) (info->stream, "%s",
|
3582 | 6643d27e | bellard | mips16_reg_names[((l >> MIPS16OP_SH_MOVE32Z)
|
3583 | 6643d27e | bellard | & MIPS16OP_MASK_MOVE32Z)]);
|
3584 | 6643d27e | bellard | break;
|
3585 | 6643d27e | bellard | |
3586 | 6643d27e | bellard | case '0':
|
3587 | 6643d27e | bellard | (*info->fprintf_func) (info->stream, "%s", mips_gpr_names[0]);
|
3588 | 6643d27e | bellard | break;
|
3589 | 6643d27e | bellard | |
3590 | 6643d27e | bellard | case 'S':
|
3591 | 6643d27e | bellard | (*info->fprintf_func) (info->stream, "%s", mips_gpr_names[29]);
|
3592 | 6643d27e | bellard | break;
|
3593 | 6643d27e | bellard | |
3594 | 6643d27e | bellard | case 'P':
|
3595 | 6643d27e | bellard | (*info->fprintf_func) (info->stream, "$pc");
|
3596 | 6643d27e | bellard | break;
|
3597 | 6643d27e | bellard | |
3598 | 6643d27e | bellard | case 'R':
|
3599 | 6643d27e | bellard | (*info->fprintf_func) (info->stream, "%s", mips_gpr_names[31]);
|
3600 | 6643d27e | bellard | break;
|
3601 | 6643d27e | bellard | |
3602 | 6643d27e | bellard | case 'X':
|
3603 | 6643d27e | bellard | (*info->fprintf_func) (info->stream, "%s",
|
3604 | 6643d27e | bellard | mips_gpr_names[((l >> MIPS16OP_SH_REGR32)
|
3605 | 6643d27e | bellard | & MIPS16OP_MASK_REGR32)]);
|
3606 | 6643d27e | bellard | break;
|
3607 | 6643d27e | bellard | |
3608 | 6643d27e | bellard | case 'Y':
|
3609 | 6643d27e | bellard | (*info->fprintf_func) (info->stream, "%s",
|
3610 | 6643d27e | bellard | mips_gpr_names[MIPS16OP_EXTRACT_REG32R (l)]);
|
3611 | 6643d27e | bellard | break;
|
3612 | 6643d27e | bellard | |
3613 | 6643d27e | bellard | case '<':
|
3614 | 6643d27e | bellard | case '>':
|
3615 | 6643d27e | bellard | case '[':
|
3616 | 6643d27e | bellard | case ']':
|
3617 | 6643d27e | bellard | case '4':
|
3618 | 6643d27e | bellard | case '5':
|
3619 | 6643d27e | bellard | case 'H':
|
3620 | 6643d27e | bellard | case 'W':
|
3621 | 6643d27e | bellard | case 'D':
|
3622 | 6643d27e | bellard | case 'j':
|
3623 | 6643d27e | bellard | case '6':
|
3624 | 6643d27e | bellard | case '8':
|
3625 | 6643d27e | bellard | case 'V':
|
3626 | 6643d27e | bellard | case 'C':
|
3627 | 6643d27e | bellard | case 'U':
|
3628 | 6643d27e | bellard | case 'k':
|
3629 | 6643d27e | bellard | case 'K':
|
3630 | 6643d27e | bellard | case 'p':
|
3631 | 6643d27e | bellard | case 'q':
|
3632 | 6643d27e | bellard | case 'A':
|
3633 | 6643d27e | bellard | case 'B':
|
3634 | 6643d27e | bellard | case 'E':
|
3635 | 6643d27e | bellard | {
|
3636 | 6643d27e | bellard | int immed, nbits, shift, signedp, extbits, pcrel, extu, branch;
|
3637 | 6643d27e | bellard | |
3638 | 6643d27e | bellard | shift = 0;
|
3639 | 6643d27e | bellard | signedp = 0;
|
3640 | 6643d27e | bellard | extbits = 16;
|
3641 | 6643d27e | bellard | pcrel = 0;
|
3642 | 6643d27e | bellard | extu = 0;
|
3643 | 6643d27e | bellard | branch = 0;
|
3644 | 6643d27e | bellard | switch (type)
|
3645 | 6643d27e | bellard | {
|
3646 | 6643d27e | bellard | case '<':
|
3647 | 6643d27e | bellard | nbits = 3;
|
3648 | 6643d27e | bellard | immed = (l >> MIPS16OP_SH_RZ) & MIPS16OP_MASK_RZ;
|
3649 | 6643d27e | bellard | extbits = 5;
|
3650 | 6643d27e | bellard | extu = 1;
|
3651 | 6643d27e | bellard | break;
|
3652 | 6643d27e | bellard | case '>':
|
3653 | 6643d27e | bellard | nbits = 3;
|
3654 | 6643d27e | bellard | immed = (l >> MIPS16OP_SH_RX) & MIPS16OP_MASK_RX;
|
3655 | 6643d27e | bellard | extbits = 5;
|
3656 | 6643d27e | bellard | extu = 1;
|
3657 | 6643d27e | bellard | break;
|
3658 | 6643d27e | bellard | case '[':
|
3659 | 6643d27e | bellard | nbits = 3;
|
3660 | 6643d27e | bellard | immed = (l >> MIPS16OP_SH_RZ) & MIPS16OP_MASK_RZ;
|
3661 | 6643d27e | bellard | extbits = 6;
|
3662 | 6643d27e | bellard | extu = 1;
|
3663 | 6643d27e | bellard | break;
|
3664 | 6643d27e | bellard | case ']':
|
3665 | 6643d27e | bellard | nbits = 3;
|
3666 | 6643d27e | bellard | immed = (l >> MIPS16OP_SH_RX) & MIPS16OP_MASK_RX;
|
3667 | 6643d27e | bellard | extbits = 6;
|
3668 | 6643d27e | bellard | extu = 1;
|
3669 | 6643d27e | bellard | break;
|
3670 | 6643d27e | bellard | case '4':
|
3671 | 6643d27e | bellard | nbits = 4;
|
3672 | 6643d27e | bellard | immed = (l >> MIPS16OP_SH_IMM4) & MIPS16OP_MASK_IMM4;
|
3673 | 6643d27e | bellard | signedp = 1;
|
3674 | 6643d27e | bellard | extbits = 15;
|
3675 | 6643d27e | bellard | break;
|
3676 | 6643d27e | bellard | case '5':
|
3677 | 6643d27e | bellard | nbits = 5;
|
3678 | 6643d27e | bellard | immed = (l >> MIPS16OP_SH_IMM5) & MIPS16OP_MASK_IMM5;
|
3679 | 6643d27e | bellard | info->insn_type = dis_dref;
|
3680 | 6643d27e | bellard | info->data_size = 1;
|
3681 | 6643d27e | bellard | break;
|
3682 | 6643d27e | bellard | case 'H':
|
3683 | 6643d27e | bellard | nbits = 5;
|
3684 | 6643d27e | bellard | shift = 1;
|
3685 | 6643d27e | bellard | immed = (l >> MIPS16OP_SH_IMM5) & MIPS16OP_MASK_IMM5;
|
3686 | 6643d27e | bellard | info->insn_type = dis_dref;
|
3687 | 6643d27e | bellard | info->data_size = 2;
|
3688 | 6643d27e | bellard | break;
|
3689 | 6643d27e | bellard | case 'W':
|
3690 | 6643d27e | bellard | nbits = 5;
|
3691 | 6643d27e | bellard | shift = 2;
|
3692 | 6643d27e | bellard | immed = (l >> MIPS16OP_SH_IMM5) & MIPS16OP_MASK_IMM5;
|
3693 | 6643d27e | bellard | if ((op->pinfo & MIPS16_INSN_READ_PC) == 0
|
3694 | 6643d27e | bellard | && (op->pinfo & MIPS16_INSN_READ_SP) == 0)
|
3695 | 6643d27e | bellard | {
|
3696 | 6643d27e | bellard | info->insn_type = dis_dref;
|
3697 | 6643d27e | bellard | info->data_size = 4;
|
3698 | 6643d27e | bellard | }
|
3699 | 6643d27e | bellard | break;
|
3700 | 6643d27e | bellard | case 'D':
|
3701 | 6643d27e | bellard | nbits = 5;
|
3702 | 6643d27e | bellard | shift = 3;
|
3703 | 6643d27e | bellard | immed = (l >> MIPS16OP_SH_IMM5) & MIPS16OP_MASK_IMM5;
|
3704 | 6643d27e | bellard | info->insn_type = dis_dref;
|
3705 | 6643d27e | bellard | info->data_size = 8;
|
3706 | 6643d27e | bellard | break;
|
3707 | 6643d27e | bellard | case 'j':
|
3708 | 6643d27e | bellard | nbits = 5;
|
3709 | 6643d27e | bellard | immed = (l >> MIPS16OP_SH_IMM5) & MIPS16OP_MASK_IMM5;
|
3710 | 6643d27e | bellard | signedp = 1;
|
3711 | 6643d27e | bellard | break;
|
3712 | 6643d27e | bellard | case '6':
|
3713 | 6643d27e | bellard | nbits = 6;
|
3714 | 6643d27e | bellard | immed = (l >> MIPS16OP_SH_IMM6) & MIPS16OP_MASK_IMM6;
|
3715 | 6643d27e | bellard | break;
|
3716 | 6643d27e | bellard | case '8':
|
3717 | 6643d27e | bellard | nbits = 8;
|
3718 | 6643d27e | bellard | immed = (l >> MIPS16OP_SH_IMM8) & MIPS16OP_MASK_IMM8;
|
3719 | 6643d27e | bellard | break;
|
3720 | 6643d27e | bellard | case 'V':
|
3721 | 6643d27e | bellard | nbits = 8;
|
3722 | 6643d27e | bellard | shift = 2;
|
3723 | 6643d27e | bellard | immed = (l >> MIPS16OP_SH_IMM8) & MIPS16OP_MASK_IMM8;
|
3724 | 6643d27e | bellard | /* FIXME: This might be lw, or it might be addiu to $sp or
|
3725 | 6643d27e | bellard | $pc. We assume it's load. */
|
3726 | 6643d27e | bellard | info->insn_type = dis_dref;
|
3727 | 6643d27e | bellard | info->data_size = 4;
|
3728 | 6643d27e | bellard | break;
|
3729 | 6643d27e | bellard | case 'C':
|
3730 | 6643d27e | bellard | nbits = 8;
|
3731 | 6643d27e | bellard | shift = 3;
|
3732 | 6643d27e | bellard | immed = (l >> MIPS16OP_SH_IMM8) & MIPS16OP_MASK_IMM8;
|
3733 | 6643d27e | bellard | info->insn_type = dis_dref;
|
3734 | 6643d27e | bellard | info->data_size = 8;
|
3735 | 6643d27e | bellard | break;
|
3736 | 6643d27e | bellard | case 'U':
|
3737 | 6643d27e | bellard | nbits = 8;
|
3738 | 6643d27e | bellard | immed = (l >> MIPS16OP_SH_IMM8) & MIPS16OP_MASK_IMM8;
|
3739 | 6643d27e | bellard | extu = 1;
|
3740 | 6643d27e | bellard | break;
|
3741 | 6643d27e | bellard | case 'k':
|
3742 | 6643d27e | bellard | nbits = 8;
|
3743 | 6643d27e | bellard | immed = (l >> MIPS16OP_SH_IMM8) & MIPS16OP_MASK_IMM8;
|
3744 | 6643d27e | bellard | signedp = 1;
|
3745 | 6643d27e | bellard | break;
|
3746 | 6643d27e | bellard | case 'K':
|
3747 | 6643d27e | bellard | nbits = 8;
|
3748 | 6643d27e | bellard | shift = 3;
|
3749 | 6643d27e | bellard | immed = (l >> MIPS16OP_SH_IMM8) & MIPS16OP_MASK_IMM8;
|
3750 | 6643d27e | bellard | signedp = 1;
|
3751 | 6643d27e | bellard | break;
|
3752 | 6643d27e | bellard | case 'p':
|
3753 | 6643d27e | bellard | nbits = 8;
|
3754 | 6643d27e | bellard | immed = (l >> MIPS16OP_SH_IMM8) & MIPS16OP_MASK_IMM8;
|
3755 | 6643d27e | bellard | signedp = 1;
|
3756 | 6643d27e | bellard | pcrel = 1;
|
3757 | 6643d27e | bellard | branch = 1;
|
3758 | 6643d27e | bellard | info->insn_type = dis_condbranch;
|
3759 | 6643d27e | bellard | break;
|
3760 | 6643d27e | bellard | case 'q':
|
3761 | 6643d27e | bellard | nbits = 11;
|
3762 | 6643d27e | bellard | immed = (l >> MIPS16OP_SH_IMM11) & MIPS16OP_MASK_IMM11;
|
3763 | 6643d27e | bellard | signedp = 1;
|
3764 | 6643d27e | bellard | pcrel = 1;
|
3765 | 6643d27e | bellard | branch = 1;
|
3766 | 6643d27e | bellard | info->insn_type = dis_branch;
|
3767 | 6643d27e | bellard | break;
|
3768 | 6643d27e | bellard | case 'A':
|
3769 | 6643d27e | bellard | nbits = 8;
|
3770 | 6643d27e | bellard | shift = 2;
|
3771 | 6643d27e | bellard | immed = (l >> MIPS16OP_SH_IMM8) & MIPS16OP_MASK_IMM8;
|
3772 | 6643d27e | bellard | pcrel = 1;
|
3773 | 6643d27e | bellard | /* FIXME: This can be lw or la. We assume it is lw. */
|
3774 | 6643d27e | bellard | info->insn_type = dis_dref;
|
3775 | 6643d27e | bellard | info->data_size = 4;
|
3776 | 6643d27e | bellard | break;
|
3777 | 6643d27e | bellard | case 'B':
|
3778 | 6643d27e | bellard | nbits = 5;
|
3779 | 6643d27e | bellard | shift = 3;
|
3780 | 6643d27e | bellard | immed = (l >> MIPS16OP_SH_IMM5) & MIPS16OP_MASK_IMM5;
|
3781 | 6643d27e | bellard | pcrel = 1;
|
3782 | 6643d27e | bellard | info->insn_type = dis_dref;
|
3783 | 6643d27e | bellard | info->data_size = 8;
|
3784 | 6643d27e | bellard | break;
|
3785 | 6643d27e | bellard | case 'E':
|
3786 | 6643d27e | bellard | nbits = 5;
|
3787 | 6643d27e | bellard | shift = 2;
|
3788 | 6643d27e | bellard | immed = (l >> MIPS16OP_SH_IMM5) & MIPS16OP_MASK_IMM5;
|
3789 | 6643d27e | bellard | pcrel = 1;
|
3790 | 6643d27e | bellard | break;
|
3791 | 6643d27e | bellard | default:
|
3792 | 6643d27e | bellard | abort ();
|
3793 | 6643d27e | bellard | }
|
3794 | 6643d27e | bellard | |
3795 | 6643d27e | bellard | if (! use_extend)
|
3796 | 6643d27e | bellard | {
|
3797 | 6643d27e | bellard | if (signedp && immed >= (1 << (nbits - 1)))
|
3798 | 6643d27e | bellard | immed -= 1 << nbits;
|
3799 | 6643d27e | bellard | immed <<= shift;
|
3800 | 6643d27e | bellard | if ((type == '<' || type == '>' || type == '[' || type == ']')
|
3801 | 6643d27e | bellard | && immed == 0)
|
3802 | 6643d27e | bellard | immed = 8;
|
3803 | 6643d27e | bellard | }
|
3804 | 6643d27e | bellard | else
|
3805 | 6643d27e | bellard | {
|
3806 | 6643d27e | bellard | if (extbits == 16)
|
3807 | 6643d27e | bellard | immed |= ((extend & 0x1f) << 11) | (extend & 0x7e0);
|
3808 | 6643d27e | bellard | else if (extbits == 15)
|
3809 | 6643d27e | bellard | immed |= ((extend & 0xf) << 11) | (extend & 0x7f0);
|
3810 | 6643d27e | bellard | else
|
3811 | 6643d27e | bellard | immed = ((extend >> 6) & 0x1f) | (extend & 0x20);
|
3812 | 6643d27e | bellard | immed &= (1 << extbits) - 1;
|
3813 | 6643d27e | bellard | if (! extu && immed >= (1 << (extbits - 1)))
|
3814 | 6643d27e | bellard | immed -= 1 << extbits;
|
3815 | 6643d27e | bellard | }
|
3816 | 6643d27e | bellard | |
3817 | 6643d27e | bellard | if (! pcrel)
|
3818 | 6643d27e | bellard | (*info->fprintf_func) (info->stream, "%d", immed);
|
3819 | 6643d27e | bellard | else
|
3820 | 6643d27e | bellard | {
|
3821 | 6643d27e | bellard | bfd_vma baseaddr;
|
3822 | 6643d27e | bellard | |
3823 | 6643d27e | bellard | if (branch)
|
3824 | 6643d27e | bellard | {
|
3825 | 6643d27e | bellard | immed *= 2;
|
3826 | 6643d27e | bellard | baseaddr = memaddr + 2;
|
3827 | 6643d27e | bellard | }
|
3828 | 6643d27e | bellard | else if (use_extend)
|
3829 | 6643d27e | bellard | baseaddr = memaddr - 2;
|
3830 | 6643d27e | bellard | else
|
3831 | 6643d27e | bellard | {
|
3832 | 6643d27e | bellard | int status;
|
3833 | 6643d27e | bellard | bfd_byte buffer[2];
|
3834 | 6643d27e | bellard | |
3835 | 6643d27e | bellard | baseaddr = memaddr;
|
3836 | 6643d27e | bellard | |
3837 | 6643d27e | bellard | /* If this instruction is in the delay slot of a jr
|
3838 | 6643d27e | bellard | instruction, the base address is the address of the
|
3839 | 6643d27e | bellard | jr instruction. If it is in the delay slot of jalr
|
3840 | 6643d27e | bellard | instruction, the base address is the address of the
|
3841 | 6643d27e | bellard | jalr instruction. This test is unreliable: we have
|
3842 | 6643d27e | bellard | no way of knowing whether the previous word is
|
3843 | 6643d27e | bellard | instruction or data. */
|
3844 | 6643d27e | bellard | status = (*info->read_memory_func) (memaddr - 4, buffer, 2,
|
3845 | 6643d27e | bellard | info);
|
3846 | 6643d27e | bellard | if (status == 0
|
3847 | 6643d27e | bellard | && (((info->endian == BFD_ENDIAN_BIG
|
3848 | 6643d27e | bellard | ? bfd_getb16 (buffer)
|
3849 | 6643d27e | bellard | : bfd_getl16 (buffer))
|
3850 | 6643d27e | bellard | & 0xf800) == 0x1800))
|
3851 | 6643d27e | bellard | baseaddr = memaddr - 4;
|
3852 | 6643d27e | bellard | else
|
3853 | 6643d27e | bellard | {
|
3854 | 6643d27e | bellard | status = (*info->read_memory_func) (memaddr - 2, buffer,
|
3855 | 6643d27e | bellard | 2, info);
|
3856 | 6643d27e | bellard | if (status == 0
|
3857 | 6643d27e | bellard | && (((info->endian == BFD_ENDIAN_BIG
|
3858 | 6643d27e | bellard | ? bfd_getb16 (buffer)
|
3859 | 6643d27e | bellard | : bfd_getl16 (buffer))
|
3860 | 6643d27e | bellard | & 0xf81f) == 0xe800))
|
3861 | 6643d27e | bellard | baseaddr = memaddr - 2;
|
3862 | 6643d27e | bellard | }
|
3863 | 6643d27e | bellard | }
|
3864 | 6643d27e | bellard | info->target = (baseaddr & ~((1 << shift) - 1)) + immed;
|
3865 | 6643d27e | bellard | (*info->print_address_func) (info->target, info);
|
3866 | 6643d27e | bellard | }
|
3867 | 6643d27e | bellard | }
|
3868 | 6643d27e | bellard | break;
|
3869 | 6643d27e | bellard | |
3870 | 6643d27e | bellard | case 'a':
|
3871 | 6643d27e | bellard | if (! use_extend)
|
3872 | 6643d27e | bellard | extend = 0;
|
3873 | 6643d27e | bellard | l = ((l & 0x1f) << 23) | ((l & 0x3e0) << 13) | (extend << 2);
|
3874 | 6643d27e | bellard | info->target = ((memaddr + 4) & ~(bfd_vma) 0x0fffffff) | l;
|
3875 | 6643d27e | bellard | (*info->print_address_func) (info->target, info);
|
3876 | 6643d27e | bellard | info->insn_type = dis_jsr;
|
3877 | 6643d27e | bellard | info->branch_delay_insns = 1;
|
3878 | 6643d27e | bellard | break;
|
3879 | 6643d27e | bellard | |
3880 | 6643d27e | bellard | case 'l':
|
3881 | 6643d27e | bellard | case 'L':
|
3882 | 6643d27e | bellard | {
|
3883 | 6643d27e | bellard | int need_comma, amask, smask;
|
3884 | 6643d27e | bellard | |
3885 | 6643d27e | bellard | need_comma = 0;
|
3886 | 6643d27e | bellard | |
3887 | 6643d27e | bellard | l = (l >> MIPS16OP_SH_IMM6) & MIPS16OP_MASK_IMM6;
|
3888 | 6643d27e | bellard | |
3889 | 6643d27e | bellard | amask = (l >> 3) & 7;
|
3890 | 6643d27e | bellard | |
3891 | 6643d27e | bellard | if (amask > 0 && amask < 5)
|
3892 | 6643d27e | bellard | {
|
3893 | 6643d27e | bellard | (*info->fprintf_func) (info->stream, "%s", mips_gpr_names[4]);
|
3894 | 6643d27e | bellard | if (amask > 1)
|
3895 | 6643d27e | bellard | (*info->fprintf_func) (info->stream, "-%s",
|
3896 | 6643d27e | bellard | mips_gpr_names[amask + 3]);
|
3897 | 6643d27e | bellard | need_comma = 1;
|
3898 | 6643d27e | bellard | }
|
3899 | 6643d27e | bellard | |
3900 | 6643d27e | bellard | smask = (l >> 1) & 3;
|
3901 | 6643d27e | bellard | if (smask == 3)
|
3902 | 6643d27e | bellard | {
|
3903 | 6643d27e | bellard | (*info->fprintf_func) (info->stream, "%s??",
|
3904 | 6643d27e | bellard | need_comma ? "," : "");
|
3905 | 6643d27e | bellard | need_comma = 1;
|
3906 | 6643d27e | bellard | }
|
3907 | 6643d27e | bellard | else if (smask > 0)
|
3908 | 6643d27e | bellard | {
|
3909 | 6643d27e | bellard | (*info->fprintf_func) (info->stream, "%s%s",
|
3910 | 6643d27e | bellard | need_comma ? "," : "",
|
3911 | 6643d27e | bellard | mips_gpr_names[16]);
|
3912 | 6643d27e | bellard | if (smask > 1)
|
3913 | 6643d27e | bellard | (*info->fprintf_func) (info->stream, "-%s",
|
3914 | 6643d27e | bellard | mips_gpr_names[smask + 15]);
|
3915 | 6643d27e | bellard | need_comma = 1;
|
3916 | 6643d27e | bellard | }
|
3917 | 6643d27e | bellard | |
3918 | 6643d27e | bellard | if (l & 1)
|
3919 | 6643d27e | bellard | {
|
3920 | 6643d27e | bellard | (*info->fprintf_func) (info->stream, "%s%s",
|
3921 | 6643d27e | bellard | need_comma ? "," : "",
|
3922 | 6643d27e | bellard | mips_gpr_names[31]);
|
3923 | 6643d27e | bellard | need_comma = 1;
|
3924 | 6643d27e | bellard | }
|
3925 | 6643d27e | bellard | |
3926 | 6643d27e | bellard | if (amask == 5 || amask == 6)
|
3927 | 6643d27e | bellard | {
|
3928 | 6643d27e | bellard | (*info->fprintf_func) (info->stream, "%s$f0",
|
3929 | 6643d27e | bellard | need_comma ? "," : "");
|
3930 | 6643d27e | bellard | if (amask == 6)
|
3931 | 6643d27e | bellard | (*info->fprintf_func) (info->stream, "-$f1");
|
3932 | 6643d27e | bellard | }
|
3933 | 6643d27e | bellard | }
|
3934 | 6643d27e | bellard | break;
|
3935 | 6643d27e | bellard | |
3936 | 6643d27e | bellard | default:
|
3937 | 6643d27e | bellard | /* xgettext:c-format */
|
3938 | 6643d27e | bellard | (*info->fprintf_func)
|
3939 | 6643d27e | bellard | (info->stream,
|
3940 | 6643d27e | bellard | _("# internal disassembler error, unrecognised modifier (%c)"),
|
3941 | 6643d27e | bellard | type);
|
3942 | 6643d27e | bellard | abort ();
|
3943 | 6643d27e | bellard | }
|
3944 | 6643d27e | bellard | }
|
3945 | 6643d27e | bellard | #endif
|
3946 | 6643d27e | bellard | |
3947 | 6643d27e | bellard | void
|
3948 | 6643d27e | bellard | print_mips_disassembler_options (stream) |
3949 | 6643d27e | bellard | FILE *stream; |
3950 | 6643d27e | bellard | { |
3951 | 6643d27e | bellard | unsigned int i; |
3952 | 6643d27e | bellard | |
3953 | 6643d27e | bellard | fprintf (stream, _("\n\
|
3954 | 6643d27e | bellard | The following MIPS specific disassembler options are supported for use\n\
|
3955 | 6643d27e | bellard | with the -M switch (multiple options should be separated by commas):\n"));
|
3956 | 6643d27e | bellard | |
3957 | 6643d27e | bellard | fprintf (stream, _("\n\
|
3958 | 6643d27e | bellard | gpr-names=ABI Print GPR names according to specified ABI.\n\
|
3959 | 6643d27e | bellard | Default: based on binary being disassembled.\n"));
|
3960 | 6643d27e | bellard | |
3961 | 6643d27e | bellard | fprintf (stream, _("\n\
|
3962 | 6643d27e | bellard | fpr-names=ABI Print FPR names according to specified ABI.\n\
|
3963 | 6643d27e | bellard | Default: numeric.\n"));
|
3964 | 6643d27e | bellard | |
3965 | 6643d27e | bellard | fprintf (stream, _("\n\
|
3966 | 6643d27e | bellard | cp0-names=ARCH Print CP0 register names according to\n\
|
3967 | 6643d27e | bellard | specified architecture.\n\
|
3968 | 6643d27e | bellard | Default: based on binary being disassembled.\n"));
|
3969 | 6643d27e | bellard | |
3970 | 6643d27e | bellard | fprintf (stream, _("\n\
|
3971 | 6643d27e | bellard | hwr-names=ARCH Print HWR names according to specified \n\
|
3972 | 6643d27e | bellard | architecture.\n\
|
3973 | 6643d27e | bellard | Default: based on binary being disassembled.\n"));
|
3974 | 6643d27e | bellard | |
3975 | 6643d27e | bellard | fprintf (stream, _("\n\
|
3976 | 6643d27e | bellard | reg-names=ABI Print GPR and FPR names according to\n\
|
3977 | 6643d27e | bellard | specified ABI.\n"));
|
3978 | 6643d27e | bellard | |
3979 | 6643d27e | bellard | fprintf (stream, _("\n\
|
3980 | 6643d27e | bellard | reg-names=ARCH Print CP0 register and HWR names according to\n\
|
3981 | 6643d27e | bellard | specified architecture.\n"));
|
3982 | 6643d27e | bellard | |
3983 | 6643d27e | bellard | fprintf (stream, _("\n\
|
3984 | 6643d27e | bellard | For the options above, the following values are supported for \"ABI\":\n\
|
3985 | 6643d27e | bellard | "));
|
3986 | 6643d27e | bellard | for (i = 0; i < ARRAY_SIZE (mips_abi_choices); i++) |
3987 | 6643d27e | bellard | fprintf (stream, " %s", mips_abi_choices[i].name);
|
3988 | 6643d27e | bellard | fprintf (stream, _("\n"));
|
3989 | 6643d27e | bellard | |
3990 | 6643d27e | bellard | fprintf (stream, _("\n\
|
3991 | 6643d27e | bellard | For the options above, The following values are supported for \"ARCH\":\n\
|
3992 | 6643d27e | bellard | "));
|
3993 | 6643d27e | bellard | for (i = 0; i < ARRAY_SIZE (mips_arch_choices); i++) |
3994 | 6643d27e | bellard | if (*mips_arch_choices[i].name != '\0') |
3995 | 6643d27e | bellard | fprintf (stream, " %s", mips_arch_choices[i].name);
|
3996 | 6643d27e | bellard | fprintf (stream, _("\n"));
|
3997 | 6643d27e | bellard | |
3998 | 6643d27e | bellard | fprintf (stream, _("\n"));
|
3999 | 6643d27e | bellard | } |