* mep.h (EF_MEP_COP_*): New.
[deliverable/binutils-gdb.git] / opcodes / mep-opc.c
... / ...
CommitLineData
1/* Instruction opcode table for mep.
2
3THIS FILE IS MACHINE GENERATED WITH CGEN.
4
5Copyright 1996-2007 Free Software Foundation, Inc.
6
7This file is part of the GNU Binutils and/or GDB, the GNU debugger.
8
9 This file 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 3, or (at your option)
12 any later version.
13
14 It is distributed in the hope that it will be useful, but WITHOUT
15 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
16 or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
17 License for more details.
18
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 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
22
23*/
24
25#include "sysdep.h"
26#include "ansidecl.h"
27#include "bfd.h"
28#include "symcat.h"
29#include "mep-desc.h"
30#include "mep-opc.h"
31#include "libiberty.h"
32
33/* -- opc.c */
34#include "elf/mep.h"
35
36/* A mask for all ISAs executed by the core. */
37CGEN_ATTR_VALUE_BITSET_TYPE mep_all_core_isas_mask = {0, 0};
38
39void
40init_mep_all_core_isas_mask (void)
41{
42 if (mep_all_core_isas_mask.length != 0)
43 return;
44 cgen_bitset_init (& mep_all_core_isas_mask, ISA_MAX);
45 cgen_bitset_set (& mep_all_core_isas_mask, ISA_MEP);
46 /* begin-all-core-isas */
47 cgen_bitset_add (& mep_all_core_isas_mask, ISA_EXT_CORE1);
48 /* end-all-core-isas */
49}
50
51CGEN_ATTR_VALUE_BITSET_TYPE mep_all_cop_isas_mask = {0, 0};
52
53void
54init_mep_all_cop_isas_mask (void)
55{
56 if (mep_all_cop_isas_mask.length != 0)
57 return;
58 cgen_bitset_init (& mep_all_cop_isas_mask, ISA_MAX);
59 /* begin-all-cop-isas */
60 /* end-all-cop-isas */
61}
62
63int
64mep_insn_supported_by_isa (const CGEN_INSN *insn, CGEN_ATTR_VALUE_BITSET_TYPE *isa_mask)
65{
66 CGEN_BITSET insn_isas = CGEN_INSN_BITSET_ATTR_VALUE (insn, CGEN_INSN_ISA);
67 return cgen_bitset_intersect_p (& insn_isas, isa_mask);
68}
69
70#define OPTION_MASK \
71 ( (1 << CGEN_INSN_OPTIONAL_BIT_INSN) \
72 | (1 << CGEN_INSN_OPTIONAL_MUL_INSN) \
73 | (1 << CGEN_INSN_OPTIONAL_DIV_INSN) \
74 | (1 << CGEN_INSN_OPTIONAL_DEBUG_INSN) \
75 | (1 << CGEN_INSN_OPTIONAL_LDZ_INSN) \
76 | (1 << CGEN_INSN_OPTIONAL_ABS_INSN) \
77 | (1 << CGEN_INSN_OPTIONAL_AVE_INSN) \
78 | (1 << CGEN_INSN_OPTIONAL_MINMAX_INSN) \
79 | (1 << CGEN_INSN_OPTIONAL_CLIP_INSN) \
80 | (1 << CGEN_INSN_OPTIONAL_SAT_INSN) \
81 | (1 << CGEN_INSN_OPTIONAL_UCI_INSN) \
82 | (1 << CGEN_INSN_OPTIONAL_DSP_INSN) \
83 | (1 << CGEN_INSN_OPTIONAL_CP_INSN) \
84 | (1 << CGEN_INSN_OPTIONAL_CP64_INSN) )
85
86
87mep_config_map_struct mep_config_map[] =
88{
89 /* config-map-start */
90 /* Default entry: mep core only, all options enabled. */
91 { "", 0, EF_MEP_CPU_C5, 1, 0, {1,"\x0"}, {1,"\x0"}, {1,"\x0"}, {1,"\x0"}, {1,"\x0"}, {1,"\x80"}, OPTION_MASK },
92 { "default", CONFIG_DEFAULT, EF_MEP_CPU_C5, 0, 0, { 1, "\x0" }, { 1, "\x0" }, { 1, "\x0" }, { 1, "\x0" }, { 1, "\x0" }, { 1, "\xc0" },
93 0
94 | (1 << CGEN_INSN_OPTIONAL_MUL_INSN)
95 | (1 << CGEN_INSN_OPTIONAL_DIV_INSN)
96 | (1 << CGEN_INSN_OPTIONAL_BIT_INSN)
97 | (1 << CGEN_INSN_OPTIONAL_LDZ_INSN)
98 | (1 << CGEN_INSN_OPTIONAL_ABS_INSN)
99 | (1 << CGEN_INSN_OPTIONAL_AVE_INSN)
100 | (1 << CGEN_INSN_OPTIONAL_MINMAX_INSN)
101 | (1 << CGEN_INSN_OPTIONAL_CLIP_INSN)
102 | (1 << CGEN_INSN_OPTIONAL_SAT_INSN) },
103 /* config-map-end */
104 { 0, 0, 0, 0, 0, {0, 0}, {0, 0}, {0, 0}, {0, 0}, {0, 0}, {0, 0}, 0 }
105};
106
107int mep_config_index = 0;
108
109static int
110check_configured_mach (int machs)
111{
112 /* All base insns are supported. */
113 int mach = 1 << MACH_BASE;
114 switch (MEP_CPU)
115 {
116 case EF_MEP_CPU_C2:
117 case EF_MEP_CPU_C3:
118 mach |= (1 << MACH_MEP);
119 break;
120 case EF_MEP_CPU_H1:
121 mach |= (1 << MACH_H1);
122 break;
123 case EF_MEP_CPU_C5:
124 mach |= (1 << MACH_MEP);
125 mach |= (1 << MACH_C5);
126 break;
127 default:
128 break;
129 }
130 return machs & mach;
131}
132
133int
134mep_cgen_insn_supported (CGEN_CPU_DESC cd, const CGEN_INSN *insn)
135{
136 int iconfig = CGEN_INSN_ATTR_VALUE (insn, CGEN_INSN_CONFIG);
137 int machs = CGEN_INSN_ATTR_VALUE (insn, CGEN_INSN_MACH);
138 CGEN_BITSET isas = CGEN_INSN_BITSET_ATTR_VALUE (insn, CGEN_INSN_ISA);
139 int ok1;
140 int ok2;
141 int ok3;
142
143 /* If the insn has an option bit set that we don't want,
144 reject it. */
145 if (CGEN_INSN_ATTRS (insn)->bool & OPTION_MASK & ~MEP_OMASK)
146 return 0;
147
148 /* If attributes are absent, assume no restriction. */
149 if (machs == 0)
150 machs = ~0;
151
152 ok1 = ((machs & cd->machs) && cgen_bitset_intersect_p (& isas, cd->isas));
153 /* If the insn is config-specific, make sure it matches. */
154 ok2 = (iconfig == 0 || iconfig == MEP_CONFIG);
155 /* Make sure the insn is supported by the configured mach */
156 ok3 = check_configured_mach (machs);
157
158 return (ok1 && ok2 && ok3);
159}
160/* The hash functions are recorded here to help keep assembler code out of
161 the disassembler and vice versa. */
162
163static int asm_hash_insn_p (const CGEN_INSN *);
164static unsigned int asm_hash_insn (const char *);
165static int dis_hash_insn_p (const CGEN_INSN *);
166static unsigned int dis_hash_insn (const char *, CGEN_INSN_INT);
167
168/* Instruction formats. */
169
170#if defined (__STDC__) || defined (ALMOST_STDC) || defined (HAVE_STRINGIZE)
171#define F(f) & mep_cgen_ifld_table[MEP_##f]
172#else
173#define F(f) & mep_cgen_ifld_table[MEP_/**/f]
174#endif
175static const CGEN_IFMT ifmt_empty ATTRIBUTE_UNUSED = {
176 0, 0, 0x0, { { 0 } }
177};
178
179static const CGEN_IFMT ifmt_stcb_r ATTRIBUTE_UNUSED = {
180 16, 16, 0xf00f, { { F (F_MAJOR) }, { F (F_RN) }, { F (F_RM) }, { F (F_SUB4) }, { 0 } }
181};
182
183static const CGEN_IFMT ifmt_pref ATTRIBUTE_UNUSED = {
184 16, 16, 0xf00f, { { F (F_MAJOR) }, { F (F_RN) }, { F (F_RM) }, { F (F_SUB4) }, { 0 } }
185};
186
187static const CGEN_IFMT ifmt_prefd ATTRIBUTE_UNUSED = {
188 32, 32, 0xf00f0000, { { F (F_MAJOR) }, { F (F_RN) }, { F (F_RM) }, { F (F_SUB4) }, { F (F_16S16) }, { 0 } }
189};
190
191static const CGEN_IFMT ifmt_casb3 ATTRIBUTE_UNUSED = {
192 32, 32, 0xf00ff0ff, { { F (F_MAJOR) }, { F (F_RN) }, { F (F_RM) }, { F (F_SUB4) }, { F (F_C5N4) }, { F (F_RL5) }, { F (F_C5N6) }, { F (F_C5N7) }, { 0 } }
193};
194
195static const CGEN_IFMT ifmt_sbcp ATTRIBUTE_UNUSED = {
196 32, 32, 0xf00ff000, { { F (F_MAJOR) }, { F (F_CRN) }, { F (F_RM) }, { F (F_SUB4) }, { F (F_EXT4) }, { F (F_12S20) }, { 0 } }
197};
198
199static const CGEN_IFMT ifmt_lbucpa ATTRIBUTE_UNUSED = {
200 32, 32, 0xf00ffc00, { { F (F_MAJOR) }, { F (F_CRN) }, { F (F_RM) }, { F (F_SUB4) }, { F (F_EXT4) }, { F (F_EXT62) }, { F (F_CDISP10) }, { 0 } }
201};
202
203static const CGEN_IFMT ifmt_lhucpa ATTRIBUTE_UNUSED = {
204 32, 32, 0xf00ffc00, { { F (F_MAJOR) }, { F (F_CRN) }, { F (F_RM) }, { F (F_SUB4) }, { F (F_EXT4) }, { F (F_EXT62) }, { F (F_CDISP10) }, { 0 } }
205};
206
207static const CGEN_IFMT ifmt_uci ATTRIBUTE_UNUSED = {
208 32, 32, 0xf00f0000, { { F (F_MAJOR) }, { F (F_RN) }, { F (F_RM) }, { F (F_SUB4) }, { F (F_16S16) }, { 0 } }
209};
210
211static const CGEN_IFMT ifmt_dsp ATTRIBUTE_UNUSED = {
212 32, 32, 0xf00f0000, { { F (F_MAJOR) }, { F (F_RN) }, { F (F_RM) }, { F (F_SUB4) }, { F (F_16U16) }, { 0 } }
213};
214
215static const CGEN_IFMT ifmt_dsp0 ATTRIBUTE_UNUSED = {
216 32, 32, 0xf00f0000, { { F (F_MAJOR) }, { F (F_C5_RNMUIMM24) }, { F (F_SUB4) }, { 0 } }
217};
218
219static const CGEN_IFMT ifmt_dsp1 ATTRIBUTE_UNUSED = {
220 32, 32, 0xf00f0000, { { F (F_MAJOR) }, { F (F_RN) }, { F (F_C5_RMUIMM20) }, { F (F_SUB4) }, { 0 } }
221};
222
223static const CGEN_IFMT ifmt_sb ATTRIBUTE_UNUSED = {
224 16, 16, 0xf00f, { { F (F_MAJOR) }, { F (F_RN) }, { F (F_RM) }, { F (F_SUB4) }, { 0 } }
225};
226
227static const CGEN_IFMT ifmt_sh ATTRIBUTE_UNUSED = {
228 16, 16, 0xf00f, { { F (F_MAJOR) }, { F (F_RN) }, { F (F_RM) }, { F (F_SUB4) }, { 0 } }
229};
230
231static const CGEN_IFMT ifmt_sw ATTRIBUTE_UNUSED = {
232 16, 16, 0xf00f, { { F (F_MAJOR) }, { F (F_RN) }, { F (F_RM) }, { F (F_SUB4) }, { 0 } }
233};
234
235static const CGEN_IFMT ifmt_lbu ATTRIBUTE_UNUSED = {
236 16, 16, 0xf00f, { { F (F_MAJOR) }, { F (F_RN) }, { F (F_RM) }, { F (F_SUB4) }, { 0 } }
237};
238
239static const CGEN_IFMT ifmt_lhu ATTRIBUTE_UNUSED = {
240 16, 16, 0xf00f, { { F (F_MAJOR) }, { F (F_RN) }, { F (F_RM) }, { F (F_SUB4) }, { 0 } }
241};
242
243static const CGEN_IFMT ifmt_sw_sp ATTRIBUTE_UNUSED = {
244 16, 16, 0xf083, { { F (F_MAJOR) }, { F (F_RN) }, { F (F_8) }, { F (F_7U9A4) }, { F (F_SUB2) }, { 0 } }
245};
246
247static const CGEN_IFMT ifmt_sb_tp ATTRIBUTE_UNUSED = {
248 16, 16, 0xf880, { { F (F_MAJOR) }, { F (F_4) }, { F (F_RN3) }, { F (F_8) }, { F (F_7U9) }, { 0 } }
249};
250
251static const CGEN_IFMT ifmt_sh_tp ATTRIBUTE_UNUSED = {
252 16, 16, 0xf881, { { F (F_MAJOR) }, { F (F_4) }, { F (F_RN3) }, { F (F_8) }, { F (F_7U9A2) }, { F (F_15) }, { 0 } }
253};
254
255static const CGEN_IFMT ifmt_sw_tp ATTRIBUTE_UNUSED = {
256 16, 16, 0xf883, { { F (F_MAJOR) }, { F (F_4) }, { F (F_RN3) }, { F (F_8) }, { F (F_7U9A4) }, { F (F_SUB2) }, { 0 } }
257};
258
259static const CGEN_IFMT ifmt_lbu_tp ATTRIBUTE_UNUSED = {
260 16, 16, 0xf880, { { F (F_MAJOR) }, { F (F_4) }, { F (F_RN3) }, { F (F_8) }, { F (F_7U9) }, { 0 } }
261};
262
263static const CGEN_IFMT ifmt_lhu_tp ATTRIBUTE_UNUSED = {
264 16, 16, 0xf881, { { F (F_MAJOR) }, { F (F_4) }, { F (F_RN3) }, { F (F_8) }, { F (F_7U9A2) }, { F (F_15) }, { 0 } }
265};
266
267static const CGEN_IFMT ifmt_sb16 ATTRIBUTE_UNUSED = {
268 32, 32, 0xf00f0000, { { F (F_MAJOR) }, { F (F_RN) }, { F (F_RM) }, { F (F_SUB4) }, { F (F_16S16) }, { 0 } }
269};
270
271static const CGEN_IFMT ifmt_sh16 ATTRIBUTE_UNUSED = {
272 32, 32, 0xf00f0000, { { F (F_MAJOR) }, { F (F_RN) }, { F (F_RM) }, { F (F_SUB4) }, { F (F_16S16) }, { 0 } }
273};
274
275static const CGEN_IFMT ifmt_sw16 ATTRIBUTE_UNUSED = {
276 32, 32, 0xf00f0000, { { F (F_MAJOR) }, { F (F_RN) }, { F (F_RM) }, { F (F_SUB4) }, { F (F_16S16) }, { 0 } }
277};
278
279static const CGEN_IFMT ifmt_lbu16 ATTRIBUTE_UNUSED = {
280 32, 32, 0xf00f0000, { { F (F_MAJOR) }, { F (F_RN) }, { F (F_RM) }, { F (F_SUB4) }, { F (F_16S16) }, { 0 } }
281};
282
283static const CGEN_IFMT ifmt_lhu16 ATTRIBUTE_UNUSED = {
284 32, 32, 0xf00f0000, { { F (F_MAJOR) }, { F (F_RN) }, { F (F_RM) }, { F (F_SUB4) }, { F (F_16S16) }, { 0 } }
285};
286
287static const CGEN_IFMT ifmt_sw24 ATTRIBUTE_UNUSED = {
288 32, 32, 0xf0030000, { { F (F_MAJOR) }, { F (F_RN) }, { F (F_24U8A4N) }, { F (F_SUB2) }, { 0 } }
289};
290
291static const CGEN_IFMT ifmt_extb ATTRIBUTE_UNUSED = {
292 16, 16, 0xf0ff, { { F (F_MAJOR) }, { F (F_RN) }, { F (F_RM) }, { F (F_SUB4) }, { 0 } }
293};
294
295static const CGEN_IFMT ifmt_ssarb ATTRIBUTE_UNUSED = {
296 16, 16, 0xfc0f, { { F (F_MAJOR) }, { F (F_4) }, { F (F_5) }, { F (F_2U6) }, { F (F_RM) }, { F (F_SUB4) }, { 0 } }
297};
298
299static const CGEN_IFMT ifmt_mov ATTRIBUTE_UNUSED = {
300 16, 16, 0xf00f, { { F (F_MAJOR) }, { F (F_RN) }, { F (F_RM) }, { F (F_SUB4) }, { 0 } }
301};
302
303static const CGEN_IFMT ifmt_movi8 ATTRIBUTE_UNUSED = {
304 16, 16, 0xf000, { { F (F_MAJOR) }, { F (F_RN) }, { F (F_8S8) }, { 0 } }
305};
306
307static const CGEN_IFMT ifmt_movi16 ATTRIBUTE_UNUSED = {
308 32, 32, 0xf0ff0000, { { F (F_MAJOR) }, { F (F_RN) }, { F (F_RM) }, { F (F_SUB4) }, { F (F_16S16) }, { 0 } }
309};
310
311static const CGEN_IFMT ifmt_movu24 ATTRIBUTE_UNUSED = {
312 32, 32, 0xf8000000, { { F (F_MAJOR) }, { F (F_4) }, { F (F_RN3) }, { F (F_24U8N) }, { 0 } }
313};
314
315static const CGEN_IFMT ifmt_movu16 ATTRIBUTE_UNUSED = {
316 32, 32, 0xf0ff0000, { { F (F_MAJOR) }, { F (F_RN) }, { F (F_RM) }, { F (F_SUB4) }, { F (F_16U16) }, { 0 } }
317};
318
319static const CGEN_IFMT ifmt_add3 ATTRIBUTE_UNUSED = {
320 16, 16, 0xf000, { { F (F_MAJOR) }, { F (F_RN) }, { F (F_RM) }, { F (F_RL) }, { 0 } }
321};
322
323static const CGEN_IFMT ifmt_add ATTRIBUTE_UNUSED = {
324 16, 16, 0xf003, { { F (F_MAJOR) }, { F (F_RN) }, { F (F_6S8) }, { F (F_SUB2) }, { 0 } }
325};
326
327static const CGEN_IFMT ifmt_add3i ATTRIBUTE_UNUSED = {
328 16, 16, 0xf083, { { F (F_MAJOR) }, { F (F_RN) }, { F (F_8) }, { F (F_7U9A4) }, { F (F_SUB2) }, { 0 } }
329};
330
331static const CGEN_IFMT ifmt_slt3i ATTRIBUTE_UNUSED = {
332 16, 16, 0xf007, { { F (F_MAJOR) }, { F (F_RN) }, { F (F_5U8) }, { F (F_SUB3) }, { 0 } }
333};
334
335static const CGEN_IFMT ifmt_bra ATTRIBUTE_UNUSED = {
336 16, 16, 0xf001, { { F (F_MAJOR) }, { F (F_12S4A2) }, { F (F_15) }, { 0 } }
337};
338
339static const CGEN_IFMT ifmt_beqz ATTRIBUTE_UNUSED = {
340 16, 16, 0xf001, { { F (F_MAJOR) }, { F (F_RN) }, { F (F_8S8A2) }, { F (F_15) }, { 0 } }
341};
342
343static const CGEN_IFMT ifmt_beqi ATTRIBUTE_UNUSED = {
344 32, 32, 0xf00f0000, { { F (F_MAJOR) }, { F (F_RN) }, { F (F_4U8) }, { F (F_SUB4) }, { F (F_17S16A2) }, { 0 } }
345};
346
347static const CGEN_IFMT ifmt_beq ATTRIBUTE_UNUSED = {
348 32, 32, 0xf00f0000, { { F (F_MAJOR) }, { F (F_RN) }, { F (F_RM) }, { F (F_SUB4) }, { F (F_17S16A2) }, { 0 } }
349};
350
351static const CGEN_IFMT ifmt_bsr24 ATTRIBUTE_UNUSED = {
352 32, 32, 0xf80f0000, { { F (F_MAJOR) }, { F (F_4) }, { F (F_24S5A2N) }, { F (F_SUB4) }, { 0 } }
353};
354
355static const CGEN_IFMT ifmt_jmp ATTRIBUTE_UNUSED = {
356 16, 16, 0xff0f, { { F (F_MAJOR) }, { F (F_RN) }, { F (F_RM) }, { F (F_SUB4) }, { 0 } }
357};
358
359static const CGEN_IFMT ifmt_jmp24 ATTRIBUTE_UNUSED = {
360 32, 32, 0xf80f0000, { { F (F_MAJOR) }, { F (F_4) }, { F (F_24U5A2N) }, { F (F_SUB4) }, { 0 } }
361};
362
363static const CGEN_IFMT ifmt_ret ATTRIBUTE_UNUSED = {
364 16, 16, 0xffff, { { F (F_MAJOR) }, { F (F_RN) }, { F (F_RM) }, { F (F_SUB4) }, { 0 } }
365};
366
367static const CGEN_IFMT ifmt_repeat ATTRIBUTE_UNUSED = {
368 32, 32, 0xf0ff0000, { { F (F_MAJOR) }, { F (F_RN) }, { F (F_RM) }, { F (F_SUB4) }, { F (F_17S16A2) }, { 0 } }
369};
370
371static const CGEN_IFMT ifmt_erepeat ATTRIBUTE_UNUSED = {
372 32, 32, 0xffff0000, { { F (F_MAJOR) }, { F (F_RN) }, { F (F_RM) }, { F (F_SUB4) }, { F (F_17S16A2) }, { 0 } }
373};
374
375static const CGEN_IFMT ifmt_stc_lp ATTRIBUTE_UNUSED = {
376 16, 16, 0xf0ff, { { F (F_MAJOR) }, { F (F_RN) }, { F (F_CSRN_LO) }, { F (F_12) }, { F (F_13) }, { F (F_14) }, { F (F_CSRN_HI) }, { 0 } }
377};
378
379static const CGEN_IFMT ifmt_stc ATTRIBUTE_UNUSED = {
380 16, 16, 0xf00e, { { F (F_MAJOR) }, { F (F_RN) }, { F (F_CSRN) }, { F (F_12) }, { F (F_13) }, { F (F_14) }, { 0 } }
381};
382
383static const CGEN_IFMT ifmt_swi ATTRIBUTE_UNUSED = {
384 16, 16, 0xffcf, { { F (F_MAJOR) }, { F (F_RN) }, { F (F_8) }, { F (F_9) }, { F (F_2U10) }, { F (F_SUB4) }, { 0 } }
385};
386
387static const CGEN_IFMT ifmt_bsetm ATTRIBUTE_UNUSED = {
388 16, 16, 0xf80f, { { F (F_MAJOR) }, { F (F_4) }, { F (F_3U5) }, { F (F_RM) }, { F (F_SUB4) }, { 0 } }
389};
390
391static const CGEN_IFMT ifmt_madd ATTRIBUTE_UNUSED = {
392 32, 32, 0xf00fffff, { { F (F_MAJOR) }, { F (F_RN) }, { F (F_RM) }, { F (F_SUB4) }, { F (F_16U16) }, { 0 } }
393};
394
395static const CGEN_IFMT ifmt_clip ATTRIBUTE_UNUSED = {
396 32, 32, 0xf0ffff07, { { F (F_MAJOR) }, { F (F_RN) }, { F (F_RM) }, { F (F_SUB4) }, { F (F_EXT) }, { F (F_5U24) }, { F (F_29) }, { F (F_30) }, { F (F_31) }, { 0 } }
397};
398
399static const CGEN_IFMT ifmt_swcp ATTRIBUTE_UNUSED = {
400 16, 16, 0xf00f, { { F (F_MAJOR) }, { F (F_CRN) }, { F (F_RM) }, { F (F_SUB4) }, { 0 } }
401};
402
403static const CGEN_IFMT ifmt_smcp ATTRIBUTE_UNUSED = {
404 16, 16, 0xf00f, { { F (F_MAJOR) }, { F (F_CRN) }, { F (F_RM) }, { F (F_SUB4) }, { 0 } }
405};
406
407static const CGEN_IFMT ifmt_swcp16 ATTRIBUTE_UNUSED = {
408 32, 32, 0xf00f0000, { { F (F_MAJOR) }, { F (F_CRN) }, { F (F_RM) }, { F (F_SUB4) }, { F (F_16S16) }, { 0 } }
409};
410
411static const CGEN_IFMT ifmt_smcp16 ATTRIBUTE_UNUSED = {
412 32, 32, 0xf00f0000, { { F (F_MAJOR) }, { F (F_CRN) }, { F (F_RM) }, { F (F_SUB4) }, { F (F_16S16) }, { 0 } }
413};
414
415static const CGEN_IFMT ifmt_swcpa ATTRIBUTE_UNUSED = {
416 32, 32, 0xf00ffc00, { { F (F_MAJOR) }, { F (F_CRN) }, { F (F_RM) }, { F (F_SUB4) }, { F (F_EXT4) }, { F (F_EXT62) }, { F (F_CDISP10) }, { 0 } }
417};
418
419static const CGEN_IFMT ifmt_smcpa ATTRIBUTE_UNUSED = {
420 32, 32, 0xf00ffc00, { { F (F_MAJOR) }, { F (F_CRN) }, { F (F_RM) }, { F (F_SUB4) }, { F (F_EXT4) }, { F (F_EXT62) }, { F (F_CDISP10) }, { 0 } }
421};
422
423static const CGEN_IFMT ifmt_bcpeq ATTRIBUTE_UNUSED = {
424 32, 32, 0xff0f0000, { { F (F_MAJOR) }, { F (F_RN) }, { F (F_RM) }, { F (F_SUB4) }, { F (F_17S16A2) }, { 0 } }
425};
426
427static const CGEN_IFMT ifmt_sim_syscall ATTRIBUTE_UNUSED = {
428 16, 16, 0xf8ef, { { F (F_MAJOR) }, { F (F_4) }, { F (F_CALLNUM) }, { F (F_8) }, { F (F_9) }, { F (F_10) }, { F (F_SUB4) }, { 0 } }
429};
430
431#undef F
432
433#if defined (__STDC__) || defined (ALMOST_STDC) || defined (HAVE_STRINGIZE)
434#define A(a) (1 << CGEN_INSN_##a)
435#else
436#define A(a) (1 << CGEN_INSN_/**/a)
437#endif
438#if defined (__STDC__) || defined (ALMOST_STDC) || defined (HAVE_STRINGIZE)
439#define OPERAND(op) MEP_OPERAND_##op
440#else
441#define OPERAND(op) MEP_OPERAND_/**/op
442#endif
443#define MNEM CGEN_SYNTAX_MNEMONIC /* syntax value for mnemonic */
444#define OP(field) CGEN_SYNTAX_MAKE_FIELD (OPERAND (field))
445
446/* The instruction table. */
447
448static const CGEN_OPCODE mep_cgen_insn_opcode_table[MAX_INSNS] =
449{
450 /* Special null first entry.
451 A `num' value of zero is thus invalid.
452 Also, the special `invalid' insn resides here. */
453 { { 0, 0, 0, 0 }, {{0}}, 0, {0}},
454/* stcb $rn,($rma) */
455 {
456 { 0, 0, 0, 0 },
457 { { MNEM, ' ', OP (RN), ',', '(', OP (RMA), ')', 0 } },
458 & ifmt_stcb_r, { 0x700c }
459 },
460/* ldcb $rn,($rma) */
461 {
462 { 0, 0, 0, 0 },
463 { { MNEM, ' ', OP (RN), ',', '(', OP (RMA), ')', 0 } },
464 & ifmt_stcb_r, { 0x700d }
465 },
466/* pref $cimm4,($rma) */
467 {
468 { 0, 0, 0, 0 },
469 { { MNEM, ' ', OP (CIMM4), ',', '(', OP (RMA), ')', 0 } },
470 & ifmt_pref, { 0x7005 }
471 },
472/* pref $cimm4,$sdisp16($rma) */
473 {
474 { 0, 0, 0, 0 },
475 { { MNEM, ' ', OP (CIMM4), ',', OP (SDISP16), '(', OP (RMA), ')', 0 } },
476 & ifmt_prefd, { 0xf0030000 }
477 },
478/* casb3 $rl5,$rn,($rm) */
479 {
480 { 0, 0, 0, 0 },
481 { { MNEM, ' ', OP (RL5), ',', OP (RN), ',', '(', OP (RM), ')', 0 } },
482 & ifmt_casb3, { 0xf0012000 }
483 },
484/* cash3 $rl5,$rn,($rm) */
485 {
486 { 0, 0, 0, 0 },
487 { { MNEM, ' ', OP (RL5), ',', OP (RN), ',', '(', OP (RM), ')', 0 } },
488 & ifmt_casb3, { 0xf0012001 }
489 },
490/* casw3 $rl5,$rn,($rm) */
491 {
492 { 0, 0, 0, 0 },
493 { { MNEM, ' ', OP (RL5), ',', OP (RN), ',', '(', OP (RM), ')', 0 } },
494 & ifmt_casb3, { 0xf0012002 }
495 },
496/* sbcp $crn,$cdisp12($rma) */
497 {
498 { 0, 0, 0, 0 },
499 { { MNEM, ' ', OP (CRN), ',', OP (CDISP12), '(', OP (RMA), ')', 0 } },
500 & ifmt_sbcp, { 0xf0060000 }
501 },
502/* lbcp $crn,$cdisp12($rma) */
503 {
504 { 0, 0, 0, 0 },
505 { { MNEM, ' ', OP (CRN), ',', OP (CDISP12), '(', OP (RMA), ')', 0 } },
506 & ifmt_sbcp, { 0xf0064000 }
507 },
508/* lbucp $crn,$cdisp12($rma) */
509 {
510 { 0, 0, 0, 0 },
511 { { MNEM, ' ', OP (CRN), ',', OP (CDISP12), '(', OP (RMA), ')', 0 } },
512 & ifmt_sbcp, { 0xf006c000 }
513 },
514/* shcp $crn,$cdisp12($rma) */
515 {
516 { 0, 0, 0, 0 },
517 { { MNEM, ' ', OP (CRN), ',', OP (CDISP12), '(', OP (RMA), ')', 0 } },
518 & ifmt_sbcp, { 0xf0061000 }
519 },
520/* lhcp $crn,$cdisp12($rma) */
521 {
522 { 0, 0, 0, 0 },
523 { { MNEM, ' ', OP (CRN), ',', OP (CDISP12), '(', OP (RMA), ')', 0 } },
524 & ifmt_sbcp, { 0xf0065000 }
525 },
526/* lhucp $crn,$cdisp12($rma) */
527 {
528 { 0, 0, 0, 0 },
529 { { MNEM, ' ', OP (CRN), ',', OP (CDISP12), '(', OP (RMA), ')', 0 } },
530 & ifmt_sbcp, { 0xf006d000 }
531 },
532/* lbucpa $crn,($rma+),$cdisp10 */
533 {
534 { 0, 0, 0, 0 },
535 { { MNEM, ' ', OP (CRN), ',', '(', OP (RMA), '+', ')', ',', OP (CDISP10), 0 } },
536 & ifmt_lbucpa, { 0xf005c000 }
537 },
538/* lhucpa $crn,($rma+),$cdisp10a2 */
539 {
540 { 0, 0, 0, 0 },
541 { { MNEM, ' ', OP (CRN), ',', '(', OP (RMA), '+', ')', ',', OP (CDISP10A2), 0 } },
542 & ifmt_lhucpa, { 0xf005d000 }
543 },
544/* lbucpm0 $crn,($rma+),$cdisp10 */
545 {
546 { 0, 0, 0, 0 },
547 { { MNEM, ' ', OP (CRN), ',', '(', OP (RMA), '+', ')', ',', OP (CDISP10), 0 } },
548 & ifmt_lbucpa, { 0xf005c800 }
549 },
550/* lhucpm0 $crn,($rma+),$cdisp10a2 */
551 {
552 { 0, 0, 0, 0 },
553 { { MNEM, ' ', OP (CRN), ',', '(', OP (RMA), '+', ')', ',', OP (CDISP10A2), 0 } },
554 & ifmt_lhucpa, { 0xf005d800 }
555 },
556/* lbucpm1 $crn,($rma+),$cdisp10 */
557 {
558 { 0, 0, 0, 0 },
559 { { MNEM, ' ', OP (CRN), ',', '(', OP (RMA), '+', ')', ',', OP (CDISP10), 0 } },
560 & ifmt_lbucpa, { 0xf005cc00 }
561 },
562/* lhucpm1 $crn,($rma+),$cdisp10a2 */
563 {
564 { 0, 0, 0, 0 },
565 { { MNEM, ' ', OP (CRN), ',', '(', OP (RMA), '+', ')', ',', OP (CDISP10A2), 0 } },
566 & ifmt_lhucpa, { 0xf005dc00 }
567 },
568/* uci $rn,$rm,$uimm16 */
569 {
570 { 0, 0, 0, 0 },
571 { { MNEM, ' ', OP (RN), ',', OP (RM), ',', OP (UIMM16), 0 } },
572 & ifmt_uci, { 0xf0020000 }
573 },
574/* dsp $rn,$rm,$uimm16 */
575 {
576 { 0, 0, 0, 0 },
577 { { MNEM, ' ', OP (RN), ',', OP (RM), ',', OP (UIMM16), 0 } },
578 & ifmt_dsp, { 0xf0000000 }
579 },
580/* dsp0 $c5rnmuimm24 */
581 {
582 { 0, 0, 0, 0 },
583 { { MNEM, ' ', OP (C5RNMUIMM24), 0 } },
584 & ifmt_dsp0, { 0xf0000000 }
585 },
586/* dsp1 $rn,$c5rmuimm20 */
587 {
588 { 0, 0, 0, 0 },
589 { { MNEM, ' ', OP (RN), ',', OP (C5RMUIMM20), 0 } },
590 & ifmt_dsp1, { 0xf0000000 }
591 },
592/* sb $rnc,($rma) */
593 {
594 { 0, 0, 0, 0 },
595 { { MNEM, ' ', OP (RNC), ',', '(', OP (RMA), ')', 0 } },
596 & ifmt_sb, { 0x8 }
597 },
598/* sh $rns,($rma) */
599 {
600 { 0, 0, 0, 0 },
601 { { MNEM, ' ', OP (RNS), ',', '(', OP (RMA), ')', 0 } },
602 & ifmt_sh, { 0x9 }
603 },
604/* sw $rnl,($rma) */
605 {
606 { 0, 0, 0, 0 },
607 { { MNEM, ' ', OP (RNL), ',', '(', OP (RMA), ')', 0 } },
608 & ifmt_sw, { 0xa }
609 },
610/* lb $rnc,($rma) */
611 {
612 { 0, 0, 0, 0 },
613 { { MNEM, ' ', OP (RNC), ',', '(', OP (RMA), ')', 0 } },
614 & ifmt_sb, { 0xc }
615 },
616/* lh $rns,($rma) */
617 {
618 { 0, 0, 0, 0 },
619 { { MNEM, ' ', OP (RNS), ',', '(', OP (RMA), ')', 0 } },
620 & ifmt_sh, { 0xd }
621 },
622/* lw $rnl,($rma) */
623 {
624 { 0, 0, 0, 0 },
625 { { MNEM, ' ', OP (RNL), ',', '(', OP (RMA), ')', 0 } },
626 & ifmt_sw, { 0xe }
627 },
628/* lbu $rnuc,($rma) */
629 {
630 { 0, 0, 0, 0 },
631 { { MNEM, ' ', OP (RNUC), ',', '(', OP (RMA), ')', 0 } },
632 & ifmt_lbu, { 0xb }
633 },
634/* lhu $rnus,($rma) */
635 {
636 { 0, 0, 0, 0 },
637 { { MNEM, ' ', OP (RNUS), ',', '(', OP (RMA), ')', 0 } },
638 & ifmt_lhu, { 0xf }
639 },
640/* sw $rnl,$udisp7a4($spr) */
641 {
642 { 0, 0, 0, 0 },
643 { { MNEM, ' ', OP (RNL), ',', OP (UDISP7A4), '(', OP (SPR), ')', 0 } },
644 & ifmt_sw_sp, { 0x4002 }
645 },
646/* lw $rnl,$udisp7a4($spr) */
647 {
648 { 0, 0, 0, 0 },
649 { { MNEM, ' ', OP (RNL), ',', OP (UDISP7A4), '(', OP (SPR), ')', 0 } },
650 & ifmt_sw_sp, { 0x4003 }
651 },
652/* sb $rn3c,$udisp7($tpr) */
653 {
654 { 0, 0, 0, 0 },
655 { { MNEM, ' ', OP (RN3C), ',', OP (UDISP7), '(', OP (TPR), ')', 0 } },
656 & ifmt_sb_tp, { 0x8000 }
657 },
658/* sh $rn3s,$udisp7a2($tpr) */
659 {
660 { 0, 0, 0, 0 },
661 { { MNEM, ' ', OP (RN3S), ',', OP (UDISP7A2), '(', OP (TPR), ')', 0 } },
662 & ifmt_sh_tp, { 0x8080 }
663 },
664/* sw $rn3l,$udisp7a4($tpr) */
665 {
666 { 0, 0, 0, 0 },
667 { { MNEM, ' ', OP (RN3L), ',', OP (UDISP7A4), '(', OP (TPR), ')', 0 } },
668 & ifmt_sw_tp, { 0x4082 }
669 },
670/* lb $rn3c,$udisp7($tpr) */
671 {
672 { 0, 0, 0, 0 },
673 { { MNEM, ' ', OP (RN3C), ',', OP (UDISP7), '(', OP (TPR), ')', 0 } },
674 & ifmt_sb_tp, { 0x8800 }
675 },
676/* lh $rn3s,$udisp7a2($tpr) */
677 {
678 { 0, 0, 0, 0 },
679 { { MNEM, ' ', OP (RN3S), ',', OP (UDISP7A2), '(', OP (TPR), ')', 0 } },
680 & ifmt_sh_tp, { 0x8880 }
681 },
682/* lw $rn3l,$udisp7a4($tpr) */
683 {
684 { 0, 0, 0, 0 },
685 { { MNEM, ' ', OP (RN3L), ',', OP (UDISP7A4), '(', OP (TPR), ')', 0 } },
686 & ifmt_sw_tp, { 0x4083 }
687 },
688/* lbu $rn3uc,$udisp7($tpr) */
689 {
690 { 0, 0, 0, 0 },
691 { { MNEM, ' ', OP (RN3UC), ',', OP (UDISP7), '(', OP (TPR), ')', 0 } },
692 & ifmt_lbu_tp, { 0x4880 }
693 },
694/* lhu $rn3us,$udisp7a2($tpr) */
695 {
696 { 0, 0, 0, 0 },
697 { { MNEM, ' ', OP (RN3US), ',', OP (UDISP7A2), '(', OP (TPR), ')', 0 } },
698 & ifmt_lhu_tp, { 0x8881 }
699 },
700/* sb $rnc,$sdisp16($rma) */
701 {
702 { 0, 0, 0, 0 },
703 { { MNEM, ' ', OP (RNC), ',', OP (SDISP16), '(', OP (RMA), ')', 0 } },
704 & ifmt_sb16, { 0xc0080000 }
705 },
706/* sh $rns,$sdisp16($rma) */
707 {
708 { 0, 0, 0, 0 },
709 { { MNEM, ' ', OP (RNS), ',', OP (SDISP16), '(', OP (RMA), ')', 0 } },
710 & ifmt_sh16, { 0xc0090000 }
711 },
712/* sw $rnl,$sdisp16($rma) */
713 {
714 { 0, 0, 0, 0 },
715 { { MNEM, ' ', OP (RNL), ',', OP (SDISP16), '(', OP (RMA), ')', 0 } },
716 & ifmt_sw16, { 0xc00a0000 }
717 },
718/* lb $rnc,$sdisp16($rma) */
719 {
720 { 0, 0, 0, 0 },
721 { { MNEM, ' ', OP (RNC), ',', OP (SDISP16), '(', OP (RMA), ')', 0 } },
722 & ifmt_sb16, { 0xc00c0000 }
723 },
724/* lh $rns,$sdisp16($rma) */
725 {
726 { 0, 0, 0, 0 },
727 { { MNEM, ' ', OP (RNS), ',', OP (SDISP16), '(', OP (RMA), ')', 0 } },
728 & ifmt_sh16, { 0xc00d0000 }
729 },
730/* lw $rnl,$sdisp16($rma) */
731 {
732 { 0, 0, 0, 0 },
733 { { MNEM, ' ', OP (RNL), ',', OP (SDISP16), '(', OP (RMA), ')', 0 } },
734 & ifmt_sw16, { 0xc00e0000 }
735 },
736/* lbu $rnuc,$sdisp16($rma) */
737 {
738 { 0, 0, 0, 0 },
739 { { MNEM, ' ', OP (RNUC), ',', OP (SDISP16), '(', OP (RMA), ')', 0 } },
740 & ifmt_lbu16, { 0xc00b0000 }
741 },
742/* lhu $rnus,$sdisp16($rma) */
743 {
744 { 0, 0, 0, 0 },
745 { { MNEM, ' ', OP (RNUS), ',', OP (SDISP16), '(', OP (RMA), ')', 0 } },
746 & ifmt_lhu16, { 0xc00f0000 }
747 },
748/* sw $rnl,($addr24a4) */
749 {
750 { 0, 0, 0, 0 },
751 { { MNEM, ' ', OP (RNL), ',', '(', OP (ADDR24A4), ')', 0 } },
752 & ifmt_sw24, { 0xe0020000 }
753 },
754/* lw $rnl,($addr24a4) */
755 {
756 { 0, 0, 0, 0 },
757 { { MNEM, ' ', OP (RNL), ',', '(', OP (ADDR24A4), ')', 0 } },
758 & ifmt_sw24, { 0xe0030000 }
759 },
760/* extb $rn */
761 {
762 { 0, 0, 0, 0 },
763 { { MNEM, ' ', OP (RN), 0 } },
764 & ifmt_extb, { 0x100d }
765 },
766/* exth $rn */
767 {
768 { 0, 0, 0, 0 },
769 { { MNEM, ' ', OP (RN), 0 } },
770 & ifmt_extb, { 0x102d }
771 },
772/* extub $rn */
773 {
774 { 0, 0, 0, 0 },
775 { { MNEM, ' ', OP (RN), 0 } },
776 & ifmt_extb, { 0x108d }
777 },
778/* extuh $rn */
779 {
780 { 0, 0, 0, 0 },
781 { { MNEM, ' ', OP (RN), 0 } },
782 & ifmt_extb, { 0x10ad }
783 },
784/* ssarb $udisp2($rm) */
785 {
786 { 0, 0, 0, 0 },
787 { { MNEM, ' ', OP (UDISP2), '(', OP (RM), ')', 0 } },
788 & ifmt_ssarb, { 0x100c }
789 },
790/* mov $rn,$rm */
791 {
792 { 0, 0, 0, 0 },
793 { { MNEM, ' ', OP (RN), ',', OP (RM), 0 } },
794 & ifmt_mov, { 0x0 }
795 },
796/* mov $rn,$simm8 */
797 {
798 { 0, 0, 0, 0 },
799 { { MNEM, ' ', OP (RN), ',', OP (SIMM8), 0 } },
800 & ifmt_movi8, { 0x5000 }
801 },
802/* mov $rn,$simm16 */
803 {
804 { 0, 0, 0, 0 },
805 { { MNEM, ' ', OP (RN), ',', OP (SIMM16), 0 } },
806 & ifmt_movi16, { 0xc0010000 }
807 },
808/* movu $rn3,$uimm24 */
809 {
810 { 0, 0, 0, 0 },
811 { { MNEM, ' ', OP (RN3), ',', OP (UIMM24), 0 } },
812 & ifmt_movu24, { 0xd0000000 }
813 },
814/* movu $rn,$uimm16 */
815 {
816 { 0, 0, 0, 0 },
817 { { MNEM, ' ', OP (RN), ',', OP (UIMM16), 0 } },
818 & ifmt_movu16, { 0xc0110000 }
819 },
820/* movh $rn,$uimm16 */
821 {
822 { 0, 0, 0, 0 },
823 { { MNEM, ' ', OP (RN), ',', OP (UIMM16), 0 } },
824 & ifmt_movu16, { 0xc0210000 }
825 },
826/* add3 $rl,$rn,$rm */
827 {
828 { 0, 0, 0, 0 },
829 { { MNEM, ' ', OP (RL), ',', OP (RN), ',', OP (RM), 0 } },
830 & ifmt_add3, { 0x9000 }
831 },
832/* add $rn,$simm6 */
833 {
834 { 0, 0, 0, 0 },
835 { { MNEM, ' ', OP (RN), ',', OP (SIMM6), 0 } },
836 & ifmt_add, { 0x6000 }
837 },
838/* add3 $rn,$spr,$uimm7a4 */
839 {
840 { 0, 0, 0, 0 },
841 { { MNEM, ' ', OP (RN), ',', OP (SPR), ',', OP (UIMM7A4), 0 } },
842 & ifmt_add3i, { 0x4000 }
843 },
844/* advck3 \$0,$rn,$rm */
845 {
846 { 0, 0, 0, 0 },
847 { { MNEM, ' ', '$', '0', ',', OP (RN), ',', OP (RM), 0 } },
848 & ifmt_mov, { 0x7 }
849 },
850/* sub $rn,$rm */
851 {
852 { 0, 0, 0, 0 },
853 { { MNEM, ' ', OP (RN), ',', OP (RM), 0 } },
854 & ifmt_mov, { 0x4 }
855 },
856/* sbvck3 \$0,$rn,$rm */
857 {
858 { 0, 0, 0, 0 },
859 { { MNEM, ' ', '$', '0', ',', OP (RN), ',', OP (RM), 0 } },
860 & ifmt_mov, { 0x5 }
861 },
862/* neg $rn,$rm */
863 {
864 { 0, 0, 0, 0 },
865 { { MNEM, ' ', OP (RN), ',', OP (RM), 0 } },
866 & ifmt_mov, { 0x1 }
867 },
868/* slt3 \$0,$rn,$rm */
869 {
870 { 0, 0, 0, 0 },
871 { { MNEM, ' ', '$', '0', ',', OP (RN), ',', OP (RM), 0 } },
872 & ifmt_mov, { 0x2 }
873 },
874/* sltu3 \$0,$rn,$rm */
875 {
876 { 0, 0, 0, 0 },
877 { { MNEM, ' ', '$', '0', ',', OP (RN), ',', OP (RM), 0 } },
878 & ifmt_mov, { 0x3 }
879 },
880/* slt3 \$0,$rn,$uimm5 */
881 {
882 { 0, 0, 0, 0 },
883 { { MNEM, ' ', '$', '0', ',', OP (RN), ',', OP (UIMM5), 0 } },
884 & ifmt_slt3i, { 0x6001 }
885 },
886/* sltu3 \$0,$rn,$uimm5 */
887 {
888 { 0, 0, 0, 0 },
889 { { MNEM, ' ', '$', '0', ',', OP (RN), ',', OP (UIMM5), 0 } },
890 & ifmt_slt3i, { 0x6005 }
891 },
892/* sl1ad3 \$0,$rn,$rm */
893 {
894 { 0, 0, 0, 0 },
895 { { MNEM, ' ', '$', '0', ',', OP (RN), ',', OP (RM), 0 } },
896 & ifmt_mov, { 0x2006 }
897 },
898/* sl2ad3 \$0,$rn,$rm */
899 {
900 { 0, 0, 0, 0 },
901 { { MNEM, ' ', '$', '0', ',', OP (RN), ',', OP (RM), 0 } },
902 & ifmt_mov, { 0x2007 }
903 },
904/* add3 $rn,$rm,$simm16 */
905 {
906 { 0, 0, 0, 0 },
907 { { MNEM, ' ', OP (RN), ',', OP (RM), ',', OP (SIMM16), 0 } },
908 & ifmt_uci, { 0xc0000000 }
909 },
910/* slt3 $rn,$rm,$simm16 */
911 {
912 { 0, 0, 0, 0 },
913 { { MNEM, ' ', OP (RN), ',', OP (RM), ',', OP (SIMM16), 0 } },
914 & ifmt_uci, { 0xc0020000 }
915 },
916/* sltu3 $rn,$rm,$uimm16 */
917 {
918 { 0, 0, 0, 0 },
919 { { MNEM, ' ', OP (RN), ',', OP (RM), ',', OP (UIMM16), 0 } },
920 & ifmt_dsp, { 0xc0030000 }
921 },
922/* or $rn,$rm */
923 {
924 { 0, 0, 0, 0 },
925 { { MNEM, ' ', OP (RN), ',', OP (RM), 0 } },
926 & ifmt_mov, { 0x1000 }
927 },
928/* and $rn,$rm */
929 {
930 { 0, 0, 0, 0 },
931 { { MNEM, ' ', OP (RN), ',', OP (RM), 0 } },
932 & ifmt_mov, { 0x1001 }
933 },
934/* xor $rn,$rm */
935 {
936 { 0, 0, 0, 0 },
937 { { MNEM, ' ', OP (RN), ',', OP (RM), 0 } },
938 & ifmt_mov, { 0x1002 }
939 },
940/* nor $rn,$rm */
941 {
942 { 0, 0, 0, 0 },
943 { { MNEM, ' ', OP (RN), ',', OP (RM), 0 } },
944 & ifmt_mov, { 0x1003 }
945 },
946/* or3 $rn,$rm,$uimm16 */
947 {
948 { 0, 0, 0, 0 },
949 { { MNEM, ' ', OP (RN), ',', OP (RM), ',', OP (UIMM16), 0 } },
950 & ifmt_dsp, { 0xc0040000 }
951 },
952/* and3 $rn,$rm,$uimm16 */
953 {
954 { 0, 0, 0, 0 },
955 { { MNEM, ' ', OP (RN), ',', OP (RM), ',', OP (UIMM16), 0 } },
956 & ifmt_dsp, { 0xc0050000 }
957 },
958/* xor3 $rn,$rm,$uimm16 */
959 {
960 { 0, 0, 0, 0 },
961 { { MNEM, ' ', OP (RN), ',', OP (RM), ',', OP (UIMM16), 0 } },
962 & ifmt_dsp, { 0xc0060000 }
963 },
964/* sra $rn,$rm */
965 {
966 { 0, 0, 0, 0 },
967 { { MNEM, ' ', OP (RN), ',', OP (RM), 0 } },
968 & ifmt_mov, { 0x200d }
969 },
970/* srl $rn,$rm */
971 {
972 { 0, 0, 0, 0 },
973 { { MNEM, ' ', OP (RN), ',', OP (RM), 0 } },
974 & ifmt_mov, { 0x200c }
975 },
976/* sll $rn,$rm */
977 {
978 { 0, 0, 0, 0 },
979 { { MNEM, ' ', OP (RN), ',', OP (RM), 0 } },
980 & ifmt_mov, { 0x200e }
981 },
982/* sra $rn,$uimm5 */
983 {
984 { 0, 0, 0, 0 },
985 { { MNEM, ' ', OP (RN), ',', OP (UIMM5), 0 } },
986 & ifmt_slt3i, { 0x6003 }
987 },
988/* srl $rn,$uimm5 */
989 {
990 { 0, 0, 0, 0 },
991 { { MNEM, ' ', OP (RN), ',', OP (UIMM5), 0 } },
992 & ifmt_slt3i, { 0x6002 }
993 },
994/* sll $rn,$uimm5 */
995 {
996 { 0, 0, 0, 0 },
997 { { MNEM, ' ', OP (RN), ',', OP (UIMM5), 0 } },
998 & ifmt_slt3i, { 0x6006 }
999 },
1000/* sll3 \$0,$rn,$uimm5 */
1001 {
1002 { 0, 0, 0, 0 },
1003 { { MNEM, ' ', '$', '0', ',', OP (RN), ',', OP (UIMM5), 0 } },
1004 & ifmt_slt3i, { 0x6007 }
1005 },
1006/* fsft $rn,$rm */
1007 {
1008 { 0, 0, 0, 0 },
1009 { { MNEM, ' ', OP (RN), ',', OP (RM), 0 } },
1010 & ifmt_mov, { 0x200f }
1011 },
1012/* bra $pcrel12a2 */
1013 {
1014 { 0, 0, 0, 0 },
1015 { { MNEM, ' ', OP (PCREL12A2), 0 } },
1016 & ifmt_bra, { 0xb000 }
1017 },
1018/* beqz $rn,$pcrel8a2 */
1019 {
1020 { 0, 0, 0, 0 },
1021 { { MNEM, ' ', OP (RN), ',', OP (PCREL8A2), 0 } },
1022 & ifmt_beqz, { 0xa000 }
1023 },
1024/* bnez $rn,$pcrel8a2 */
1025 {
1026 { 0, 0, 0, 0 },
1027 { { MNEM, ' ', OP (RN), ',', OP (PCREL8A2), 0 } },
1028 & ifmt_beqz, { 0xa001 }
1029 },
1030/* beqi $rn,$uimm4,$pcrel17a2 */
1031 {
1032 { 0, 0, 0, 0 },
1033 { { MNEM, ' ', OP (RN), ',', OP (UIMM4), ',', OP (PCREL17A2), 0 } },
1034 & ifmt_beqi, { 0xe0000000 }
1035 },
1036/* bnei $rn,$uimm4,$pcrel17a2 */
1037 {
1038 { 0, 0, 0, 0 },
1039 { { MNEM, ' ', OP (RN), ',', OP (UIMM4), ',', OP (PCREL17A2), 0 } },
1040 & ifmt_beqi, { 0xe0040000 }
1041 },
1042/* blti $rn,$uimm4,$pcrel17a2 */
1043 {
1044 { 0, 0, 0, 0 },
1045 { { MNEM, ' ', OP (RN), ',', OP (UIMM4), ',', OP (PCREL17A2), 0 } },
1046 & ifmt_beqi, { 0xe00c0000 }
1047 },
1048/* bgei $rn,$uimm4,$pcrel17a2 */
1049 {
1050 { 0, 0, 0, 0 },
1051 { { MNEM, ' ', OP (RN), ',', OP (UIMM4), ',', OP (PCREL17A2), 0 } },
1052 & ifmt_beqi, { 0xe0080000 }
1053 },
1054/* beq $rn,$rm,$pcrel17a2 */
1055 {
1056 { 0, 0, 0, 0 },
1057 { { MNEM, ' ', OP (RN), ',', OP (RM), ',', OP (PCREL17A2), 0 } },
1058 & ifmt_beq, { 0xe0010000 }
1059 },
1060/* bne $rn,$rm,$pcrel17a2 */
1061 {
1062 { 0, 0, 0, 0 },
1063 { { MNEM, ' ', OP (RN), ',', OP (RM), ',', OP (PCREL17A2), 0 } },
1064 & ifmt_beq, { 0xe0050000 }
1065 },
1066/* bsr $pcrel12a2 */
1067 {
1068 { 0, 0, 0, 0 },
1069 { { MNEM, ' ', OP (PCREL12A2), 0 } },
1070 & ifmt_bra, { 0xb001 }
1071 },
1072/* bsr $pcrel24a2 */
1073 {
1074 { 0, 0, 0, 0 },
1075 { { MNEM, ' ', OP (PCREL24A2), 0 } },
1076 & ifmt_bsr24, { 0xd8090000 }
1077 },
1078/* jmp $rm */
1079 {
1080 { 0, 0, 0, 0 },
1081 { { MNEM, ' ', OP (RM), 0 } },
1082 & ifmt_jmp, { 0x100e }
1083 },
1084/* jmp $pcabs24a2 */
1085 {
1086 { 0, 0, 0, 0 },
1087 { { MNEM, ' ', OP (PCABS24A2), 0 } },
1088 & ifmt_jmp24, { 0xd8080000 }
1089 },
1090/* jsr $rm */
1091 {
1092 { 0, 0, 0, 0 },
1093 { { MNEM, ' ', OP (RM), 0 } },
1094 & ifmt_jmp, { 0x100f }
1095 },
1096/* ret */
1097 {
1098 { 0, 0, 0, 0 },
1099 { { MNEM, 0 } },
1100 & ifmt_ret, { 0x7002 }
1101 },
1102/* repeat $rn,$pcrel17a2 */
1103 {
1104 { 0, 0, 0, 0 },
1105 { { MNEM, ' ', OP (RN), ',', OP (PCREL17A2), 0 } },
1106 & ifmt_repeat, { 0xe0090000 }
1107 },
1108/* erepeat $pcrel17a2 */
1109 {
1110 { 0, 0, 0, 0 },
1111 { { MNEM, ' ', OP (PCREL17A2), 0 } },
1112 & ifmt_erepeat, { 0xe0190000 }
1113 },
1114/* stc $rn,\$lp */
1115 {
1116 { 0, 0, 0, 0 },
1117 { { MNEM, ' ', OP (RN), ',', '$', 'l', 'p', 0 } },
1118 & ifmt_stc_lp, { 0x7018 }
1119 },
1120/* stc $rn,\$hi */
1121 {
1122 { 0, 0, 0, 0 },
1123 { { MNEM, ' ', OP (RN), ',', '$', 'h', 'i', 0 } },
1124 & ifmt_stc_lp, { 0x7078 }
1125 },
1126/* stc $rn,\$lo */
1127 {
1128 { 0, 0, 0, 0 },
1129 { { MNEM, ' ', OP (RN), ',', '$', 'l', 'o', 0 } },
1130 & ifmt_stc_lp, { 0x7088 }
1131 },
1132/* stc $rn,$csrn */
1133 {
1134 { 0, 0, 0, 0 },
1135 { { MNEM, ' ', OP (RN), ',', OP (CSRN), 0 } },
1136 & ifmt_stc, { 0x7008 }
1137 },
1138/* ldc $rn,\$lp */
1139 {
1140 { 0, 0, 0, 0 },
1141 { { MNEM, ' ', OP (RN), ',', '$', 'l', 'p', 0 } },
1142 & ifmt_stc_lp, { 0x701a }
1143 },
1144/* ldc $rn,\$hi */
1145 {
1146 { 0, 0, 0, 0 },
1147 { { MNEM, ' ', OP (RN), ',', '$', 'h', 'i', 0 } },
1148 & ifmt_stc_lp, { 0x707a }
1149 },
1150/* ldc $rn,\$lo */
1151 {
1152 { 0, 0, 0, 0 },
1153 { { MNEM, ' ', OP (RN), ',', '$', 'l', 'o', 0 } },
1154 & ifmt_stc_lp, { 0x708a }
1155 },
1156/* ldc $rn,$csrn */
1157 {
1158 { 0, 0, 0, 0 },
1159 { { MNEM, ' ', OP (RN), ',', OP (CSRN), 0 } },
1160 & ifmt_stc, { 0x700a }
1161 },
1162/* di */
1163 {
1164 { 0, 0, 0, 0 },
1165 { { MNEM, 0 } },
1166 & ifmt_ret, { 0x7000 }
1167 },
1168/* ei */
1169 {
1170 { 0, 0, 0, 0 },
1171 { { MNEM, 0 } },
1172 & ifmt_ret, { 0x7010 }
1173 },
1174/* reti */
1175 {
1176 { 0, 0, 0, 0 },
1177 { { MNEM, 0 } },
1178 & ifmt_ret, { 0x7012 }
1179 },
1180/* halt */
1181 {
1182 { 0, 0, 0, 0 },
1183 { { MNEM, 0 } },
1184 & ifmt_ret, { 0x7022 }
1185 },
1186/* sleep */
1187 {
1188 { 0, 0, 0, 0 },
1189 { { MNEM, 0 } },
1190 & ifmt_ret, { 0x7062 }
1191 },
1192/* swi $uimm2 */
1193 {
1194 { 0, 0, 0, 0 },
1195 { { MNEM, ' ', OP (UIMM2), 0 } },
1196 & ifmt_swi, { 0x7006 }
1197 },
1198/* break */
1199 {
1200 { 0, 0, 0, 0 },
1201 { { MNEM, 0 } },
1202 & ifmt_ret, { 0x7032 }
1203 },
1204/* syncm */
1205 {
1206 { 0, 0, 0, 0 },
1207 { { MNEM, 0 } },
1208 & ifmt_ret, { 0x7011 }
1209 },
1210/* stcb $rn,$uimm16 */
1211 {
1212 { 0, 0, 0, 0 },
1213 { { MNEM, ' ', OP (RN), ',', OP (UIMM16), 0 } },
1214 & ifmt_movu16, { 0xf0040000 }
1215 },
1216/* ldcb $rn,$uimm16 */
1217 {
1218 { 0, 0, 0, 0 },
1219 { { MNEM, ' ', OP (RN), ',', OP (UIMM16), 0 } },
1220 & ifmt_movu16, { 0xf0140000 }
1221 },
1222/* bsetm ($rma),$uimm3 */
1223 {
1224 { 0, 0, 0, 0 },
1225 { { MNEM, ' ', '(', OP (RMA), ')', ',', OP (UIMM3), 0 } },
1226 & ifmt_bsetm, { 0x2000 }
1227 },
1228/* bclrm ($rma),$uimm3 */
1229 {
1230 { 0, 0, 0, 0 },
1231 { { MNEM, ' ', '(', OP (RMA), ')', ',', OP (UIMM3), 0 } },
1232 & ifmt_bsetm, { 0x2001 }
1233 },
1234/* bnotm ($rma),$uimm3 */
1235 {
1236 { 0, 0, 0, 0 },
1237 { { MNEM, ' ', '(', OP (RMA), ')', ',', OP (UIMM3), 0 } },
1238 & ifmt_bsetm, { 0x2002 }
1239 },
1240/* btstm \$0,($rma),$uimm3 */
1241 {
1242 { 0, 0, 0, 0 },
1243 { { MNEM, ' ', '$', '0', ',', '(', OP (RMA), ')', ',', OP (UIMM3), 0 } },
1244 & ifmt_bsetm, { 0x2003 }
1245 },
1246/* tas $rn,($rma) */
1247 {
1248 { 0, 0, 0, 0 },
1249 { { MNEM, ' ', OP (RN), ',', '(', OP (RMA), ')', 0 } },
1250 & ifmt_stcb_r, { 0x2004 }
1251 },
1252/* cache $cimm4,($rma) */
1253 {
1254 { 0, 0, 0, 0 },
1255 { { MNEM, ' ', OP (CIMM4), ',', '(', OP (RMA), ')', 0 } },
1256 & ifmt_pref, { 0x7004 }
1257 },
1258/* mul $rn,$rm */
1259 {
1260 { 0, 0, 0, 0 },
1261 { { MNEM, ' ', OP (RN), ',', OP (RM), 0 } },
1262 & ifmt_mov, { 0x1004 }
1263 },
1264/* mulu $rn,$rm */
1265 {
1266 { 0, 0, 0, 0 },
1267 { { MNEM, ' ', OP (RN), ',', OP (RM), 0 } },
1268 & ifmt_mov, { 0x1005 }
1269 },
1270/* mulr $rn,$rm */
1271 {
1272 { 0, 0, 0, 0 },
1273 { { MNEM, ' ', OP (RN), ',', OP (RM), 0 } },
1274 & ifmt_mov, { 0x1006 }
1275 },
1276/* mulru $rn,$rm */
1277 {
1278 { 0, 0, 0, 0 },
1279 { { MNEM, ' ', OP (RN), ',', OP (RM), 0 } },
1280 & ifmt_mov, { 0x1007 }
1281 },
1282/* madd $rn,$rm */
1283 {
1284 { 0, 0, 0, 0 },
1285 { { MNEM, ' ', OP (RN), ',', OP (RM), 0 } },
1286 & ifmt_madd, { 0xf0013004 }
1287 },
1288/* maddu $rn,$rm */
1289 {
1290 { 0, 0, 0, 0 },
1291 { { MNEM, ' ', OP (RN), ',', OP (RM), 0 } },
1292 & ifmt_madd, { 0xf0013005 }
1293 },
1294/* maddr $rn,$rm */
1295 {
1296 { 0, 0, 0, 0 },
1297 { { MNEM, ' ', OP (RN), ',', OP (RM), 0 } },
1298 & ifmt_madd, { 0xf0013006 }
1299 },
1300/* maddru $rn,$rm */
1301 {
1302 { 0, 0, 0, 0 },
1303 { { MNEM, ' ', OP (RN), ',', OP (RM), 0 } },
1304 & ifmt_madd, { 0xf0013007 }
1305 },
1306/* div $rn,$rm */
1307 {
1308 { 0, 0, 0, 0 },
1309 { { MNEM, ' ', OP (RN), ',', OP (RM), 0 } },
1310 & ifmt_mov, { 0x1008 }
1311 },
1312/* divu $rn,$rm */
1313 {
1314 { 0, 0, 0, 0 },
1315 { { MNEM, ' ', OP (RN), ',', OP (RM), 0 } },
1316 & ifmt_mov, { 0x1009 }
1317 },
1318/* dret */
1319 {
1320 { 0, 0, 0, 0 },
1321 { { MNEM, 0 } },
1322 & ifmt_ret, { 0x7013 }
1323 },
1324/* dbreak */
1325 {
1326 { 0, 0, 0, 0 },
1327 { { MNEM, 0 } },
1328 & ifmt_ret, { 0x7033 }
1329 },
1330/* ldz $rn,$rm */
1331 {
1332 { 0, 0, 0, 0 },
1333 { { MNEM, ' ', OP (RN), ',', OP (RM), 0 } },
1334 & ifmt_madd, { 0xf0010000 }
1335 },
1336/* abs $rn,$rm */
1337 {
1338 { 0, 0, 0, 0 },
1339 { { MNEM, ' ', OP (RN), ',', OP (RM), 0 } },
1340 & ifmt_madd, { 0xf0010003 }
1341 },
1342/* ave $rn,$rm */
1343 {
1344 { 0, 0, 0, 0 },
1345 { { MNEM, ' ', OP (RN), ',', OP (RM), 0 } },
1346 & ifmt_madd, { 0xf0010002 }
1347 },
1348/* min $rn,$rm */
1349 {
1350 { 0, 0, 0, 0 },
1351 { { MNEM, ' ', OP (RN), ',', OP (RM), 0 } },
1352 & ifmt_madd, { 0xf0010004 }
1353 },
1354/* max $rn,$rm */
1355 {
1356 { 0, 0, 0, 0 },
1357 { { MNEM, ' ', OP (RN), ',', OP (RM), 0 } },
1358 & ifmt_madd, { 0xf0010005 }
1359 },
1360/* minu $rn,$rm */
1361 {
1362 { 0, 0, 0, 0 },
1363 { { MNEM, ' ', OP (RN), ',', OP (RM), 0 } },
1364 & ifmt_madd, { 0xf0010006 }
1365 },
1366/* maxu $rn,$rm */
1367 {
1368 { 0, 0, 0, 0 },
1369 { { MNEM, ' ', OP (RN), ',', OP (RM), 0 } },
1370 & ifmt_madd, { 0xf0010007 }
1371 },
1372/* clip $rn,$cimm5 */
1373 {
1374 { 0, 0, 0, 0 },
1375 { { MNEM, ' ', OP (RN), ',', OP (CIMM5), 0 } },
1376 & ifmt_clip, { 0xf0011000 }
1377 },
1378/* clipu $rn,$cimm5 */
1379 {
1380 { 0, 0, 0, 0 },
1381 { { MNEM, ' ', OP (RN), ',', OP (CIMM5), 0 } },
1382 & ifmt_clip, { 0xf0011001 }
1383 },
1384/* sadd $rn,$rm */
1385 {
1386 { 0, 0, 0, 0 },
1387 { { MNEM, ' ', OP (RN), ',', OP (RM), 0 } },
1388 & ifmt_madd, { 0xf0010008 }
1389 },
1390/* ssub $rn,$rm */
1391 {
1392 { 0, 0, 0, 0 },
1393 { { MNEM, ' ', OP (RN), ',', OP (RM), 0 } },
1394 & ifmt_madd, { 0xf001000a }
1395 },
1396/* saddu $rn,$rm */
1397 {
1398 { 0, 0, 0, 0 },
1399 { { MNEM, ' ', OP (RN), ',', OP (RM), 0 } },
1400 & ifmt_madd, { 0xf0010009 }
1401 },
1402/* ssubu $rn,$rm */
1403 {
1404 { 0, 0, 0, 0 },
1405 { { MNEM, ' ', OP (RN), ',', OP (RM), 0 } },
1406 & ifmt_madd, { 0xf001000b }
1407 },
1408/* swcp $crn,($rma) */
1409 {
1410 { 0, 0, 0, 0 },
1411 { { MNEM, ' ', OP (CRN), ',', '(', OP (RMA), ')', 0 } },
1412 & ifmt_swcp, { 0x3008 }
1413 },
1414/* lwcp $crn,($rma) */
1415 {
1416 { 0, 0, 0, 0 },
1417 { { MNEM, ' ', OP (CRN), ',', '(', OP (RMA), ')', 0 } },
1418 & ifmt_swcp, { 0x3009 }
1419 },
1420/* smcp $crn64,($rma) */
1421 {
1422 { 0, 0, 0, 0 },
1423 { { MNEM, ' ', OP (CRN64), ',', '(', OP (RMA), ')', 0 } },
1424 & ifmt_smcp, { 0x300a }
1425 },
1426/* lmcp $crn64,($rma) */
1427 {
1428 { 0, 0, 0, 0 },
1429 { { MNEM, ' ', OP (CRN64), ',', '(', OP (RMA), ')', 0 } },
1430 & ifmt_smcp, { 0x300b }
1431 },
1432/* swcpi $crn,($rma+) */
1433 {
1434 { 0, 0, 0, 0 },
1435 { { MNEM, ' ', OP (CRN), ',', '(', OP (RMA), '+', ')', 0 } },
1436 & ifmt_swcp, { 0x3000 }
1437 },
1438/* lwcpi $crn,($rma+) */
1439 {
1440 { 0, 0, 0, 0 },
1441 { { MNEM, ' ', OP (CRN), ',', '(', OP (RMA), '+', ')', 0 } },
1442 & ifmt_swcp, { 0x3001 }
1443 },
1444/* smcpi $crn64,($rma+) */
1445 {
1446 { 0, 0, 0, 0 },
1447 { { MNEM, ' ', OP (CRN64), ',', '(', OP (RMA), '+', ')', 0 } },
1448 & ifmt_smcp, { 0x3002 }
1449 },
1450/* lmcpi $crn64,($rma+) */
1451 {
1452 { 0, 0, 0, 0 },
1453 { { MNEM, ' ', OP (CRN64), ',', '(', OP (RMA), '+', ')', 0 } },
1454 & ifmt_smcp, { 0x3003 }
1455 },
1456/* swcp $crn,$sdisp16($rma) */
1457 {
1458 { 0, 0, 0, 0 },
1459 { { MNEM, ' ', OP (CRN), ',', OP (SDISP16), '(', OP (RMA), ')', 0 } },
1460 & ifmt_swcp16, { 0xf00c0000 }
1461 },
1462/* lwcp $crn,$sdisp16($rma) */
1463 {
1464 { 0, 0, 0, 0 },
1465 { { MNEM, ' ', OP (CRN), ',', OP (SDISP16), '(', OP (RMA), ')', 0 } },
1466 & ifmt_swcp16, { 0xf00d0000 }
1467 },
1468/* smcp $crn64,$sdisp16($rma) */
1469 {
1470 { 0, 0, 0, 0 },
1471 { { MNEM, ' ', OP (CRN64), ',', OP (SDISP16), '(', OP (RMA), ')', 0 } },
1472 & ifmt_smcp16, { 0xf00e0000 }
1473 },
1474/* lmcp $crn64,$sdisp16($rma) */
1475 {
1476 { 0, 0, 0, 0 },
1477 { { MNEM, ' ', OP (CRN64), ',', OP (SDISP16), '(', OP (RMA), ')', 0 } },
1478 & ifmt_smcp16, { 0xf00f0000 }
1479 },
1480/* sbcpa $crn,($rma+),$cdisp10 */
1481 {
1482 { 0, 0, 0, 0 },
1483 { { MNEM, ' ', OP (CRN), ',', '(', OP (RMA), '+', ')', ',', OP (CDISP10), 0 } },
1484 & ifmt_lbucpa, { 0xf0050000 }
1485 },
1486/* lbcpa $crn,($rma+),$cdisp10 */
1487 {
1488 { 0, 0, 0, 0 },
1489 { { MNEM, ' ', OP (CRN), ',', '(', OP (RMA), '+', ')', ',', OP (CDISP10), 0 } },
1490 & ifmt_lbucpa, { 0xf0054000 }
1491 },
1492/* shcpa $crn,($rma+),$cdisp10a2 */
1493 {
1494 { 0, 0, 0, 0 },
1495 { { MNEM, ' ', OP (CRN), ',', '(', OP (RMA), '+', ')', ',', OP (CDISP10A2), 0 } },
1496 & ifmt_lhucpa, { 0xf0051000 }
1497 },
1498/* lhcpa $crn,($rma+),$cdisp10a2 */
1499 {
1500 { 0, 0, 0, 0 },
1501 { { MNEM, ' ', OP (CRN), ',', '(', OP (RMA), '+', ')', ',', OP (CDISP10A2), 0 } },
1502 & ifmt_lhucpa, { 0xf0055000 }
1503 },
1504/* swcpa $crn,($rma+),$cdisp10a4 */
1505 {
1506 { 0, 0, 0, 0 },
1507 { { MNEM, ' ', OP (CRN), ',', '(', OP (RMA), '+', ')', ',', OP (CDISP10A4), 0 } },
1508 & ifmt_swcpa, { 0xf0052000 }
1509 },
1510/* lwcpa $crn,($rma+),$cdisp10a4 */
1511 {
1512 { 0, 0, 0, 0 },
1513 { { MNEM, ' ', OP (CRN), ',', '(', OP (RMA), '+', ')', ',', OP (CDISP10A4), 0 } },
1514 & ifmt_swcpa, { 0xf0056000 }
1515 },
1516/* smcpa $crn64,($rma+),$cdisp10a8 */
1517 {
1518 { 0, 0, 0, 0 },
1519 { { MNEM, ' ', OP (CRN64), ',', '(', OP (RMA), '+', ')', ',', OP (CDISP10A8), 0 } },
1520 & ifmt_smcpa, { 0xf0053000 }
1521 },
1522/* lmcpa $crn64,($rma+),$cdisp10a8 */
1523 {
1524 { 0, 0, 0, 0 },
1525 { { MNEM, ' ', OP (CRN64), ',', '(', OP (RMA), '+', ')', ',', OP (CDISP10A8), 0 } },
1526 & ifmt_smcpa, { 0xf0057000 }
1527 },
1528/* sbcpm0 $crn,($rma+),$cdisp10 */
1529 {
1530 { 0, 0, 0, 0 },
1531 { { MNEM, ' ', OP (CRN), ',', '(', OP (RMA), '+', ')', ',', OP (CDISP10), 0 } },
1532 & ifmt_lbucpa, { 0xf0050800 }
1533 },
1534/* lbcpm0 $crn,($rma+),$cdisp10 */
1535 {
1536 { 0, 0, 0, 0 },
1537 { { MNEM, ' ', OP (CRN), ',', '(', OP (RMA), '+', ')', ',', OP (CDISP10), 0 } },
1538 & ifmt_lbucpa, { 0xf0054800 }
1539 },
1540/* shcpm0 $crn,($rma+),$cdisp10a2 */
1541 {
1542 { 0, 0, 0, 0 },
1543 { { MNEM, ' ', OP (CRN), ',', '(', OP (RMA), '+', ')', ',', OP (CDISP10A2), 0 } },
1544 & ifmt_lhucpa, { 0xf0051800 }
1545 },
1546/* lhcpm0 $crn,($rma+),$cdisp10a2 */
1547 {
1548 { 0, 0, 0, 0 },
1549 { { MNEM, ' ', OP (CRN), ',', '(', OP (RMA), '+', ')', ',', OP (CDISP10A2), 0 } },
1550 & ifmt_lhucpa, { 0xf0055800 }
1551 },
1552/* swcpm0 $crn,($rma+),$cdisp10a4 */
1553 {
1554 { 0, 0, 0, 0 },
1555 { { MNEM, ' ', OP (CRN), ',', '(', OP (RMA), '+', ')', ',', OP (CDISP10A4), 0 } },
1556 & ifmt_swcpa, { 0xf0052800 }
1557 },
1558/* lwcpm0 $crn,($rma+),$cdisp10a4 */
1559 {
1560 { 0, 0, 0, 0 },
1561 { { MNEM, ' ', OP (CRN), ',', '(', OP (RMA), '+', ')', ',', OP (CDISP10A4), 0 } },
1562 & ifmt_swcpa, { 0xf0056800 }
1563 },
1564/* smcpm0 $crn64,($rma+),$cdisp10a8 */
1565 {
1566 { 0, 0, 0, 0 },
1567 { { MNEM, ' ', OP (CRN64), ',', '(', OP (RMA), '+', ')', ',', OP (CDISP10A8), 0 } },
1568 & ifmt_smcpa, { 0xf0053800 }
1569 },
1570/* lmcpm0 $crn64,($rma+),$cdisp10a8 */
1571 {
1572 { 0, 0, 0, 0 },
1573 { { MNEM, ' ', OP (CRN64), ',', '(', OP (RMA), '+', ')', ',', OP (CDISP10A8), 0 } },
1574 & ifmt_smcpa, { 0xf0057800 }
1575 },
1576/* sbcpm1 $crn,($rma+),$cdisp10 */
1577 {
1578 { 0, 0, 0, 0 },
1579 { { MNEM, ' ', OP (CRN), ',', '(', OP (RMA), '+', ')', ',', OP (CDISP10), 0 } },
1580 & ifmt_lbucpa, { 0xf0050c00 }
1581 },
1582/* lbcpm1 $crn,($rma+),$cdisp10 */
1583 {
1584 { 0, 0, 0, 0 },
1585 { { MNEM, ' ', OP (CRN), ',', '(', OP (RMA), '+', ')', ',', OP (CDISP10), 0 } },
1586 & ifmt_lbucpa, { 0xf0054c00 }
1587 },
1588/* shcpm1 $crn,($rma+),$cdisp10a2 */
1589 {
1590 { 0, 0, 0, 0 },
1591 { { MNEM, ' ', OP (CRN), ',', '(', OP (RMA), '+', ')', ',', OP (CDISP10A2), 0 } },
1592 & ifmt_lhucpa, { 0xf0051c00 }
1593 },
1594/* lhcpm1 $crn,($rma+),$cdisp10a2 */
1595 {
1596 { 0, 0, 0, 0 },
1597 { { MNEM, ' ', OP (CRN), ',', '(', OP (RMA), '+', ')', ',', OP (CDISP10A2), 0 } },
1598 & ifmt_lhucpa, { 0xf0055c00 }
1599 },
1600/* swcpm1 $crn,($rma+),$cdisp10a4 */
1601 {
1602 { 0, 0, 0, 0 },
1603 { { MNEM, ' ', OP (CRN), ',', '(', OP (RMA), '+', ')', ',', OP (CDISP10A4), 0 } },
1604 & ifmt_swcpa, { 0xf0052c00 }
1605 },
1606/* lwcpm1 $crn,($rma+),$cdisp10a4 */
1607 {
1608 { 0, 0, 0, 0 },
1609 { { MNEM, ' ', OP (CRN), ',', '(', OP (RMA), '+', ')', ',', OP (CDISP10A4), 0 } },
1610 & ifmt_swcpa, { 0xf0056c00 }
1611 },
1612/* smcpm1 $crn64,($rma+),$cdisp10a8 */
1613 {
1614 { 0, 0, 0, 0 },
1615 { { MNEM, ' ', OP (CRN64), ',', '(', OP (RMA), '+', ')', ',', OP (CDISP10A8), 0 } },
1616 & ifmt_smcpa, { 0xf0053c00 }
1617 },
1618/* lmcpm1 $crn64,($rma+),$cdisp10a8 */
1619 {
1620 { 0, 0, 0, 0 },
1621 { { MNEM, ' ', OP (CRN64), ',', '(', OP (RMA), '+', ')', ',', OP (CDISP10A8), 0 } },
1622 & ifmt_smcpa, { 0xf0057c00 }
1623 },
1624/* bcpeq $cccc,$pcrel17a2 */
1625 {
1626 { 0, 0, 0, 0 },
1627 { { MNEM, ' ', OP (CCCC), ',', OP (PCREL17A2), 0 } },
1628 & ifmt_bcpeq, { 0xd8040000 }
1629 },
1630/* bcpne $cccc,$pcrel17a2 */
1631 {
1632 { 0, 0, 0, 0 },
1633 { { MNEM, ' ', OP (CCCC), ',', OP (PCREL17A2), 0 } },
1634 & ifmt_bcpeq, { 0xd8050000 }
1635 },
1636/* bcpat $cccc,$pcrel17a2 */
1637 {
1638 { 0, 0, 0, 0 },
1639 { { MNEM, ' ', OP (CCCC), ',', OP (PCREL17A2), 0 } },
1640 & ifmt_bcpeq, { 0xd8060000 }
1641 },
1642/* bcpaf $cccc,$pcrel17a2 */
1643 {
1644 { 0, 0, 0, 0 },
1645 { { MNEM, ' ', OP (CCCC), ',', OP (PCREL17A2), 0 } },
1646 & ifmt_bcpeq, { 0xd8070000 }
1647 },
1648/* synccp */
1649 {
1650 { 0, 0, 0, 0 },
1651 { { MNEM, 0 } },
1652 & ifmt_ret, { 0x7021 }
1653 },
1654/* jsrv $rm */
1655 {
1656 { 0, 0, 0, 0 },
1657 { { MNEM, ' ', OP (RM), 0 } },
1658 & ifmt_jmp, { 0x180f }
1659 },
1660/* bsrv $pcrel24a2 */
1661 {
1662 { 0, 0, 0, 0 },
1663 { { MNEM, ' ', OP (PCREL24A2), 0 } },
1664 & ifmt_bsr24, { 0xd80b0000 }
1665 },
1666/* --unused-- */
1667 {
1668 { 0, 0, 0, 0 },
1669 { { MNEM, 0 } },
1670 & ifmt_sim_syscall, { 0x7800 }
1671 },
1672/* --reserved-- */
1673 {
1674 { 0, 0, 0, 0 },
1675 { { MNEM, 0 } },
1676 & ifmt_mov, { 0x6 }
1677 },
1678/* --reserved-- */
1679 {
1680 { 0, 0, 0, 0 },
1681 { { MNEM, 0 } },
1682 & ifmt_mov, { 0x100a }
1683 },
1684/* --reserved-- */
1685 {
1686 { 0, 0, 0, 0 },
1687 { { MNEM, 0 } },
1688 & ifmt_mov, { 0x100b }
1689 },
1690/* --reserved-- */
1691 {
1692 { 0, 0, 0, 0 },
1693 { { MNEM, 0 } },
1694 & ifmt_mov, { 0x2005 }
1695 },
1696/* --reserved-- */
1697 {
1698 { 0, 0, 0, 0 },
1699 { { MNEM, 0 } },
1700 & ifmt_mov, { 0x2008 }
1701 },
1702/* --reserved-- */
1703 {
1704 { 0, 0, 0, 0 },
1705 { { MNEM, 0 } },
1706 & ifmt_mov, { 0x2009 }
1707 },
1708/* --reserved-- */
1709 {
1710 { 0, 0, 0, 0 },
1711 { { MNEM, 0 } },
1712 & ifmt_mov, { 0x200a }
1713 },
1714/* --reserved-- */
1715 {
1716 { 0, 0, 0, 0 },
1717 { { MNEM, 0 } },
1718 & ifmt_mov, { 0x200b }
1719 },
1720/* --reserved-- */
1721 {
1722 { 0, 0, 0, 0 },
1723 { { MNEM, 0 } },
1724 & ifmt_mov, { 0x3004 }
1725 },
1726/* --reserved-- */
1727 {
1728 { 0, 0, 0, 0 },
1729 { { MNEM, 0 } },
1730 & ifmt_mov, { 0x3005 }
1731 },
1732/* --reserved-- */
1733 {
1734 { 0, 0, 0, 0 },
1735 { { MNEM, 0 } },
1736 & ifmt_mov, { 0x3006 }
1737 },
1738/* --reserved-- */
1739 {
1740 { 0, 0, 0, 0 },
1741 { { MNEM, 0 } },
1742 & ifmt_mov, { 0x3007 }
1743 },
1744/* --reserved-- */
1745 {
1746 { 0, 0, 0, 0 },
1747 { { MNEM, 0 } },
1748 & ifmt_mov, { 0x300c }
1749 },
1750/* --reserved-- */
1751 {
1752 { 0, 0, 0, 0 },
1753 { { MNEM, 0 } },
1754 & ifmt_mov, { 0x300d }
1755 },
1756/* --reserved-- */
1757 {
1758 { 0, 0, 0, 0 },
1759 { { MNEM, 0 } },
1760 & ifmt_mov, { 0x300e }
1761 },
1762/* --reserved-- */
1763 {
1764 { 0, 0, 0, 0 },
1765 { { MNEM, 0 } },
1766 & ifmt_mov, { 0x300f }
1767 },
1768/* --reserved-- */
1769 {
1770 { 0, 0, 0, 0 },
1771 { { MNEM, 0 } },
1772 & ifmt_mov, { 0x7007 }
1773 },
1774/* --reserved-- */
1775 {
1776 { 0, 0, 0, 0 },
1777 { { MNEM, 0 } },
1778 & ifmt_mov, { 0x700e }
1779 },
1780/* --reserved-- */
1781 {
1782 { 0, 0, 0, 0 },
1783 { { MNEM, 0 } },
1784 & ifmt_mov, { 0x700f }
1785 },
1786/* --reserved-- */
1787 {
1788 { 0, 0, 0, 0 },
1789 { { MNEM, 0 } },
1790 & ifmt_mov, { 0xc007 }
1791 },
1792/* --reserved-- */
1793 {
1794 { 0, 0, 0, 0 },
1795 { { MNEM, 0 } },
1796 & ifmt_mov, { 0xe00d }
1797 },
1798/* --reserved-- */
1799 {
1800 { 0, 0, 0, 0 },
1801 { { MNEM, 0 } },
1802 & ifmt_mov, { 0xf008 }
1803 },
1804};
1805
1806#undef A
1807#undef OPERAND
1808#undef MNEM
1809#undef OP
1810
1811/* Formats for ALIAS macro-insns. */
1812
1813#if defined (__STDC__) || defined (ALMOST_STDC) || defined (HAVE_STRINGIZE)
1814#define F(f) & mep_cgen_ifld_table[MEP_##f]
1815#else
1816#define F(f) & mep_cgen_ifld_table[MEP_/**/f]
1817#endif
1818static const CGEN_IFMT ifmt_nop ATTRIBUTE_UNUSED = {
1819 16, 16, 0xffff, { { F (F_MAJOR) }, { F (F_RN) }, { F (F_RM) }, { F (F_SUB4) }, { 0 } }
1820};
1821
1822static const CGEN_IFMT ifmt_sb16_0 ATTRIBUTE_UNUSED = {
1823 16, 16, 0xf00f, { { F (F_MAJOR) }, { F (F_RN) }, { F (F_RM) }, { F (F_SUB4) }, { 0 } }
1824};
1825
1826static const CGEN_IFMT ifmt_sh16_0 ATTRIBUTE_UNUSED = {
1827 16, 16, 0xf00f, { { F (F_MAJOR) }, { F (F_RN) }, { F (F_RM) }, { F (F_SUB4) }, { 0 } }
1828};
1829
1830static const CGEN_IFMT ifmt_sw16_0 ATTRIBUTE_UNUSED = {
1831 16, 16, 0xf00f, { { F (F_MAJOR) }, { F (F_RN) }, { F (F_RM) }, { F (F_SUB4) }, { 0 } }
1832};
1833
1834static const CGEN_IFMT ifmt_lb16_0 ATTRIBUTE_UNUSED = {
1835 16, 16, 0xf00f, { { F (F_MAJOR) }, { F (F_RN) }, { F (F_RM) }, { F (F_SUB4) }, { 0 } }
1836};
1837
1838static const CGEN_IFMT ifmt_lh16_0 ATTRIBUTE_UNUSED = {
1839 16, 16, 0xf00f, { { F (F_MAJOR) }, { F (F_RN) }, { F (F_RM) }, { F (F_SUB4) }, { 0 } }
1840};
1841
1842static const CGEN_IFMT ifmt_lw16_0 ATTRIBUTE_UNUSED = {
1843 16, 16, 0xf00f, { { F (F_MAJOR) }, { F (F_RN) }, { F (F_RM) }, { F (F_SUB4) }, { 0 } }
1844};
1845
1846static const CGEN_IFMT ifmt_lbu16_0 ATTRIBUTE_UNUSED = {
1847 16, 16, 0xf00f, { { F (F_MAJOR) }, { F (F_RN) }, { F (F_RM) }, { F (F_SUB4) }, { 0 } }
1848};
1849
1850static const CGEN_IFMT ifmt_lhu16_0 ATTRIBUTE_UNUSED = {
1851 16, 16, 0xf00f, { { F (F_MAJOR) }, { F (F_RN) }, { F (F_RM) }, { F (F_SUB4) }, { 0 } }
1852};
1853
1854static const CGEN_IFMT ifmt_swcp16_0 ATTRIBUTE_UNUSED = {
1855 16, 16, 0xf00f, { { F (F_MAJOR) }, { F (F_CRN) }, { F (F_RM) }, { F (F_SUB4) }, { 0 } }
1856};
1857
1858static const CGEN_IFMT ifmt_lwcp16_0 ATTRIBUTE_UNUSED = {
1859 16, 16, 0xf00f, { { F (F_MAJOR) }, { F (F_CRN) }, { F (F_RM) }, { F (F_SUB4) }, { 0 } }
1860};
1861
1862static const CGEN_IFMT ifmt_smcp16_0 ATTRIBUTE_UNUSED = {
1863 16, 16, 0xf00f, { { F (F_MAJOR) }, { F (F_CRN) }, { F (F_RM) }, { F (F_SUB4) }, { 0 } }
1864};
1865
1866static const CGEN_IFMT ifmt_lmcp16_0 ATTRIBUTE_UNUSED = {
1867 16, 16, 0xf00f, { { F (F_MAJOR) }, { F (F_CRN) }, { F (F_RM) }, { F (F_SUB4) }, { 0 } }
1868};
1869
1870#undef F
1871
1872/* Each non-simple macro entry points to an array of expansion possibilities. */
1873
1874#if defined (__STDC__) || defined (ALMOST_STDC) || defined (HAVE_STRINGIZE)
1875#define A(a) (1 << CGEN_INSN_##a)
1876#else
1877#define A(a) (1 << CGEN_INSN_/**/a)
1878#endif
1879#if defined (__STDC__) || defined (ALMOST_STDC) || defined (HAVE_STRINGIZE)
1880#define OPERAND(op) MEP_OPERAND_##op
1881#else
1882#define OPERAND(op) MEP_OPERAND_/**/op
1883#endif
1884#define MNEM CGEN_SYNTAX_MNEMONIC /* syntax value for mnemonic */
1885#define OP(field) CGEN_SYNTAX_MAKE_FIELD (OPERAND (field))
1886
1887/* The macro instruction table. */
1888
1889static const CGEN_IBASE mep_cgen_macro_insn_table[] =
1890{
1891/* nop */
1892 {
1893 -1, "nop", "nop", 16,
1894 { 0|A(ALIAS), { { { (1<<MACH_BASE), 0 } }, { { 1, "\x80" } }, { { 0, 0 } }, { { CONFIG_NONE, 0 } } } }
1895 },
1896/* sb $rnc,$zero($rma) */
1897 {
1898 -1, "sb16-0", "sb", 16,
1899 { 0|A(NO_DIS)|A(ALIAS), { { { (1<<MACH_BASE), 0 } }, { { 1, "\xc0" } }, { { 0, 0 } }, { { CONFIG_NONE, 0 } } } }
1900 },
1901/* sh $rns,$zero($rma) */
1902 {
1903 -1, "sh16-0", "sh", 16,
1904 { 0|A(NO_DIS)|A(ALIAS), { { { (1<<MACH_BASE), 0 } }, { { 1, "\xc0" } }, { { 0, 0 } }, { { CONFIG_NONE, 0 } } } }
1905 },
1906/* sw $rnl,$zero($rma) */
1907 {
1908 -1, "sw16-0", "sw", 16,
1909 { 0|A(NO_DIS)|A(ALIAS), { { { (1<<MACH_BASE), 0 } }, { { 1, "\xc0" } }, { { 0, 0 } }, { { CONFIG_NONE, 0 } } } }
1910 },
1911/* lb $rnc,$zero($rma) */
1912 {
1913 -1, "lb16-0", "lb", 16,
1914 { 0|A(NO_DIS)|A(ALIAS), { { { (1<<MACH_BASE), 0 } }, { { 1, "\xc0" } }, { { 0, 0 } }, { { CONFIG_NONE, 0 } } } }
1915 },
1916/* lh $rns,$zero($rma) */
1917 {
1918 -1, "lh16-0", "lh", 16,
1919 { 0|A(NO_DIS)|A(ALIAS), { { { (1<<MACH_BASE), 0 } }, { { 1, "\xc0" } }, { { 0, 0 } }, { { CONFIG_NONE, 0 } } } }
1920 },
1921/* lw $rnl,$zero($rma) */
1922 {
1923 -1, "lw16-0", "lw", 16,
1924 { 0|A(NO_DIS)|A(ALIAS), { { { (1<<MACH_BASE), 0 } }, { { 1, "\xc0" } }, { { 0, 0 } }, { { CONFIG_NONE, 0 } } } }
1925 },
1926/* lbu $rnuc,$zero($rma) */
1927 {
1928 -1, "lbu16-0", "lbu", 16,
1929 { 0|A(NO_DIS)|A(ALIAS), { { { (1<<MACH_BASE), 0 } }, { { 1, "\xc0" } }, { { 0, 0 } }, { { CONFIG_NONE, 0 } } } }
1930 },
1931/* lhu $rnus,$zero($rma) */
1932 {
1933 -1, "lhu16-0", "lhu", 16,
1934 { 0|A(NO_DIS)|A(ALIAS), { { { (1<<MACH_BASE), 0 } }, { { 1, "\xc0" } }, { { 0, 0 } }, { { CONFIG_NONE, 0 } } } }
1935 },
1936/* swcp $crn,$zero($rma) */
1937 {
1938 -1, "swcp16-0", "swcp", 16,
1939 { 0|A(NO_DIS)|A(OPTIONAL_CP_INSN)|A(ALIAS), { { { (1<<MACH_BASE), 0 } }, { { 1, "\xc0" } }, { { 0, 0 } }, { { CONFIG_NONE, 0 } } } }
1940 },
1941/* lwcp $crn,$zero($rma) */
1942 {
1943 -1, "lwcp16-0", "lwcp", 16,
1944 { 0|A(NO_DIS)|A(OPTIONAL_CP_INSN)|A(ALIAS), { { { (1<<MACH_BASE), 0 } }, { { 1, "\xc0" } }, { { 0, 0 } }, { { CONFIG_NONE, 0 } } } }
1945 },
1946/* smcp $crn64,$zero($rma) */
1947 {
1948 -1, "smcp16-0", "smcp", 16,
1949 { 0|A(NO_DIS)|A(OPTIONAL_CP64_INSN)|A(OPTIONAL_CP_INSN)|A(ALIAS), { { { (1<<MACH_BASE), 0 } }, { { 1, "\xc0" } }, { { 0, 0 } }, { { CONFIG_NONE, 0 } } } }
1950 },
1951/* lmcp $crn64,$zero($rma) */
1952 {
1953 -1, "lmcp16-0", "lmcp", 16,
1954 { 0|A(NO_DIS)|A(OPTIONAL_CP64_INSN)|A(OPTIONAL_CP_INSN)|A(ALIAS), { { { (1<<MACH_BASE), 0 } }, { { 1, "\xc0" } }, { { 0, 0 } }, { { CONFIG_NONE, 0 } } } }
1955 },
1956};
1957
1958/* The macro instruction opcode table. */
1959
1960static const CGEN_OPCODE mep_cgen_macro_insn_opcode_table[] =
1961{
1962/* nop */
1963 {
1964 { 0, 0, 0, 0 },
1965 { { MNEM, 0 } },
1966 & ifmt_nop, { 0x0 }
1967 },
1968/* sb $rnc,$zero($rma) */
1969 {
1970 { 0, 0, 0, 0 },
1971 { { MNEM, ' ', OP (RNC), ',', OP (ZERO), '(', OP (RMA), ')', 0 } },
1972 & ifmt_sb16_0, { 0x8 }
1973 },
1974/* sh $rns,$zero($rma) */
1975 {
1976 { 0, 0, 0, 0 },
1977 { { MNEM, ' ', OP (RNS), ',', OP (ZERO), '(', OP (RMA), ')', 0 } },
1978 & ifmt_sh16_0, { 0x9 }
1979 },
1980/* sw $rnl,$zero($rma) */
1981 {
1982 { 0, 0, 0, 0 },
1983 { { MNEM, ' ', OP (RNL), ',', OP (ZERO), '(', OP (RMA), ')', 0 } },
1984 & ifmt_sw16_0, { 0xa }
1985 },
1986/* lb $rnc,$zero($rma) */
1987 {
1988 { 0, 0, 0, 0 },
1989 { { MNEM, ' ', OP (RNC), ',', OP (ZERO), '(', OP (RMA), ')', 0 } },
1990 & ifmt_lb16_0, { 0xc }
1991 },
1992/* lh $rns,$zero($rma) */
1993 {
1994 { 0, 0, 0, 0 },
1995 { { MNEM, ' ', OP (RNS), ',', OP (ZERO), '(', OP (RMA), ')', 0 } },
1996 & ifmt_lh16_0, { 0xd }
1997 },
1998/* lw $rnl,$zero($rma) */
1999 {
2000 { 0, 0, 0, 0 },
2001 { { MNEM, ' ', OP (RNL), ',', OP (ZERO), '(', OP (RMA), ')', 0 } },
2002 & ifmt_lw16_0, { 0xe }
2003 },
2004/* lbu $rnuc,$zero($rma) */
2005 {
2006 { 0, 0, 0, 0 },
2007 { { MNEM, ' ', OP (RNUC), ',', OP (ZERO), '(', OP (RMA), ')', 0 } },
2008 & ifmt_lbu16_0, { 0xb }
2009 },
2010/* lhu $rnus,$zero($rma) */
2011 {
2012 { 0, 0, 0, 0 },
2013 { { MNEM, ' ', OP (RNUS), ',', OP (ZERO), '(', OP (RMA), ')', 0 } },
2014 & ifmt_lhu16_0, { 0xf }
2015 },
2016/* swcp $crn,$zero($rma) */
2017 {
2018 { 0, 0, 0, 0 },
2019 { { MNEM, ' ', OP (CRN), ',', OP (ZERO), '(', OP (RMA), ')', 0 } },
2020 & ifmt_swcp16_0, { 0x3008 }
2021 },
2022/* lwcp $crn,$zero($rma) */
2023 {
2024 { 0, 0, 0, 0 },
2025 { { MNEM, ' ', OP (CRN), ',', OP (ZERO), '(', OP (RMA), ')', 0 } },
2026 & ifmt_lwcp16_0, { 0x3009 }
2027 },
2028/* smcp $crn64,$zero($rma) */
2029 {
2030 { 0, 0, 0, 0 },
2031 { { MNEM, ' ', OP (CRN64), ',', OP (ZERO), '(', OP (RMA), ')', 0 } },
2032 & ifmt_smcp16_0, { 0x300a }
2033 },
2034/* lmcp $crn64,$zero($rma) */
2035 {
2036 { 0, 0, 0, 0 },
2037 { { MNEM, ' ', OP (CRN64), ',', OP (ZERO), '(', OP (RMA), ')', 0 } },
2038 & ifmt_lmcp16_0, { 0x300b }
2039 },
2040};
2041
2042#undef A
2043#undef OPERAND
2044#undef MNEM
2045#undef OP
2046
2047#ifndef CGEN_ASM_HASH_P
2048#define CGEN_ASM_HASH_P(insn) 1
2049#endif
2050
2051#ifndef CGEN_DIS_HASH_P
2052#define CGEN_DIS_HASH_P(insn) 1
2053#endif
2054
2055/* Return non-zero if INSN is to be added to the hash table.
2056 Targets are free to override CGEN_{ASM,DIS}_HASH_P in the .opc file. */
2057
2058static int
2059asm_hash_insn_p (insn)
2060 const CGEN_INSN *insn ATTRIBUTE_UNUSED;
2061{
2062 return CGEN_ASM_HASH_P (insn);
2063}
2064
2065static int
2066dis_hash_insn_p (insn)
2067 const CGEN_INSN *insn;
2068{
2069 /* If building the hash table and the NO-DIS attribute is present,
2070 ignore. */
2071 if (CGEN_INSN_ATTR_VALUE (insn, CGEN_INSN_NO_DIS))
2072 return 0;
2073 return CGEN_DIS_HASH_P (insn);
2074}
2075
2076#ifndef CGEN_ASM_HASH
2077#define CGEN_ASM_HASH_SIZE 127
2078#ifdef CGEN_MNEMONIC_OPERANDS
2079#define CGEN_ASM_HASH(mnem) (*(unsigned char *) (mnem) % CGEN_ASM_HASH_SIZE)
2080#else
2081#define CGEN_ASM_HASH(mnem) (*(unsigned char *) (mnem) % CGEN_ASM_HASH_SIZE) /*FIXME*/
2082#endif
2083#endif
2084
2085/* It doesn't make much sense to provide a default here,
2086 but while this is under development we do.
2087 BUFFER is a pointer to the bytes of the insn, target order.
2088 VALUE is the first base_insn_bitsize bits as an int in host order. */
2089
2090#ifndef CGEN_DIS_HASH
2091#define CGEN_DIS_HASH_SIZE 256
2092#define CGEN_DIS_HASH(buf, value) (*(unsigned char *) (buf))
2093#endif
2094
2095/* The result is the hash value of the insn.
2096 Targets are free to override CGEN_{ASM,DIS}_HASH in the .opc file. */
2097
2098static unsigned int
2099asm_hash_insn (mnem)
2100 const char * mnem;
2101{
2102 return CGEN_ASM_HASH (mnem);
2103}
2104
2105/* BUF is a pointer to the bytes of the insn, target order.
2106 VALUE is the first base_insn_bitsize bits as an int in host order. */
2107
2108static unsigned int
2109dis_hash_insn (buf, value)
2110 const char * buf ATTRIBUTE_UNUSED;
2111 CGEN_INSN_INT value ATTRIBUTE_UNUSED;
2112{
2113 return CGEN_DIS_HASH (buf, value);
2114}
2115
2116/* Set the recorded length of the insn in the CGEN_FIELDS struct. */
2117
2118static void
2119set_fields_bitsize (CGEN_FIELDS *fields, int size)
2120{
2121 CGEN_FIELDS_BITSIZE (fields) = size;
2122}
2123
2124/* Function to call before using the operand instance table.
2125 This plugs the opcode entries and macro instructions into the cpu table. */
2126
2127void
2128mep_cgen_init_opcode_table (CGEN_CPU_DESC cd)
2129{
2130 int i;
2131 int num_macros = (sizeof (mep_cgen_macro_insn_table) /
2132 sizeof (mep_cgen_macro_insn_table[0]));
2133 const CGEN_IBASE *ib = & mep_cgen_macro_insn_table[0];
2134 const CGEN_OPCODE *oc = & mep_cgen_macro_insn_opcode_table[0];
2135 CGEN_INSN *insns = xmalloc (num_macros * sizeof (CGEN_INSN));
2136
2137 /* This test has been added to avoid a warning generated
2138 if memset is called with a third argument of value zero. */
2139 if (num_macros >= 1)
2140 memset (insns, 0, num_macros * sizeof (CGEN_INSN));
2141 for (i = 0; i < num_macros; ++i)
2142 {
2143 insns[i].base = &ib[i];
2144 insns[i].opcode = &oc[i];
2145 mep_cgen_build_insn_regex (& insns[i]);
2146 }
2147 cd->macro_insn_table.init_entries = insns;
2148 cd->macro_insn_table.entry_size = sizeof (CGEN_IBASE);
2149 cd->macro_insn_table.num_init_entries = num_macros;
2150
2151 oc = & mep_cgen_insn_opcode_table[0];
2152 insns = (CGEN_INSN *) cd->insn_table.init_entries;
2153 for (i = 0; i < MAX_INSNS; ++i)
2154 {
2155 insns[i].opcode = &oc[i];
2156 mep_cgen_build_insn_regex (& insns[i]);
2157 }
2158
2159 cd->sizeof_fields = sizeof (CGEN_FIELDS);
2160 cd->set_fields_bitsize = set_fields_bitsize;
2161
2162 cd->asm_hash_p = asm_hash_insn_p;
2163 cd->asm_hash = asm_hash_insn;
2164 cd->asm_hash_size = CGEN_ASM_HASH_SIZE;
2165
2166 cd->dis_hash_p = dis_hash_insn_p;
2167 cd->dis_hash = dis_hash_insn;
2168 cd->dis_hash_size = CGEN_DIS_HASH_SIZE;
2169}
This page took 0.031565 seconds and 4 git commands to generate.