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