Add support for h8300hn and h8300sn
[binutils.git] / opcodes / iq2000-desc.c
bloba30bf56b8bffaa61ae756102358600a78b608596
1 /* CPU data for iq2000.
3 THIS FILE IS MACHINE GENERATED WITH CGEN.
5 Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
7 This file is part of the GNU Binutils and/or GDB, the GNU debugger.
9 This program is free software; you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation; either version 2, or (at your option)
12 any later version.
14 This program is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License for more details.
19 You should have received a copy of the GNU General Public License along
20 with this program; if not, write to the Free Software Foundation, Inc.,
21 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
25 #include "sysdep.h"
26 #include <ctype.h>
27 #include <stdio.h>
28 #include <stdarg.h>
29 #include "ansidecl.h"
30 #include "bfd.h"
31 #include "symcat.h"
32 #include "iq2000-desc.h"
33 #include "iq2000-opc.h"
34 #include "opintl.h"
35 #include "libiberty.h"
37 /* Attributes. */
39 static const CGEN_ATTR_ENTRY bool_attr[] =
41 { "#f", 0 },
42 { "#t", 1 },
43 { 0, 0 }
46 static const CGEN_ATTR_ENTRY MACH_attr[] =
48 { "base", MACH_BASE },
49 { "iq2000", MACH_IQ2000 },
50 { "iq10", MACH_IQ10 },
51 { "max", MACH_MAX },
52 { 0, 0 }
55 static const CGEN_ATTR_ENTRY ISA_attr[] =
57 { "iq2000", ISA_IQ2000 },
58 { "max", ISA_MAX },
59 { 0, 0 }
62 const CGEN_ATTR_TABLE iq2000_cgen_ifield_attr_table[] =
64 { "MACH", & MACH_attr[0], & MACH_attr[0] },
65 { "VIRTUAL", &bool_attr[0], &bool_attr[0] },
66 { "PCREL-ADDR", &bool_attr[0], &bool_attr[0] },
67 { "ABS-ADDR", &bool_attr[0], &bool_attr[0] },
68 { "RESERVED", &bool_attr[0], &bool_attr[0] },
69 { "SIGN-OPT", &bool_attr[0], &bool_attr[0] },
70 { "SIGNED", &bool_attr[0], &bool_attr[0] },
71 { 0, 0, 0 }
74 const CGEN_ATTR_TABLE iq2000_cgen_hardware_attr_table[] =
76 { "MACH", & MACH_attr[0], & MACH_attr[0] },
77 { "VIRTUAL", &bool_attr[0], &bool_attr[0] },
78 { "CACHE-ADDR", &bool_attr[0], &bool_attr[0] },
79 { "PC", &bool_attr[0], &bool_attr[0] },
80 { "PROFILE", &bool_attr[0], &bool_attr[0] },
81 { 0, 0, 0 }
84 const CGEN_ATTR_TABLE iq2000_cgen_operand_attr_table[] =
86 { "MACH", & MACH_attr[0], & MACH_attr[0] },
87 { "VIRTUAL", &bool_attr[0], &bool_attr[0] },
88 { "PCREL-ADDR", &bool_attr[0], &bool_attr[0] },
89 { "ABS-ADDR", &bool_attr[0], &bool_attr[0] },
90 { "SIGN-OPT", &bool_attr[0], &bool_attr[0] },
91 { "SIGNED", &bool_attr[0], &bool_attr[0] },
92 { "NEGATIVE", &bool_attr[0], &bool_attr[0] },
93 { "RELAX", &bool_attr[0], &bool_attr[0] },
94 { "SEM-ONLY", &bool_attr[0], &bool_attr[0] },
95 { 0, 0, 0 }
98 const CGEN_ATTR_TABLE iq2000_cgen_insn_attr_table[] =
100 { "MACH", & MACH_attr[0], & MACH_attr[0] },
101 { "ALIAS", &bool_attr[0], &bool_attr[0] },
102 { "VIRTUAL", &bool_attr[0], &bool_attr[0] },
103 { "UNCOND-CTI", &bool_attr[0], &bool_attr[0] },
104 { "COND-CTI", &bool_attr[0], &bool_attr[0] },
105 { "SKIP-CTI", &bool_attr[0], &bool_attr[0] },
106 { "DELAY-SLOT", &bool_attr[0], &bool_attr[0] },
107 { "RELAXABLE", &bool_attr[0], &bool_attr[0] },
108 { "RELAX", &bool_attr[0], &bool_attr[0] },
109 { "NO-DIS", &bool_attr[0], &bool_attr[0] },
110 { "PBB", &bool_attr[0], &bool_attr[0] },
111 { "YIELD-INSN", &bool_attr[0], &bool_attr[0] },
112 { "LOAD-DELAY", &bool_attr[0], &bool_attr[0] },
113 { "EVEN-REG-NUM", &bool_attr[0], &bool_attr[0] },
114 { "UNSUPPORTED", &bool_attr[0], &bool_attr[0] },
115 { "USES-RD", &bool_attr[0], &bool_attr[0] },
116 { "USES-RS", &bool_attr[0], &bool_attr[0] },
117 { "USES-RT", &bool_attr[0], &bool_attr[0] },
118 { "USES-R31", &bool_attr[0], &bool_attr[0] },
119 { 0, 0, 0 }
122 /* Instruction set variants. */
124 static const CGEN_ISA iq2000_cgen_isa_table[] = {
125 { "iq2000", 32, 32, 32, 32 },
126 { 0, 0, 0, 0, 0 }
129 /* Machine variants. */
131 static const CGEN_MACH iq2000_cgen_mach_table[] = {
132 { "iq2000", "iq2000", MACH_IQ2000, 0 },
133 { "iq10", "iq10", MACH_IQ10, 0 },
134 { 0, 0, 0, 0 }
137 static CGEN_KEYWORD_ENTRY iq2000_cgen_opval_gr_names_entries[] =
139 { "r0", 0, {0, {0}}, 0, 0 },
140 { "%0", 0, {0, {0}}, 0, 0 },
141 { "r1", 1, {0, {0}}, 0, 0 },
142 { "%1", 1, {0, {0}}, 0, 0 },
143 { "r2", 2, {0, {0}}, 0, 0 },
144 { "%2", 2, {0, {0}}, 0, 0 },
145 { "r3", 3, {0, {0}}, 0, 0 },
146 { "%3", 3, {0, {0}}, 0, 0 },
147 { "r4", 4, {0, {0}}, 0, 0 },
148 { "%4", 4, {0, {0}}, 0, 0 },
149 { "r5", 5, {0, {0}}, 0, 0 },
150 { "%5", 5, {0, {0}}, 0, 0 },
151 { "r6", 6, {0, {0}}, 0, 0 },
152 { "%6", 6, {0, {0}}, 0, 0 },
153 { "r7", 7, {0, {0}}, 0, 0 },
154 { "%7", 7, {0, {0}}, 0, 0 },
155 { "r8", 8, {0, {0}}, 0, 0 },
156 { "%8", 8, {0, {0}}, 0, 0 },
157 { "r9", 9, {0, {0}}, 0, 0 },
158 { "%9", 9, {0, {0}}, 0, 0 },
159 { "r10", 10, {0, {0}}, 0, 0 },
160 { "%10", 10, {0, {0}}, 0, 0 },
161 { "r11", 11, {0, {0}}, 0, 0 },
162 { "%11", 11, {0, {0}}, 0, 0 },
163 { "r12", 12, {0, {0}}, 0, 0 },
164 { "%12", 12, {0, {0}}, 0, 0 },
165 { "r13", 13, {0, {0}}, 0, 0 },
166 { "%13", 13, {0, {0}}, 0, 0 },
167 { "r14", 14, {0, {0}}, 0, 0 },
168 { "%14", 14, {0, {0}}, 0, 0 },
169 { "r15", 15, {0, {0}}, 0, 0 },
170 { "%15", 15, {0, {0}}, 0, 0 },
171 { "r16", 16, {0, {0}}, 0, 0 },
172 { "%16", 16, {0, {0}}, 0, 0 },
173 { "r17", 17, {0, {0}}, 0, 0 },
174 { "%17", 17, {0, {0}}, 0, 0 },
175 { "r18", 18, {0, {0}}, 0, 0 },
176 { "%18", 18, {0, {0}}, 0, 0 },
177 { "r19", 19, {0, {0}}, 0, 0 },
178 { "%19", 19, {0, {0}}, 0, 0 },
179 { "r20", 20, {0, {0}}, 0, 0 },
180 { "%20", 20, {0, {0}}, 0, 0 },
181 { "r21", 21, {0, {0}}, 0, 0 },
182 { "%21", 21, {0, {0}}, 0, 0 },
183 { "r22", 22, {0, {0}}, 0, 0 },
184 { "%22", 22, {0, {0}}, 0, 0 },
185 { "r23", 23, {0, {0}}, 0, 0 },
186 { "%23", 23, {0, {0}}, 0, 0 },
187 { "r24", 24, {0, {0}}, 0, 0 },
188 { "%24", 24, {0, {0}}, 0, 0 },
189 { "r25", 25, {0, {0}}, 0, 0 },
190 { "%25", 25, {0, {0}}, 0, 0 },
191 { "r26", 26, {0, {0}}, 0, 0 },
192 { "%26", 26, {0, {0}}, 0, 0 },
193 { "r27", 27, {0, {0}}, 0, 0 },
194 { "%27", 27, {0, {0}}, 0, 0 },
195 { "r28", 28, {0, {0}}, 0, 0 },
196 { "%28", 28, {0, {0}}, 0, 0 },
197 { "r29", 29, {0, {0}}, 0, 0 },
198 { "%29", 29, {0, {0}}, 0, 0 },
199 { "r30", 30, {0, {0}}, 0, 0 },
200 { "%30", 30, {0, {0}}, 0, 0 },
201 { "r31", 31, {0, {0}}, 0, 0 },
202 { "%31", 31, {0, {0}}, 0, 0 }
205 CGEN_KEYWORD iq2000_cgen_opval_gr_names =
207 & iq2000_cgen_opval_gr_names_entries[0],
209 0, 0, 0, 0, ""
213 /* The hardware table. */
215 #if defined (__STDC__) || defined (ALMOST_STDC) || defined (HAVE_STRINGIZE)
216 #define A(a) (1 << CGEN_HW_##a)
217 #else
218 #define A(a) (1 << CGEN_HW_/**/a)
219 #endif
221 const CGEN_HW_ENTRY iq2000_cgen_hw_table[] =
223 { "h-memory", HW_H_MEMORY, CGEN_ASM_NONE, 0, { 0, { (1<<MACH_BASE) } } },
224 { "h-sint", HW_H_SINT, CGEN_ASM_NONE, 0, { 0, { (1<<MACH_BASE) } } },
225 { "h-uint", HW_H_UINT, CGEN_ASM_NONE, 0, { 0, { (1<<MACH_BASE) } } },
226 { "h-addr", HW_H_ADDR, CGEN_ASM_NONE, 0, { 0, { (1<<MACH_BASE) } } },
227 { "h-iaddr", HW_H_IADDR, CGEN_ASM_NONE, 0, { 0, { (1<<MACH_BASE) } } },
228 { "h-pc", HW_H_PC, CGEN_ASM_NONE, 0, { 0|A(PROFILE)|A(PC), { (1<<MACH_BASE) } } },
229 { "h-gr", HW_H_GR, CGEN_ASM_KEYWORD, (PTR) & iq2000_cgen_opval_gr_names, { 0, { (1<<MACH_BASE) } } },
230 { 0, 0, CGEN_ASM_NONE, 0, {0, {0}} }
233 #undef A
236 /* The instruction field table. */
238 #if defined (__STDC__) || defined (ALMOST_STDC) || defined (HAVE_STRINGIZE)
239 #define A(a) (1 << CGEN_IFLD_##a)
240 #else
241 #define A(a) (1 << CGEN_IFLD_/**/a)
242 #endif
244 const CGEN_IFLD iq2000_cgen_ifld_table[] =
246 { IQ2000_F_NIL, "f-nil", 0, 0, 0, 0, { 0, { (1<<MACH_BASE) } } },
247 { IQ2000_F_ANYOF, "f-anyof", 0, 0, 0, 0, { 0, { (1<<MACH_BASE) } } },
248 { IQ2000_F_OPCODE, "f-opcode", 0, 32, 31, 6, { 0, { (1<<MACH_BASE) } } },
249 { IQ2000_F_RS, "f-rs", 0, 32, 25, 5, { 0, { (1<<MACH_BASE) } } },
250 { IQ2000_F_RT, "f-rt", 0, 32, 20, 5, { 0, { (1<<MACH_BASE) } } },
251 { IQ2000_F_RD, "f-rd", 0, 32, 15, 5, { 0, { (1<<MACH_BASE) } } },
252 { IQ2000_F_SHAMT, "f-shamt", 0, 32, 10, 5, { 0, { (1<<MACH_BASE) } } },
253 { IQ2000_F_CP_OP, "f-cp-op", 0, 32, 10, 3, { 0, { (1<<MACH_BASE) } } },
254 { IQ2000_F_CP_OP_10, "f-cp-op-10", 0, 32, 10, 5, { 0, { (1<<MACH_BASE) } } },
255 { IQ2000_F_CP_GRP, "f-cp-grp", 0, 32, 7, 2, { 0, { (1<<MACH_BASE) } } },
256 { IQ2000_F_FUNC, "f-func", 0, 32, 5, 6, { 0, { (1<<MACH_BASE) } } },
257 { IQ2000_F_IMM, "f-imm", 0, 32, 15, 16, { 0, { (1<<MACH_BASE) } } },
258 { IQ2000_F_JTARG, "f-jtarg", 0, 32, 15, 16, { 0|A(ABS_ADDR), { (1<<MACH_BASE) } } },
259 { IQ2000_F_JTARGQ10, "f-jtargq10", 0, 32, 20, 21, { 0|A(ABS_ADDR), { (1<<MACH_BASE) } } },
260 { IQ2000_F_OFFSET, "f-offset", 0, 32, 15, 16, { 0|A(PCREL_ADDR), { (1<<MACH_BASE) } } },
261 { IQ2000_F_COUNT, "f-count", 0, 32, 15, 7, { 0, { (1<<MACH_BASE) } } },
262 { IQ2000_F_BYTECOUNT, "f-bytecount", 0, 32, 7, 8, { 0, { (1<<MACH_BASE) } } },
263 { IQ2000_F_INDEX, "f-index", 0, 32, 8, 9, { 0, { (1<<MACH_BASE) } } },
264 { IQ2000_F_MASK, "f-mask", 0, 32, 9, 4, { 0, { (1<<MACH_BASE) } } },
265 { IQ2000_F_MASKQ10, "f-maskq10", 0, 32, 10, 5, { 0, { (1<<MACH_BASE) } } },
266 { IQ2000_F_MASKL, "f-maskl", 0, 32, 4, 5, { 0, { (1<<MACH_BASE) } } },
267 { IQ2000_F_EXCODE, "f-excode", 0, 32, 25, 20, { 0, { (1<<MACH_BASE) } } },
268 { IQ2000_F_RSRVD, "f-rsrvd", 0, 32, 25, 10, { 0, { (1<<MACH_BASE) } } },
269 { IQ2000_F_10_11, "f-10-11", 0, 32, 10, 11, { 0, { (1<<MACH_BASE) } } },
270 { IQ2000_F_24_19, "f-24-19", 0, 32, 24, 19, { 0, { (1<<MACH_BASE) } } },
271 { IQ2000_F_5, "f-5", 0, 32, 5, 1, { 0, { (1<<MACH_BASE) } } },
272 { IQ2000_F_10, "f-10", 0, 32, 10, 1, { 0, { (1<<MACH_BASE) } } },
273 { IQ2000_F_25, "f-25", 0, 32, 25, 1, { 0, { (1<<MACH_BASE) } } },
274 { IQ2000_F_CAM_Z, "f-cam-z", 0, 32, 5, 3, { 0, { (1<<MACH_BASE) } } },
275 { IQ2000_F_CAM_Y, "f-cam-y", 0, 32, 2, 3, { 0, { (1<<MACH_BASE) } } },
276 { IQ2000_F_CM_3FUNC, "f-cm-3func", 0, 32, 5, 3, { 0, { (1<<MACH_BASE) } } },
277 { IQ2000_F_CM_4FUNC, "f-cm-4func", 0, 32, 5, 4, { 0, { (1<<MACH_BASE) } } },
278 { IQ2000_F_CM_3Z, "f-cm-3z", 0, 32, 1, 2, { 0, { (1<<MACH_BASE) } } },
279 { IQ2000_F_CM_4Z, "f-cm-4z", 0, 32, 2, 3, { 0, { (1<<MACH_BASE) } } },
280 { 0, 0, 0, 0, 0, 0, {0, {0}} }
283 #undef A
287 /* multi ifield declarations */
289 const CGEN_MAYBE_MULTI_IFLD IQ2000_F_RD_RS_MULTI_IFIELD [];
290 const CGEN_MAYBE_MULTI_IFLD IQ2000_F_RD_RT_MULTI_IFIELD [];
291 const CGEN_MAYBE_MULTI_IFLD IQ2000_F_RT_RS_MULTI_IFIELD [];
294 /* multi ifield definitions */
296 const CGEN_MAYBE_MULTI_IFLD IQ2000_F_RD_RS_MULTI_IFIELD [] =
298 { 0, { (void *) &(iq2000_cgen_ifld_table[5])} },
299 { 0, { (void *) &(iq2000_cgen_ifld_table[3])} },
300 {0,{0}}
302 const CGEN_MAYBE_MULTI_IFLD IQ2000_F_RD_RT_MULTI_IFIELD [] =
304 { 0, { (void *) &(iq2000_cgen_ifld_table[5])} },
305 { 0, { (void *) &(iq2000_cgen_ifld_table[4])} },
306 {0,{0}}
308 const CGEN_MAYBE_MULTI_IFLD IQ2000_F_RT_RS_MULTI_IFIELD [] =
310 { 0, { (void *) &(iq2000_cgen_ifld_table[4])} },
311 { 0, { (void *) &(iq2000_cgen_ifld_table[3])} },
312 {0,{0}}
315 /* The operand table. */
317 #if defined (__STDC__) || defined (ALMOST_STDC) || defined (HAVE_STRINGIZE)
318 #define A(a) (1 << CGEN_OPERAND_##a)
319 #else
320 #define A(a) (1 << CGEN_OPERAND_/**/a)
321 #endif
322 #if defined (__STDC__) || defined (ALMOST_STDC) || defined (HAVE_STRINGIZE)
323 #define OPERAND(op) IQ2000_OPERAND_##op
324 #else
325 #define OPERAND(op) IQ2000_OPERAND_/**/op
326 #endif
328 const CGEN_OPERAND iq2000_cgen_operand_table[] =
330 /* pc: program counter */
331 { "pc", IQ2000_OPERAND_PC, HW_H_PC, 0, 0,
332 { 0, { (void *) &(iq2000_cgen_ifld_table[0])} },
333 { 0|A(SEM_ONLY), { (1<<MACH_BASE) } } },
334 /* rs: register Rs */
335 { "rs", IQ2000_OPERAND_RS, HW_H_GR, 25, 5,
336 { 0, { (void *) &(iq2000_cgen_ifld_table[3])} },
337 { 0, { (1<<MACH_BASE) } } },
338 /* rt: register Rt */
339 { "rt", IQ2000_OPERAND_RT, HW_H_GR, 20, 5,
340 { 0, { (void *) &(iq2000_cgen_ifld_table[4])} },
341 { 0, { (1<<MACH_BASE) } } },
342 /* rd: register Rd */
343 { "rd", IQ2000_OPERAND_RD, HW_H_GR, 15, 5,
344 { 0, { (void *) &(iq2000_cgen_ifld_table[5])} },
345 { 0, { (1<<MACH_BASE) } } },
346 /* rd-rs: register Rd from Rs */
347 { "rd-rs", IQ2000_OPERAND_RD_RS, HW_H_GR, 15, 10,
348 { 2, { (void *) &(IQ2000_F_RD_RS_MULTI_IFIELD[0])} },
349 { 0|A(VIRTUAL), { (1<<MACH_BASE) } } },
350 /* rd-rt: register Rd from Rt */
351 { "rd-rt", IQ2000_OPERAND_RD_RT, HW_H_GR, 15, 10,
352 { 2, { (void *) &(IQ2000_F_RD_RT_MULTI_IFIELD[0])} },
353 { 0|A(VIRTUAL), { (1<<MACH_BASE) } } },
354 /* rt-rs: register Rt from Rs */
355 { "rt-rs", IQ2000_OPERAND_RT_RS, HW_H_GR, 20, 10,
356 { 2, { (void *) &(IQ2000_F_RT_RS_MULTI_IFIELD[0])} },
357 { 0|A(VIRTUAL), { (1<<MACH_BASE) } } },
358 /* shamt: shift amount */
359 { "shamt", IQ2000_OPERAND_SHAMT, HW_H_UINT, 10, 5,
360 { 0, { (void *) &(iq2000_cgen_ifld_table[6])} },
361 { 0, { (1<<MACH_BASE) } } },
362 /* imm: immediate */
363 { "imm", IQ2000_OPERAND_IMM, HW_H_UINT, 15, 16,
364 { 0, { (void *) &(iq2000_cgen_ifld_table[11])} },
365 { 0, { (1<<MACH_BASE) } } },
366 /* offset: pc-relative offset */
367 { "offset", IQ2000_OPERAND_OFFSET, HW_H_IADDR, 15, 16,
368 { 0, { (void *) &(iq2000_cgen_ifld_table[14])} },
369 { 0|A(PCREL_ADDR), { (1<<MACH_BASE) } } },
370 /* baseoff: base register offset */
371 { "baseoff", IQ2000_OPERAND_BASEOFF, HW_H_IADDR, 15, 16,
372 { 0, { (void *) &(iq2000_cgen_ifld_table[11])} },
373 { 0, { (1<<MACH_BASE) } } },
374 /* jmptarg: jump target */
375 { "jmptarg", IQ2000_OPERAND_JMPTARG, HW_H_IADDR, 15, 16,
376 { 0, { (void *) &(iq2000_cgen_ifld_table[12])} },
377 { 0|A(ABS_ADDR), { (1<<MACH_BASE) } } },
378 /* mask: mask */
379 { "mask", IQ2000_OPERAND_MASK, HW_H_UINT, 9, 4,
380 { 0, { (void *) &(iq2000_cgen_ifld_table[18])} },
381 { 0, { (1<<MACH_BASE) } } },
382 /* maskq10: iq10 mask */
383 { "maskq10", IQ2000_OPERAND_MASKQ10, HW_H_UINT, 10, 5,
384 { 0, { (void *) &(iq2000_cgen_ifld_table[19])} },
385 { 0, { (1<<MACH_BASE) } } },
386 /* maskl: mask left */
387 { "maskl", IQ2000_OPERAND_MASKL, HW_H_UINT, 4, 5,
388 { 0, { (void *) &(iq2000_cgen_ifld_table[20])} },
389 { 0, { (1<<MACH_BASE) } } },
390 /* count: count */
391 { "count", IQ2000_OPERAND_COUNT, HW_H_UINT, 15, 7,
392 { 0, { (void *) &(iq2000_cgen_ifld_table[15])} },
393 { 0, { (1<<MACH_BASE) } } },
394 /* index: index */
395 { "index", IQ2000_OPERAND_INDEX, HW_H_UINT, 8, 9,
396 { 0, { (void *) &(iq2000_cgen_ifld_table[17])} },
397 { 0, { (1<<MACH_BASE) } } },
398 /* execode: execcode */
399 { "execode", IQ2000_OPERAND_EXECODE, HW_H_UINT, 25, 20,
400 { 0, { (void *) &(iq2000_cgen_ifld_table[21])} },
401 { 0, { (1<<MACH_BASE) } } },
402 /* bytecount: byte count */
403 { "bytecount", IQ2000_OPERAND_BYTECOUNT, HW_H_UINT, 7, 8,
404 { 0, { (void *) &(iq2000_cgen_ifld_table[16])} },
405 { 0, { (1<<MACH_BASE) } } },
406 /* cam-y: cam global opn y */
407 { "cam-y", IQ2000_OPERAND_CAM_Y, HW_H_UINT, 2, 3,
408 { 0, { (void *) &(iq2000_cgen_ifld_table[29])} },
409 { 0, { (1<<MACH_BASE) } } },
410 /* cam-z: cam global mask z */
411 { "cam-z", IQ2000_OPERAND_CAM_Z, HW_H_UINT, 5, 3,
412 { 0, { (void *) &(iq2000_cgen_ifld_table[28])} },
413 { 0, { (1<<MACH_BASE) } } },
414 /* cm-3func: CM 3 bit fn field */
415 { "cm-3func", IQ2000_OPERAND_CM_3FUNC, HW_H_UINT, 5, 3,
416 { 0, { (void *) &(iq2000_cgen_ifld_table[30])} },
417 { 0, { (1<<MACH_BASE) } } },
418 /* cm-4func: CM 4 bit fn field */
419 { "cm-4func", IQ2000_OPERAND_CM_4FUNC, HW_H_UINT, 5, 4,
420 { 0, { (void *) &(iq2000_cgen_ifld_table[31])} },
421 { 0, { (1<<MACH_BASE) } } },
422 /* cm-3z: CM 3 bit Z field */
423 { "cm-3z", IQ2000_OPERAND_CM_3Z, HW_H_UINT, 1, 2,
424 { 0, { (void *) &(iq2000_cgen_ifld_table[32])} },
425 { 0, { (1<<MACH_BASE) } } },
426 /* cm-4z: CM 4 bit Z field */
427 { "cm-4z", IQ2000_OPERAND_CM_4Z, HW_H_UINT, 2, 3,
428 { 0, { (void *) &(iq2000_cgen_ifld_table[33])} },
429 { 0, { (1<<MACH_BASE) } } },
430 /* base: base register */
431 { "base", IQ2000_OPERAND_BASE, HW_H_GR, 25, 5,
432 { 0, { (void *) &(iq2000_cgen_ifld_table[3])} },
433 { 0, { (1<<MACH_BASE) } } },
434 /* maskr: mask right */
435 { "maskr", IQ2000_OPERAND_MASKR, HW_H_UINT, 25, 5,
436 { 0, { (void *) &(iq2000_cgen_ifld_table[3])} },
437 { 0, { (1<<MACH_BASE) } } },
438 /* bitnum: bit number */
439 { "bitnum", IQ2000_OPERAND_BITNUM, HW_H_UINT, 20, 5,
440 { 0, { (void *) &(iq2000_cgen_ifld_table[4])} },
441 { 0, { (1<<MACH_BASE) } } },
442 /* hi16: high 16 bit immediate */
443 { "hi16", IQ2000_OPERAND_HI16, HW_H_UINT, 15, 16,
444 { 0, { (void *) &(iq2000_cgen_ifld_table[11])} },
445 { 0, { (1<<MACH_BASE) } } },
446 /* lo16: 16 bit signed immediate, for low */
447 { "lo16", IQ2000_OPERAND_LO16, HW_H_UINT, 15, 16,
448 { 0, { (void *) &(iq2000_cgen_ifld_table[11])} },
449 { 0, { (1<<MACH_BASE) } } },
450 /* mlo16: negated 16 bit signed immediate */
451 { "mlo16", IQ2000_OPERAND_MLO16, HW_H_UINT, 15, 16,
452 { 0, { (void *) &(iq2000_cgen_ifld_table[11])} },
453 { 0, { (1<<MACH_BASE) } } },
454 /* jmptargq10: iq10 21-bit jump offset */
455 { "jmptargq10", IQ2000_OPERAND_JMPTARGQ10, HW_H_IADDR, 20, 21,
456 { 0, { (void *) &(iq2000_cgen_ifld_table[13])} },
457 { 0|A(ABS_ADDR), { (1<<MACH_BASE) } } },
458 { 0, 0, 0, 0, 0, {0, {0}}, {0, {0}} }
461 #undef A
464 /* The instruction table. */
466 #define OP(field) CGEN_SYNTAX_MAKE_FIELD (OPERAND (field))
467 #if defined (__STDC__) || defined (ALMOST_STDC) || defined (HAVE_STRINGIZE)
468 #define A(a) (1 << CGEN_INSN_##a)
469 #else
470 #define A(a) (1 << CGEN_INSN_/**/a)
471 #endif
473 static const CGEN_IBASE iq2000_cgen_insn_table[MAX_INSNS] =
475 /* Special null first entry.
476 A `num' value of zero is thus invalid.
477 Also, the special `invalid' insn resides here. */
478 { 0, 0, 0, 0, {0, {0}} },
479 /* add ${rd-rs},$rt */
481 -1, "add2", "add", 32,
482 { 0|A(USES_RT)|A(USES_RS)|A(USES_RD)|A(NO_DIS)|A(ALIAS), { (1<<MACH_BASE) } }
484 /* add $rd,$rs,$rt */
486 IQ2000_INSN_ADD, "add", "add", 32,
487 { 0|A(USES_RT)|A(USES_RS)|A(USES_RD), { (1<<MACH_BASE) } }
489 /* addi ${rt-rs},$lo16 */
491 -1, "addi2", "addi", 32,
492 { 0|A(USES_RT)|A(USES_RS)|A(NO_DIS)|A(ALIAS), { (1<<MACH_BASE) } }
494 /* addi $rt,$rs,$lo16 */
496 IQ2000_INSN_ADDI, "addi", "addi", 32,
497 { 0|A(USES_RT)|A(USES_RS), { (1<<MACH_BASE) } }
499 /* addiu ${rt-rs},$lo16 */
501 -1, "addiu2", "addiu", 32,
502 { 0|A(USES_RT)|A(USES_RS)|A(NO_DIS)|A(ALIAS), { (1<<MACH_BASE) } }
504 /* addiu $rt,$rs,$lo16 */
506 IQ2000_INSN_ADDIU, "addiu", "addiu", 32,
507 { 0|A(USES_RT)|A(USES_RS), { (1<<MACH_BASE) } }
509 /* addu ${rd-rs},$rt */
511 -1, "addu2", "addu", 32,
512 { 0|A(USES_RT)|A(USES_RS)|A(USES_RD)|A(NO_DIS)|A(ALIAS), { (1<<MACH_BASE) } }
514 /* addu $rd,$rs,$rt */
516 IQ2000_INSN_ADDU, "addu", "addu", 32,
517 { 0|A(USES_RT)|A(USES_RS)|A(USES_RD), { (1<<MACH_BASE) } }
519 /* ado16 ${rd-rs},$rt */
521 -1, "ado162", "ado16", 32,
522 { 0|A(USES_RT)|A(USES_RS)|A(USES_RD)|A(NO_DIS)|A(ALIAS), { (1<<MACH_BASE) } }
524 /* ado16 $rd,$rs,$rt */
526 IQ2000_INSN_ADO16, "ado16", "ado16", 32,
527 { 0|A(USES_RT)|A(USES_RS)|A(USES_RD), { (1<<MACH_BASE) } }
529 /* and ${rd-rs},$rt */
531 -1, "and2", "and", 32,
532 { 0|A(USES_RT)|A(USES_RS)|A(USES_RD)|A(NO_DIS)|A(ALIAS), { (1<<MACH_BASE) } }
534 /* and $rd,$rs,$rt */
536 IQ2000_INSN_AND, "and", "and", 32,
537 { 0|A(USES_RT)|A(USES_RS)|A(USES_RD), { (1<<MACH_BASE) } }
539 /* andi ${rt-rs},$lo16 */
541 -1, "andi2", "andi", 32,
542 { 0|A(USES_RT)|A(USES_RS)|A(NO_DIS)|A(ALIAS), { (1<<MACH_BASE) } }
544 /* andi $rt,$rs,$lo16 */
546 IQ2000_INSN_ANDI, "andi", "andi", 32,
547 { 0|A(USES_RT)|A(USES_RS), { (1<<MACH_BASE) } }
549 /* andoi ${rt-rs},$lo16 */
551 -1, "andoi2", "andoi", 32,
552 { 0|A(USES_RT)|A(USES_RS)|A(NO_DIS)|A(ALIAS), { (1<<MACH_BASE) } }
554 /* andoi $rt,$rs,$lo16 */
556 IQ2000_INSN_ANDOI, "andoi", "andoi", 32,
557 { 0|A(USES_RT)|A(USES_RS), { (1<<MACH_BASE) } }
559 /* nor ${rd-rs},$rt */
561 -1, "nor2", "nor", 32,
562 { 0|A(USES_RT)|A(USES_RS)|A(USES_RD)|A(NO_DIS)|A(ALIAS), { (1<<MACH_BASE) } }
564 /* nor $rd,$rs,$rt */
566 IQ2000_INSN_NOR, "nor", "nor", 32,
567 { 0|A(USES_RT)|A(USES_RS)|A(USES_RD), { (1<<MACH_BASE) } }
569 /* or ${rd-rs},$rt */
571 -1, "or2", "or", 32,
572 { 0|A(USES_RT)|A(USES_RS)|A(USES_RD)|A(NO_DIS)|A(ALIAS), { (1<<MACH_BASE) } }
574 /* or $rd,$rs,$rt */
576 IQ2000_INSN_OR, "or", "or", 32,
577 { 0|A(USES_RT)|A(USES_RS)|A(USES_RD), { (1<<MACH_BASE) } }
579 /* ori ${rt-rs},$lo16 */
581 -1, "ori2", "ori", 32,
582 { 0|A(USES_RT)|A(USES_RS)|A(NO_DIS)|A(ALIAS), { (1<<MACH_BASE) } }
584 /* ori $rt,$rs,$lo16 */
586 IQ2000_INSN_ORI, "ori", "ori", 32,
587 { 0|A(USES_RT)|A(USES_RS), { (1<<MACH_BASE) } }
589 /* ram $rd,$rt,$shamt,$maskl,$maskr */
591 IQ2000_INSN_RAM, "ram", "ram", 32,
592 { 0|A(USES_RT)|A(USES_RD), { (1<<MACH_BASE) } }
594 /* sll $rd,$rt,$shamt */
596 IQ2000_INSN_SLL, "sll", "sll", 32,
597 { 0|A(USES_RT)|A(USES_RD), { (1<<MACH_BASE) } }
599 /* sllv ${rd-rt},$rs */
601 -1, "sllv2", "sllv", 32,
602 { 0|A(USES_RT)|A(USES_RS)|A(USES_RD)|A(NO_DIS)|A(ALIAS), { (1<<MACH_BASE) } }
604 /* sllv $rd,$rt,$rs */
606 IQ2000_INSN_SLLV, "sllv", "sllv", 32,
607 { 0|A(USES_RT)|A(USES_RS)|A(USES_RD), { (1<<MACH_BASE) } }
609 /* slmv ${rd-rt},$rs,$shamt */
611 -1, "slmv2", "slmv", 32,
612 { 0|A(USES_RT)|A(USES_RS)|A(USES_RD)|A(NO_DIS)|A(ALIAS), { (1<<MACH_BASE) } }
614 /* slmv $rd,$rt,$rs,$shamt */
616 IQ2000_INSN_SLMV, "slmv", "slmv", 32,
617 { 0|A(USES_RT)|A(USES_RS)|A(USES_RD), { (1<<MACH_BASE) } }
619 /* slt ${rd-rs},$rt */
621 -1, "slt2", "slt", 32,
622 { 0|A(USES_RT)|A(USES_RS)|A(USES_RD)|A(NO_DIS)|A(ALIAS), { (1<<MACH_BASE) } }
624 /* slt $rd,$rs,$rt */
626 IQ2000_INSN_SLT, "slt", "slt", 32,
627 { 0|A(USES_RT)|A(USES_RS)|A(USES_RD), { (1<<MACH_BASE) } }
629 /* slti ${rt-rs},$imm */
631 -1, "slti2", "slti", 32,
632 { 0|A(USES_RT)|A(USES_RS)|A(NO_DIS)|A(ALIAS), { (1<<MACH_BASE) } }
634 /* slti $rt,$rs,$imm */
636 IQ2000_INSN_SLTI, "slti", "slti", 32,
637 { 0|A(USES_RT)|A(USES_RS), { (1<<MACH_BASE) } }
639 /* sltiu ${rt-rs},$imm */
641 -1, "sltiu2", "sltiu", 32,
642 { 0|A(USES_RT)|A(USES_RS)|A(NO_DIS)|A(ALIAS), { (1<<MACH_BASE) } }
644 /* sltiu $rt,$rs,$imm */
646 IQ2000_INSN_SLTIU, "sltiu", "sltiu", 32,
647 { 0|A(USES_RT)|A(USES_RS), { (1<<MACH_BASE) } }
649 /* sltu ${rd-rs},$rt */
651 -1, "sltu2", "sltu", 32,
652 { 0|A(USES_RT)|A(USES_RS)|A(USES_RD)|A(NO_DIS)|A(ALIAS), { (1<<MACH_BASE) } }
654 /* sltu $rd,$rs,$rt */
656 IQ2000_INSN_SLTU, "sltu", "sltu", 32,
657 { 0|A(USES_RT)|A(USES_RS)|A(USES_RD), { (1<<MACH_BASE) } }
659 /* sra ${rd-rt},$shamt */
661 -1, "sra2", "sra", 32,
662 { 0|A(USES_RT)|A(USES_RD)|A(NO_DIS)|A(ALIAS), { (1<<MACH_BASE) } }
664 /* sra $rd,$rt,$shamt */
666 IQ2000_INSN_SRA, "sra", "sra", 32,
667 { 0|A(USES_RT)|A(USES_RD), { (1<<MACH_BASE) } }
669 /* srav ${rd-rt},$rs */
671 -1, "srav2", "srav", 32,
672 { 0|A(USES_RT)|A(USES_RS)|A(USES_RD)|A(NO_DIS)|A(ALIAS), { (1<<MACH_BASE) } }
674 /* srav $rd,$rt,$rs */
676 IQ2000_INSN_SRAV, "srav", "srav", 32,
677 { 0|A(USES_RT)|A(USES_RS)|A(USES_RD), { (1<<MACH_BASE) } }
679 /* srl $rd,$rt,$shamt */
681 IQ2000_INSN_SRL, "srl", "srl", 32,
682 { 0|A(USES_RT)|A(USES_RD), { (1<<MACH_BASE) } }
684 /* srlv ${rd-rt},$rs */
686 -1, "srlv2", "srlv", 32,
687 { 0|A(USES_RT)|A(USES_RS)|A(USES_RD)|A(NO_DIS)|A(ALIAS), { (1<<MACH_BASE) } }
689 /* srlv $rd,$rt,$rs */
691 IQ2000_INSN_SRLV, "srlv", "srlv", 32,
692 { 0|A(USES_RT)|A(USES_RS)|A(USES_RD), { (1<<MACH_BASE) } }
694 /* srmv ${rd-rt},$rs,$shamt */
696 -1, "srmv2", "srmv", 32,
697 { 0|A(USES_RT)|A(USES_RS)|A(USES_RD)|A(NO_DIS)|A(ALIAS), { (1<<MACH_BASE) } }
699 /* srmv $rd,$rt,$rs,$shamt */
701 IQ2000_INSN_SRMV, "srmv", "srmv", 32,
702 { 0|A(USES_RT)|A(USES_RS)|A(USES_RD), { (1<<MACH_BASE) } }
704 /* sub ${rd-rs},$rt */
706 -1, "sub2", "sub", 32,
707 { 0|A(USES_RT)|A(USES_RS)|A(USES_RD)|A(NO_DIS)|A(ALIAS), { (1<<MACH_BASE) } }
709 /* sub $rd,$rs,$rt */
711 IQ2000_INSN_SUB, "sub", "sub", 32,
712 { 0|A(USES_RT)|A(USES_RS)|A(USES_RD), { (1<<MACH_BASE) } }
714 /* subu ${rd-rs},$rt */
716 -1, "subu2", "subu", 32,
717 { 0|A(USES_RT)|A(USES_RS)|A(USES_RD)|A(NO_DIS)|A(ALIAS), { (1<<MACH_BASE) } }
719 /* subu $rd,$rs,$rt */
721 IQ2000_INSN_SUBU, "subu", "subu", 32,
722 { 0|A(USES_RT)|A(USES_RS)|A(USES_RD), { (1<<MACH_BASE) } }
724 /* xor ${rd-rs},$rt */
726 -1, "xor2", "xor", 32,
727 { 0|A(USES_RT)|A(USES_RS)|A(USES_RD)|A(NO_DIS)|A(ALIAS), { (1<<MACH_BASE) } }
729 /* xor $rd,$rs,$rt */
731 IQ2000_INSN_XOR, "xor", "xor", 32,
732 { 0|A(USES_RT)|A(USES_RS)|A(USES_RD), { (1<<MACH_BASE) } }
734 /* xori ${rt-rs},$lo16 */
736 -1, "xori2", "xori", 32,
737 { 0|A(USES_RT)|A(USES_RS)|A(NO_DIS)|A(ALIAS), { (1<<MACH_BASE) } }
739 /* xori $rt,$rs,$lo16 */
741 IQ2000_INSN_XORI, "xori", "xori", 32,
742 { 0|A(USES_RT)|A(USES_RS), { (1<<MACH_BASE) } }
744 /* bbi $rs($bitnum),$offset */
746 IQ2000_INSN_BBI, "bbi", "bbi", 32,
747 { 0|A(USES_RS)|A(COND_CTI)|A(DELAY_SLOT), { (1<<MACH_BASE) } }
749 /* bbin $rs($bitnum),$offset */
751 IQ2000_INSN_BBIN, "bbin", "bbin", 32,
752 { 0|A(USES_RS)|A(COND_CTI)|A(DELAY_SLOT), { (1<<MACH_BASE) } }
754 /* bbv $rs,$rt,$offset */
756 IQ2000_INSN_BBV, "bbv", "bbv", 32,
757 { 0|A(USES_RT)|A(USES_RS)|A(COND_CTI)|A(DELAY_SLOT), { (1<<MACH_BASE) } }
759 /* bbvn $rs,$rt,$offset */
761 IQ2000_INSN_BBVN, "bbvn", "bbvn", 32,
762 { 0|A(USES_RT)|A(USES_RS)|A(COND_CTI)|A(DELAY_SLOT), { (1<<MACH_BASE) } }
764 /* beq $rs,$rt,$offset */
766 IQ2000_INSN_BEQ, "beq", "beq", 32,
767 { 0|A(USES_RT)|A(USES_RS)|A(COND_CTI)|A(DELAY_SLOT), { (1<<MACH_BASE) } }
769 /* beql $rs,$rt,$offset */
771 IQ2000_INSN_BEQL, "beql", "beql", 32,
772 { 0|A(USES_RT)|A(USES_RS)|A(SKIP_CTI)|A(COND_CTI)|A(DELAY_SLOT), { (1<<MACH_BASE) } }
774 /* bgez $rs,$offset */
776 IQ2000_INSN_BGEZ, "bgez", "bgez", 32,
777 { 0|A(USES_RS)|A(COND_CTI)|A(DELAY_SLOT), { (1<<MACH_BASE) } }
779 /* bgezal $rs,$offset */
781 IQ2000_INSN_BGEZAL, "bgezal", "bgezal", 32,
782 { 0|A(USES_R31)|A(USES_RS)|A(COND_CTI)|A(DELAY_SLOT), { (1<<MACH_BASE) } }
784 /* bgezall $rs,$offset */
786 IQ2000_INSN_BGEZALL, "bgezall", "bgezall", 32,
787 { 0|A(USES_R31)|A(USES_RS)|A(SKIP_CTI)|A(COND_CTI)|A(DELAY_SLOT), { (1<<MACH_BASE) } }
789 /* bgezl $rs,$offset */
791 IQ2000_INSN_BGEZL, "bgezl", "bgezl", 32,
792 { 0|A(USES_RS)|A(SKIP_CTI)|A(COND_CTI)|A(DELAY_SLOT), { (1<<MACH_BASE) } }
794 /* bltz $rs,$offset */
796 IQ2000_INSN_BLTZ, "bltz", "bltz", 32,
797 { 0|A(USES_RS)|A(COND_CTI)|A(DELAY_SLOT), { (1<<MACH_BASE) } }
799 /* bltzl $rs,$offset */
801 IQ2000_INSN_BLTZL, "bltzl", "bltzl", 32,
802 { 0|A(USES_RS)|A(SKIP_CTI)|A(COND_CTI)|A(DELAY_SLOT), { (1<<MACH_BASE) } }
804 /* bltzal $rs,$offset */
806 IQ2000_INSN_BLTZAL, "bltzal", "bltzal", 32,
807 { 0|A(USES_R31)|A(USES_RS)|A(COND_CTI)|A(DELAY_SLOT), { (1<<MACH_BASE) } }
809 /* bltzall $rs,$offset */
811 IQ2000_INSN_BLTZALL, "bltzall", "bltzall", 32,
812 { 0|A(USES_R31)|A(USES_RS)|A(SKIP_CTI)|A(COND_CTI)|A(DELAY_SLOT), { (1<<MACH_BASE) } }
814 /* bmb0 $rs,$rt,$offset */
816 IQ2000_INSN_BMB0, "bmb0", "bmb0", 32,
817 { 0|A(USES_RT)|A(USES_RS)|A(COND_CTI)|A(DELAY_SLOT), { (1<<MACH_BASE) } }
819 /* bmb1 $rs,$rt,$offset */
821 IQ2000_INSN_BMB1, "bmb1", "bmb1", 32,
822 { 0|A(USES_RT)|A(USES_RS)|A(COND_CTI)|A(DELAY_SLOT), { (1<<MACH_BASE) } }
824 /* bmb2 $rs,$rt,$offset */
826 IQ2000_INSN_BMB2, "bmb2", "bmb2", 32,
827 { 0|A(USES_RT)|A(USES_RS)|A(COND_CTI)|A(DELAY_SLOT), { (1<<MACH_BASE) } }
829 /* bmb3 $rs,$rt,$offset */
831 IQ2000_INSN_BMB3, "bmb3", "bmb3", 32,
832 { 0|A(USES_RT)|A(USES_RS)|A(COND_CTI)|A(DELAY_SLOT), { (1<<MACH_BASE) } }
834 /* bne $rs,$rt,$offset */
836 IQ2000_INSN_BNE, "bne", "bne", 32,
837 { 0|A(USES_RT)|A(USES_RS)|A(COND_CTI)|A(DELAY_SLOT), { (1<<MACH_BASE) } }
839 /* bnel $rs,$rt,$offset */
841 IQ2000_INSN_BNEL, "bnel", "bnel", 32,
842 { 0|A(USES_RT)|A(USES_RS)|A(SKIP_CTI)|A(COND_CTI)|A(DELAY_SLOT), { (1<<MACH_BASE) } }
844 /* jalr $rd,$rs */
846 IQ2000_INSN_JALR, "jalr", "jalr", 32,
847 { 0|A(USES_RS)|A(USES_RD)|A(UNCOND_CTI)|A(DELAY_SLOT), { (1<<MACH_BASE) } }
849 /* jr $rs */
851 IQ2000_INSN_JR, "jr", "jr", 32,
852 { 0|A(USES_RS)|A(UNCOND_CTI)|A(DELAY_SLOT), { (1<<MACH_BASE) } }
854 /* lb $rt,$lo16($base) */
856 IQ2000_INSN_LB, "lb", "lb", 32,
857 { 0|A(USES_RT)|A(USES_RS)|A(LOAD_DELAY), { (1<<MACH_BASE) } }
859 /* lbu $rt,$lo16($base) */
861 IQ2000_INSN_LBU, "lbu", "lbu", 32,
862 { 0|A(USES_RT)|A(USES_RS)|A(LOAD_DELAY), { (1<<MACH_BASE) } }
864 /* lh $rt,$lo16($base) */
866 IQ2000_INSN_LH, "lh", "lh", 32,
867 { 0|A(USES_RT)|A(USES_RS)|A(LOAD_DELAY), { (1<<MACH_BASE) } }
869 /* lhu $rt,$lo16($base) */
871 IQ2000_INSN_LHU, "lhu", "lhu", 32,
872 { 0|A(USES_RT)|A(USES_RS)|A(LOAD_DELAY), { (1<<MACH_BASE) } }
874 /* lui $rt,$hi16 */
876 IQ2000_INSN_LUI, "lui", "lui", 32,
877 { 0|A(USES_RT), { (1<<MACH_BASE) } }
879 /* lw $rt,$lo16($base) */
881 IQ2000_INSN_LW, "lw", "lw", 32,
882 { 0|A(USES_RT)|A(USES_RS)|A(LOAD_DELAY), { (1<<MACH_BASE) } }
884 /* sb $rt,$lo16($base) */
886 IQ2000_INSN_SB, "sb", "sb", 32,
887 { 0|A(USES_RT)|A(USES_RS), { (1<<MACH_BASE) } }
889 /* sh $rt,$lo16($base) */
891 IQ2000_INSN_SH, "sh", "sh", 32,
892 { 0|A(USES_RT)|A(USES_RS), { (1<<MACH_BASE) } }
894 /* sw $rt,$lo16($base) */
896 IQ2000_INSN_SW, "sw", "sw", 32,
897 { 0|A(USES_RT)|A(USES_RS), { (1<<MACH_BASE) } }
899 /* break */
901 IQ2000_INSN_BREAK, "break", "break", 32,
902 { 0, { (1<<MACH_BASE) } }
904 /* syscall */
906 IQ2000_INSN_SYSCALL, "syscall", "syscall", 32,
907 { 0|A(YIELD_INSN), { (1<<MACH_BASE) } }
909 /* andoui $rt,$rs,$hi16 */
911 IQ2000_INSN_ANDOUI, "andoui", "andoui", 32,
912 { 0|A(USES_RT)|A(USES_RS), { (1<<MACH_IQ2000) } }
914 /* andoui ${rt-rs},$hi16 */
916 -1, "andoui2", "andoui", 32,
917 { 0|A(USES_RT)|A(USES_RS)|A(NO_DIS)|A(ALIAS), { (1<<MACH_IQ2000) } }
919 /* orui ${rt-rs},$hi16 */
921 -1, "orui2", "orui", 32,
922 { 0|A(USES_RT)|A(USES_RS)|A(NO_DIS)|A(ALIAS), { (1<<MACH_IQ2000) } }
924 /* orui $rt,$rs,$hi16 */
926 IQ2000_INSN_ORUI, "orui", "orui", 32,
927 { 0|A(USES_RT)|A(USES_RS), { (1<<MACH_IQ2000) } }
929 /* bgtz $rs,$offset */
931 IQ2000_INSN_BGTZ, "bgtz", "bgtz", 32,
932 { 0|A(USES_RS)|A(COND_CTI)|A(DELAY_SLOT), { (1<<MACH_IQ2000) } }
934 /* bgtzl $rs,$offset */
936 IQ2000_INSN_BGTZL, "bgtzl", "bgtzl", 32,
937 { 0|A(USES_RS)|A(SKIP_CTI)|A(COND_CTI)|A(DELAY_SLOT), { (1<<MACH_IQ2000) } }
939 /* blez $rs,$offset */
941 IQ2000_INSN_BLEZ, "blez", "blez", 32,
942 { 0|A(USES_RS)|A(COND_CTI)|A(DELAY_SLOT), { (1<<MACH_IQ2000) } }
944 /* blezl $rs,$offset */
946 IQ2000_INSN_BLEZL, "blezl", "blezl", 32,
947 { 0|A(USES_RS)|A(SKIP_CTI)|A(COND_CTI)|A(DELAY_SLOT), { (1<<MACH_IQ2000) } }
949 /* mrgb $rd,$rs,$rt,$mask */
951 IQ2000_INSN_MRGB, "mrgb", "mrgb", 32,
952 { 0|A(USES_RT)|A(USES_RS)|A(USES_RD), { (1<<MACH_IQ2000) } }
954 /* mrgb ${rd-rs},$rt,$mask */
956 -1, "mrgb2", "mrgb", 32,
957 { 0|A(USES_RT)|A(USES_RS)|A(USES_RD)|A(NO_DIS)|A(ALIAS), { (1<<MACH_IQ2000) } }
959 /* bctxt $rs,$offset */
961 IQ2000_INSN_BCTXT, "bctxt", "bctxt", 32,
962 { 0|A(USES_RS)|A(COND_CTI)|A(DELAY_SLOT), { (1<<MACH_IQ2000) } }
964 /* bc0f $offset */
966 IQ2000_INSN_BC0F, "bc0f", "bc0f", 32,
967 { 0|A(COND_CTI)|A(DELAY_SLOT), { (1<<MACH_IQ2000) } }
969 /* bc0fl $offset */
971 IQ2000_INSN_BC0FL, "bc0fl", "bc0fl", 32,
972 { 0|A(SKIP_CTI)|A(COND_CTI)|A(DELAY_SLOT), { (1<<MACH_IQ2000) } }
974 /* bc3f $offset */
976 IQ2000_INSN_BC3F, "bc3f", "bc3f", 32,
977 { 0|A(COND_CTI)|A(DELAY_SLOT), { (1<<MACH_IQ2000) } }
979 /* bc3fl $offset */
981 IQ2000_INSN_BC3FL, "bc3fl", "bc3fl", 32,
982 { 0|A(SKIP_CTI)|A(COND_CTI)|A(DELAY_SLOT), { (1<<MACH_IQ2000) } }
984 /* bc0t $offset */
986 IQ2000_INSN_BC0T, "bc0t", "bc0t", 32,
987 { 0|A(COND_CTI)|A(DELAY_SLOT), { (1<<MACH_IQ2000) } }
989 /* bc0tl $offset */
991 IQ2000_INSN_BC0TL, "bc0tl", "bc0tl", 32,
992 { 0|A(SKIP_CTI)|A(COND_CTI)|A(DELAY_SLOT), { (1<<MACH_IQ2000) } }
994 /* bc3t $offset */
996 IQ2000_INSN_BC3T, "bc3t", "bc3t", 32,
997 { 0|A(COND_CTI)|A(DELAY_SLOT), { (1<<MACH_IQ2000) } }
999 /* bc3tl $offset */
1001 IQ2000_INSN_BC3TL, "bc3tl", "bc3tl", 32,
1002 { 0|A(SKIP_CTI)|A(COND_CTI)|A(DELAY_SLOT), { (1<<MACH_IQ2000) } }
1004 /* cfc0 $rt,$rd */
1006 IQ2000_INSN_CFC0, "cfc0", "cfc0", 32,
1007 { 0|A(USES_RT)|A(LOAD_DELAY), { (1<<MACH_IQ2000) } }
1009 /* cfc1 $rt,$rd */
1011 IQ2000_INSN_CFC1, "cfc1", "cfc1", 32,
1012 { 0|A(USES_RT)|A(LOAD_DELAY), { (1<<MACH_IQ2000) } }
1014 /* cfc2 $rt,$rd */
1016 IQ2000_INSN_CFC2, "cfc2", "cfc2", 32,
1017 { 0|A(YIELD_INSN)|A(USES_RT)|A(LOAD_DELAY), { (1<<MACH_IQ2000) } }
1019 /* cfc3 $rt,$rd */
1021 IQ2000_INSN_CFC3, "cfc3", "cfc3", 32,
1022 { 0|A(YIELD_INSN)|A(USES_RT)|A(LOAD_DELAY), { (1<<MACH_IQ2000) } }
1024 /* chkhdr $rd,$rt */
1026 IQ2000_INSN_CHKHDR, "chkhdr", "chkhdr", 32,
1027 { 0|A(YIELD_INSN)|A(USES_RD)|A(LOAD_DELAY), { (1<<MACH_IQ2000) } }
1029 /* ctc0 $rt,$rd */
1031 IQ2000_INSN_CTC0, "ctc0", "ctc0", 32,
1032 { 0|A(USES_RT), { (1<<MACH_IQ2000) } }
1034 /* ctc1 $rt,$rd */
1036 IQ2000_INSN_CTC1, "ctc1", "ctc1", 32,
1037 { 0|A(USES_RT), { (1<<MACH_IQ2000) } }
1039 /* ctc2 $rt,$rd */
1041 IQ2000_INSN_CTC2, "ctc2", "ctc2", 32,
1042 { 0|A(USES_RT), { (1<<MACH_IQ2000) } }
1044 /* ctc3 $rt,$rd */
1046 IQ2000_INSN_CTC3, "ctc3", "ctc3", 32,
1047 { 0|A(USES_RT), { (1<<MACH_IQ2000) } }
1049 /* jcr $rs */
1051 IQ2000_INSN_JCR, "jcr", "jcr", 32,
1052 { 0|A(USES_RS)|A(UNCOND_CTI)|A(DELAY_SLOT), { (1<<MACH_IQ2000) } }
1054 /* luc32 $rt,$rd */
1056 IQ2000_INSN_LUC32, "luc32", "luc32", 32,
1057 { 0|A(YIELD_INSN)|A(USES_RT)|A(USES_RD), { (1<<MACH_IQ2000) } }
1059 /* luc32l $rt,$rd */
1061 IQ2000_INSN_LUC32L, "luc32l", "luc32l", 32,
1062 { 0|A(YIELD_INSN)|A(USES_RT)|A(USES_RD), { (1<<MACH_IQ2000) } }
1064 /* luc64 $rt,$rd */
1066 IQ2000_INSN_LUC64, "luc64", "luc64", 32,
1067 { 0|A(YIELD_INSN)|A(USES_RT)|A(USES_RD), { (1<<MACH_IQ2000) } }
1069 /* luc64l $rt,$rd */
1071 IQ2000_INSN_LUC64L, "luc64l", "luc64l", 32,
1072 { 0|A(YIELD_INSN)|A(USES_RT)|A(USES_RD), { (1<<MACH_IQ2000) } }
1074 /* luk $rt,$rd */
1076 IQ2000_INSN_LUK, "luk", "luk", 32,
1077 { 0|A(USES_RT)|A(USES_RD), { (1<<MACH_IQ2000) } }
1079 /* lulck $rt */
1081 IQ2000_INSN_LULCK, "lulck", "lulck", 32,
1082 { 0|A(YIELD_INSN)|A(USES_RT), { (1<<MACH_IQ2000) } }
1084 /* lum32 $rt,$rd */
1086 IQ2000_INSN_LUM32, "lum32", "lum32", 32,
1087 { 0|A(YIELD_INSN)|A(USES_RT)|A(USES_RD), { (1<<MACH_IQ2000) } }
1089 /* lum32l $rt,$rd */
1091 IQ2000_INSN_LUM32L, "lum32l", "lum32l", 32,
1092 { 0|A(YIELD_INSN)|A(USES_RT)|A(USES_RD), { (1<<MACH_IQ2000) } }
1094 /* lum64 $rt,$rd */
1096 IQ2000_INSN_LUM64, "lum64", "lum64", 32,
1097 { 0|A(YIELD_INSN)|A(USES_RT)|A(USES_RD), { (1<<MACH_IQ2000) } }
1099 /* lum64l $rt,$rd */
1101 IQ2000_INSN_LUM64L, "lum64l", "lum64l", 32,
1102 { 0|A(YIELD_INSN)|A(USES_RT)|A(USES_RD), { (1<<MACH_IQ2000) } }
1104 /* lur $rt,$rd */
1106 IQ2000_INSN_LUR, "lur", "lur", 32,
1107 { 0|A(YIELD_INSN)|A(USES_RT)|A(USES_RD), { (1<<MACH_IQ2000) } }
1109 /* lurl $rt,$rd */
1111 IQ2000_INSN_LURL, "lurl", "lurl", 32,
1112 { 0|A(YIELD_INSN)|A(USES_RT)|A(USES_RD), { (1<<MACH_IQ2000) } }
1114 /* luulck $rt */
1116 IQ2000_INSN_LUULCK, "luulck", "luulck", 32,
1117 { 0|A(YIELD_INSN)|A(USES_RT), { (1<<MACH_IQ2000) } }
1119 /* mfc0 $rt,$rd */
1121 IQ2000_INSN_MFC0, "mfc0", "mfc0", 32,
1122 { 0|A(USES_RT)|A(LOAD_DELAY), { (1<<MACH_IQ2000) } }
1124 /* mfc1 $rt,$rd */
1126 IQ2000_INSN_MFC1, "mfc1", "mfc1", 32,
1127 { 0|A(USES_RT)|A(LOAD_DELAY), { (1<<MACH_IQ2000) } }
1129 /* mfc2 $rt,$rd */
1131 IQ2000_INSN_MFC2, "mfc2", "mfc2", 32,
1132 { 0|A(YIELD_INSN)|A(USES_RT)|A(LOAD_DELAY), { (1<<MACH_IQ2000) } }
1134 /* mfc3 $rt,$rd */
1136 IQ2000_INSN_MFC3, "mfc3", "mfc3", 32,
1137 { 0|A(YIELD_INSN)|A(USES_RT)|A(LOAD_DELAY), { (1<<MACH_IQ2000) } }
1139 /* mtc0 $rt,$rd */
1141 IQ2000_INSN_MTC0, "mtc0", "mtc0", 32,
1142 { 0|A(USES_RT), { (1<<MACH_IQ2000) } }
1144 /* mtc1 $rt,$rd */
1146 IQ2000_INSN_MTC1, "mtc1", "mtc1", 32,
1147 { 0|A(USES_RT), { (1<<MACH_IQ2000) } }
1149 /* mtc2 $rt,$rd */
1151 IQ2000_INSN_MTC2, "mtc2", "mtc2", 32,
1152 { 0|A(USES_RT), { (1<<MACH_IQ2000) } }
1154 /* mtc3 $rt,$rd */
1156 IQ2000_INSN_MTC3, "mtc3", "mtc3", 32,
1157 { 0|A(USES_RT), { (1<<MACH_IQ2000) } }
1159 /* pkrl $rd,$rt */
1161 IQ2000_INSN_PKRL, "pkrl", "pkrl", 32,
1162 { 0|A(YIELD_INSN)|A(USES_RT)|A(USES_RD), { (1<<MACH_IQ2000) } }
1164 /* pkrlr1 $rt,$index,$count */
1166 IQ2000_INSN_PKRLR1, "pkrlr1", "pkrlr1", 32,
1167 { 0|A(YIELD_INSN)|A(USES_RT), { (1<<MACH_IQ2000) } }
1169 /* pkrlr30 $rt,$index,$count */
1171 IQ2000_INSN_PKRLR30, "pkrlr30", "pkrlr30", 32,
1172 { 0|A(YIELD_INSN)|A(USES_RT), { (1<<MACH_IQ2000) } }
1174 /* rb $rd,$rt */
1176 IQ2000_INSN_RB, "rb", "rb", 32,
1177 { 0|A(YIELD_INSN)|A(USES_RT)|A(USES_RD), { (1<<MACH_IQ2000) } }
1179 /* rbr1 $rt,$index,$count */
1181 IQ2000_INSN_RBR1, "rbr1", "rbr1", 32,
1182 { 0|A(YIELD_INSN)|A(USES_RT), { (1<<MACH_IQ2000) } }
1184 /* rbr30 $rt,$index,$count */
1186 IQ2000_INSN_RBR30, "rbr30", "rbr30", 32,
1187 { 0|A(YIELD_INSN)|A(USES_RT), { (1<<MACH_IQ2000) } }
1189 /* rfe */
1191 IQ2000_INSN_RFE, "rfe", "rfe", 32,
1192 { 0, { (1<<MACH_IQ2000) } }
1194 /* rx $rd,$rt */
1196 IQ2000_INSN_RX, "rx", "rx", 32,
1197 { 0|A(YIELD_INSN)|A(USES_RT)|A(USES_RD), { (1<<MACH_IQ2000) } }
1199 /* rxr1 $rt,$index,$count */
1201 IQ2000_INSN_RXR1, "rxr1", "rxr1", 32,
1202 { 0|A(YIELD_INSN)|A(USES_RT), { (1<<MACH_IQ2000) } }
1204 /* rxr30 $rt,$index,$count */
1206 IQ2000_INSN_RXR30, "rxr30", "rxr30", 32,
1207 { 0|A(YIELD_INSN)|A(USES_RT), { (1<<MACH_IQ2000) } }
1209 /* sleep */
1211 IQ2000_INSN_SLEEP, "sleep", "sleep", 32,
1212 { 0|A(YIELD_INSN), { (1<<MACH_IQ2000) } }
1214 /* srrd $rt */
1216 IQ2000_INSN_SRRD, "srrd", "srrd", 32,
1217 { 0|A(YIELD_INSN)|A(USES_RT), { (1<<MACH_IQ2000) } }
1219 /* srrdl $rt */
1221 IQ2000_INSN_SRRDL, "srrdl", "srrdl", 32,
1222 { 0|A(YIELD_INSN)|A(USES_RT), { (1<<MACH_IQ2000) } }
1224 /* srulck $rt */
1226 IQ2000_INSN_SRULCK, "srulck", "srulck", 32,
1227 { 0|A(YIELD_INSN)|A(USES_RT), { (1<<MACH_IQ2000) } }
1229 /* srwr $rt,$rd */
1231 IQ2000_INSN_SRWR, "srwr", "srwr", 32,
1232 { 0|A(YIELD_INSN)|A(USES_RT)|A(USES_RD), { (1<<MACH_IQ2000) } }
1234 /* srwru $rt,$rd */
1236 IQ2000_INSN_SRWRU, "srwru", "srwru", 32,
1237 { 0|A(YIELD_INSN)|A(USES_RT)|A(USES_RD), { (1<<MACH_IQ2000) } }
1239 /* trapqfl */
1241 IQ2000_INSN_TRAPQFL, "trapqfl", "trapqfl", 32,
1242 { 0|A(YIELD_INSN), { (1<<MACH_IQ2000) } }
1244 /* trapqne */
1246 IQ2000_INSN_TRAPQNE, "trapqne", "trapqne", 32,
1247 { 0|A(YIELD_INSN), { (1<<MACH_IQ2000) } }
1249 /* traprel $rt */
1251 IQ2000_INSN_TRAPREL, "traprel", "traprel", 32,
1252 { 0|A(YIELD_INSN)|A(USES_RT), { (1<<MACH_IQ2000) } }
1254 /* wb $rd,$rt */
1256 IQ2000_INSN_WB, "wb", "wb", 32,
1257 { 0|A(YIELD_INSN)|A(USES_RT)|A(USES_RD), { (1<<MACH_IQ2000) } }
1259 /* wbu $rd,$rt */
1261 IQ2000_INSN_WBU, "wbu", "wbu", 32,
1262 { 0|A(YIELD_INSN)|A(USES_RT)|A(USES_RD), { (1<<MACH_IQ2000) } }
1264 /* wbr1 $rt,$index,$count */
1266 IQ2000_INSN_WBR1, "wbr1", "wbr1", 32,
1267 { 0|A(YIELD_INSN)|A(USES_RT), { (1<<MACH_IQ2000) } }
1269 /* wbr1u $rt,$index,$count */
1271 IQ2000_INSN_WBR1U, "wbr1u", "wbr1u", 32,
1272 { 0|A(YIELD_INSN)|A(USES_RT), { (1<<MACH_IQ2000) } }
1274 /* wbr30 $rt,$index,$count */
1276 IQ2000_INSN_WBR30, "wbr30", "wbr30", 32,
1277 { 0|A(YIELD_INSN)|A(USES_RT), { (1<<MACH_IQ2000) } }
1279 /* wbr30u $rt,$index,$count */
1281 IQ2000_INSN_WBR30U, "wbr30u", "wbr30u", 32,
1282 { 0|A(YIELD_INSN)|A(USES_RT), { (1<<MACH_IQ2000) } }
1284 /* wx $rd,$rt */
1286 IQ2000_INSN_WX, "wx", "wx", 32,
1287 { 0|A(YIELD_INSN)|A(USES_RT)|A(USES_RD), { (1<<MACH_IQ2000) } }
1289 /* wxu $rd,$rt */
1291 IQ2000_INSN_WXU, "wxu", "wxu", 32,
1292 { 0|A(YIELD_INSN)|A(USES_RT)|A(USES_RD), { (1<<MACH_IQ2000) } }
1294 /* wxr1 $rt,$index,$count */
1296 IQ2000_INSN_WXR1, "wxr1", "wxr1", 32,
1297 { 0|A(YIELD_INSN)|A(USES_RT), { (1<<MACH_IQ2000) } }
1299 /* wxr1u $rt,$index,$count */
1301 IQ2000_INSN_WXR1U, "wxr1u", "wxr1u", 32,
1302 { 0|A(YIELD_INSN)|A(USES_RT), { (1<<MACH_IQ2000) } }
1304 /* wxr30 $rt,$index,$count */
1306 IQ2000_INSN_WXR30, "wxr30", "wxr30", 32,
1307 { 0|A(YIELD_INSN)|A(USES_RT), { (1<<MACH_IQ2000) } }
1309 /* wxr30u $rt,$index,$count */
1311 IQ2000_INSN_WXR30U, "wxr30u", "wxr30u", 32,
1312 { 0|A(YIELD_INSN)|A(USES_RT), { (1<<MACH_IQ2000) } }
1314 /* ldw $rt,$lo16($base) */
1316 IQ2000_INSN_LDW, "ldw", "ldw", 32,
1317 { 0|A(USES_RT)|A(LOAD_DELAY)|A(EVEN_REG_NUM), { (1<<MACH_IQ2000) } }
1319 /* sdw $rt,$lo16($base) */
1321 IQ2000_INSN_SDW, "sdw", "sdw", 32,
1322 { 0|A(USES_RT)|A(EVEN_REG_NUM), { (1<<MACH_IQ2000) } }
1324 /* j $jmptarg */
1326 IQ2000_INSN_J, "j", "j", 32,
1327 { 0|A(UNCOND_CTI)|A(DELAY_SLOT), { (1<<MACH_IQ2000) } }
1329 /* jal $jmptarg */
1331 IQ2000_INSN_JAL, "jal", "jal", 32,
1332 { 0|A(USES_R31)|A(UNCOND_CTI)|A(DELAY_SLOT), { (1<<MACH_IQ2000) } }
1334 /* bmb $rs,$rt,$offset */
1336 IQ2000_INSN_BMB, "bmb", "bmb", 32,
1337 { 0|A(USES_RT)|A(USES_RS)|A(COND_CTI)|A(DELAY_SLOT), { (1<<MACH_IQ2000) } }
1339 /* andoui $rt,$rs,$hi16 */
1341 IQ2000_INSN_ANDOUI_Q10, "andoui-q10", "andoui", 32,
1342 { 0|A(USES_RT)|A(USES_RS), { (1<<MACH_IQ10) } }
1344 /* andoui ${rt-rs},$hi16 */
1346 -1, "andoui2-q10", "andoui", 32,
1347 { 0|A(USES_RT)|A(USES_RS)|A(NO_DIS)|A(ALIAS), { (1<<MACH_IQ10) } }
1349 /* orui $rt,$rs,$hi16 */
1351 IQ2000_INSN_ORUI_Q10, "orui-q10", "orui", 32,
1352 { 0|A(USES_RT)|A(USES_RS), { (1<<MACH_IQ10) } }
1354 /* orui ${rt-rs},$hi16 */
1356 -1, "orui2-q10", "orui", 32,
1357 { 0|A(USES_RT)|A(USES_RS)|A(NO_DIS)|A(ALIAS), { (1<<MACH_IQ10) } }
1359 /* mrgb $rd,$rs,$rt,$maskq10 */
1361 IQ2000_INSN_MRGBQ10, "mrgbq10", "mrgb", 32,
1362 { 0|A(USES_RT)|A(USES_RS)|A(USES_RD), { (1<<MACH_IQ10) } }
1364 /* mrgb ${rd-rs},$rt,$maskq10 */
1366 -1, "mrgbq102", "mrgb", 32,
1367 { 0|A(USES_RT)|A(USES_RS)|A(USES_RD)|A(NO_DIS)|A(ALIAS), { (1<<MACH_IQ10) } }
1369 /* j $jmptarg */
1371 IQ2000_INSN_JQ10, "jq10", "j", 32,
1372 { 0|A(UNCOND_CTI)|A(DELAY_SLOT), { (1<<MACH_IQ10) } }
1374 /* jal $rt,$jmptarg */
1376 IQ2000_INSN_JALQ10, "jalq10", "jal", 32,
1377 { 0|A(USES_RT)|A(UNCOND_CTI)|A(DELAY_SLOT), { (1<<MACH_IQ10) } }
1379 /* jal $jmptarg */
1381 IQ2000_INSN_JALQ10_2, "jalq10-2", "jal", 32,
1382 { 0|A(USES_RT)|A(UNCOND_CTI)|A(DELAY_SLOT), { (1<<MACH_IQ10) } }
1384 /* bbil $rs($bitnum),$offset */
1386 IQ2000_INSN_BBIL, "bbil", "bbil", 32,
1387 { 0|A(USES_RS)|A(SKIP_CTI)|A(COND_CTI)|A(DELAY_SLOT), { (1<<MACH_IQ10) } }
1389 /* bbinl $rs($bitnum),$offset */
1391 IQ2000_INSN_BBINL, "bbinl", "bbinl", 32,
1392 { 0|A(USES_RS)|A(SKIP_CTI)|A(COND_CTI)|A(DELAY_SLOT), { (1<<MACH_IQ10) } }
1394 /* bbvl $rs,$rt,$offset */
1396 IQ2000_INSN_BBVL, "bbvl", "bbvl", 32,
1397 { 0|A(USES_RT)|A(USES_RS)|A(SKIP_CTI)|A(COND_CTI)|A(DELAY_SLOT), { (1<<MACH_IQ10) } }
1399 /* bbvnl $rs,$rt,$offset */
1401 IQ2000_INSN_BBVNL, "bbvnl", "bbvnl", 32,
1402 { 0|A(USES_RT)|A(USES_RS)|A(SKIP_CTI)|A(COND_CTI)|A(DELAY_SLOT), { (1<<MACH_IQ10) } }
1404 /* bgtzal $rs,$offset */
1406 IQ2000_INSN_BGTZAL, "bgtzal", "bgtzal", 32,
1407 { 0|A(USES_R31)|A(USES_RS)|A(COND_CTI)|A(DELAY_SLOT), { (1<<MACH_IQ10) } }
1409 /* bgtzall $rs,$offset */
1411 IQ2000_INSN_BGTZALL, "bgtzall", "bgtzall", 32,
1412 { 0|A(USES_R31)|A(USES_RS)|A(SKIP_CTI)|A(COND_CTI)|A(DELAY_SLOT), { (1<<MACH_IQ10) } }
1414 /* blezal $rs,$offset */
1416 IQ2000_INSN_BLEZAL, "blezal", "blezal", 32,
1417 { 0|A(USES_R31)|A(USES_RS)|A(COND_CTI)|A(DELAY_SLOT), { (1<<MACH_IQ10) } }
1419 /* blezall $rs,$offset */
1421 IQ2000_INSN_BLEZALL, "blezall", "blezall", 32,
1422 { 0|A(USES_R31)|A(USES_RS)|A(SKIP_CTI)|A(COND_CTI)|A(DELAY_SLOT), { (1<<MACH_IQ10) } }
1424 /* bgtz $rs,$offset */
1426 IQ2000_INSN_BGTZ_Q10, "bgtz-q10", "bgtz", 32,
1427 { 0|A(USES_RS)|A(COND_CTI)|A(DELAY_SLOT), { (1<<MACH_IQ10) } }
1429 /* bgtzl $rs,$offset */
1431 IQ2000_INSN_BGTZL_Q10, "bgtzl-q10", "bgtzl", 32,
1432 { 0|A(USES_RS)|A(SKIP_CTI)|A(COND_CTI)|A(DELAY_SLOT), { (1<<MACH_IQ10) } }
1434 /* blez $rs,$offset */
1436 IQ2000_INSN_BLEZ_Q10, "blez-q10", "blez", 32,
1437 { 0|A(USES_RS)|A(COND_CTI)|A(DELAY_SLOT), { (1<<MACH_IQ10) } }
1439 /* blezl $rs,$offset */
1441 IQ2000_INSN_BLEZL_Q10, "blezl-q10", "blezl", 32,
1442 { 0|A(USES_RS)|A(SKIP_CTI)|A(COND_CTI)|A(DELAY_SLOT), { (1<<MACH_IQ10) } }
1444 /* bmb $rs,$rt,$offset */
1446 IQ2000_INSN_BMB_Q10, "bmb-q10", "bmb", 32,
1447 { 0|A(USES_RT)|A(USES_RS)|A(COND_CTI)|A(DELAY_SLOT), { (1<<MACH_IQ10) } }
1449 /* bmbl $rs,$rt,$offset */
1451 IQ2000_INSN_BMBL, "bmbl", "bmbl", 32,
1452 { 0|A(USES_RT)|A(USES_RS)|A(SKIP_CTI)|A(COND_CTI)|A(DELAY_SLOT), { (1<<MACH_IQ10) } }
1454 /* bri $rs,$offset */
1456 IQ2000_INSN_BRI, "bri", "bri", 32,
1457 { 0|A(USES_RS)|A(SKIP_CTI)|A(COND_CTI)|A(DELAY_SLOT), { (1<<MACH_IQ10) } }
1459 /* brv $rs,$offset */
1461 IQ2000_INSN_BRV, "brv", "brv", 32,
1462 { 0|A(USES_RS)|A(SKIP_CTI)|A(COND_CTI)|A(DELAY_SLOT), { (1<<MACH_IQ10) } }
1464 /* bctx $rs,$offset */
1466 IQ2000_INSN_BCTX, "bctx", "bctx", 32,
1467 { 0|A(USES_RS)|A(UNCOND_CTI)|A(DELAY_SLOT), { (1<<MACH_IQ10) } }
1469 /* yield */
1471 IQ2000_INSN_YIELD, "yield", "yield", 32,
1472 { 0, { (1<<MACH_IQ10) } }
1474 /* crc32 $rd,$rs,$rt */
1476 IQ2000_INSN_CRC32, "crc32", "crc32", 32,
1477 { 0|A(USES_RT)|A(USES_RS)|A(USES_RD), { (1<<MACH_IQ10) } }
1479 /* crc32b $rd,$rs,$rt */
1481 IQ2000_INSN_CRC32B, "crc32b", "crc32b", 32,
1482 { 0|A(USES_RT)|A(USES_RS)|A(USES_RD), { (1<<MACH_IQ10) } }
1484 /* cnt1s $rd,$rs */
1486 IQ2000_INSN_CNT1S, "cnt1s", "cnt1s", 32,
1487 { 0|A(USES_RS)|A(USES_RD), { (1<<MACH_IQ10) } }
1489 /* avail $rd */
1491 IQ2000_INSN_AVAIL, "avail", "avail", 32,
1492 { 0|A(USES_RD), { (1<<MACH_IQ10) } }
1494 /* free $rd,$rs */
1496 IQ2000_INSN_FREE, "free", "free", 32,
1497 { 0|A(USES_RD)|A(USES_RS), { (1<<MACH_IQ10) } }
1499 /* tstod $rd,$rs */
1501 IQ2000_INSN_TSTOD, "tstod", "tstod", 32,
1502 { 0|A(USES_RD)|A(USES_RS), { (1<<MACH_IQ10) } }
1504 /* cmphdr $rd */
1506 IQ2000_INSN_CMPHDR, "cmphdr", "cmphdr", 32,
1507 { 0|A(USES_RD), { (1<<MACH_IQ10) } }
1509 /* mcid $rd,$rt */
1511 IQ2000_INSN_MCID, "mcid", "mcid", 32,
1512 { 0|A(USES_RT)|A(USES_RD), { (1<<MACH_IQ10) } }
1514 /* dba $rd */
1516 IQ2000_INSN_DBA, "dba", "dba", 32,
1517 { 0|A(USES_RD), { (1<<MACH_IQ10) } }
1519 /* dbd $rd,$rs,$rt */
1521 IQ2000_INSN_DBD, "dbd", "dbd", 32,
1522 { 0|A(USES_RD)|A(USES_RT)|A(USES_RS), { (1<<MACH_IQ10) } }
1524 /* dpwt $rd,$rs */
1526 IQ2000_INSN_DPWT, "dpwt", "dpwt", 32,
1527 { 0|A(USES_RD)|A(USES_RS), { (1<<MACH_IQ10) } }
1529 /* chkhdr $rd,$rs */
1531 IQ2000_INSN_CHKHDRQ10, "chkhdrq10", "chkhdr", 32,
1532 { 0|A(USES_RD)|A(USES_RS), { (1<<MACH_IQ10) } }
1534 /* rba $rd,$rs,$rt */
1536 IQ2000_INSN_RBA, "rba", "rba", 32,
1537 { 0|A(USES_RD)|A(USES_RT)|A(USES_RS), { (1<<MACH_IQ10) } }
1539 /* rbal $rd,$rs,$rt */
1541 IQ2000_INSN_RBAL, "rbal", "rbal", 32,
1542 { 0|A(USES_RD)|A(USES_RT)|A(USES_RS), { (1<<MACH_IQ10) } }
1544 /* rbar $rd,$rs,$rt */
1546 IQ2000_INSN_RBAR, "rbar", "rbar", 32,
1547 { 0|A(USES_RD)|A(USES_RT)|A(USES_RS), { (1<<MACH_IQ10) } }
1549 /* wba $rd,$rs,$rt */
1551 IQ2000_INSN_WBA, "wba", "wba", 32,
1552 { 0|A(USES_RD)|A(USES_RT)|A(USES_RS), { (1<<MACH_IQ10) } }
1554 /* wbau $rd,$rs,$rt */
1556 IQ2000_INSN_WBAU, "wbau", "wbau", 32,
1557 { 0|A(USES_RD)|A(USES_RT)|A(USES_RS), { (1<<MACH_IQ10) } }
1559 /* wbac $rd,$rs,$rt */
1561 IQ2000_INSN_WBAC, "wbac", "wbac", 32,
1562 { 0|A(USES_RD)|A(USES_RT)|A(USES_RS), { (1<<MACH_IQ10) } }
1564 /* rbi $rd,$rs,$rt,$bytecount */
1566 IQ2000_INSN_RBI, "rbi", "rbi", 32,
1567 { 0|A(USES_RT)|A(USES_RS)|A(USES_RD), { (1<<MACH_IQ10) } }
1569 /* rbil $rd,$rs,$rt,$bytecount */
1571 IQ2000_INSN_RBIL, "rbil", "rbil", 32,
1572 { 0|A(USES_RT)|A(USES_RS)|A(USES_RD), { (1<<MACH_IQ10) } }
1574 /* rbir $rd,$rs,$rt,$bytecount */
1576 IQ2000_INSN_RBIR, "rbir", "rbir", 32,
1577 { 0|A(USES_RT)|A(USES_RS)|A(USES_RD), { (1<<MACH_IQ10) } }
1579 /* wbi $rd,$rs,$rt,$bytecount */
1581 IQ2000_INSN_WBI, "wbi", "wbi", 32,
1582 { 0|A(USES_RT)|A(USES_RS)|A(USES_RD), { (1<<MACH_IQ10) } }
1584 /* wbic $rd,$rs,$rt,$bytecount */
1586 IQ2000_INSN_WBIC, "wbic", "wbic", 32,
1587 { 0|A(USES_RT)|A(USES_RS)|A(USES_RD), { (1<<MACH_IQ10) } }
1589 /* wbiu $rd,$rs,$rt,$bytecount */
1591 IQ2000_INSN_WBIU, "wbiu", "wbiu", 32,
1592 { 0|A(USES_RT)|A(USES_RS)|A(USES_RD), { (1<<MACH_IQ10) } }
1594 /* pkrli $rd,$rs,$rt,$bytecount */
1596 IQ2000_INSN_PKRLI, "pkrli", "pkrli", 32,
1597 { 0|A(USES_RT)|A(USES_RS)|A(USES_RD), { (1<<MACH_IQ10) } }
1599 /* pkrlih $rd,$rs,$rt,$bytecount */
1601 IQ2000_INSN_PKRLIH, "pkrlih", "pkrlih", 32,
1602 { 0|A(USES_RT)|A(USES_RS)|A(USES_RD), { (1<<MACH_IQ10) } }
1604 /* pkrliu $rd,$rs,$rt,$bytecount */
1606 IQ2000_INSN_PKRLIU, "pkrliu", "pkrliu", 32,
1607 { 0|A(USES_RT)|A(USES_RS)|A(USES_RD), { (1<<MACH_IQ10) } }
1609 /* pkrlic $rd,$rs,$rt,$bytecount */
1611 IQ2000_INSN_PKRLIC, "pkrlic", "pkrlic", 32,
1612 { 0|A(USES_RT)|A(USES_RS)|A(USES_RD), { (1<<MACH_IQ10) } }
1614 /* pkrla $rd,$rs,$rt */
1616 IQ2000_INSN_PKRLA, "pkrla", "pkrla", 32,
1617 { 0|A(USES_RD)|A(USES_RT)|A(USES_RS), { (1<<MACH_IQ10) } }
1619 /* pkrlau $rd,$rs,$rt */
1621 IQ2000_INSN_PKRLAU, "pkrlau", "pkrlau", 32,
1622 { 0|A(USES_RD)|A(USES_RT)|A(USES_RS), { (1<<MACH_IQ10) } }
1624 /* pkrlah $rd,$rs,$rt */
1626 IQ2000_INSN_PKRLAH, "pkrlah", "pkrlah", 32,
1627 { 0|A(USES_RD)|A(USES_RT)|A(USES_RS), { (1<<MACH_IQ10) } }
1629 /* pkrlac $rd,$rs,$rt */
1631 IQ2000_INSN_PKRLAC, "pkrlac", "pkrlac", 32,
1632 { 0|A(USES_RD)|A(USES_RT)|A(USES_RS), { (1<<MACH_IQ10) } }
1634 /* lock $rd,$rt */
1636 IQ2000_INSN_LOCK, "lock", "lock", 32,
1637 { 0|A(USES_RT)|A(USES_RD), { (1<<MACH_IQ10) } }
1639 /* unlk $rd,$rt */
1641 IQ2000_INSN_UNLK, "unlk", "unlk", 32,
1642 { 0|A(USES_RD)|A(USES_RT), { (1<<MACH_IQ10) } }
1644 /* swrd $rd,$rt */
1646 IQ2000_INSN_SWRD, "swrd", "swrd", 32,
1647 { 0|A(USES_RD)|A(USES_RT), { (1<<MACH_IQ10) } }
1649 /* swrdl $rd,$rt */
1651 IQ2000_INSN_SWRDL, "swrdl", "swrdl", 32,
1652 { 0|A(USES_RD)|A(USES_RT), { (1<<MACH_IQ10) } }
1654 /* swwr $rd,$rs,$rt */
1656 IQ2000_INSN_SWWR, "swwr", "swwr", 32,
1657 { 0|A(USES_RD)|A(USES_RT)|A(USES_RS), { (1<<MACH_IQ10) } }
1659 /* swwru $rd,$rs,$rt */
1661 IQ2000_INSN_SWWRU, "swwru", "swwru", 32,
1662 { 0|A(USES_RD)|A(USES_RT)|A(USES_RS), { (1<<MACH_IQ10) } }
1664 /* dwrd $rd,$rt */
1666 IQ2000_INSN_DWRD, "dwrd", "dwrd", 32,
1667 { 0|A(USES_RD)|A(USES_RT)|A(EVEN_REG_NUM), { (1<<MACH_IQ10) } }
1669 /* dwrdl $rd,$rt */
1671 IQ2000_INSN_DWRDL, "dwrdl", "dwrdl", 32,
1672 { 0|A(USES_RD)|A(USES_RT)|A(EVEN_REG_NUM), { (1<<MACH_IQ10) } }
1674 /* cam36 $rd,$rt,${cam-z},${cam-y} */
1676 IQ2000_INSN_CAM36, "cam36", "cam36", 32,
1677 { 0|A(USES_RD)|A(USES_RT), { (1<<MACH_IQ10) } }
1679 /* cam72 $rd,$rt,${cam-y},${cam-z} */
1681 IQ2000_INSN_CAM72, "cam72", "cam72", 32,
1682 { 0|A(USES_RD)|A(USES_RT), { (1<<MACH_IQ10) } }
1684 /* cam144 $rd,$rt,${cam-y},${cam-z} */
1686 IQ2000_INSN_CAM144, "cam144", "cam144", 32,
1687 { 0|A(USES_RD)|A(USES_RT), { (1<<MACH_IQ10) } }
1689 /* cam288 $rd,$rt,${cam-y},${cam-z} */
1691 IQ2000_INSN_CAM288, "cam288", "cam288", 32,
1692 { 0|A(USES_RD)|A(USES_RT), { (1<<MACH_IQ10) } }
1694 /* cm32and $rd,$rs,$rt */
1696 IQ2000_INSN_CM32AND, "cm32and", "cm32and", 32,
1697 { 0|A(USES_RD)|A(USES_RT)|A(USES_RS), { (1<<MACH_IQ10) } }
1699 /* cm32andn $rd,$rs,$rt */
1701 IQ2000_INSN_CM32ANDN, "cm32andn", "cm32andn", 32,
1702 { 0|A(USES_RD)|A(USES_RT)|A(USES_RS), { (1<<MACH_IQ10) } }
1704 /* cm32or $rd,$rs,$rt */
1706 IQ2000_INSN_CM32OR, "cm32or", "cm32or", 32,
1707 { 0|A(USES_RD)|A(USES_RT)|A(USES_RS), { (1<<MACH_IQ10) } }
1709 /* cm32ra $rd,$rs,$rt */
1711 IQ2000_INSN_CM32RA, "cm32ra", "cm32ra", 32,
1712 { 0|A(USES_RD)|A(USES_RT)|A(USES_RS), { (1<<MACH_IQ10) } }
1714 /* cm32rd $rd,$rt */
1716 IQ2000_INSN_CM32RD, "cm32rd", "cm32rd", 32,
1717 { 0|A(USES_RD)|A(USES_RT), { (1<<MACH_IQ10) } }
1719 /* cm32ri $rd,$rt */
1721 IQ2000_INSN_CM32RI, "cm32ri", "cm32ri", 32,
1722 { 0|A(USES_RD)|A(USES_RT), { (1<<MACH_IQ10) } }
1724 /* cm32rs $rd,$rs,$rt */
1726 IQ2000_INSN_CM32RS, "cm32rs", "cm32rs", 32,
1727 { 0|A(USES_RD)|A(USES_RT)|A(USES_RS), { (1<<MACH_IQ10) } }
1729 /* cm32sa $rd,$rs,$rt */
1731 IQ2000_INSN_CM32SA, "cm32sa", "cm32sa", 32,
1732 { 0|A(USES_RD)|A(USES_RT)|A(USES_RS), { (1<<MACH_IQ10) } }
1734 /* cm32sd $rd,$rt */
1736 IQ2000_INSN_CM32SD, "cm32sd", "cm32sd", 32,
1737 { 0|A(USES_RD)|A(USES_RT), { (1<<MACH_IQ10) } }
1739 /* cm32si $rd,$rt */
1741 IQ2000_INSN_CM32SI, "cm32si", "cm32si", 32,
1742 { 0|A(USES_RD)|A(USES_RT), { (1<<MACH_IQ10) } }
1744 /* cm32ss $rd,$rs,$rt */
1746 IQ2000_INSN_CM32SS, "cm32ss", "cm32ss", 32,
1747 { 0|A(USES_RD)|A(USES_RT)|A(USES_RS), { (1<<MACH_IQ10) } }
1749 /* cm32xor $rd,$rs,$rt */
1751 IQ2000_INSN_CM32XOR, "cm32xor", "cm32xor", 32,
1752 { 0|A(USES_RD)|A(USES_RT)|A(USES_RS), { (1<<MACH_IQ10) } }
1754 /* cm64clr $rd,$rt */
1756 IQ2000_INSN_CM64CLR, "cm64clr", "cm64clr", 32,
1757 { 0|A(USES_RD)|A(USES_RT)|A(EVEN_REG_NUM), { (1<<MACH_IQ10) } }
1759 /* cm64ra $rd,$rs,$rt */
1761 IQ2000_INSN_CM64RA, "cm64ra", "cm64ra", 32,
1762 { 0|A(USES_RD)|A(USES_RT)|A(USES_RS)|A(EVEN_REG_NUM), { (1<<MACH_IQ10) } }
1764 /* cm64rd $rd,$rt */
1766 IQ2000_INSN_CM64RD, "cm64rd", "cm64rd", 32,
1767 { 0|A(USES_RD)|A(USES_RT)|A(EVEN_REG_NUM), { (1<<MACH_IQ10) } }
1769 /* cm64ri $rd,$rt */
1771 IQ2000_INSN_CM64RI, "cm64ri", "cm64ri", 32,
1772 { 0|A(USES_RD)|A(USES_RT)|A(EVEN_REG_NUM), { (1<<MACH_IQ10) } }
1774 /* cm64ria2 $rd,$rs,$rt */
1776 IQ2000_INSN_CM64RIA2, "cm64ria2", "cm64ria2", 32,
1777 { 0|A(USES_RD)|A(USES_RT)|A(USES_RS)|A(EVEN_REG_NUM), { (1<<MACH_IQ10) } }
1779 /* cm64rs $rd,$rs,$rt */
1781 IQ2000_INSN_CM64RS, "cm64rs", "cm64rs", 32,
1782 { 0|A(USES_RD)|A(USES_RT)|A(USES_RS)|A(EVEN_REG_NUM), { (1<<MACH_IQ10) } }
1784 /* cm64sa $rd,$rs,$rt */
1786 IQ2000_INSN_CM64SA, "cm64sa", "cm64sa", 32,
1787 { 0|A(USES_RD)|A(USES_RT)|A(USES_RS)|A(EVEN_REG_NUM), { (1<<MACH_IQ10) } }
1789 /* cm64sd $rd,$rt */
1791 IQ2000_INSN_CM64SD, "cm64sd", "cm64sd", 32,
1792 { 0|A(USES_RD)|A(USES_RT)|A(EVEN_REG_NUM), { (1<<MACH_IQ10) } }
1794 /* cm64si $rd,$rt */
1796 IQ2000_INSN_CM64SI, "cm64si", "cm64si", 32,
1797 { 0|A(USES_RD)|A(USES_RT)|A(EVEN_REG_NUM), { (1<<MACH_IQ10) } }
1799 /* cm64sia2 $rd,$rs,$rt */
1801 IQ2000_INSN_CM64SIA2, "cm64sia2", "cm64sia2", 32,
1802 { 0|A(USES_RD)|A(USES_RT)|A(USES_RS)|A(EVEN_REG_NUM), { (1<<MACH_IQ10) } }
1804 /* cm64ss $rd,$rs,$rt */
1806 IQ2000_INSN_CM64SS, "cm64ss", "cm64ss", 32,
1807 { 0|A(USES_RD)|A(USES_RT)|A(USES_RS)|A(EVEN_REG_NUM), { (1<<MACH_IQ10) } }
1809 /* cm128ria2 $rd,$rs,$rt */
1811 IQ2000_INSN_CM128RIA2, "cm128ria2", "cm128ria2", 32,
1812 { 0|A(USES_RD)|A(USES_RT)|A(USES_RS)|A(EVEN_REG_NUM), { (1<<MACH_IQ10) } }
1814 /* cm128ria3 $rd,$rs,$rt,${cm-3z} */
1816 IQ2000_INSN_CM128RIA3, "cm128ria3", "cm128ria3", 32,
1817 { 0|A(USES_RD)|A(USES_RT)|A(USES_RS)|A(EVEN_REG_NUM), { (1<<MACH_IQ10) } }
1819 /* cm128ria4 $rd,$rs,$rt,${cm-4z} */
1821 IQ2000_INSN_CM128RIA4, "cm128ria4", "cm128ria4", 32,
1822 { 0|A(USES_RD)|A(USES_RT)|A(USES_RS), { (1<<MACH_IQ10) } }
1824 /* cm128sia2 $rd,$rs,$rt */
1826 IQ2000_INSN_CM128SIA2, "cm128sia2", "cm128sia2", 32,
1827 { 0|A(USES_RD)|A(USES_RT)|A(USES_RS)|A(EVEN_REG_NUM), { (1<<MACH_IQ10) } }
1829 /* cm128sia3 $rd,$rs,$rt,${cm-3z} */
1831 IQ2000_INSN_CM128SIA3, "cm128sia3", "cm128sia3", 32,
1832 { 0|A(USES_RD)|A(USES_RT)|A(USES_RS)|A(EVEN_REG_NUM), { (1<<MACH_IQ10) } }
1834 /* cm128sia4 $rd,$rs,$rt,${cm-4z} */
1836 IQ2000_INSN_CM128SIA4, "cm128sia4", "cm128sia4", 32,
1837 { 0|A(USES_RD)|A(USES_RT)|A(USES_RS), { (1<<MACH_IQ10) } }
1839 /* cm128vsa $rd,$rs,$rt */
1841 IQ2000_INSN_CM128VSA, "cm128vsa", "cm128vsa", 32,
1842 { 0|A(USES_RD)|A(USES_RT)|A(USES_RS), { (1<<MACH_IQ10) } }
1844 /* cfc $rd,$rt */
1846 IQ2000_INSN_CFC, "cfc", "cfc", 32,
1847 { 0|A(YIELD_INSN)|A(USES_RD)|A(LOAD_DELAY), { (1<<MACH_IQ10) } }
1849 /* ctc $rs,$rt */
1851 IQ2000_INSN_CTC, "ctc", "ctc", 32,
1852 { 0|A(USES_RS), { (1<<MACH_IQ10) } }
1856 #undef OP
1857 #undef A
1859 /* Initialize anything needed to be done once, before any cpu_open call. */
1860 static void init_tables PARAMS ((void));
1862 static void
1863 init_tables ()
1867 static const CGEN_MACH * lookup_mach_via_bfd_name
1868 PARAMS ((const CGEN_MACH *, const char *));
1869 static void build_hw_table PARAMS ((CGEN_CPU_TABLE *));
1870 static void build_ifield_table PARAMS ((CGEN_CPU_TABLE *));
1871 static void build_operand_table PARAMS ((CGEN_CPU_TABLE *));
1872 static void build_insn_table PARAMS ((CGEN_CPU_TABLE *));
1873 static void iq2000_cgen_rebuild_tables PARAMS ((CGEN_CPU_TABLE *));
1875 /* Subroutine of iq2000_cgen_cpu_open to look up a mach via its bfd name. */
1877 static const CGEN_MACH *
1878 lookup_mach_via_bfd_name (table, name)
1879 const CGEN_MACH *table;
1880 const char *name;
1882 while (table->name)
1884 if (strcmp (name, table->bfd_name) == 0)
1885 return table;
1886 ++table;
1888 abort ();
1891 /* Subroutine of iq2000_cgen_cpu_open to build the hardware table. */
1893 static void
1894 build_hw_table (cd)
1895 CGEN_CPU_TABLE *cd;
1897 int i;
1898 int machs = cd->machs;
1899 const CGEN_HW_ENTRY *init = & iq2000_cgen_hw_table[0];
1900 /* MAX_HW is only an upper bound on the number of selected entries.
1901 However each entry is indexed by it's enum so there can be holes in
1902 the table. */
1903 const CGEN_HW_ENTRY **selected =
1904 (const CGEN_HW_ENTRY **) xmalloc (MAX_HW * sizeof (CGEN_HW_ENTRY *));
1906 cd->hw_table.init_entries = init;
1907 cd->hw_table.entry_size = sizeof (CGEN_HW_ENTRY);
1908 memset (selected, 0, MAX_HW * sizeof (CGEN_HW_ENTRY *));
1909 /* ??? For now we just use machs to determine which ones we want. */
1910 for (i = 0; init[i].name != NULL; ++i)
1911 if (CGEN_HW_ATTR_VALUE (&init[i], CGEN_HW_MACH)
1912 & machs)
1913 selected[init[i].type] = &init[i];
1914 cd->hw_table.entries = selected;
1915 cd->hw_table.num_entries = MAX_HW;
1918 /* Subroutine of iq2000_cgen_cpu_open to build the hardware table. */
1920 static void
1921 build_ifield_table (cd)
1922 CGEN_CPU_TABLE *cd;
1924 cd->ifld_table = & iq2000_cgen_ifld_table[0];
1927 /* Subroutine of iq2000_cgen_cpu_open to build the hardware table. */
1929 static void
1930 build_operand_table (cd)
1931 CGEN_CPU_TABLE *cd;
1933 int i;
1934 int machs = cd->machs;
1935 const CGEN_OPERAND *init = & iq2000_cgen_operand_table[0];
1936 /* MAX_OPERANDS is only an upper bound on the number of selected entries.
1937 However each entry is indexed by it's enum so there can be holes in
1938 the table. */
1939 const CGEN_OPERAND **selected =
1940 (const CGEN_OPERAND **) xmalloc (MAX_OPERANDS * sizeof (CGEN_OPERAND *));
1942 cd->operand_table.init_entries = init;
1943 cd->operand_table.entry_size = sizeof (CGEN_OPERAND);
1944 memset (selected, 0, MAX_OPERANDS * sizeof (CGEN_OPERAND *));
1945 /* ??? For now we just use mach to determine which ones we want. */
1946 for (i = 0; init[i].name != NULL; ++i)
1947 if (CGEN_OPERAND_ATTR_VALUE (&init[i], CGEN_OPERAND_MACH)
1948 & machs)
1949 selected[init[i].type] = &init[i];
1950 cd->operand_table.entries = selected;
1951 cd->operand_table.num_entries = MAX_OPERANDS;
1954 /* Subroutine of iq2000_cgen_cpu_open to build the hardware table.
1955 ??? This could leave out insns not supported by the specified mach/isa,
1956 but that would cause errors like "foo only supported by bar" to become
1957 "unknown insn", so for now we include all insns and require the app to
1958 do the checking later.
1959 ??? On the other hand, parsing of such insns may require their hardware or
1960 operand elements to be in the table [which they mightn't be]. */
1962 static void
1963 build_insn_table (cd)
1964 CGEN_CPU_TABLE *cd;
1966 int i;
1967 const CGEN_IBASE *ib = & iq2000_cgen_insn_table[0];
1968 CGEN_INSN *insns = (CGEN_INSN *) xmalloc (MAX_INSNS * sizeof (CGEN_INSN));
1970 memset (insns, 0, MAX_INSNS * sizeof (CGEN_INSN));
1971 for (i = 0; i < MAX_INSNS; ++i)
1972 insns[i].base = &ib[i];
1973 cd->insn_table.init_entries = insns;
1974 cd->insn_table.entry_size = sizeof (CGEN_IBASE);
1975 cd->insn_table.num_init_entries = MAX_INSNS;
1978 /* Subroutine of iq2000_cgen_cpu_open to rebuild the tables. */
1980 static void
1981 iq2000_cgen_rebuild_tables (cd)
1982 CGEN_CPU_TABLE *cd;
1984 int i;
1985 unsigned int isas = cd->isas;
1986 unsigned int machs = cd->machs;
1988 cd->int_insn_p = CGEN_INT_INSN_P;
1990 /* Data derived from the isa spec. */
1991 #define UNSET (CGEN_SIZE_UNKNOWN + 1)
1992 cd->default_insn_bitsize = UNSET;
1993 cd->base_insn_bitsize = UNSET;
1994 cd->min_insn_bitsize = 65535; /* some ridiculously big number */
1995 cd->max_insn_bitsize = 0;
1996 for (i = 0; i < MAX_ISAS; ++i)
1997 if (((1 << i) & isas) != 0)
1999 const CGEN_ISA *isa = & iq2000_cgen_isa_table[i];
2001 /* Default insn sizes of all selected isas must be
2002 equal or we set the result to 0, meaning "unknown". */
2003 if (cd->default_insn_bitsize == UNSET)
2004 cd->default_insn_bitsize = isa->default_insn_bitsize;
2005 else if (isa->default_insn_bitsize == cd->default_insn_bitsize)
2006 ; /* this is ok */
2007 else
2008 cd->default_insn_bitsize = CGEN_SIZE_UNKNOWN;
2010 /* Base insn sizes of all selected isas must be equal
2011 or we set the result to 0, meaning "unknown". */
2012 if (cd->base_insn_bitsize == UNSET)
2013 cd->base_insn_bitsize = isa->base_insn_bitsize;
2014 else if (isa->base_insn_bitsize == cd->base_insn_bitsize)
2015 ; /* this is ok */
2016 else
2017 cd->base_insn_bitsize = CGEN_SIZE_UNKNOWN;
2019 /* Set min,max insn sizes. */
2020 if (isa->min_insn_bitsize < cd->min_insn_bitsize)
2021 cd->min_insn_bitsize = isa->min_insn_bitsize;
2022 if (isa->max_insn_bitsize > cd->max_insn_bitsize)
2023 cd->max_insn_bitsize = isa->max_insn_bitsize;
2026 /* Data derived from the mach spec. */
2027 for (i = 0; i < MAX_MACHS; ++i)
2028 if (((1 << i) & machs) != 0)
2030 const CGEN_MACH *mach = & iq2000_cgen_mach_table[i];
2032 if (mach->insn_chunk_bitsize != 0)
2034 if (cd->insn_chunk_bitsize != 0 && cd->insn_chunk_bitsize != mach->insn_chunk_bitsize)
2036 fprintf (stderr, "iq2000_cgen_rebuild_tables: conflicting insn-chunk-bitsize values: `%d' vs. `%d'\n",
2037 cd->insn_chunk_bitsize, mach->insn_chunk_bitsize);
2038 abort ();
2041 cd->insn_chunk_bitsize = mach->insn_chunk_bitsize;
2045 /* Determine which hw elements are used by MACH. */
2046 build_hw_table (cd);
2048 /* Build the ifield table. */
2049 build_ifield_table (cd);
2051 /* Determine which operands are used by MACH/ISA. */
2052 build_operand_table (cd);
2054 /* Build the instruction table. */
2055 build_insn_table (cd);
2058 /* Initialize a cpu table and return a descriptor.
2059 It's much like opening a file, and must be the first function called.
2060 The arguments are a set of (type/value) pairs, terminated with
2061 CGEN_CPU_OPEN_END.
2063 Currently supported values:
2064 CGEN_CPU_OPEN_ISAS: bitmap of values in enum isa_attr
2065 CGEN_CPU_OPEN_MACHS: bitmap of values in enum mach_attr
2066 CGEN_CPU_OPEN_BFDMACH: specify 1 mach using bfd name
2067 CGEN_CPU_OPEN_ENDIAN: specify endian choice
2068 CGEN_CPU_OPEN_END: terminates arguments
2070 ??? Simultaneous multiple isas might not make sense, but it's not (yet)
2071 precluded.
2073 ??? We only support ISO C stdargs here, not K&R.
2074 Laziness, plus experiment to see if anything requires K&R - eventually
2075 K&R will no longer be supported - e.g. GDB is currently trying this. */
2077 CGEN_CPU_DESC
2078 iq2000_cgen_cpu_open (enum cgen_cpu_open_arg arg_type, ...)
2080 CGEN_CPU_TABLE *cd = (CGEN_CPU_TABLE *) xmalloc (sizeof (CGEN_CPU_TABLE));
2081 static int init_p;
2082 unsigned int isas = 0; /* 0 = "unspecified" */
2083 unsigned int machs = 0; /* 0 = "unspecified" */
2084 enum cgen_endian endian = CGEN_ENDIAN_UNKNOWN;
2085 va_list ap;
2087 if (! init_p)
2089 init_tables ();
2090 init_p = 1;
2093 memset (cd, 0, sizeof (*cd));
2095 va_start (ap, arg_type);
2096 while (arg_type != CGEN_CPU_OPEN_END)
2098 switch (arg_type)
2100 case CGEN_CPU_OPEN_ISAS :
2101 isas = va_arg (ap, unsigned int);
2102 break;
2103 case CGEN_CPU_OPEN_MACHS :
2104 machs = va_arg (ap, unsigned int);
2105 break;
2106 case CGEN_CPU_OPEN_BFDMACH :
2108 const char *name = va_arg (ap, const char *);
2109 const CGEN_MACH *mach =
2110 lookup_mach_via_bfd_name (iq2000_cgen_mach_table, name);
2112 machs |= 1 << mach->num;
2113 break;
2115 case CGEN_CPU_OPEN_ENDIAN :
2116 endian = va_arg (ap, enum cgen_endian);
2117 break;
2118 default :
2119 fprintf (stderr, "iq2000_cgen_cpu_open: unsupported argument `%d'\n",
2120 arg_type);
2121 abort (); /* ??? return NULL? */
2123 arg_type = va_arg (ap, enum cgen_cpu_open_arg);
2125 va_end (ap);
2127 /* mach unspecified means "all" */
2128 if (machs == 0)
2129 machs = (1 << MAX_MACHS) - 1;
2130 /* base mach is always selected */
2131 machs |= 1;
2132 /* isa unspecified means "all" */
2133 if (isas == 0)
2134 isas = (1 << MAX_ISAS) - 1;
2135 if (endian == CGEN_ENDIAN_UNKNOWN)
2137 /* ??? If target has only one, could have a default. */
2138 fprintf (stderr, "iq2000_cgen_cpu_open: no endianness specified\n");
2139 abort ();
2142 cd->isas = isas;
2143 cd->machs = machs;
2144 cd->endian = endian;
2145 /* FIXME: for the sparc case we can determine insn-endianness statically.
2146 The worry here is where both data and insn endian can be independently
2147 chosen, in which case this function will need another argument.
2148 Actually, will want to allow for more arguments in the future anyway. */
2149 cd->insn_endian = endian;
2151 /* Table (re)builder. */
2152 cd->rebuild_tables = iq2000_cgen_rebuild_tables;
2153 iq2000_cgen_rebuild_tables (cd);
2155 /* Default to not allowing signed overflow. */
2156 cd->signed_overflow_ok_p = 0;
2158 return (CGEN_CPU_DESC) cd;
2161 /* Cover fn to iq2000_cgen_cpu_open to handle the simple case of 1 isa, 1 mach.
2162 MACH_NAME is the bfd name of the mach. */
2164 CGEN_CPU_DESC
2165 iq2000_cgen_cpu_open_1 (mach_name, endian)
2166 const char *mach_name;
2167 enum cgen_endian endian;
2169 return iq2000_cgen_cpu_open (CGEN_CPU_OPEN_BFDMACH, mach_name,
2170 CGEN_CPU_OPEN_ENDIAN, endian,
2171 CGEN_CPU_OPEN_END);
2174 /* Close a cpu table.
2175 ??? This can live in a machine independent file, but there's currently
2176 no place to put this file (there's no libcgen). libopcodes is the wrong
2177 place as some simulator ports use this but they don't use libopcodes. */
2179 void
2180 iq2000_cgen_cpu_close (cd)
2181 CGEN_CPU_DESC cd;
2183 unsigned int i;
2184 CGEN_INSN *insns;
2186 if (cd->macro_insn_table.init_entries)
2188 insns = cd->macro_insn_table.init_entries;
2189 for (i = 0; i < cd->macro_insn_table.num_init_entries; ++i, ++insns)
2191 if (CGEN_INSN_RX ((insns)))
2192 regfree(CGEN_INSN_RX (insns));
2196 if (cd->insn_table.init_entries)
2198 insns = cd->insn_table.init_entries;
2199 for (i = 0; i < cd->insn_table.num_init_entries; ++i, ++insns)
2201 if (CGEN_INSN_RX (insns))
2202 regfree(CGEN_INSN_RX (insns));
2208 if (cd->macro_insn_table.init_entries)
2209 free ((CGEN_INSN *) cd->macro_insn_table.init_entries);
2211 if (cd->insn_table.init_entries)
2212 free ((CGEN_INSN *) cd->insn_table.init_entries);
2214 if (cd->hw_table.entries)
2215 free ((CGEN_HW_ENTRY *) cd->hw_table.entries);
2217 if (cd->operand_table.entries)
2218 free ((CGEN_HW_ENTRY *) cd->operand_table.entries);
2220 free (cd);