1 /* Instruction opcode table for mep.
3 THIS FILE IS MACHINE GENERATED WITH CGEN.
5 Copyright 1996-2007 Free Software Foundation, Inc.
7 This file is part of the GNU Binutils and/or GDB, the GNU debugger.
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)
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.
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.
31 #include "libiberty.h"
36 /* A mask for all ISAs executed by the core. */
37 CGEN_ATTR_VALUE_BITSET_TYPE mep_all_core_isas_mask = {0, 0};
40 init_mep_all_core_isas_mask (void)
42 if (mep_all_core_isas_mask.length != 0)
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 */
51 CGEN_ATTR_VALUE_BITSET_TYPE mep_all_cop_isas_mask = {0, 0};
54 init_mep_all_cop_isas_mask (void)
56 if (mep_all_cop_isas_mask.length != 0)
58 cgen_bitset_init (& mep_all_cop_isas_mask, ISA_MAX);
59 /* begin-all-cop-isas */
60 /* end-all-cop-isas */
64 mep_insn_supported_by_isa (const CGEN_INSN *insn, CGEN_ATTR_VALUE_BITSET_TYPE *isa_mask)
66 CGEN_BITSET insn_isas = CGEN_INSN_BITSET_ATTR_VALUE (insn, CGEN_INSN_ISA);
67 return cgen_bitset_intersect_p (& insn_isas, isa_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) )
87 mep_config_map_struct mep_config_map[] =
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" },
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) },
104 { 0, 0, 0, 0, 0, {0, 0}, {0, 0}, {0, 0}, {0, 0}, {0, 0}, {0, 0}, 0 }
107 int mep_config_index = 0;
110 check_configured_mach (int machs)
112 /* All base insns are supported. */
113 int mach = 1 << MACH_BASE;
118 mach |= (1 << MACH_MEP);
121 mach |= (1 << MACH_H1);
124 mach |= (1 << MACH_MEP);
125 mach |= (1 << MACH_C5);
134 mep_cgen_insn_supported (CGEN_CPU_DESC cd, const CGEN_INSN *insn)
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);
143 /* If the insn has an option bit set that we don't want,
145 if (CGEN_INSN_ATTRS (insn)->bool & OPTION_MASK & ~MEP_OMASK)
148 /* If attributes are absent, assume no restriction. */
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);
158 return (ok1 && ok2 && ok3);
160 /* The hash functions are recorded here to help keep assembler code out of
161 the disassembler and vice versa. */
163 static int asm_hash_insn_p (const CGEN_INSN *);
164 static unsigned int asm_hash_insn (const char *);
165 static int dis_hash_insn_p (const CGEN_INSN *);
166 static unsigned int dis_hash_insn (const char *, CGEN_INSN_INT);
168 /* Instruction formats. */
170 #if defined (__STDC__) || defined (ALMOST_STDC) || defined (HAVE_STRINGIZE)
171 #define F(f) & mep_cgen_ifld_table[MEP_##f]
173 #define F(f) & mep_cgen_ifld_table[MEP_/**/f]
175 static const CGEN_IFMT ifmt_empty ATTRIBUTE_UNUSED = {
179 static 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 } }
183 static const CGEN_IFMT ifmt_pref ATTRIBUTE_UNUSED = {
184 16, 16, 0xf00f, { { F (F_MAJOR) }, { F (F_RN) }, { F (F_RM) }, { F (F_SUB4) }, { 0 } }
187 static 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 } }
191 static 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 } }
195 static 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 } }
199 static 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 } }
203 static 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 } }
207 static 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 } }
211 static 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 } }
215 static const CGEN_IFMT ifmt_dsp0 ATTRIBUTE_UNUSED = {
216 32, 32, 0xf00f0000, { { F (F_MAJOR) }, { F (F_C5_RNMUIMM24) }, { F (F_SUB4) }, { 0 } }
219 static 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 } }
223 static const CGEN_IFMT ifmt_sb ATTRIBUTE_UNUSED = {
224 16, 16, 0xf00f, { { F (F_MAJOR) }, { F (F_RN) }, { F (F_RM) }, { F (F_SUB4) }, { 0 } }
227 static const CGEN_IFMT ifmt_sh ATTRIBUTE_UNUSED = {
228 16, 16, 0xf00f, { { F (F_MAJOR) }, { F (F_RN) }, { F (F_RM) }, { F (F_SUB4) }, { 0 } }
231 static const CGEN_IFMT ifmt_sw ATTRIBUTE_UNUSED = {
232 16, 16, 0xf00f, { { F (F_MAJOR) }, { F (F_RN) }, { F (F_RM) }, { F (F_SUB4) }, { 0 } }
235 static const CGEN_IFMT ifmt_lbu ATTRIBUTE_UNUSED = {
236 16, 16, 0xf00f, { { F (F_MAJOR) }, { F (F_RN) }, { F (F_RM) }, { F (F_SUB4) }, { 0 } }
239 static const CGEN_IFMT ifmt_lhu ATTRIBUTE_UNUSED = {
240 16, 16, 0xf00f, { { F (F_MAJOR) }, { F (F_RN) }, { F (F_RM) }, { F (F_SUB4) }, { 0 } }
243 static 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 } }
247 static 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 } }
251 static 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 } }
255 static 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 } }
259 static 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 } }
263 static 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 } }
267 static 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 } }
271 static 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 } }
275 static 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 } }
279 static 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 } }
283 static 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 } }
287 static const CGEN_IFMT ifmt_sw24 ATTRIBUTE_UNUSED = {
288 32, 32, 0xf0030000, { { F (F_MAJOR) }, { F (F_RN) }, { F (F_24U8A4N) }, { F (F_SUB2) }, { 0 } }
291 static const CGEN_IFMT ifmt_extb ATTRIBUTE_UNUSED = {
292 16, 16, 0xf0ff, { { F (F_MAJOR) }, { F (F_RN) }, { F (F_RM) }, { F (F_SUB4) }, { 0 } }
295 static 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 } }
299 static const CGEN_IFMT ifmt_mov ATTRIBUTE_UNUSED = {
300 16, 16, 0xf00f, { { F (F_MAJOR) }, { F (F_RN) }, { F (F_RM) }, { F (F_SUB4) }, { 0 } }
303 static const CGEN_IFMT ifmt_movi8 ATTRIBUTE_UNUSED = {
304 16, 16, 0xf000, { { F (F_MAJOR) }, { F (F_RN) }, { F (F_8S8) }, { 0 } }
307 static 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 } }
311 static const CGEN_IFMT ifmt_movu24 ATTRIBUTE_UNUSED = {
312 32, 32, 0xf8000000, { { F (F_MAJOR) }, { F (F_4) }, { F (F_RN3) }, { F (F_24U8N) }, { 0 } }
315 static 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 } }
319 static const CGEN_IFMT ifmt_add3 ATTRIBUTE_UNUSED = {
320 16, 16, 0xf000, { { F (F_MAJOR) }, { F (F_RN) }, { F (F_RM) }, { F (F_RL) }, { 0 } }
323 static const CGEN_IFMT ifmt_add ATTRIBUTE_UNUSED = {
324 16, 16, 0xf003, { { F (F_MAJOR) }, { F (F_RN) }, { F (F_6S8) }, { F (F_SUB2) }, { 0 } }
327 static 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 } }
331 static const CGEN_IFMT ifmt_slt3i ATTRIBUTE_UNUSED = {
332 16, 16, 0xf007, { { F (F_MAJOR) }, { F (F_RN) }, { F (F_5U8) }, { F (F_SUB3) }, { 0 } }
335 static const CGEN_IFMT ifmt_bra ATTRIBUTE_UNUSED = {
336 16, 16, 0xf001, { { F (F_MAJOR) }, { F (F_12S4A2) }, { F (F_15) }, { 0 } }
339 static const CGEN_IFMT ifmt_beqz ATTRIBUTE_UNUSED = {
340 16, 16, 0xf001, { { F (F_MAJOR) }, { F (F_RN) }, { F (F_8S8A2) }, { F (F_15) }, { 0 } }
343 static 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 } }
347 static 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 } }
351 static const CGEN_IFMT ifmt_bsr24 ATTRIBUTE_UNUSED = {
352 32, 32, 0xf80f0000, { { F (F_MAJOR) }, { F (F_4) }, { F (F_24S5A2N) }, { F (F_SUB4) }, { 0 } }
355 static const CGEN_IFMT ifmt_jmp ATTRIBUTE_UNUSED = {
356 16, 16, 0xff0f, { { F (F_MAJOR) }, { F (F_RN) }, { F (F_RM) }, { F (F_SUB4) }, { 0 } }
359 static const CGEN_IFMT ifmt_jmp24 ATTRIBUTE_UNUSED = {
360 32, 32, 0xf80f0000, { { F (F_MAJOR) }, { F (F_4) }, { F (F_24U5A2N) }, { F (F_SUB4) }, { 0 } }
363 static const CGEN_IFMT ifmt_ret ATTRIBUTE_UNUSED = {
364 16, 16, 0xffff, { { F (F_MAJOR) }, { F (F_RN) }, { F (F_RM) }, { F (F_SUB4) }, { 0 } }
367 static 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 } }
371 static 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 } }
375 static 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 } }
379 static 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 } }
383 static 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 } }
387 static 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 } }
391 static 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 } }
395 static 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 } }
399 static const CGEN_IFMT ifmt_swcp ATTRIBUTE_UNUSED = {
400 16, 16, 0xf00f, { { F (F_MAJOR) }, { F (F_CRN) }, { F (F_RM) }, { F (F_SUB4) }, { 0 } }
403 static const CGEN_IFMT ifmt_smcp ATTRIBUTE_UNUSED = {
404 16, 16, 0xf00f, { { F (F_MAJOR) }, { F (F_CRN) }, { F (F_RM) }, { F (F_SUB4) }, { 0 } }
407 static 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 } }
411 static 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 } }
415 static 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 } }
419 static 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 } }
423 static 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 } }
427 static 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 } }
433 #if defined (__STDC__) || defined (ALMOST_STDC) || defined (HAVE_STRINGIZE)
434 #define A(a) (1 << CGEN_INSN_##a)
436 #define A(a) (1 << CGEN_INSN_/**/a)
438 #if defined (__STDC__) || defined (ALMOST_STDC) || defined (HAVE_STRINGIZE)
439 #define OPERAND(op) MEP_OPERAND_##op
441 #define OPERAND(op) MEP_OPERAND_/**/op
443 #define MNEM CGEN_SYNTAX_MNEMONIC /* syntax value for mnemonic */
444 #define OP(field) CGEN_SYNTAX_MAKE_FIELD (OPERAND (field))
446 /* The instruction table. */
448 static const CGEN_OPCODE mep_cgen_insn_opcode_table[MAX_INSNS] =
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) */
457 { { MNEM, ' ', OP (RN), ',', '(', OP (RMA), ')', 0 } },
458 & ifmt_stcb_r, { 0x700c }
460 /* ldcb $rn,($rma) */
463 { { MNEM, ' ', OP (RN), ',', '(', OP (RMA), ')', 0 } },
464 & ifmt_stcb_r, { 0x700d }
466 /* pref $cimm4,($rma) */
469 { { MNEM, ' ', OP (CIMM4), ',', '(', OP (RMA), ')', 0 } },
470 & ifmt_pref, { 0x7005 }
472 /* pref $cimm4,$sdisp16($rma) */
475 { { MNEM, ' ', OP (CIMM4), ',', OP (SDISP16), '(', OP (RMA), ')', 0 } },
476 & ifmt_prefd, { 0xf0030000 }
478 /* casb3 $rl5,$rn,($rm) */
481 { { MNEM, ' ', OP (RL5), ',', OP (RN), ',', '(', OP (RM), ')', 0 } },
482 & ifmt_casb3, { 0xf0012000 }
484 /* cash3 $rl5,$rn,($rm) */
487 { { MNEM, ' ', OP (RL5), ',', OP (RN), ',', '(', OP (RM), ')', 0 } },
488 & ifmt_casb3, { 0xf0012001 }
490 /* casw3 $rl5,$rn,($rm) */
493 { { MNEM, ' ', OP (RL5), ',', OP (RN), ',', '(', OP (RM), ')', 0 } },
494 & ifmt_casb3, { 0xf0012002 }
496 /* sbcp $crn,$cdisp12($rma) */
499 { { MNEM, ' ', OP (CRN), ',', OP (CDISP12), '(', OP (RMA), ')', 0 } },
500 & ifmt_sbcp, { 0xf0060000 }
502 /* lbcp $crn,$cdisp12($rma) */
505 { { MNEM, ' ', OP (CRN), ',', OP (CDISP12), '(', OP (RMA), ')', 0 } },
506 & ifmt_sbcp, { 0xf0064000 }
508 /* lbucp $crn,$cdisp12($rma) */
511 { { MNEM, ' ', OP (CRN), ',', OP (CDISP12), '(', OP (RMA), ')', 0 } },
512 & ifmt_sbcp, { 0xf006c000 }
514 /* shcp $crn,$cdisp12($rma) */
517 { { MNEM, ' ', OP (CRN), ',', OP (CDISP12), '(', OP (RMA), ')', 0 } },
518 & ifmt_sbcp, { 0xf0061000 }
520 /* lhcp $crn,$cdisp12($rma) */
523 { { MNEM, ' ', OP (CRN), ',', OP (CDISP12), '(', OP (RMA), ')', 0 } },
524 & ifmt_sbcp, { 0xf0065000 }
526 /* lhucp $crn,$cdisp12($rma) */
529 { { MNEM, ' ', OP (CRN), ',', OP (CDISP12), '(', OP (RMA), ')', 0 } },
530 & ifmt_sbcp, { 0xf006d000 }
532 /* lbucpa $crn,($rma+),$cdisp10 */
535 { { MNEM, ' ', OP (CRN), ',', '(', OP (RMA), '+', ')', ',', OP (CDISP10), 0 } },
536 & ifmt_lbucpa, { 0xf005c000 }
538 /* lhucpa $crn,($rma+),$cdisp10a2 */
541 { { MNEM, ' ', OP (CRN), ',', '(', OP (RMA), '+', ')', ',', OP (CDISP10A2), 0 } },
542 & ifmt_lhucpa, { 0xf005d000 }
544 /* lbucpm0 $crn,($rma+),$cdisp10 */
547 { { MNEM, ' ', OP (CRN), ',', '(', OP (RMA), '+', ')', ',', OP (CDISP10), 0 } },
548 & ifmt_lbucpa, { 0xf005c800 }
550 /* lhucpm0 $crn,($rma+),$cdisp10a2 */
553 { { MNEM, ' ', OP (CRN), ',', '(', OP (RMA), '+', ')', ',', OP (CDISP10A2), 0 } },
554 & ifmt_lhucpa, { 0xf005d800 }
556 /* lbucpm1 $crn,($rma+),$cdisp10 */
559 { { MNEM, ' ', OP (CRN), ',', '(', OP (RMA), '+', ')', ',', OP (CDISP10), 0 } },
560 & ifmt_lbucpa, { 0xf005cc00 }
562 /* lhucpm1 $crn,($rma+),$cdisp10a2 */
565 { { MNEM, ' ', OP (CRN), ',', '(', OP (RMA), '+', ')', ',', OP (CDISP10A2), 0 } },
566 & ifmt_lhucpa, { 0xf005dc00 }
568 /* uci $rn,$rm,$uimm16 */
571 { { MNEM, ' ', OP (RN), ',', OP (RM), ',', OP (UIMM16), 0 } },
572 & ifmt_uci, { 0xf0020000 }
574 /* dsp $rn,$rm,$uimm16 */
577 { { MNEM, ' ', OP (RN), ',', OP (RM), ',', OP (UIMM16), 0 } },
578 & ifmt_dsp, { 0xf0000000 }
580 /* dsp0 $c5rnmuimm24 */
583 { { MNEM, ' ', OP (C5RNMUIMM24), 0 } },
584 & ifmt_dsp0, { 0xf0000000 }
586 /* dsp1 $rn,$c5rmuimm20 */
589 { { MNEM, ' ', OP (RN), ',', OP (C5RMUIMM20), 0 } },
590 & ifmt_dsp1, { 0xf0000000 }
595 { { MNEM, ' ', OP (RNC), ',', '(', OP (RMA), ')', 0 } },
601 { { MNEM, ' ', OP (RNS), ',', '(', OP (RMA), ')', 0 } },
607 { { MNEM, ' ', OP (RNL), ',', '(', OP (RMA), ')', 0 } },
613 { { MNEM, ' ', OP (RNC), ',', '(', OP (RMA), ')', 0 } },
619 { { MNEM, ' ', OP (RNS), ',', '(', OP (RMA), ')', 0 } },
625 { { MNEM, ' ', OP (RNL), ',', '(', OP (RMA), ')', 0 } },
628 /* lbu $rnuc,($rma) */
631 { { MNEM, ' ', OP (RNUC), ',', '(', OP (RMA), ')', 0 } },
634 /* lhu $rnus,($rma) */
637 { { MNEM, ' ', OP (RNUS), ',', '(', OP (RMA), ')', 0 } },
640 /* sw $rnl,$udisp7a4($spr) */
643 { { MNEM, ' ', OP (RNL), ',', OP (UDISP7A4), '(', OP (SPR), ')', 0 } },
644 & ifmt_sw_sp, { 0x4002 }
646 /* lw $rnl,$udisp7a4($spr) */
649 { { MNEM, ' ', OP (RNL), ',', OP (UDISP7A4), '(', OP (SPR), ')', 0 } },
650 & ifmt_sw_sp, { 0x4003 }
652 /* sb $rn3c,$udisp7($tpr) */
655 { { MNEM, ' ', OP (RN3C), ',', OP (UDISP7), '(', OP (TPR), ')', 0 } },
656 & ifmt_sb_tp, { 0x8000 }
658 /* sh $rn3s,$udisp7a2($tpr) */
661 { { MNEM, ' ', OP (RN3S), ',', OP (UDISP7A2), '(', OP (TPR), ')', 0 } },
662 & ifmt_sh_tp, { 0x8080 }
664 /* sw $rn3l,$udisp7a4($tpr) */
667 { { MNEM, ' ', OP (RN3L), ',', OP (UDISP7A4), '(', OP (TPR), ')', 0 } },
668 & ifmt_sw_tp, { 0x4082 }
670 /* lb $rn3c,$udisp7($tpr) */
673 { { MNEM, ' ', OP (RN3C), ',', OP (UDISP7), '(', OP (TPR), ')', 0 } },
674 & ifmt_sb_tp, { 0x8800 }
676 /* lh $rn3s,$udisp7a2($tpr) */
679 { { MNEM, ' ', OP (RN3S), ',', OP (UDISP7A2), '(', OP (TPR), ')', 0 } },
680 & ifmt_sh_tp, { 0x8880 }
682 /* lw $rn3l,$udisp7a4($tpr) */
685 { { MNEM, ' ', OP (RN3L), ',', OP (UDISP7A4), '(', OP (TPR), ')', 0 } },
686 & ifmt_sw_tp, { 0x4083 }
688 /* lbu $rn3uc,$udisp7($tpr) */
691 { { MNEM, ' ', OP (RN3UC), ',', OP (UDISP7), '(', OP (TPR), ')', 0 } },
692 & ifmt_lbu_tp, { 0x4880 }
694 /* lhu $rn3us,$udisp7a2($tpr) */
697 { { MNEM, ' ', OP (RN3US), ',', OP (UDISP7A2), '(', OP (TPR), ')', 0 } },
698 & ifmt_lhu_tp, { 0x8881 }
700 /* sb $rnc,$sdisp16($rma) */
703 { { MNEM, ' ', OP (RNC), ',', OP (SDISP16), '(', OP (RMA), ')', 0 } },
704 & ifmt_sb16, { 0xc0080000 }
706 /* sh $rns,$sdisp16($rma) */
709 { { MNEM, ' ', OP (RNS), ',', OP (SDISP16), '(', OP (RMA), ')', 0 } },
710 & ifmt_sh16, { 0xc0090000 }
712 /* sw $rnl,$sdisp16($rma) */
715 { { MNEM, ' ', OP (RNL), ',', OP (SDISP16), '(', OP (RMA), ')', 0 } },
716 & ifmt_sw16, { 0xc00a0000 }
718 /* lb $rnc,$sdisp16($rma) */
721 { { MNEM, ' ', OP (RNC), ',', OP (SDISP16), '(', OP (RMA), ')', 0 } },
722 & ifmt_sb16, { 0xc00c0000 }
724 /* lh $rns,$sdisp16($rma) */
727 { { MNEM, ' ', OP (RNS), ',', OP (SDISP16), '(', OP (RMA), ')', 0 } },
728 & ifmt_sh16, { 0xc00d0000 }
730 /* lw $rnl,$sdisp16($rma) */
733 { { MNEM, ' ', OP (RNL), ',', OP (SDISP16), '(', OP (RMA), ')', 0 } },
734 & ifmt_sw16, { 0xc00e0000 }
736 /* lbu $rnuc,$sdisp16($rma) */
739 { { MNEM, ' ', OP (RNUC), ',', OP (SDISP16), '(', OP (RMA), ')', 0 } },
740 & ifmt_lbu16, { 0xc00b0000 }
742 /* lhu $rnus,$sdisp16($rma) */
745 { { MNEM, ' ', OP (RNUS), ',', OP (SDISP16), '(', OP (RMA), ')', 0 } },
746 & ifmt_lhu16, { 0xc00f0000 }
748 /* sw $rnl,($addr24a4) */
751 { { MNEM, ' ', OP (RNL), ',', '(', OP (ADDR24A4), ')', 0 } },
752 & ifmt_sw24, { 0xe0020000 }
754 /* lw $rnl,($addr24a4) */
757 { { MNEM, ' ', OP (RNL), ',', '(', OP (ADDR24A4), ')', 0 } },
758 & ifmt_sw24, { 0xe0030000 }
763 { { MNEM, ' ', OP (RN), 0 } },
764 & ifmt_extb, { 0x100d }
769 { { MNEM, ' ', OP (RN), 0 } },
770 & ifmt_extb, { 0x102d }
775 { { MNEM, ' ', OP (RN), 0 } },
776 & ifmt_extb, { 0x108d }
781 { { MNEM, ' ', OP (RN), 0 } },
782 & ifmt_extb, { 0x10ad }
784 /* ssarb $udisp2($rm) */
787 { { MNEM, ' ', OP (UDISP2), '(', OP (RM), ')', 0 } },
788 & ifmt_ssarb, { 0x100c }
793 { { MNEM, ' ', OP (RN), ',', OP (RM), 0 } },
799 { { MNEM, ' ', OP (RN), ',', OP (SIMM8), 0 } },
800 & ifmt_movi8, { 0x5000 }
802 /* mov $rn,$simm16 */
805 { { MNEM, ' ', OP (RN), ',', OP (SIMM16), 0 } },
806 & ifmt_movi16, { 0xc0010000 }
808 /* movu $rn3,$uimm24 */
811 { { MNEM, ' ', OP (RN3), ',', OP (UIMM24), 0 } },
812 & ifmt_movu24, { 0xd0000000 }
814 /* movu $rn,$uimm16 */
817 { { MNEM, ' ', OP (RN), ',', OP (UIMM16), 0 } },
818 & ifmt_movu16, { 0xc0110000 }
820 /* movh $rn,$uimm16 */
823 { { MNEM, ' ', OP (RN), ',', OP (UIMM16), 0 } },
824 & ifmt_movu16, { 0xc0210000 }
826 /* add3 $rl,$rn,$rm */
829 { { MNEM, ' ', OP (RL), ',', OP (RN), ',', OP (RM), 0 } },
830 & ifmt_add3, { 0x9000 }
835 { { MNEM, ' ', OP (RN), ',', OP (SIMM6), 0 } },
836 & ifmt_add, { 0x6000 }
838 /* add3 $rn,$spr,$uimm7a4 */
841 { { MNEM, ' ', OP (RN), ',', OP (SPR), ',', OP (UIMM7A4), 0 } },
842 & ifmt_add3i, { 0x4000 }
844 /* advck3 \$0,$rn,$rm */
847 { { MNEM, ' ', '$', '0', ',', OP (RN), ',', OP (RM), 0 } },
853 { { MNEM, ' ', OP (RN), ',', OP (RM), 0 } },
856 /* sbvck3 \$0,$rn,$rm */
859 { { MNEM, ' ', '$', '0', ',', OP (RN), ',', OP (RM), 0 } },
865 { { MNEM, ' ', OP (RN), ',', OP (RM), 0 } },
868 /* slt3 \$0,$rn,$rm */
871 { { MNEM, ' ', '$', '0', ',', OP (RN), ',', OP (RM), 0 } },
874 /* sltu3 \$0,$rn,$rm */
877 { { MNEM, ' ', '$', '0', ',', OP (RN), ',', OP (RM), 0 } },
880 /* slt3 \$0,$rn,$uimm5 */
883 { { MNEM, ' ', '$', '0', ',', OP (RN), ',', OP (UIMM5), 0 } },
884 & ifmt_slt3i, { 0x6001 }
886 /* sltu3 \$0,$rn,$uimm5 */
889 { { MNEM, ' ', '$', '0', ',', OP (RN), ',', OP (UIMM5), 0 } },
890 & ifmt_slt3i, { 0x6005 }
892 /* sl1ad3 \$0,$rn,$rm */
895 { { MNEM, ' ', '$', '0', ',', OP (RN), ',', OP (RM), 0 } },
896 & ifmt_mov, { 0x2006 }
898 /* sl2ad3 \$0,$rn,$rm */
901 { { MNEM, ' ', '$', '0', ',', OP (RN), ',', OP (RM), 0 } },
902 & ifmt_mov, { 0x2007 }
904 /* add3 $rn,$rm,$simm16 */
907 { { MNEM, ' ', OP (RN), ',', OP (RM), ',', OP (SIMM16), 0 } },
908 & ifmt_uci, { 0xc0000000 }
910 /* slt3 $rn,$rm,$simm16 */
913 { { MNEM, ' ', OP (RN), ',', OP (RM), ',', OP (SIMM16), 0 } },
914 & ifmt_uci, { 0xc0020000 }
916 /* sltu3 $rn,$rm,$uimm16 */
919 { { MNEM, ' ', OP (RN), ',', OP (RM), ',', OP (UIMM16), 0 } },
920 & ifmt_dsp, { 0xc0030000 }
925 { { MNEM, ' ', OP (RN), ',', OP (RM), 0 } },
926 & ifmt_mov, { 0x1000 }
931 { { MNEM, ' ', OP (RN), ',', OP (RM), 0 } },
932 & ifmt_mov, { 0x1001 }
937 { { MNEM, ' ', OP (RN), ',', OP (RM), 0 } },
938 & ifmt_mov, { 0x1002 }
943 { { MNEM, ' ', OP (RN), ',', OP (RM), 0 } },
944 & ifmt_mov, { 0x1003 }
946 /* or3 $rn,$rm,$uimm16 */
949 { { MNEM, ' ', OP (RN), ',', OP (RM), ',', OP (UIMM16), 0 } },
950 & ifmt_dsp, { 0xc0040000 }
952 /* and3 $rn,$rm,$uimm16 */
955 { { MNEM, ' ', OP (RN), ',', OP (RM), ',', OP (UIMM16), 0 } },
956 & ifmt_dsp, { 0xc0050000 }
958 /* xor3 $rn,$rm,$uimm16 */
961 { { MNEM, ' ', OP (RN), ',', OP (RM), ',', OP (UIMM16), 0 } },
962 & ifmt_dsp, { 0xc0060000 }
967 { { MNEM, ' ', OP (RN), ',', OP (RM), 0 } },
968 & ifmt_mov, { 0x200d }
973 { { MNEM, ' ', OP (RN), ',', OP (RM), 0 } },
974 & ifmt_mov, { 0x200c }
979 { { MNEM, ' ', OP (RN), ',', OP (RM), 0 } },
980 & ifmt_mov, { 0x200e }
985 { { MNEM, ' ', OP (RN), ',', OP (UIMM5), 0 } },
986 & ifmt_slt3i, { 0x6003 }
991 { { MNEM, ' ', OP (RN), ',', OP (UIMM5), 0 } },
992 & ifmt_slt3i, { 0x6002 }
997 { { MNEM, ' ', OP (RN), ',', OP (UIMM5), 0 } },
998 & ifmt_slt3i, { 0x6006 }
1000 /* sll3 \$0,$rn,$uimm5 */
1003 { { MNEM, ' ', '$', '0', ',', OP (RN), ',', OP (UIMM5), 0 } },
1004 & ifmt_slt3i, { 0x6007 }
1009 { { MNEM, ' ', OP (RN), ',', OP (RM), 0 } },
1010 & ifmt_mov, { 0x200f }
1012 /* bra $pcrel12a2 */
1015 { { MNEM, ' ', OP (PCREL12A2), 0 } },
1016 & ifmt_bra, { 0xb000 }
1018 /* beqz $rn,$pcrel8a2 */
1021 { { MNEM, ' ', OP (RN), ',', OP (PCREL8A2), 0 } },
1022 & ifmt_beqz, { 0xa000 }
1024 /* bnez $rn,$pcrel8a2 */
1027 { { MNEM, ' ', OP (RN), ',', OP (PCREL8A2), 0 } },
1028 & ifmt_beqz, { 0xa001 }
1030 /* beqi $rn,$uimm4,$pcrel17a2 */
1033 { { MNEM, ' ', OP (RN), ',', OP (UIMM4), ',', OP (PCREL17A2), 0 } },
1034 & ifmt_beqi, { 0xe0000000 }
1036 /* bnei $rn,$uimm4,$pcrel17a2 */
1039 { { MNEM, ' ', OP (RN), ',', OP (UIMM4), ',', OP (PCREL17A2), 0 } },
1040 & ifmt_beqi, { 0xe0040000 }
1042 /* blti $rn,$uimm4,$pcrel17a2 */
1045 { { MNEM, ' ', OP (RN), ',', OP (UIMM4), ',', OP (PCREL17A2), 0 } },
1046 & ifmt_beqi, { 0xe00c0000 }
1048 /* bgei $rn,$uimm4,$pcrel17a2 */
1051 { { MNEM, ' ', OP (RN), ',', OP (UIMM4), ',', OP (PCREL17A2), 0 } },
1052 & ifmt_beqi, { 0xe0080000 }
1054 /* beq $rn,$rm,$pcrel17a2 */
1057 { { MNEM, ' ', OP (RN), ',', OP (RM), ',', OP (PCREL17A2), 0 } },
1058 & ifmt_beq, { 0xe0010000 }
1060 /* bne $rn,$rm,$pcrel17a2 */
1063 { { MNEM, ' ', OP (RN), ',', OP (RM), ',', OP (PCREL17A2), 0 } },
1064 & ifmt_beq, { 0xe0050000 }
1066 /* bsr $pcrel12a2 */
1069 { { MNEM, ' ', OP (PCREL12A2), 0 } },
1070 & ifmt_bra, { 0xb001 }
1072 /* bsr $pcrel24a2 */
1075 { { MNEM, ' ', OP (PCREL24A2), 0 } },
1076 & ifmt_bsr24, { 0xd8090000 }
1081 { { MNEM, ' ', OP (RM), 0 } },
1082 & ifmt_jmp, { 0x100e }
1084 /* jmp $pcabs24a2 */
1087 { { MNEM, ' ', OP (PCABS24A2), 0 } },
1088 & ifmt_jmp24, { 0xd8080000 }
1093 { { MNEM, ' ', OP (RM), 0 } },
1094 & ifmt_jmp, { 0x100f }
1100 & ifmt_ret, { 0x7002 }
1102 /* repeat $rn,$pcrel17a2 */
1105 { { MNEM, ' ', OP (RN), ',', OP (PCREL17A2), 0 } },
1106 & ifmt_repeat, { 0xe0090000 }
1108 /* erepeat $pcrel17a2 */
1111 { { MNEM, ' ', OP (PCREL17A2), 0 } },
1112 & ifmt_erepeat, { 0xe0190000 }
1117 { { MNEM, ' ', OP (RN), ',', '$', 'l', 'p', 0 } },
1118 & ifmt_stc_lp, { 0x7018 }
1123 { { MNEM, ' ', OP (RN), ',', '$', 'h', 'i', 0 } },
1124 & ifmt_stc_lp, { 0x7078 }
1129 { { MNEM, ' ', OP (RN), ',', '$', 'l', 'o', 0 } },
1130 & ifmt_stc_lp, { 0x7088 }
1135 { { MNEM, ' ', OP (RN), ',', OP (CSRN), 0 } },
1136 & ifmt_stc, { 0x7008 }
1141 { { MNEM, ' ', OP (RN), ',', '$', 'l', 'p', 0 } },
1142 & ifmt_stc_lp, { 0x701a }
1147 { { MNEM, ' ', OP (RN), ',', '$', 'h', 'i', 0 } },
1148 & ifmt_stc_lp, { 0x707a }
1153 { { MNEM, ' ', OP (RN), ',', '$', 'l', 'o', 0 } },
1154 & ifmt_stc_lp, { 0x708a }
1159 { { MNEM, ' ', OP (RN), ',', OP (CSRN), 0 } },
1160 & ifmt_stc, { 0x700a }
1166 & ifmt_ret, { 0x7000 }
1172 & ifmt_ret, { 0x7010 }
1178 & ifmt_ret, { 0x7012 }
1184 & ifmt_ret, { 0x7022 }
1190 & ifmt_ret, { 0x7062 }
1195 { { MNEM, ' ', OP (UIMM2), 0 } },
1196 & ifmt_swi, { 0x7006 }
1202 & ifmt_ret, { 0x7032 }
1208 & ifmt_ret, { 0x7011 }
1210 /* stcb $rn,$uimm16 */
1213 { { MNEM, ' ', OP (RN), ',', OP (UIMM16), 0 } },
1214 & ifmt_movu16, { 0xf0040000 }
1216 /* ldcb $rn,$uimm16 */
1219 { { MNEM, ' ', OP (RN), ',', OP (UIMM16), 0 } },
1220 & ifmt_movu16, { 0xf0140000 }
1222 /* bsetm ($rma),$uimm3 */
1225 { { MNEM, ' ', '(', OP (RMA), ')', ',', OP (UIMM3), 0 } },
1226 & ifmt_bsetm, { 0x2000 }
1228 /* bclrm ($rma),$uimm3 */
1231 { { MNEM, ' ', '(', OP (RMA), ')', ',', OP (UIMM3), 0 } },
1232 & ifmt_bsetm, { 0x2001 }
1234 /* bnotm ($rma),$uimm3 */
1237 { { MNEM, ' ', '(', OP (RMA), ')', ',', OP (UIMM3), 0 } },
1238 & ifmt_bsetm, { 0x2002 }
1240 /* btstm \$0,($rma),$uimm3 */
1243 { { MNEM, ' ', '$', '0', ',', '(', OP (RMA), ')', ',', OP (UIMM3), 0 } },
1244 & ifmt_bsetm, { 0x2003 }
1246 /* tas $rn,($rma) */
1249 { { MNEM, ' ', OP (RN), ',', '(', OP (RMA), ')', 0 } },
1250 & ifmt_stcb_r, { 0x2004 }
1252 /* cache $cimm4,($rma) */
1255 { { MNEM, ' ', OP (CIMM4), ',', '(', OP (RMA), ')', 0 } },
1256 & ifmt_pref, { 0x7004 }
1261 { { MNEM, ' ', OP (RN), ',', OP (RM), 0 } },
1262 & ifmt_mov, { 0x1004 }
1267 { { MNEM, ' ', OP (RN), ',', OP (RM), 0 } },
1268 & ifmt_mov, { 0x1005 }
1273 { { MNEM, ' ', OP (RN), ',', OP (RM), 0 } },
1274 & ifmt_mov, { 0x1006 }
1279 { { MNEM, ' ', OP (RN), ',', OP (RM), 0 } },
1280 & ifmt_mov, { 0x1007 }
1285 { { MNEM, ' ', OP (RN), ',', OP (RM), 0 } },
1286 & ifmt_madd, { 0xf0013004 }
1291 { { MNEM, ' ', OP (RN), ',', OP (RM), 0 } },
1292 & ifmt_madd, { 0xf0013005 }
1297 { { MNEM, ' ', OP (RN), ',', OP (RM), 0 } },
1298 & ifmt_madd, { 0xf0013006 }
1300 /* maddru $rn,$rm */
1303 { { MNEM, ' ', OP (RN), ',', OP (RM), 0 } },
1304 & ifmt_madd, { 0xf0013007 }
1309 { { MNEM, ' ', OP (RN), ',', OP (RM), 0 } },
1310 & ifmt_mov, { 0x1008 }
1315 { { MNEM, ' ', OP (RN), ',', OP (RM), 0 } },
1316 & ifmt_mov, { 0x1009 }
1322 & ifmt_ret, { 0x7013 }
1328 & ifmt_ret, { 0x7033 }
1333 { { MNEM, ' ', OP (RN), ',', OP (RM), 0 } },
1334 & ifmt_madd, { 0xf0010000 }
1339 { { MNEM, ' ', OP (RN), ',', OP (RM), 0 } },
1340 & ifmt_madd, { 0xf0010003 }
1345 { { MNEM, ' ', OP (RN), ',', OP (RM), 0 } },
1346 & ifmt_madd, { 0xf0010002 }
1351 { { MNEM, ' ', OP (RN), ',', OP (RM), 0 } },
1352 & ifmt_madd, { 0xf0010004 }
1357 { { MNEM, ' ', OP (RN), ',', OP (RM), 0 } },
1358 & ifmt_madd, { 0xf0010005 }
1363 { { MNEM, ' ', OP (RN), ',', OP (RM), 0 } },
1364 & ifmt_madd, { 0xf0010006 }
1369 { { MNEM, ' ', OP (RN), ',', OP (RM), 0 } },
1370 & ifmt_madd, { 0xf0010007 }
1372 /* clip $rn,$cimm5 */
1375 { { MNEM, ' ', OP (RN), ',', OP (CIMM5), 0 } },
1376 & ifmt_clip, { 0xf0011000 }
1378 /* clipu $rn,$cimm5 */
1381 { { MNEM, ' ', OP (RN), ',', OP (CIMM5), 0 } },
1382 & ifmt_clip, { 0xf0011001 }
1387 { { MNEM, ' ', OP (RN), ',', OP (RM), 0 } },
1388 & ifmt_madd, { 0xf0010008 }
1393 { { MNEM, ' ', OP (RN), ',', OP (RM), 0 } },
1394 & ifmt_madd, { 0xf001000a }
1399 { { MNEM, ' ', OP (RN), ',', OP (RM), 0 } },
1400 & ifmt_madd, { 0xf0010009 }
1405 { { MNEM, ' ', OP (RN), ',', OP (RM), 0 } },
1406 & ifmt_madd, { 0xf001000b }
1408 /* swcp $crn,($rma) */
1411 { { MNEM, ' ', OP (CRN), ',', '(', OP (RMA), ')', 0 } },
1412 & ifmt_swcp, { 0x3008 }
1414 /* lwcp $crn,($rma) */
1417 { { MNEM, ' ', OP (CRN), ',', '(', OP (RMA), ')', 0 } },
1418 & ifmt_swcp, { 0x3009 }
1420 /* smcp $crn64,($rma) */
1423 { { MNEM, ' ', OP (CRN64), ',', '(', OP (RMA), ')', 0 } },
1424 & ifmt_smcp, { 0x300a }
1426 /* lmcp $crn64,($rma) */
1429 { { MNEM, ' ', OP (CRN64), ',', '(', OP (RMA), ')', 0 } },
1430 & ifmt_smcp, { 0x300b }
1432 /* swcpi $crn,($rma+) */
1435 { { MNEM, ' ', OP (CRN), ',', '(', OP (RMA), '+', ')', 0 } },
1436 & ifmt_swcp, { 0x3000 }
1438 /* lwcpi $crn,($rma+) */
1441 { { MNEM, ' ', OP (CRN), ',', '(', OP (RMA), '+', ')', 0 } },
1442 & ifmt_swcp, { 0x3001 }
1444 /* smcpi $crn64,($rma+) */
1447 { { MNEM, ' ', OP (CRN64), ',', '(', OP (RMA), '+', ')', 0 } },
1448 & ifmt_smcp, { 0x3002 }
1450 /* lmcpi $crn64,($rma+) */
1453 { { MNEM, ' ', OP (CRN64), ',', '(', OP (RMA), '+', ')', 0 } },
1454 & ifmt_smcp, { 0x3003 }
1456 /* swcp $crn,$sdisp16($rma) */
1459 { { MNEM, ' ', OP (CRN), ',', OP (SDISP16), '(', OP (RMA), ')', 0 } },
1460 & ifmt_swcp16, { 0xf00c0000 }
1462 /* lwcp $crn,$sdisp16($rma) */
1465 { { MNEM, ' ', OP (CRN), ',', OP (SDISP16), '(', OP (RMA), ')', 0 } },
1466 & ifmt_swcp16, { 0xf00d0000 }
1468 /* smcp $crn64,$sdisp16($rma) */
1471 { { MNEM, ' ', OP (CRN64), ',', OP (SDISP16), '(', OP (RMA), ')', 0 } },
1472 & ifmt_smcp16, { 0xf00e0000 }
1474 /* lmcp $crn64,$sdisp16($rma) */
1477 { { MNEM, ' ', OP (CRN64), ',', OP (SDISP16), '(', OP (RMA), ')', 0 } },
1478 & ifmt_smcp16, { 0xf00f0000 }
1480 /* sbcpa $crn,($rma+),$cdisp10 */
1483 { { MNEM, ' ', OP (CRN), ',', '(', OP (RMA), '+', ')', ',', OP (CDISP10), 0 } },
1484 & ifmt_lbucpa, { 0xf0050000 }
1486 /* lbcpa $crn,($rma+),$cdisp10 */
1489 { { MNEM, ' ', OP (CRN), ',', '(', OP (RMA), '+', ')', ',', OP (CDISP10), 0 } },
1490 & ifmt_lbucpa, { 0xf0054000 }
1492 /* shcpa $crn,($rma+),$cdisp10a2 */
1495 { { MNEM, ' ', OP (CRN), ',', '(', OP (RMA), '+', ')', ',', OP (CDISP10A2), 0 } },
1496 & ifmt_lhucpa, { 0xf0051000 }
1498 /* lhcpa $crn,($rma+),$cdisp10a2 */
1501 { { MNEM, ' ', OP (CRN), ',', '(', OP (RMA), '+', ')', ',', OP (CDISP10A2), 0 } },
1502 & ifmt_lhucpa, { 0xf0055000 }
1504 /* swcpa $crn,($rma+),$cdisp10a4 */
1507 { { MNEM, ' ', OP (CRN), ',', '(', OP (RMA), '+', ')', ',', OP (CDISP10A4), 0 } },
1508 & ifmt_swcpa, { 0xf0052000 }
1510 /* lwcpa $crn,($rma+),$cdisp10a4 */
1513 { { MNEM, ' ', OP (CRN), ',', '(', OP (RMA), '+', ')', ',', OP (CDISP10A4), 0 } },
1514 & ifmt_swcpa, { 0xf0056000 }
1516 /* smcpa $crn64,($rma+),$cdisp10a8 */
1519 { { MNEM, ' ', OP (CRN64), ',', '(', OP (RMA), '+', ')', ',', OP (CDISP10A8), 0 } },
1520 & ifmt_smcpa, { 0xf0053000 }
1522 /* lmcpa $crn64,($rma+),$cdisp10a8 */
1525 { { MNEM, ' ', OP (CRN64), ',', '(', OP (RMA), '+', ')', ',', OP (CDISP10A8), 0 } },
1526 & ifmt_smcpa, { 0xf0057000 }
1528 /* sbcpm0 $crn,($rma+),$cdisp10 */
1531 { { MNEM, ' ', OP (CRN), ',', '(', OP (RMA), '+', ')', ',', OP (CDISP10), 0 } },
1532 & ifmt_lbucpa, { 0xf0050800 }
1534 /* lbcpm0 $crn,($rma+),$cdisp10 */
1537 { { MNEM, ' ', OP (CRN), ',', '(', OP (RMA), '+', ')', ',', OP (CDISP10), 0 } },
1538 & ifmt_lbucpa, { 0xf0054800 }
1540 /* shcpm0 $crn,($rma+),$cdisp10a2 */
1543 { { MNEM, ' ', OP (CRN), ',', '(', OP (RMA), '+', ')', ',', OP (CDISP10A2), 0 } },
1544 & ifmt_lhucpa, { 0xf0051800 }
1546 /* lhcpm0 $crn,($rma+),$cdisp10a2 */
1549 { { MNEM, ' ', OP (CRN), ',', '(', OP (RMA), '+', ')', ',', OP (CDISP10A2), 0 } },
1550 & ifmt_lhucpa, { 0xf0055800 }
1552 /* swcpm0 $crn,($rma+),$cdisp10a4 */
1555 { { MNEM, ' ', OP (CRN), ',', '(', OP (RMA), '+', ')', ',', OP (CDISP10A4), 0 } },
1556 & ifmt_swcpa, { 0xf0052800 }
1558 /* lwcpm0 $crn,($rma+),$cdisp10a4 */
1561 { { MNEM, ' ', OP (CRN), ',', '(', OP (RMA), '+', ')', ',', OP (CDISP10A4), 0 } },
1562 & ifmt_swcpa, { 0xf0056800 }
1564 /* smcpm0 $crn64,($rma+),$cdisp10a8 */
1567 { { MNEM, ' ', OP (CRN64), ',', '(', OP (RMA), '+', ')', ',', OP (CDISP10A8), 0 } },
1568 & ifmt_smcpa, { 0xf0053800 }
1570 /* lmcpm0 $crn64,($rma+),$cdisp10a8 */
1573 { { MNEM, ' ', OP (CRN64), ',', '(', OP (RMA), '+', ')', ',', OP (CDISP10A8), 0 } },
1574 & ifmt_smcpa, { 0xf0057800 }
1576 /* sbcpm1 $crn,($rma+),$cdisp10 */
1579 { { MNEM, ' ', OP (CRN), ',', '(', OP (RMA), '+', ')', ',', OP (CDISP10), 0 } },
1580 & ifmt_lbucpa, { 0xf0050c00 }
1582 /* lbcpm1 $crn,($rma+),$cdisp10 */
1585 { { MNEM, ' ', OP (CRN), ',', '(', OP (RMA), '+', ')', ',', OP (CDISP10), 0 } },
1586 & ifmt_lbucpa, { 0xf0054c00 }
1588 /* shcpm1 $crn,($rma+),$cdisp10a2 */
1591 { { MNEM, ' ', OP (CRN), ',', '(', OP (RMA), '+', ')', ',', OP (CDISP10A2), 0 } },
1592 & ifmt_lhucpa, { 0xf0051c00 }
1594 /* lhcpm1 $crn,($rma+),$cdisp10a2 */
1597 { { MNEM, ' ', OP (CRN), ',', '(', OP (RMA), '+', ')', ',', OP (CDISP10A2), 0 } },
1598 & ifmt_lhucpa, { 0xf0055c00 }
1600 /* swcpm1 $crn,($rma+),$cdisp10a4 */
1603 { { MNEM, ' ', OP (CRN), ',', '(', OP (RMA), '+', ')', ',', OP (CDISP10A4), 0 } },
1604 & ifmt_swcpa, { 0xf0052c00 }
1606 /* lwcpm1 $crn,($rma+),$cdisp10a4 */
1609 { { MNEM, ' ', OP (CRN), ',', '(', OP (RMA), '+', ')', ',', OP (CDISP10A4), 0 } },
1610 & ifmt_swcpa, { 0xf0056c00 }
1612 /* smcpm1 $crn64,($rma+),$cdisp10a8 */
1615 { { MNEM, ' ', OP (CRN64), ',', '(', OP (RMA), '+', ')', ',', OP (CDISP10A8), 0 } },
1616 & ifmt_smcpa, { 0xf0053c00 }
1618 /* lmcpm1 $crn64,($rma+),$cdisp10a8 */
1621 { { MNEM, ' ', OP (CRN64), ',', '(', OP (RMA), '+', ')', ',', OP (CDISP10A8), 0 } },
1622 & ifmt_smcpa, { 0xf0057c00 }
1624 /* bcpeq $cccc,$pcrel17a2 */
1627 { { MNEM, ' ', OP (CCCC), ',', OP (PCREL17A2), 0 } },
1628 & ifmt_bcpeq, { 0xd8040000 }
1630 /* bcpne $cccc,$pcrel17a2 */
1633 { { MNEM, ' ', OP (CCCC), ',', OP (PCREL17A2), 0 } },
1634 & ifmt_bcpeq, { 0xd8050000 }
1636 /* bcpat $cccc,$pcrel17a2 */
1639 { { MNEM, ' ', OP (CCCC), ',', OP (PCREL17A2), 0 } },
1640 & ifmt_bcpeq, { 0xd8060000 }
1642 /* bcpaf $cccc,$pcrel17a2 */
1645 { { MNEM, ' ', OP (CCCC), ',', OP (PCREL17A2), 0 } },
1646 & ifmt_bcpeq, { 0xd8070000 }
1652 & ifmt_ret, { 0x7021 }
1657 { { MNEM, ' ', OP (RM), 0 } },
1658 & ifmt_jmp, { 0x180f }
1660 /* bsrv $pcrel24a2 */
1663 { { MNEM, ' ', OP (PCREL24A2), 0 } },
1664 & ifmt_bsr24, { 0xd80b0000 }
1670 & ifmt_sim_syscall, { 0x7800 }
1682 & ifmt_mov, { 0x100a }
1688 & ifmt_mov, { 0x100b }
1694 & ifmt_mov, { 0x2005 }
1700 & ifmt_mov, { 0x2008 }
1706 & ifmt_mov, { 0x2009 }
1712 & ifmt_mov, { 0x200a }
1718 & ifmt_mov, { 0x200b }
1724 & ifmt_mov, { 0x3004 }
1730 & ifmt_mov, { 0x3005 }
1736 & ifmt_mov, { 0x3006 }
1742 & ifmt_mov, { 0x3007 }
1748 & ifmt_mov, { 0x300c }
1754 & ifmt_mov, { 0x300d }
1760 & ifmt_mov, { 0x300e }
1766 & ifmt_mov, { 0x300f }
1772 & ifmt_mov, { 0x7007 }
1778 & ifmt_mov, { 0x700e }
1784 & ifmt_mov, { 0x700f }
1790 & ifmt_mov, { 0xc007 }
1796 & ifmt_mov, { 0xe00d }
1802 & ifmt_mov, { 0xf008 }
1811 /* Formats for ALIAS macro-insns. */
1813 #if defined (__STDC__) || defined (ALMOST_STDC) || defined (HAVE_STRINGIZE)
1814 #define F(f) & mep_cgen_ifld_table[MEP_##f]
1816 #define F(f) & mep_cgen_ifld_table[MEP_/**/f]
1818 static const CGEN_IFMT ifmt_nop ATTRIBUTE_UNUSED = {
1819 16, 16, 0xffff, { { F (F_MAJOR) }, { F (F_RN) }, { F (F_RM) }, { F (F_SUB4) }, { 0 } }
1822 static 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 } }
1826 static 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 } }
1830 static 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 } }
1834 static 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 } }
1838 static 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 } }
1842 static 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 } }
1846 static 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 } }
1850 static 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 } }
1854 static 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 } }
1858 static 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 } }
1862 static 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 } }
1866 static 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 } }
1872 /* Each non-simple macro entry points to an array of expansion possibilities. */
1874 #if defined (__STDC__) || defined (ALMOST_STDC) || defined (HAVE_STRINGIZE)
1875 #define A(a) (1 << CGEN_INSN_##a)
1877 #define A(a) (1 << CGEN_INSN_/**/a)
1879 #if defined (__STDC__) || defined (ALMOST_STDC) || defined (HAVE_STRINGIZE)
1880 #define OPERAND(op) MEP_OPERAND_##op
1882 #define OPERAND(op) MEP_OPERAND_/**/op
1884 #define MNEM CGEN_SYNTAX_MNEMONIC /* syntax value for mnemonic */
1885 #define OP(field) CGEN_SYNTAX_MAKE_FIELD (OPERAND (field))
1887 /* The macro instruction table. */
1889 static const CGEN_IBASE mep_cgen_macro_insn_table[] =
1893 -1, "nop", "nop", 16,
1894 { 0|A(ALIAS), { { { (1<<MACH_BASE), 0 } }, { { 1, "\x80" } }, { { 0, 0 } }, { { CONFIG_NONE, 0 } } } }
1896 /* sb $rnc,$zero($rma) */
1898 -1, "sb16-0", "sb", 16,
1899 { 0|A(NO_DIS)|A(ALIAS), { { { (1<<MACH_BASE), 0 } }, { { 1, "\xc0" } }, { { 0, 0 } }, { { CONFIG_NONE, 0 } } } }
1901 /* sh $rns,$zero($rma) */
1903 -1, "sh16-0", "sh", 16,
1904 { 0|A(NO_DIS)|A(ALIAS), { { { (1<<MACH_BASE), 0 } }, { { 1, "\xc0" } }, { { 0, 0 } }, { { CONFIG_NONE, 0 } } } }
1906 /* sw $rnl,$zero($rma) */
1908 -1, "sw16-0", "sw", 16,
1909 { 0|A(NO_DIS)|A(ALIAS), { { { (1<<MACH_BASE), 0 } }, { { 1, "\xc0" } }, { { 0, 0 } }, { { CONFIG_NONE, 0 } } } }
1911 /* lb $rnc,$zero($rma) */
1913 -1, "lb16-0", "lb", 16,
1914 { 0|A(NO_DIS)|A(ALIAS), { { { (1<<MACH_BASE), 0 } }, { { 1, "\xc0" } }, { { 0, 0 } }, { { CONFIG_NONE, 0 } } } }
1916 /* lh $rns,$zero($rma) */
1918 -1, "lh16-0", "lh", 16,
1919 { 0|A(NO_DIS)|A(ALIAS), { { { (1<<MACH_BASE), 0 } }, { { 1, "\xc0" } }, { { 0, 0 } }, { { CONFIG_NONE, 0 } } } }
1921 /* lw $rnl,$zero($rma) */
1923 -1, "lw16-0", "lw", 16,
1924 { 0|A(NO_DIS)|A(ALIAS), { { { (1<<MACH_BASE), 0 } }, { { 1, "\xc0" } }, { { 0, 0 } }, { { CONFIG_NONE, 0 } } } }
1926 /* lbu $rnuc,$zero($rma) */
1928 -1, "lbu16-0", "lbu", 16,
1929 { 0|A(NO_DIS)|A(ALIAS), { { { (1<<MACH_BASE), 0 } }, { { 1, "\xc0" } }, { { 0, 0 } }, { { CONFIG_NONE, 0 } } } }
1931 /* lhu $rnus,$zero($rma) */
1933 -1, "lhu16-0", "lhu", 16,
1934 { 0|A(NO_DIS)|A(ALIAS), { { { (1<<MACH_BASE), 0 } }, { { 1, "\xc0" } }, { { 0, 0 } }, { { CONFIG_NONE, 0 } } } }
1936 /* swcp $crn,$zero($rma) */
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 } } } }
1941 /* lwcp $crn,$zero($rma) */
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 } } } }
1946 /* smcp $crn64,$zero($rma) */
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 } } } }
1951 /* lmcp $crn64,$zero($rma) */
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 } } } }
1958 /* The macro instruction opcode table. */
1960 static const CGEN_OPCODE mep_cgen_macro_insn_opcode_table[] =
1968 /* sb $rnc,$zero($rma) */
1971 { { MNEM, ' ', OP (RNC), ',', OP (ZERO), '(', OP (RMA), ')', 0 } },
1972 & ifmt_sb16_0, { 0x8 }
1974 /* sh $rns,$zero($rma) */
1977 { { MNEM, ' ', OP (RNS), ',', OP (ZERO), '(', OP (RMA), ')', 0 } },
1978 & ifmt_sh16_0, { 0x9 }
1980 /* sw $rnl,$zero($rma) */
1983 { { MNEM, ' ', OP (RNL), ',', OP (ZERO), '(', OP (RMA), ')', 0 } },
1984 & ifmt_sw16_0, { 0xa }
1986 /* lb $rnc,$zero($rma) */
1989 { { MNEM, ' ', OP (RNC), ',', OP (ZERO), '(', OP (RMA), ')', 0 } },
1990 & ifmt_lb16_0, { 0xc }
1992 /* lh $rns,$zero($rma) */
1995 { { MNEM, ' ', OP (RNS), ',', OP (ZERO), '(', OP (RMA), ')', 0 } },
1996 & ifmt_lh16_0, { 0xd }
1998 /* lw $rnl,$zero($rma) */
2001 { { MNEM, ' ', OP (RNL), ',', OP (ZERO), '(', OP (RMA), ')', 0 } },
2002 & ifmt_lw16_0, { 0xe }
2004 /* lbu $rnuc,$zero($rma) */
2007 { { MNEM, ' ', OP (RNUC), ',', OP (ZERO), '(', OP (RMA), ')', 0 } },
2008 & ifmt_lbu16_0, { 0xb }
2010 /* lhu $rnus,$zero($rma) */
2013 { { MNEM, ' ', OP (RNUS), ',', OP (ZERO), '(', OP (RMA), ')', 0 } },
2014 & ifmt_lhu16_0, { 0xf }
2016 /* swcp $crn,$zero($rma) */
2019 { { MNEM, ' ', OP (CRN), ',', OP (ZERO), '(', OP (RMA), ')', 0 } },
2020 & ifmt_swcp16_0, { 0x3008 }
2022 /* lwcp $crn,$zero($rma) */
2025 { { MNEM, ' ', OP (CRN), ',', OP (ZERO), '(', OP (RMA), ')', 0 } },
2026 & ifmt_lwcp16_0, { 0x3009 }
2028 /* smcp $crn64,$zero($rma) */
2031 { { MNEM, ' ', OP (CRN64), ',', OP (ZERO), '(', OP (RMA), ')', 0 } },
2032 & ifmt_smcp16_0, { 0x300a }
2034 /* lmcp $crn64,$zero($rma) */
2037 { { MNEM, ' ', OP (CRN64), ',', OP (ZERO), '(', OP (RMA), ')', 0 } },
2038 & ifmt_lmcp16_0, { 0x300b }
2047 #ifndef CGEN_ASM_HASH_P
2048 #define CGEN_ASM_HASH_P(insn) 1
2051 #ifndef CGEN_DIS_HASH_P
2052 #define CGEN_DIS_HASH_P(insn) 1
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. */
2059 asm_hash_insn_p (insn)
2060 const CGEN_INSN *insn ATTRIBUTE_UNUSED;
2062 return CGEN_ASM_HASH_P (insn);
2066 dis_hash_insn_p (insn)
2067 const CGEN_INSN *insn;
2069 /* If building the hash table and the NO-DIS attribute is present,
2071 if (CGEN_INSN_ATTR_VALUE (insn, CGEN_INSN_NO_DIS))
2073 return CGEN_DIS_HASH_P (insn);
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)
2081 #define CGEN_ASM_HASH(mnem) (*(unsigned char *) (mnem) % CGEN_ASM_HASH_SIZE) /*FIXME*/
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. */
2090 #ifndef CGEN_DIS_HASH
2091 #define CGEN_DIS_HASH_SIZE 256
2092 #define CGEN_DIS_HASH(buf, value) (*(unsigned char *) (buf))
2095 /* The result is the hash value of the insn.
2096 Targets are free to override CGEN_{ASM,DIS}_HASH in the .opc file. */
2099 asm_hash_insn (mnem)
2102 return CGEN_ASM_HASH (mnem);
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. */
2109 dis_hash_insn (buf, value)
2110 const char * buf ATTRIBUTE_UNUSED;
2111 CGEN_INSN_INT value ATTRIBUTE_UNUSED;
2113 return CGEN_DIS_HASH (buf, value);
2116 /* Set the recorded length of the insn in the CGEN_FIELDS struct. */
2119 set_fields_bitsize (CGEN_FIELDS *fields, int size)
2121 CGEN_FIELDS_BITSIZE (fields) = size;
2124 /* Function to call before using the operand instance table.
2125 This plugs the opcode entries and macro instructions into the cpu table. */
2128 mep_cgen_init_opcode_table (CGEN_CPU_DESC cd)
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));
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)
2143 insns[i].base = &ib[i];
2144 insns[i].opcode = &oc[i];
2145 mep_cgen_build_insn_regex (& insns[i]);
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;
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)
2155 insns[i].opcode = &oc[i];
2156 mep_cgen_build_insn_regex (& insns[i]);
2159 cd->sizeof_fields = sizeof (CGEN_FIELDS);
2160 cd->set_fields_bitsize = set_fields_bitsize;
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;
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;