1 /* Generic opcode table support for targets using CGEN. -*- C -*-
2 CGEN: Cpu tools GENerator
4 THIS FILE IS USED TO GENERATE fr30-opc.c.
6 Copyright (C) 1998 Free Software Foundation, Inc.
8 This file is part of the GNU Binutils and GDB, the GNU debugger.
10 This program is free software; you can redistribute it and/or modify
11 it under the terms of the GNU General Public License as published by
12 the Free Software Foundation; either version 2, or (at your option)
15 This program is distributed in the hope that it will be useful,
16 but WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 GNU General Public License for more details.
20 You should have received a copy of the GNU General Public License
21 along with this program; if not, write to the Free Software Foundation, Inc.,
22 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
27 #include "libiberty.h"
33 /* Used by the ifield rtx function. */
34 #define FLD(f) (fields->f)
36 /* The hash functions are recorded here to help keep assembler code out of
37 the disassembler and vice versa. */
39 static int asm_hash_insn_p PARAMS ((const CGEN_INSN *));
40 static unsigned int asm_hash_insn PARAMS ((const char *));
41 static int dis_hash_insn_p PARAMS ((const CGEN_INSN *));
42 static unsigned int dis_hash_insn PARAMS ((const char *, CGEN_INSN_INT));
44 /* Look up instruction INSN_VALUE and extract its fields.
45 INSN, if non-null, is the insn table entry.
46 Otherwise INSN_VALUE is examined to compute it.
47 LENGTH is the bit length of INSN_VALUE if known, otherwise 0.
48 0 is only valid if `insn == NULL && ! CGEN_INT_INSN_P'.
49 If INSN != NULL, LENGTH must be valid.
50 ALIAS_P is non-zero if alias insns are to be included in the search.
52 The result is a pointer to the insn table entry, or NULL if the instruction
56 fr30_cgen_lookup_insn (od, insn, insn_value, length, fields, alias_p)
58 const CGEN_INSN *insn;
59 CGEN_INSN_BYTES insn_value;
64 unsigned char buf[CGEN_MAX_INSN_SIZE];
66 CGEN_INSN_INT base_insn;
68 CGEN_EXTRACT_INFO *info = NULL;
70 CGEN_EXTRACT_INFO ex_info;
71 CGEN_EXTRACT_INFO *info = &ex_info;
75 cgen_put_insn_value (od, buf, length, insn_value);
77 base_insn = insn_value; /*???*/
79 ex_info.dis_info = NULL;
80 ex_info.insn_bytes = insn_value;
82 base_insn = cgen_get_insn_value (od, buf, length);
88 const CGEN_INSN_LIST *insn_list;
90 /* The instructions are stored in hash lists.
91 Pick the first one and keep trying until we find the right one. */
93 insn_list = CGEN_DIS_LOOKUP_INSN (od, bufp, base_insn);
94 while (insn_list != NULL)
96 insn = insn_list->insn;
99 || ! CGEN_INSN_ATTR (insn, CGEN_INSN_ALIAS))
101 /* Basic bit mask must be correct. */
102 /* ??? May wish to allow target to defer this check until the
104 if ((base_insn & CGEN_INSN_BASE_MASK (insn))
105 == CGEN_INSN_BASE_VALUE (insn))
107 /* ??? 0 is passed for `pc' */
108 int elength = (*CGEN_EXTRACT_FN (insn)) (od, insn, info,
114 if (length != 0 && length != elength)
121 insn_list = CGEN_DIS_NEXT_INSN (insn_list);
126 /* Sanity check: can't pass an alias insn if ! alias_p. */
128 && CGEN_INSN_ATTR (insn, CGEN_INSN_ALIAS))
130 /* Sanity check: length must be correct. */
131 if (length != CGEN_INSN_BITSIZE (insn))
134 /* ??? 0 is passed for `pc' */
135 length = (*CGEN_EXTRACT_FN (insn)) (od, insn, info, base_insn, fields,
137 /* Sanity check: must succeed.
138 Could relax this later if it ever proves useful. */
147 /* Fill in the operand instances used by INSN whose operands are FIELDS.
148 INDICES is a pointer to a buffer of MAX_OPERAND_INSTANCES ints to be filled
152 fr30_cgen_get_insn_operands (od, insn, fields, indices)
154 const CGEN_INSN * insn;
155 const CGEN_FIELDS * fields;
158 const CGEN_OPERAND_INSTANCE *opinst;
161 for (i = 0, opinst = CGEN_INSN_OPERANDS (insn);
163 && CGEN_OPERAND_INSTANCE_TYPE (opinst) != CGEN_OPERAND_INSTANCE_END;
166 const CGEN_OPERAND *op = CGEN_OPERAND_INSTANCE_OPERAND (opinst);
168 indices[i] = CGEN_OPERAND_INSTANCE_INDEX (opinst);
170 indices[i] = fr30_cgen_get_int_operand (CGEN_OPERAND_INDEX (op),
175 /* Cover function to fr30_cgen_get_insn_operands when either INSN or FIELDS
177 The INSN, INSN_VALUE, and LENGTH arguments are passed to
178 fr30_cgen_lookup_insn unchanged.
180 The result is the insn table entry or NULL if the instruction wasn't
184 fr30_cgen_lookup_get_insn_operands (od, insn, insn_value, length, indices)
186 const CGEN_INSN *insn;
187 CGEN_INSN_BYTES insn_value;
193 /* Pass non-zero for ALIAS_P only if INSN != NULL.
194 If INSN == NULL, we want a real insn. */
195 insn = fr30_cgen_lookup_insn (od, insn, insn_value, length, &fields,
200 fr30_cgen_get_insn_operands (od, insn, &fields, indices);
205 static const CGEN_ATTR_ENTRY MACH_attr[] =
207 { "base", MACH_BASE },
208 { "fr30", MACH_FR30 },
213 const CGEN_ATTR_TABLE fr30_cgen_hardware_attr_table[] =
215 { "CACHE-ADDR", NULL },
216 { "FUN-ACCESS", NULL },
222 const CGEN_ATTR_TABLE fr30_cgen_operand_attr_table[] =
224 { "ABS-ADDR", NULL },
225 { "HASH-PREFIX", NULL },
226 { "NEGATIVE", NULL },
227 { "PCREL-ADDR", NULL },
229 { "SEM-ONLY", NULL },
230 { "SIGN-OPT", NULL },
232 { "UNSIGNED", NULL },
237 const CGEN_ATTR_TABLE fr30_cgen_insn_attr_table[] =
240 { "COND-CTI", NULL },
241 { "DELAY-SLOT", NULL },
243 { "NOT-IN-DELAY-SLOT", NULL },
245 { "RELAXABLE", NULL },
246 { "SKIP-CTI", NULL },
247 { "UNCOND-CTI", NULL },
252 CGEN_KEYWORD_ENTRY fr30_cgen_opval_h_gr_entries[] =
275 CGEN_KEYWORD fr30_cgen_opval_h_gr =
277 & fr30_cgen_opval_h_gr_entries[0],
281 CGEN_KEYWORD_ENTRY fr30_cgen_opval_h_cr_entries[] =
301 CGEN_KEYWORD fr30_cgen_opval_h_cr =
303 & fr30_cgen_opval_h_cr_entries[0],
307 CGEN_KEYWORD_ENTRY fr30_cgen_opval_h_dr_entries[] =
317 CGEN_KEYWORD fr30_cgen_opval_h_dr =
319 & fr30_cgen_opval_h_dr_entries[0],
323 CGEN_KEYWORD_ENTRY fr30_cgen_opval_h_ps_entries[] =
328 CGEN_KEYWORD fr30_cgen_opval_h_ps =
330 & fr30_cgen_opval_h_ps_entries[0],
334 CGEN_KEYWORD_ENTRY fr30_cgen_opval_h_r13_entries[] =
339 CGEN_KEYWORD fr30_cgen_opval_h_r13 =
341 & fr30_cgen_opval_h_r13_entries[0],
345 CGEN_KEYWORD_ENTRY fr30_cgen_opval_h_r14_entries[] =
350 CGEN_KEYWORD fr30_cgen_opval_h_r14 =
352 & fr30_cgen_opval_h_r14_entries[0],
356 CGEN_KEYWORD_ENTRY fr30_cgen_opval_h_r15_entries[] =
361 CGEN_KEYWORD fr30_cgen_opval_h_r15 =
363 & fr30_cgen_opval_h_r15_entries[0],
368 /* The hardware table. */
370 #define HW_ENT(n) fr30_cgen_hw_entries[n]
371 static const CGEN_HW_ENTRY fr30_cgen_hw_entries[] =
373 { HW_H_PC, & HW_ENT (HW_H_PC + 1), "h-pc", CGEN_ASM_KEYWORD, (PTR) 0, { 0, 0|(1<<CGEN_HW_PROFILE)|(1<<CGEN_HW_PC), { 0 } } },
374 { HW_H_MEMORY, & HW_ENT (HW_H_MEMORY + 1), "h-memory", CGEN_ASM_KEYWORD, (PTR) 0, { 0, 0, { 0 } } },
375 { HW_H_SINT, & HW_ENT (HW_H_SINT + 1), "h-sint", CGEN_ASM_KEYWORD, (PTR) 0, { 0, 0, { 0 } } },
376 { HW_H_UINT, & HW_ENT (HW_H_UINT + 1), "h-uint", CGEN_ASM_KEYWORD, (PTR) 0, { 0, 0, { 0 } } },
377 { HW_H_ADDR, & HW_ENT (HW_H_ADDR + 1), "h-addr", CGEN_ASM_KEYWORD, (PTR) 0, { 0, 0, { 0 } } },
378 { HW_H_IADDR, & HW_ENT (HW_H_IADDR + 1), "h-iaddr", CGEN_ASM_KEYWORD, (PTR) 0, { 0, 0, { 0 } } },
379 { HW_H_GR, & HW_ENT (HW_H_GR + 1), "h-gr", CGEN_ASM_KEYWORD, (PTR) & fr30_cgen_opval_h_gr, { 0, 0|(1<<CGEN_HW_CACHE_ADDR)|(1<<CGEN_HW_PROFILE), { 0 } } },
380 { HW_H_CR, & HW_ENT (HW_H_CR + 1), "h-cr", CGEN_ASM_KEYWORD, (PTR) & fr30_cgen_opval_h_cr, { 0, 0, { 0 } } },
381 { HW_H_DR, & HW_ENT (HW_H_DR + 1), "h-dr", CGEN_ASM_KEYWORD, (PTR) & fr30_cgen_opval_h_dr, { 0, 0|(1<<CGEN_HW_FUN_ACCESS), { 0 } } },
382 { HW_H_PS, & HW_ENT (HW_H_PS + 1), "h-ps", CGEN_ASM_KEYWORD, (PTR) & fr30_cgen_opval_h_ps, { 0, 0|(1<<CGEN_HW_FUN_ACCESS), { 0 } } },
383 { HW_H_R13, & HW_ENT (HW_H_R13 + 1), "h-r13", CGEN_ASM_KEYWORD, (PTR) & fr30_cgen_opval_h_r13, { 0, 0, { 0 } } },
384 { HW_H_R14, & HW_ENT (HW_H_R14 + 1), "h-r14", CGEN_ASM_KEYWORD, (PTR) & fr30_cgen_opval_h_r14, { 0, 0, { 0 } } },
385 { HW_H_R15, & HW_ENT (HW_H_R15 + 1), "h-r15", CGEN_ASM_KEYWORD, (PTR) & fr30_cgen_opval_h_r15, { 0, 0, { 0 } } },
386 { HW_H_NBIT, & HW_ENT (HW_H_NBIT + 1), "h-nbit", CGEN_ASM_KEYWORD, (PTR) 0, { 0, 0, { 0 } } },
387 { HW_H_ZBIT, & HW_ENT (HW_H_ZBIT + 1), "h-zbit", CGEN_ASM_KEYWORD, (PTR) 0, { 0, 0, { 0 } } },
388 { HW_H_VBIT, & HW_ENT (HW_H_VBIT + 1), "h-vbit", CGEN_ASM_KEYWORD, (PTR) 0, { 0, 0, { 0 } } },
389 { HW_H_CBIT, & HW_ENT (HW_H_CBIT + 1), "h-cbit", CGEN_ASM_KEYWORD, (PTR) 0, { 0, 0, { 0 } } },
390 { HW_H_IBIT, & HW_ENT (HW_H_IBIT + 1), "h-ibit", CGEN_ASM_KEYWORD, (PTR) 0, { 0, 0, { 0 } } },
391 { HW_H_SBIT, & HW_ENT (HW_H_SBIT + 1), "h-sbit", CGEN_ASM_KEYWORD, (PTR) 0, { 0, 0, { 0 } } },
392 { HW_H_CCR, & HW_ENT (HW_H_CCR + 1), "h-ccr", CGEN_ASM_KEYWORD, (PTR) 0, { 0, 0|(1<<CGEN_HW_FUN_ACCESS), { 0 } } },
393 { HW_H_SCR, & HW_ENT (HW_H_SCR + 1), "h-scr", CGEN_ASM_KEYWORD, (PTR) 0, { 0, 0|(1<<CGEN_HW_FUN_ACCESS), { 0 } } },
394 { HW_H_ILM, & HW_ENT (HW_H_ILM + 1), "h-ilm", CGEN_ASM_KEYWORD, (PTR) 0, { 0, 0|(1<<CGEN_HW_FUN_ACCESS), { 0 } } },
398 /* The instruction field table. */
400 static const CGEN_IFLD fr30_cgen_ifld_table[] =
402 { FR30_F_NIL, "f-nil", 0, 0, 0, 0, { 0, 0, { 0 } } },
403 { FR30_F_OP1, "f-op1", 0, 16, 0, 4, { 0, 0|(1<<CGEN_IFLD_UNSIGNED), { 0 } } },
404 { FR30_F_OP2, "f-op2", 0, 16, 4, 4, { 0, 0|(1<<CGEN_IFLD_UNSIGNED), { 0 } } },
405 { FR30_F_OP3, "f-op3", 0, 16, 8, 4, { 0, 0|(1<<CGEN_IFLD_UNSIGNED), { 0 } } },
406 { FR30_F_OP4, "f-op4", 0, 16, 12, 4, { 0, 0|(1<<CGEN_IFLD_UNSIGNED), { 0 } } },
407 { FR30_F_OP5, "f-op5", 0, 16, 4, 1, { 0, 0|(1<<CGEN_IFLD_UNSIGNED), { 0 } } },
408 { FR30_F_CC, "f-cc", 0, 16, 4, 4, { 0, 0|(1<<CGEN_IFLD_UNSIGNED), { 0 } } },
409 { FR30_F_CCC, "f-ccc", 16, 16, 0, 8, { 0, 0|(1<<CGEN_IFLD_UNSIGNED), { 0 } } },
410 { FR30_F_RJ, "f-Rj", 0, 16, 8, 4, { 0, 0|(1<<CGEN_IFLD_UNSIGNED), { 0 } } },
411 { FR30_F_RI, "f-Ri", 0, 16, 12, 4, { 0, 0|(1<<CGEN_IFLD_UNSIGNED), { 0 } } },
412 { FR30_F_RS1, "f-Rs1", 0, 16, 8, 4, { 0, 0|(1<<CGEN_IFLD_UNSIGNED), { 0 } } },
413 { FR30_F_RS2, "f-Rs2", 0, 16, 12, 4, { 0, 0|(1<<CGEN_IFLD_UNSIGNED), { 0 } } },
414 { FR30_F_RJC, "f-Rjc", 16, 16, 8, 4, { 0, 0|(1<<CGEN_IFLD_UNSIGNED), { 0 } } },
415 { FR30_F_RIC, "f-Ric", 16, 16, 12, 4, { 0, 0|(1<<CGEN_IFLD_UNSIGNED), { 0 } } },
416 { FR30_F_CRJ, "f-CRj", 16, 16, 8, 4, { 0, 0|(1<<CGEN_IFLD_UNSIGNED), { 0 } } },
417 { FR30_F_CRI, "f-CRi", 16, 16, 12, 4, { 0, 0|(1<<CGEN_IFLD_UNSIGNED), { 0 } } },
418 { FR30_F_U4, "f-u4", 0, 16, 8, 4, { 0, 0|(1<<CGEN_IFLD_UNSIGNED), { 0 } } },
419 { FR30_F_U4C, "f-u4c", 0, 16, 12, 4, { 0, 0|(1<<CGEN_IFLD_UNSIGNED), { 0 } } },
420 { FR30_F_I4, "f-i4", 0, 16, 8, 4, { 0, 0|(1<<CGEN_IFLD_SIGNED), { 0 } } },
421 { FR30_F_M4, "f-m4", 0, 16, 8, 4, { 0, 0|(1<<CGEN_IFLD_UNSIGNED), { 0 } } },
422 { FR30_F_U8, "f-u8", 0, 16, 8, 8, { 0, 0|(1<<CGEN_IFLD_UNSIGNED), { 0 } } },
423 { FR30_F_I8, "f-i8", 0, 16, 4, 8, { 0, 0|(1<<CGEN_IFLD_UNSIGNED), { 0 } } },
424 { FR30_F_I20_4, "f-i20-4", 0, 16, 8, 4, { 0, 0|(1<<CGEN_IFLD_UNSIGNED), { 0 } } },
425 { FR30_F_I20_16, "f-i20-16", 16, 16, 0, 16, { 0, 0|(1<<CGEN_IFLD_UNSIGNED), { 0 } } },
426 { FR30_F_I32, "f-i32", 16, 32, 0, 32, { 0, 0|(1<<CGEN_IFLD_SIGN_OPT)|(1<<CGEN_IFLD_UNSIGNED), { 0 } } },
427 { FR30_F_UDISP6, "f-udisp6", 0, 16, 8, 4, { 0, 0|(1<<CGEN_IFLD_UNSIGNED), { 0 } } },
428 { FR30_F_DISP8, "f-disp8", 0, 16, 4, 8, { 0, 0|(1<<CGEN_IFLD_SIGNED), { 0 } } },
429 { FR30_F_DISP9, "f-disp9", 0, 16, 4, 8, { 0, 0|(1<<CGEN_IFLD_SIGNED), { 0 } } },
430 { FR30_F_DISP10, "f-disp10", 0, 16, 4, 8, { 0, 0|(1<<CGEN_IFLD_SIGNED), { 0 } } },
431 { FR30_F_S10, "f-s10", 0, 16, 8, 8, { 0, 0|(1<<CGEN_IFLD_SIGNED), { 0 } } },
432 { FR30_F_U10, "f-u10", 0, 16, 8, 8, { 0, 0|(1<<CGEN_IFLD_UNSIGNED), { 0 } } },
433 { FR30_F_REL9, "f-rel9", 0, 16, 8, 8, { 0, 0|(1<<CGEN_IFLD_PCREL_ADDR)|(1<<CGEN_IFLD_SIGNED), { 0 } } },
434 { FR30_F_DIR8, "f-dir8", 0, 16, 8, 8, { 0, 0|(1<<CGEN_IFLD_UNSIGNED), { 0 } } },
435 { FR30_F_DIR9, "f-dir9", 0, 16, 8, 8, { 0, 0|(1<<CGEN_IFLD_UNSIGNED), { 0 } } },
436 { FR30_F_DIR10, "f-dir10", 0, 16, 8, 8, { 0, 0|(1<<CGEN_IFLD_UNSIGNED), { 0 } } },
437 { FR30_F_REL12, "f-rel12", 0, 16, 5, 11, { 0, 0|(1<<CGEN_IFLD_PCREL_ADDR)|(1<<CGEN_IFLD_SIGNED), { 0 } } },
438 { FR30_F_REGLIST_HI, "f-reglist_hi", 0, 16, 8, 8, { 0, 0|(1<<CGEN_IFLD_UNSIGNED), { 0 } } },
439 { FR30_F_REGLIST_LOW, "f-reglist_low", 0, 16, 8, 8, { 0, 0|(1<<CGEN_IFLD_UNSIGNED), { 0 } } },
443 /* The operand table. */
445 #define OPERAND(op) CONCAT2 (FR30_OPERAND_,op)
446 #define OP_ENT(op) fr30_cgen_operand_table[OPERAND (op)]
448 const CGEN_OPERAND fr30_cgen_operand_table[MAX_OPERANDS] =
450 /* pc: program counter */
451 { "pc", & HW_ENT (HW_H_PC), 0, 0,
452 { 0, 0|(1<<CGEN_OPERAND_SEM_ONLY), { 0 } } },
453 /* Ri: destination register */
454 { "Ri", & HW_ENT (HW_H_GR), 12, 4,
455 { 0, 0|(1<<CGEN_OPERAND_UNSIGNED), { 0 } } },
456 /* Rj: source register */
457 { "Rj", & HW_ENT (HW_H_GR), 8, 4,
458 { 0, 0|(1<<CGEN_OPERAND_UNSIGNED), { 0 } } },
459 /* Ric: target register coproc insn */
460 { "Ric", & HW_ENT (HW_H_GR), 12, 4,
461 { 0, 0|(1<<CGEN_OPERAND_UNSIGNED), { 0 } } },
462 /* Rjc: source register coproc insn */
463 { "Rjc", & HW_ENT (HW_H_GR), 8, 4,
464 { 0, 0|(1<<CGEN_OPERAND_UNSIGNED), { 0 } } },
465 /* CRi: coprocessor register */
466 { "CRi", & HW_ENT (HW_H_CR), 12, 4,
467 { 0, 0|(1<<CGEN_OPERAND_UNSIGNED), { 0 } } },
468 /* CRj: coprocessor register */
469 { "CRj", & HW_ENT (HW_H_CR), 8, 4,
470 { 0, 0|(1<<CGEN_OPERAND_UNSIGNED), { 0 } } },
471 /* Rs1: dedicated register */
472 { "Rs1", & HW_ENT (HW_H_DR), 8, 4,
473 { 0, 0|(1<<CGEN_OPERAND_UNSIGNED), { 0 } } },
474 /* Rs2: dedicated register */
475 { "Rs2", & HW_ENT (HW_H_DR), 12, 4,
476 { 0, 0|(1<<CGEN_OPERAND_UNSIGNED), { 0 } } },
477 /* R13: General Register 13 */
478 { "R13", & HW_ENT (HW_H_R13), 0, 0,
480 /* R14: General Register 14 */
481 { "R14", & HW_ENT (HW_H_R14), 0, 0,
483 /* R15: General Register 15 */
484 { "R15", & HW_ENT (HW_H_R15), 0, 0,
486 /* ps: Program Status register */
487 { "ps", & HW_ENT (HW_H_PS), 0, 0,
489 /* u4: 4 bit unsigned immediate */
490 { "u4", & HW_ENT (HW_H_UINT), 8, 4,
491 { 0, 0|(1<<CGEN_OPERAND_HASH_PREFIX)|(1<<CGEN_OPERAND_UNSIGNED), { 0 } } },
492 /* u4c: 4 bit unsigned immediate */
493 { "u4c", & HW_ENT (HW_H_UINT), 12, 4,
494 { 0, 0|(1<<CGEN_OPERAND_HASH_PREFIX)|(1<<CGEN_OPERAND_UNSIGNED), { 0 } } },
495 /* u8: 8 bit unsigned immediate */
496 { "u8", & HW_ENT (HW_H_UINT), 8, 8,
497 { 0, 0|(1<<CGEN_OPERAND_HASH_PREFIX)|(1<<CGEN_OPERAND_UNSIGNED), { 0 } } },
498 /* i8: 8 bit unsigned immediate */
499 { "i8", & HW_ENT (HW_H_UINT), 4, 8,
500 { 0, 0|(1<<CGEN_OPERAND_HASH_PREFIX)|(1<<CGEN_OPERAND_UNSIGNED), { 0 } } },
501 /* udisp6: 6 bit unsigned immediate */
502 { "udisp6", & HW_ENT (HW_H_UINT), 8, 4,
503 { 0, 0|(1<<CGEN_OPERAND_HASH_PREFIX)|(1<<CGEN_OPERAND_UNSIGNED), { 0 } } },
504 /* disp8: 8 bit signed immediate */
505 { "disp8", & HW_ENT (HW_H_SINT), 4, 8,
506 { 0, 0|(1<<CGEN_OPERAND_HASH_PREFIX)|(1<<CGEN_OPERAND_SIGNED), { 0 } } },
507 /* disp9: 9 bit signed immediate */
508 { "disp9", & HW_ENT (HW_H_SINT), 4, 8,
509 { 0, 0|(1<<CGEN_OPERAND_HASH_PREFIX)|(1<<CGEN_OPERAND_SIGNED), { 0 } } },
510 /* disp10: 10 bit signed immediate */
511 { "disp10", & HW_ENT (HW_H_SINT), 4, 8,
512 { 0, 0|(1<<CGEN_OPERAND_HASH_PREFIX)|(1<<CGEN_OPERAND_SIGNED), { 0 } } },
513 /* s10: 10 bit signed immediate */
514 { "s10", & HW_ENT (HW_H_SINT), 8, 8,
515 { 0, 0|(1<<CGEN_OPERAND_HASH_PREFIX)|(1<<CGEN_OPERAND_SIGNED), { 0 } } },
516 /* u10: 10 bit unsigned immediate */
517 { "u10", & HW_ENT (HW_H_UINT), 8, 8,
518 { 0, 0|(1<<CGEN_OPERAND_HASH_PREFIX)|(1<<CGEN_OPERAND_UNSIGNED), { 0 } } },
519 /* i32: 32 bit immediate */
520 { "i32", & HW_ENT (HW_H_UINT), 0, 32,
521 { 0, 0|(1<<CGEN_OPERAND_HASH_PREFIX)|(1<<CGEN_OPERAND_SIGN_OPT)|(1<<CGEN_OPERAND_UNSIGNED), { 0 } } },
522 /* m4: 4 bit negative immediate */
523 { "m4", & HW_ENT (HW_H_SINT), 8, 4,
524 { 0, 0|(1<<CGEN_OPERAND_UNSIGNED), { 0 } } },
525 /* i20: 20 bit immediate */
526 { "i20", & HW_ENT (HW_H_UINT), 0, 20,
527 { 0, 0|(1<<CGEN_OPERAND_HASH_PREFIX)|(1<<CGEN_OPERAND_UNSIGNED)|(1<<CGEN_OPERAND_VIRTUAL), { 0 } } },
528 /* dir8: 8 bit direct address */
529 { "dir8", & HW_ENT (HW_H_UINT), 8, 8,
530 { 0, 0|(1<<CGEN_OPERAND_UNSIGNED), { 0 } } },
531 /* dir9: 9 bit direct address */
532 { "dir9", & HW_ENT (HW_H_UINT), 8, 8,
533 { 0, 0|(1<<CGEN_OPERAND_UNSIGNED), { 0 } } },
534 /* dir10: 10 bit direct address */
535 { "dir10", & HW_ENT (HW_H_UINT), 8, 8,
536 { 0, 0|(1<<CGEN_OPERAND_UNSIGNED), { 0 } } },
537 /* label9: 9 bit pc relative address */
538 { "label9", & HW_ENT (HW_H_IADDR), 8, 8,
539 { 0, 0|(1<<CGEN_OPERAND_PCREL_ADDR)|(1<<CGEN_OPERAND_SIGNED), { 0 } } },
540 /* label12: 12 bit pc relative address */
541 { "label12", & HW_ENT (HW_H_IADDR), 5, 11,
542 { 0, 0|(1<<CGEN_OPERAND_PCREL_ADDR)|(1<<CGEN_OPERAND_SIGNED), { 0 } } },
543 /* reglist_low: 8 bit register mask */
544 { "reglist_low", & HW_ENT (HW_H_UINT), 8, 8,
545 { 0, 0|(1<<CGEN_OPERAND_UNSIGNED), { 0 } } },
546 /* reglist_hi: 8 bit register mask */
547 { "reglist_hi", & HW_ENT (HW_H_UINT), 8, 8,
548 { 0, 0|(1<<CGEN_OPERAND_UNSIGNED), { 0 } } },
549 /* cc: condition codes */
550 { "cc", & HW_ENT (HW_H_UINT), 4, 4,
551 { 0, 0|(1<<CGEN_OPERAND_UNSIGNED), { 0 } } },
552 /* ccc: coprocessor calc */
553 { "ccc", & HW_ENT (HW_H_UINT), 0, 8,
554 { 0, 0|(1<<CGEN_OPERAND_HASH_PREFIX)|(1<<CGEN_OPERAND_UNSIGNED), { 0 } } },
555 /* nbit: negative bit */
556 { "nbit", & HW_ENT (HW_H_NBIT), 0, 0,
557 { 0, 0|(1<<CGEN_OPERAND_SEM_ONLY), { 0 } } },
558 /* vbit: overflow bit */
559 { "vbit", & HW_ENT (HW_H_VBIT), 0, 0,
560 { 0, 0|(1<<CGEN_OPERAND_SEM_ONLY), { 0 } } },
562 { "zbit", & HW_ENT (HW_H_ZBIT), 0, 0,
563 { 0, 0|(1<<CGEN_OPERAND_SEM_ONLY), { 0 } } },
564 /* cbit: carry bit */
565 { "cbit", & HW_ENT (HW_H_CBIT), 0, 0,
566 { 0, 0|(1<<CGEN_OPERAND_SEM_ONLY), { 0 } } },
567 /* ibit: interrupt bit */
568 { "ibit", & HW_ENT (HW_H_IBIT), 0, 0,
569 { 0, 0|(1<<CGEN_OPERAND_SEM_ONLY), { 0 } } },
570 /* sbit: stack bit */
571 { "sbit", & HW_ENT (HW_H_SBIT), 0, 0,
572 { 0, 0|(1<<CGEN_OPERAND_SEM_ONLY), { 0 } } },
573 /* ccr: condition code bits */
574 { "ccr", & HW_ENT (HW_H_CCR), 0, 0,
575 { 0, 0|(1<<CGEN_OPERAND_SEM_ONLY), { 0 } } },
576 /* scr: system condition bits */
577 { "scr", & HW_ENT (HW_H_SCR), 0, 0,
578 { 0, 0|(1<<CGEN_OPERAND_SEM_ONLY), { 0 } } },
579 /* ilm: condition code bits */
580 { "ilm", & HW_ENT (HW_H_ILM), 0, 0,
581 { 0, 0|(1<<CGEN_OPERAND_SEM_ONLY), { 0 } } },
584 /* Operand references. */
586 #define INPUT CGEN_OPERAND_INSTANCE_INPUT
587 #define OUTPUT CGEN_OPERAND_INSTANCE_OUTPUT
588 #define COND_REF CGEN_OPERAND_INSTANCE_COND_REF
590 static const CGEN_OPERAND_INSTANCE fmt_add_ops[] = {
591 { INPUT, "Ri", & HW_ENT (HW_H_GR), CGEN_MODE_SI, & OP_ENT (RI), 0, 0 },
592 { INPUT, "Rj", & HW_ENT (HW_H_GR), CGEN_MODE_SI, & OP_ENT (RJ), 0, 0 },
593 { OUTPUT, "vbit", & HW_ENT (HW_H_VBIT), CGEN_MODE_BI, 0, 0, 0 },
594 { OUTPUT, "cbit", & HW_ENT (HW_H_CBIT), CGEN_MODE_BI, 0, 0, 0 },
595 { OUTPUT, "Ri", & HW_ENT (HW_H_GR), CGEN_MODE_SI, & OP_ENT (RI), 0, 0 },
596 { OUTPUT, "zbit", & HW_ENT (HW_H_ZBIT), CGEN_MODE_BI, 0, 0, 0 },
597 { OUTPUT, "nbit", & HW_ENT (HW_H_NBIT), CGEN_MODE_BI, 0, 0, 0 },
601 static const CGEN_OPERAND_INSTANCE fmt_addi_ops[] = {
602 { INPUT, "Ri", & HW_ENT (HW_H_GR), CGEN_MODE_SI, & OP_ENT (RI), 0, 0 },
603 { INPUT, "u4", & HW_ENT (HW_H_UINT), CGEN_MODE_USI, & OP_ENT (U4), 0, 0 },
604 { OUTPUT, "vbit", & HW_ENT (HW_H_VBIT), CGEN_MODE_BI, 0, 0, 0 },
605 { OUTPUT, "cbit", & HW_ENT (HW_H_CBIT), CGEN_MODE_BI, 0, 0, 0 },
606 { OUTPUT, "Ri", & HW_ENT (HW_H_GR), CGEN_MODE_SI, & OP_ENT (RI), 0, 0 },
607 { OUTPUT, "zbit", & HW_ENT (HW_H_ZBIT), CGEN_MODE_BI, 0, 0, 0 },
608 { OUTPUT, "nbit", & HW_ENT (HW_H_NBIT), CGEN_MODE_BI, 0, 0, 0 },
612 static const CGEN_OPERAND_INSTANCE fmt_add2_ops[] = {
613 { INPUT, "Ri", & HW_ENT (HW_H_GR), CGEN_MODE_SI, & OP_ENT (RI), 0, 0 },
614 { INPUT, "m4", & HW_ENT (HW_H_SINT), CGEN_MODE_SI, & OP_ENT (M4), 0, 0 },
615 { OUTPUT, "vbit", & HW_ENT (HW_H_VBIT), CGEN_MODE_BI, 0, 0, 0 },
616 { OUTPUT, "cbit", & HW_ENT (HW_H_CBIT), CGEN_MODE_BI, 0, 0, 0 },
617 { OUTPUT, "Ri", & HW_ENT (HW_H_GR), CGEN_MODE_SI, & OP_ENT (RI), 0, 0 },
618 { OUTPUT, "zbit", & HW_ENT (HW_H_ZBIT), CGEN_MODE_BI, 0, 0, 0 },
619 { OUTPUT, "nbit", & HW_ENT (HW_H_NBIT), CGEN_MODE_BI, 0, 0, 0 },
623 static const CGEN_OPERAND_INSTANCE fmt_addc_ops[] = {
624 { INPUT, "Ri", & HW_ENT (HW_H_GR), CGEN_MODE_SI, & OP_ENT (RI), 0, 0 },
625 { INPUT, "Rj", & HW_ENT (HW_H_GR), CGEN_MODE_SI, & OP_ENT (RJ), 0, 0 },
626 { INPUT, "cbit", & HW_ENT (HW_H_CBIT), CGEN_MODE_BI, 0, 0, 0 },
627 { OUTPUT, "vbit", & HW_ENT (HW_H_VBIT), CGEN_MODE_BI, 0, 0, 0 },
628 { OUTPUT, "cbit", & HW_ENT (HW_H_CBIT), CGEN_MODE_BI, 0, 0, 0 },
629 { OUTPUT, "Ri", & HW_ENT (HW_H_GR), CGEN_MODE_SI, & OP_ENT (RI), 0, 0 },
630 { OUTPUT, "zbit", & HW_ENT (HW_H_ZBIT), CGEN_MODE_BI, 0, 0, 0 },
631 { OUTPUT, "nbit", & HW_ENT (HW_H_NBIT), CGEN_MODE_BI, 0, 0, 0 },
635 static const CGEN_OPERAND_INSTANCE fmt_addn_ops[] = {
636 { INPUT, "Ri", & HW_ENT (HW_H_GR), CGEN_MODE_SI, & OP_ENT (RI), 0, 0 },
637 { INPUT, "Rj", & HW_ENT (HW_H_GR), CGEN_MODE_SI, & OP_ENT (RJ), 0, 0 },
638 { OUTPUT, "Ri", & HW_ENT (HW_H_GR), CGEN_MODE_SI, & OP_ENT (RI), 0, 0 },
642 static const CGEN_OPERAND_INSTANCE fmt_addni_ops[] = {
643 { INPUT, "Ri", & HW_ENT (HW_H_GR), CGEN_MODE_SI, & OP_ENT (RI), 0, 0 },
644 { INPUT, "u4", & HW_ENT (HW_H_UINT), CGEN_MODE_USI, & OP_ENT (U4), 0, 0 },
645 { OUTPUT, "Ri", & HW_ENT (HW_H_GR), CGEN_MODE_SI, & OP_ENT (RI), 0, 0 },
649 static const CGEN_OPERAND_INSTANCE fmt_addn2_ops[] = {
650 { INPUT, "Ri", & HW_ENT (HW_H_GR), CGEN_MODE_SI, & OP_ENT (RI), 0, 0 },
651 { INPUT, "m4", & HW_ENT (HW_H_SINT), CGEN_MODE_SI, & OP_ENT (M4), 0, 0 },
652 { OUTPUT, "Ri", & HW_ENT (HW_H_GR), CGEN_MODE_SI, & OP_ENT (RI), 0, 0 },
656 static const CGEN_OPERAND_INSTANCE fmt_cmp_ops[] = {
657 { INPUT, "Ri", & HW_ENT (HW_H_GR), CGEN_MODE_SI, & OP_ENT (RI), 0, 0 },
658 { INPUT, "Rj", & HW_ENT (HW_H_GR), CGEN_MODE_SI, & OP_ENT (RJ), 0, 0 },
659 { OUTPUT, "vbit", & HW_ENT (HW_H_VBIT), CGEN_MODE_BI, 0, 0, 0 },
660 { OUTPUT, "cbit", & HW_ENT (HW_H_CBIT), CGEN_MODE_BI, 0, 0, 0 },
661 { OUTPUT, "zbit", & HW_ENT (HW_H_ZBIT), CGEN_MODE_BI, 0, 0, 0 },
662 { OUTPUT, "nbit", & HW_ENT (HW_H_NBIT), CGEN_MODE_BI, 0, 0, 0 },
666 static const CGEN_OPERAND_INSTANCE fmt_cmpi_ops[] = {
667 { INPUT, "Ri", & HW_ENT (HW_H_GR), CGEN_MODE_SI, & OP_ENT (RI), 0, 0 },
668 { INPUT, "u4", & HW_ENT (HW_H_UINT), CGEN_MODE_USI, & OP_ENT (U4), 0, 0 },
669 { OUTPUT, "vbit", & HW_ENT (HW_H_VBIT), CGEN_MODE_BI, 0, 0, 0 },
670 { OUTPUT, "cbit", & HW_ENT (HW_H_CBIT), CGEN_MODE_BI, 0, 0, 0 },
671 { OUTPUT, "zbit", & HW_ENT (HW_H_ZBIT), CGEN_MODE_BI, 0, 0, 0 },
672 { OUTPUT, "nbit", & HW_ENT (HW_H_NBIT), CGEN_MODE_BI, 0, 0, 0 },
676 static const CGEN_OPERAND_INSTANCE fmt_cmp2_ops[] = {
677 { INPUT, "Ri", & HW_ENT (HW_H_GR), CGEN_MODE_SI, & OP_ENT (RI), 0, 0 },
678 { INPUT, "m4", & HW_ENT (HW_H_SINT), CGEN_MODE_SI, & OP_ENT (M4), 0, 0 },
679 { OUTPUT, "vbit", & HW_ENT (HW_H_VBIT), CGEN_MODE_BI, 0, 0, 0 },
680 { OUTPUT, "cbit", & HW_ENT (HW_H_CBIT), CGEN_MODE_BI, 0, 0, 0 },
681 { OUTPUT, "zbit", & HW_ENT (HW_H_ZBIT), CGEN_MODE_BI, 0, 0, 0 },
682 { OUTPUT, "nbit", & HW_ENT (HW_H_NBIT), CGEN_MODE_BI, 0, 0, 0 },
686 static const CGEN_OPERAND_INSTANCE fmt_and_ops[] = {
687 { INPUT, "Ri", & HW_ENT (HW_H_GR), CGEN_MODE_SI, & OP_ENT (RI), 0, 0 },
688 { INPUT, "Rj", & HW_ENT (HW_H_GR), CGEN_MODE_SI, & OP_ENT (RJ), 0, 0 },
689 { OUTPUT, "Ri", & HW_ENT (HW_H_GR), CGEN_MODE_SI, & OP_ENT (RI), 0, 0 },
690 { OUTPUT, "zbit", & HW_ENT (HW_H_ZBIT), CGEN_MODE_BI, 0, 0, 0 },
691 { OUTPUT, "nbit", & HW_ENT (HW_H_NBIT), CGEN_MODE_BI, 0, 0, 0 },
695 static const CGEN_OPERAND_INSTANCE fmt_andm_ops[] = {
696 { INPUT, "Ri", & HW_ENT (HW_H_GR), CGEN_MODE_USI, & OP_ENT (RI), 0, 0 },
697 { INPUT, "h_memory_Ri", & HW_ENT (HW_H_MEMORY), CGEN_MODE_SI, 0, 0, 0 },
698 { INPUT, "Rj", & HW_ENT (HW_H_GR), CGEN_MODE_SI, & OP_ENT (RJ), 0, 0 },
699 { OUTPUT, "zbit", & HW_ENT (HW_H_ZBIT), CGEN_MODE_BI, 0, 0, 0 },
700 { OUTPUT, "nbit", & HW_ENT (HW_H_NBIT), CGEN_MODE_BI, 0, 0, 0 },
701 { OUTPUT, "h_memory_Ri", & HW_ENT (HW_H_MEMORY), CGEN_MODE_SI, 0, 0, 0 },
705 static const CGEN_OPERAND_INSTANCE fmt_andh_ops[] = {
706 { INPUT, "Ri", & HW_ENT (HW_H_GR), CGEN_MODE_USI, & OP_ENT (RI), 0, 0 },
707 { INPUT, "h_memory_Ri", & HW_ENT (HW_H_MEMORY), CGEN_MODE_HI, 0, 0, 0 },
708 { INPUT, "Rj", & HW_ENT (HW_H_GR), CGEN_MODE_HI, & OP_ENT (RJ), 0, 0 },
709 { OUTPUT, "zbit", & HW_ENT (HW_H_ZBIT), CGEN_MODE_BI, 0, 0, 0 },
710 { OUTPUT, "nbit", & HW_ENT (HW_H_NBIT), CGEN_MODE_BI, 0, 0, 0 },
711 { OUTPUT, "h_memory_Ri", & HW_ENT (HW_H_MEMORY), CGEN_MODE_HI, 0, 0, 0 },
715 static const CGEN_OPERAND_INSTANCE fmt_andb_ops[] = {
716 { INPUT, "Ri", & HW_ENT (HW_H_GR), CGEN_MODE_USI, & OP_ENT (RI), 0, 0 },
717 { INPUT, "h_memory_Ri", & HW_ENT (HW_H_MEMORY), CGEN_MODE_QI, 0, 0, 0 },
718 { INPUT, "Rj", & HW_ENT (HW_H_GR), CGEN_MODE_QI, & OP_ENT (RJ), 0, 0 },
719 { OUTPUT, "zbit", & HW_ENT (HW_H_ZBIT), CGEN_MODE_BI, 0, 0, 0 },
720 { OUTPUT, "nbit", & HW_ENT (HW_H_NBIT), CGEN_MODE_BI, 0, 0, 0 },
721 { OUTPUT, "h_memory_Ri", & HW_ENT (HW_H_MEMORY), CGEN_MODE_QI, 0, 0, 0 },
725 static const CGEN_OPERAND_INSTANCE fmt_bandl_ops[] = {
726 { INPUT, "Ri", & HW_ENT (HW_H_GR), CGEN_MODE_USI, & OP_ENT (RI), 0, 0 },
727 { INPUT, "u4", & HW_ENT (HW_H_UINT), CGEN_MODE_QI, & OP_ENT (U4), 0, 0 },
728 { INPUT, "h_memory_Ri", & HW_ENT (HW_H_MEMORY), CGEN_MODE_QI, 0, 0, 0 },
729 { OUTPUT, "h_memory_Ri", & HW_ENT (HW_H_MEMORY), CGEN_MODE_QI, 0, 0, 0 },
733 static const CGEN_OPERAND_INSTANCE fmt_btstl_ops[] = {
734 { INPUT, "u4", & HW_ENT (HW_H_UINT), CGEN_MODE_QI, & OP_ENT (U4), 0, 0 },
735 { INPUT, "Ri", & HW_ENT (HW_H_GR), CGEN_MODE_USI, & OP_ENT (RI), 0, 0 },
736 { INPUT, "h_memory_Ri", & HW_ENT (HW_H_MEMORY), CGEN_MODE_QI, 0, 0, 0 },
737 { OUTPUT, "zbit", & HW_ENT (HW_H_ZBIT), CGEN_MODE_BI, 0, 0, 0 },
738 { OUTPUT, "nbit", & HW_ENT (HW_H_NBIT), CGEN_MODE_BI, 0, 0, 0 },
742 static const CGEN_OPERAND_INSTANCE fmt_mul_ops[] = {
743 { INPUT, "Rj", & HW_ENT (HW_H_GR), CGEN_MODE_SI, & OP_ENT (RJ), 0, 0 },
744 { INPUT, "Ri", & HW_ENT (HW_H_GR), CGEN_MODE_SI, & OP_ENT (RI), 0, 0 },
745 { INPUT, "h_dr_5", & HW_ENT (HW_H_DR), CGEN_MODE_SI, 0, 5, 0 },
746 { OUTPUT, "h_dr_5", & HW_ENT (HW_H_DR), CGEN_MODE_SI, 0, 5, 0 },
747 { OUTPUT, "h_dr_4", & HW_ENT (HW_H_DR), CGEN_MODE_SI, 0, 4, 0 },
748 { OUTPUT, "nbit", & HW_ENT (HW_H_NBIT), CGEN_MODE_BI, 0, 0, 0 },
749 { OUTPUT, "zbit", & HW_ENT (HW_H_ZBIT), CGEN_MODE_BI, 0, 0, 0 },
750 { OUTPUT, "vbit", & HW_ENT (HW_H_VBIT), CGEN_MODE_BI, 0, 0, 0 },
754 static const CGEN_OPERAND_INSTANCE fmt_mulu_ops[] = {
755 { INPUT, "Rj", & HW_ENT (HW_H_GR), CGEN_MODE_SI, & OP_ENT (RJ), 0, 0 },
756 { INPUT, "Ri", & HW_ENT (HW_H_GR), CGEN_MODE_SI, & OP_ENT (RI), 0, 0 },
757 { INPUT, "h_dr_4", & HW_ENT (HW_H_DR), CGEN_MODE_SI, 0, 4, 0 },
758 { INPUT, "h_dr_5", & HW_ENT (HW_H_DR), CGEN_MODE_SI, 0, 5, 0 },
759 { OUTPUT, "h_dr_5", & HW_ENT (HW_H_DR), CGEN_MODE_SI, 0, 5, 0 },
760 { OUTPUT, "h_dr_4", & HW_ENT (HW_H_DR), CGEN_MODE_SI, 0, 4, 0 },
761 { OUTPUT, "nbit", & HW_ENT (HW_H_NBIT), CGEN_MODE_BI, 0, 0, 0 },
762 { OUTPUT, "zbit", & HW_ENT (HW_H_ZBIT), CGEN_MODE_BI, 0, 0, 0 },
763 { OUTPUT, "vbit", & HW_ENT (HW_H_VBIT), CGEN_MODE_BI, 0, 0, 0 },
767 static const CGEN_OPERAND_INSTANCE fmt_mulh_ops[] = {
768 { INPUT, "Rj", & HW_ENT (HW_H_GR), CGEN_MODE_SI, & OP_ENT (RJ), 0, 0 },
769 { INPUT, "Ri", & HW_ENT (HW_H_GR), CGEN_MODE_SI, & OP_ENT (RI), 0, 0 },
770 { INPUT, "h_dr_5", & HW_ENT (HW_H_DR), CGEN_MODE_SI, 0, 5, 0 },
771 { OUTPUT, "h_dr_5", & HW_ENT (HW_H_DR), CGEN_MODE_SI, 0, 5, 0 },
772 { OUTPUT, "nbit", & HW_ENT (HW_H_NBIT), CGEN_MODE_BI, 0, 0, 0 },
773 { OUTPUT, "zbit", & HW_ENT (HW_H_ZBIT), CGEN_MODE_BI, 0, 0, 0 },
777 static const CGEN_OPERAND_INSTANCE fmt_lsl_ops[] = {
778 { INPUT, "Rj", & HW_ENT (HW_H_GR), CGEN_MODE_SI, & OP_ENT (RJ), 0, 0 },
779 { INPUT, "Ri", & HW_ENT (HW_H_GR), CGEN_MODE_SI, & OP_ENT (RI), 0, COND_REF },
780 { OUTPUT, "cbit", & HW_ENT (HW_H_CBIT), CGEN_MODE_BI, 0, 0, COND_REF },
781 { OUTPUT, "Ri", & HW_ENT (HW_H_GR), CGEN_MODE_SI, & OP_ENT (RI), 0, COND_REF },
782 { OUTPUT, "nbit", & HW_ENT (HW_H_NBIT), CGEN_MODE_BI, 0, 0, 0 },
783 { OUTPUT, "zbit", & HW_ENT (HW_H_ZBIT), CGEN_MODE_BI, 0, 0, 0 },
787 static const CGEN_OPERAND_INSTANCE fmt_lsli_ops[] = {
788 { INPUT, "u4", & HW_ENT (HW_H_UINT), CGEN_MODE_USI, & OP_ENT (U4), 0, 0 },
789 { INPUT, "Ri", & HW_ENT (HW_H_GR), CGEN_MODE_SI, & OP_ENT (RI), 0, COND_REF },
790 { OUTPUT, "cbit", & HW_ENT (HW_H_CBIT), CGEN_MODE_BI, 0, 0, COND_REF },
791 { OUTPUT, "Ri", & HW_ENT (HW_H_GR), CGEN_MODE_SI, & OP_ENT (RI), 0, COND_REF },
792 { OUTPUT, "nbit", & HW_ENT (HW_H_NBIT), CGEN_MODE_BI, 0, 0, 0 },
793 { OUTPUT, "zbit", & HW_ENT (HW_H_ZBIT), CGEN_MODE_BI, 0, 0, 0 },
797 static const CGEN_OPERAND_INSTANCE fmt_ldi8_ops[] = {
798 { INPUT, "i8", & HW_ENT (HW_H_UINT), CGEN_MODE_USI, & OP_ENT (I8), 0, 0 },
799 { OUTPUT, "Ri", & HW_ENT (HW_H_GR), CGEN_MODE_SI, & OP_ENT (RI), 0, 0 },
803 static const CGEN_OPERAND_INSTANCE fmt_ldi20_ops[] = {
804 { INPUT, "i20", & HW_ENT (HW_H_UINT), CGEN_MODE_USI, & OP_ENT (I20), 0, 0 },
805 { OUTPUT, "Ri", & HW_ENT (HW_H_GR), CGEN_MODE_SI, & OP_ENT (RI), 0, 0 },
809 static const CGEN_OPERAND_INSTANCE fmt_ldi32_ops[] = {
810 { INPUT, "i32", & HW_ENT (HW_H_UINT), CGEN_MODE_USI, & OP_ENT (I32), 0, 0 },
811 { OUTPUT, "Ri", & HW_ENT (HW_H_GR), CGEN_MODE_SI, & OP_ENT (RI), 0, 0 },
815 static const CGEN_OPERAND_INSTANCE fmt_ld_ops[] = {
816 { INPUT, "Rj", & HW_ENT (HW_H_GR), CGEN_MODE_USI, & OP_ENT (RJ), 0, 0 },
817 { INPUT, "h_memory_Rj", & HW_ENT (HW_H_MEMORY), CGEN_MODE_SI, 0, 0, 0 },
818 { OUTPUT, "Ri", & HW_ENT (HW_H_GR), CGEN_MODE_SI, & OP_ENT (RI), 0, 0 },
822 static const CGEN_OPERAND_INSTANCE fmt_lduh_ops[] = {
823 { INPUT, "Rj", & HW_ENT (HW_H_GR), CGEN_MODE_USI, & OP_ENT (RJ), 0, 0 },
824 { INPUT, "h_memory_Rj", & HW_ENT (HW_H_MEMORY), CGEN_MODE_UHI, 0, 0, 0 },
825 { OUTPUT, "Ri", & HW_ENT (HW_H_GR), CGEN_MODE_SI, & OP_ENT (RI), 0, 0 },
829 static const CGEN_OPERAND_INSTANCE fmt_ldub_ops[] = {
830 { INPUT, "Rj", & HW_ENT (HW_H_GR), CGEN_MODE_USI, & OP_ENT (RJ), 0, 0 },
831 { INPUT, "h_memory_Rj", & HW_ENT (HW_H_MEMORY), CGEN_MODE_UQI, 0, 0, 0 },
832 { OUTPUT, "Ri", & HW_ENT (HW_H_GR), CGEN_MODE_SI, & OP_ENT (RI), 0, 0 },
836 static const CGEN_OPERAND_INSTANCE fmt_ldr13_ops[] = {
837 { INPUT, "Rj", & HW_ENT (HW_H_GR), CGEN_MODE_SI, & OP_ENT (RJ), 0, 0 },
838 { INPUT, "h_gr_13", & HW_ENT (HW_H_GR), CGEN_MODE_SI, 0, 13, 0 },
839 { INPUT, "h_memory_add__VM_Rj_reg__VM_h_gr_13", & HW_ENT (HW_H_MEMORY), CGEN_MODE_SI, 0, 0, 0 },
840 { OUTPUT, "Ri", & HW_ENT (HW_H_GR), CGEN_MODE_SI, & OP_ENT (RI), 0, 0 },
844 static const CGEN_OPERAND_INSTANCE fmt_ldr13uh_ops[] = {
845 { INPUT, "Rj", & HW_ENT (HW_H_GR), CGEN_MODE_SI, & OP_ENT (RJ), 0, 0 },
846 { INPUT, "h_gr_13", & HW_ENT (HW_H_GR), CGEN_MODE_SI, 0, 13, 0 },
847 { INPUT, "h_memory_add__VM_Rj_reg__VM_h_gr_13", & HW_ENT (HW_H_MEMORY), CGEN_MODE_UHI, 0, 0, 0 },
848 { OUTPUT, "Ri", & HW_ENT (HW_H_GR), CGEN_MODE_SI, & OP_ENT (RI), 0, 0 },
852 static const CGEN_OPERAND_INSTANCE fmt_ldr13ub_ops[] = {
853 { INPUT, "Rj", & HW_ENT (HW_H_GR), CGEN_MODE_SI, & OP_ENT (RJ), 0, 0 },
854 { INPUT, "h_gr_13", & HW_ENT (HW_H_GR), CGEN_MODE_SI, 0, 13, 0 },
855 { INPUT, "h_memory_add__VM_Rj_reg__VM_h_gr_13", & HW_ENT (HW_H_MEMORY), CGEN_MODE_UQI, 0, 0, 0 },
856 { OUTPUT, "Ri", & HW_ENT (HW_H_GR), CGEN_MODE_SI, & OP_ENT (RI), 0, 0 },
860 static const CGEN_OPERAND_INSTANCE fmt_ldr14_ops[] = {
861 { INPUT, "disp10", & HW_ENT (HW_H_SINT), CGEN_MODE_SI, & OP_ENT (DISP10), 0, 0 },
862 { INPUT, "h_gr_14", & HW_ENT (HW_H_GR), CGEN_MODE_SI, 0, 14, 0 },
863 { INPUT, "h_memory_add__VM_disp10_reg__VM_h_gr_14", & HW_ENT (HW_H_MEMORY), CGEN_MODE_SI, 0, 0, 0 },
864 { OUTPUT, "Ri", & HW_ENT (HW_H_GR), CGEN_MODE_SI, & OP_ENT (RI), 0, 0 },
868 static const CGEN_OPERAND_INSTANCE fmt_ldr14uh_ops[] = {
869 { INPUT, "disp9", & HW_ENT (HW_H_SINT), CGEN_MODE_SI, & OP_ENT (DISP9), 0, 0 },
870 { INPUT, "h_gr_14", & HW_ENT (HW_H_GR), CGEN_MODE_SI, 0, 14, 0 },
871 { INPUT, "h_memory_add__VM_disp9_reg__VM_h_gr_14", & HW_ENT (HW_H_MEMORY), CGEN_MODE_UHI, 0, 0, 0 },
872 { OUTPUT, "Ri", & HW_ENT (HW_H_GR), CGEN_MODE_SI, & OP_ENT (RI), 0, 0 },
876 static const CGEN_OPERAND_INSTANCE fmt_ldr14ub_ops[] = {
877 { INPUT, "disp8", & HW_ENT (HW_H_SINT), CGEN_MODE_SI, & OP_ENT (DISP8), 0, 0 },
878 { INPUT, "h_gr_14", & HW_ENT (HW_H_GR), CGEN_MODE_SI, 0, 14, 0 },
879 { INPUT, "h_memory_add__VM_disp8_reg__VM_h_gr_14", & HW_ENT (HW_H_MEMORY), CGEN_MODE_UQI, 0, 0, 0 },
880 { OUTPUT, "Ri", & HW_ENT (HW_H_GR), CGEN_MODE_SI, & OP_ENT (RI), 0, 0 },
884 static const CGEN_OPERAND_INSTANCE fmt_ldr15_ops[] = {
885 { INPUT, "udisp6", & HW_ENT (HW_H_UINT), CGEN_MODE_USI, & OP_ENT (UDISP6), 0, 0 },
886 { INPUT, "h_gr_15", & HW_ENT (HW_H_GR), CGEN_MODE_SI, 0, 15, 0 },
887 { INPUT, "h_memory_add__VM_udisp6_reg__VM_h_gr_15", & HW_ENT (HW_H_MEMORY), CGEN_MODE_SI, 0, 0, 0 },
888 { OUTPUT, "Ri", & HW_ENT (HW_H_GR), CGEN_MODE_SI, & OP_ENT (RI), 0, 0 },
892 static const CGEN_OPERAND_INSTANCE fmt_ldr15gr_ops[] = {
893 { INPUT, "h_gr_15", & HW_ENT (HW_H_GR), CGEN_MODE_SI, 0, 15, 0 },
894 { INPUT, "h_memory_reg__VM_h_gr_15", & HW_ENT (HW_H_MEMORY), CGEN_MODE_SI, 0, 0, 0 },
895 { INPUT, "f_Ri", & HW_ENT (HW_H_UINT), CGEN_MODE_USI, 0, 0, COND_REF },
896 { OUTPUT, "Ri", & HW_ENT (HW_H_GR), CGEN_MODE_SI, & OP_ENT (RI), 0, 0 },
897 { OUTPUT, "h_gr_15", & HW_ENT (HW_H_GR), CGEN_MODE_SI, 0, 15, COND_REF },
901 static const CGEN_OPERAND_INSTANCE fmt_ldr15dr_ops[] = {
902 { INPUT, "h_gr_15", & HW_ENT (HW_H_GR), CGEN_MODE_SI, 0, 15, 0 },
903 { INPUT, "h_memory_reg__VM_h_gr_15", & HW_ENT (HW_H_MEMORY), CGEN_MODE_SI, 0, 0, 0 },
904 { OUTPUT, "Rs2", & HW_ENT (HW_H_DR), CGEN_MODE_SI, & OP_ENT (RS2), 0, 0 },
905 { OUTPUT, "h_gr_15", & HW_ENT (HW_H_GR), CGEN_MODE_SI, 0, 15, 0 },
909 static const CGEN_OPERAND_INSTANCE fmt_ldr15ps_ops[] = {
910 { INPUT, "h_gr_15", & HW_ENT (HW_H_GR), CGEN_MODE_SI, 0, 15, 0 },
911 { INPUT, "h_memory_reg__VM_h_gr_15", & HW_ENT (HW_H_MEMORY), CGEN_MODE_SI, 0, 0, 0 },
912 { OUTPUT, "ps", & HW_ENT (HW_H_PS), CGEN_MODE_USI, 0, 0, 0 },
913 { OUTPUT, "h_gr_15", & HW_ENT (HW_H_GR), CGEN_MODE_SI, 0, 15, 0 },
917 static const CGEN_OPERAND_INSTANCE fmt_st_ops[] = {
918 { INPUT, "Rj", & HW_ENT (HW_H_GR), CGEN_MODE_USI, & OP_ENT (RJ), 0, 0 },
919 { INPUT, "Ri", & HW_ENT (HW_H_GR), CGEN_MODE_SI, & OP_ENT (RI), 0, 0 },
920 { OUTPUT, "h_memory_Rj", & HW_ENT (HW_H_MEMORY), CGEN_MODE_SI, 0, 0, 0 },
924 static const CGEN_OPERAND_INSTANCE fmt_sth_ops[] = {
925 { INPUT, "Rj", & HW_ENT (HW_H_GR), CGEN_MODE_USI, & OP_ENT (RJ), 0, 0 },
926 { INPUT, "Ri", & HW_ENT (HW_H_GR), CGEN_MODE_SI, & OP_ENT (RI), 0, 0 },
927 { OUTPUT, "h_memory_Rj", & HW_ENT (HW_H_MEMORY), CGEN_MODE_HI, 0, 0, 0 },
931 static const CGEN_OPERAND_INSTANCE fmt_stb_ops[] = {
932 { INPUT, "Rj", & HW_ENT (HW_H_GR), CGEN_MODE_USI, & OP_ENT (RJ), 0, 0 },
933 { INPUT, "Ri", & HW_ENT (HW_H_GR), CGEN_MODE_SI, & OP_ENT (RI), 0, 0 },
934 { OUTPUT, "h_memory_Rj", & HW_ENT (HW_H_MEMORY), CGEN_MODE_QI, 0, 0, 0 },
938 static const CGEN_OPERAND_INSTANCE fmt_str13_ops[] = {
939 { INPUT, "Rj", & HW_ENT (HW_H_GR), CGEN_MODE_SI, & OP_ENT (RJ), 0, 0 },
940 { INPUT, "h_gr_13", & HW_ENT (HW_H_GR), CGEN_MODE_SI, 0, 13, 0 },
941 { INPUT, "Ri", & HW_ENT (HW_H_GR), CGEN_MODE_SI, & OP_ENT (RI), 0, 0 },
942 { OUTPUT, "h_memory_add__VM_Rj_reg__VM_h_gr_13", & HW_ENT (HW_H_MEMORY), CGEN_MODE_SI, 0, 0, 0 },
946 static const CGEN_OPERAND_INSTANCE fmt_str13h_ops[] = {
947 { INPUT, "Rj", & HW_ENT (HW_H_GR), CGEN_MODE_SI, & OP_ENT (RJ), 0, 0 },
948 { INPUT, "h_gr_13", & HW_ENT (HW_H_GR), CGEN_MODE_SI, 0, 13, 0 },
949 { INPUT, "Ri", & HW_ENT (HW_H_GR), CGEN_MODE_SI, & OP_ENT (RI), 0, 0 },
950 { OUTPUT, "h_memory_add__VM_Rj_reg__VM_h_gr_13", & HW_ENT (HW_H_MEMORY), CGEN_MODE_HI, 0, 0, 0 },
954 static const CGEN_OPERAND_INSTANCE fmt_str13b_ops[] = {
955 { INPUT, "Rj", & HW_ENT (HW_H_GR), CGEN_MODE_SI, & OP_ENT (RJ), 0, 0 },
956 { INPUT, "h_gr_13", & HW_ENT (HW_H_GR), CGEN_MODE_SI, 0, 13, 0 },
957 { INPUT, "Ri", & HW_ENT (HW_H_GR), CGEN_MODE_SI, & OP_ENT (RI), 0, 0 },
958 { OUTPUT, "h_memory_add__VM_Rj_reg__VM_h_gr_13", & HW_ENT (HW_H_MEMORY), CGEN_MODE_QI, 0, 0, 0 },
962 static const CGEN_OPERAND_INSTANCE fmt_str14_ops[] = {
963 { INPUT, "disp10", & HW_ENT (HW_H_SINT), CGEN_MODE_SI, & OP_ENT (DISP10), 0, 0 },
964 { INPUT, "h_gr_14", & HW_ENT (HW_H_GR), CGEN_MODE_SI, 0, 14, 0 },
965 { INPUT, "Ri", & HW_ENT (HW_H_GR), CGEN_MODE_SI, & OP_ENT (RI), 0, 0 },
966 { OUTPUT, "h_memory_add__VM_disp10_reg__VM_h_gr_14", & HW_ENT (HW_H_MEMORY), CGEN_MODE_SI, 0, 0, 0 },
970 static const CGEN_OPERAND_INSTANCE fmt_str14h_ops[] = {
971 { INPUT, "disp9", & HW_ENT (HW_H_SINT), CGEN_MODE_SI, & OP_ENT (DISP9), 0, 0 },
972 { INPUT, "h_gr_14", & HW_ENT (HW_H_GR), CGEN_MODE_SI, 0, 14, 0 },
973 { INPUT, "Ri", & HW_ENT (HW_H_GR), CGEN_MODE_SI, & OP_ENT (RI), 0, 0 },
974 { OUTPUT, "h_memory_add__VM_disp9_reg__VM_h_gr_14", & HW_ENT (HW_H_MEMORY), CGEN_MODE_HI, 0, 0, 0 },
978 static const CGEN_OPERAND_INSTANCE fmt_str14b_ops[] = {
979 { INPUT, "disp8", & HW_ENT (HW_H_SINT), CGEN_MODE_SI, & OP_ENT (DISP8), 0, 0 },
980 { INPUT, "h_gr_14", & HW_ENT (HW_H_GR), CGEN_MODE_SI, 0, 14, 0 },
981 { INPUT, "Ri", & HW_ENT (HW_H_GR), CGEN_MODE_SI, & OP_ENT (RI), 0, 0 },
982 { OUTPUT, "h_memory_add__VM_disp8_reg__VM_h_gr_14", & HW_ENT (HW_H_MEMORY), CGEN_MODE_QI, 0, 0, 0 },
986 static const CGEN_OPERAND_INSTANCE fmt_str15_ops[] = {
987 { INPUT, "h_gr_15", & HW_ENT (HW_H_GR), CGEN_MODE_SI, 0, 15, 0 },
988 { INPUT, "udisp6", & HW_ENT (HW_H_UINT), CGEN_MODE_USI, & OP_ENT (UDISP6), 0, 0 },
989 { INPUT, "Ri", & HW_ENT (HW_H_GR), CGEN_MODE_SI, & OP_ENT (RI), 0, 0 },
990 { OUTPUT, "h_memory_add__VM_reg__VM_h_gr_15_udisp6", & HW_ENT (HW_H_MEMORY), CGEN_MODE_SI, 0, 0, 0 },
994 static const CGEN_OPERAND_INSTANCE fmt_str15gr_ops[] = {
995 { INPUT, "Ri", & HW_ENT (HW_H_GR), CGEN_MODE_SI, & OP_ENT (RI), 0, 0 },
996 { INPUT, "h_gr_15", & HW_ENT (HW_H_GR), CGEN_MODE_SI, 0, 15, 0 },
997 { OUTPUT, "h_gr_15", & HW_ENT (HW_H_GR), CGEN_MODE_SI, 0, 15, 0 },
998 { OUTPUT, "h_memory_reg__VM_h_gr_15", & HW_ENT (HW_H_MEMORY), CGEN_MODE_SI, 0, 0, 0 },
1002 static const CGEN_OPERAND_INSTANCE fmt_str15dr_ops[] = {
1003 { INPUT, "Rs2", & HW_ENT (HW_H_DR), CGEN_MODE_SI, & OP_ENT (RS2), 0, 0 },
1004 { INPUT, "h_gr_15", & HW_ENT (HW_H_GR), CGEN_MODE_SI, 0, 15, 0 },
1005 { OUTPUT, "h_gr_15", & HW_ENT (HW_H_GR), CGEN_MODE_SI, 0, 15, 0 },
1006 { OUTPUT, "h_memory_reg__VM_h_gr_15", & HW_ENT (HW_H_MEMORY), CGEN_MODE_SI, 0, 0, 0 },
1010 static const CGEN_OPERAND_INSTANCE fmt_str15ps_ops[] = {
1011 { INPUT, "h_gr_15", & HW_ENT (HW_H_GR), CGEN_MODE_SI, 0, 15, 0 },
1012 { INPUT, "ps", & HW_ENT (HW_H_PS), CGEN_MODE_USI, 0, 0, 0 },
1013 { OUTPUT, "h_gr_15", & HW_ENT (HW_H_GR), CGEN_MODE_SI, 0, 15, 0 },
1014 { OUTPUT, "h_memory_reg__VM_h_gr_15", & HW_ENT (HW_H_MEMORY), CGEN_MODE_SI, 0, 0, 0 },
1018 static const CGEN_OPERAND_INSTANCE fmt_mov_ops[] = {
1019 { INPUT, "Rj", & HW_ENT (HW_H_GR), CGEN_MODE_SI, & OP_ENT (RJ), 0, 0 },
1020 { OUTPUT, "Ri", & HW_ENT (HW_H_GR), CGEN_MODE_SI, & OP_ENT (RI), 0, 0 },
1024 static const CGEN_OPERAND_INSTANCE fmt_movdr_ops[] = {
1025 { INPUT, "Rs1", & HW_ENT (HW_H_DR), CGEN_MODE_SI, & OP_ENT (RS1), 0, 0 },
1026 { OUTPUT, "Ri", & HW_ENT (HW_H_GR), CGEN_MODE_SI, & OP_ENT (RI), 0, 0 },
1030 static const CGEN_OPERAND_INSTANCE fmt_movps_ops[] = {
1031 { INPUT, "ps", & HW_ENT (HW_H_PS), CGEN_MODE_USI, 0, 0, 0 },
1032 { OUTPUT, "Ri", & HW_ENT (HW_H_GR), CGEN_MODE_SI, & OP_ENT (RI), 0, 0 },
1036 static const CGEN_OPERAND_INSTANCE fmt_mov2dr_ops[] = {
1037 { INPUT, "Ri", & HW_ENT (HW_H_GR), CGEN_MODE_SI, & OP_ENT (RI), 0, 0 },
1038 { OUTPUT, "Rs1", & HW_ENT (HW_H_DR), CGEN_MODE_SI, & OP_ENT (RS1), 0, 0 },
1042 static const CGEN_OPERAND_INSTANCE fmt_mov2ps_ops[] = {
1043 { INPUT, "Ri", & HW_ENT (HW_H_GR), CGEN_MODE_SI, & OP_ENT (RI), 0, 0 },
1044 { OUTPUT, "ps", & HW_ENT (HW_H_PS), CGEN_MODE_USI, 0, 0, 0 },
1048 static const CGEN_OPERAND_INSTANCE fmt_jmp_ops[] = {
1049 { INPUT, "Ri", & HW_ENT (HW_H_GR), CGEN_MODE_SI, & OP_ENT (RI), 0, 0 },
1050 { OUTPUT, "pc", & HW_ENT (HW_H_PC), CGEN_MODE_USI, 0, 0, 0 },
1054 static const CGEN_OPERAND_INSTANCE fmt_callr_ops[] = {
1055 { INPUT, "pc", & HW_ENT (HW_H_PC), CGEN_MODE_USI, 0, 0, 0 },
1056 { INPUT, "Ri", & HW_ENT (HW_H_GR), CGEN_MODE_SI, & OP_ENT (RI), 0, 0 },
1057 { OUTPUT, "h_dr_1", & HW_ENT (HW_H_DR), CGEN_MODE_SI, 0, 1, 0 },
1058 { OUTPUT, "pc", & HW_ENT (HW_H_PC), CGEN_MODE_USI, 0, 0, 0 },
1062 static const CGEN_OPERAND_INSTANCE fmt_call_ops[] = {
1063 { INPUT, "pc", & HW_ENT (HW_H_PC), CGEN_MODE_USI, 0, 0, 0 },
1064 { INPUT, "label12", & HW_ENT (HW_H_IADDR), CGEN_MODE_USI, & OP_ENT (LABEL12), 0, 0 },
1065 { OUTPUT, "h_dr_1", & HW_ENT (HW_H_DR), CGEN_MODE_SI, 0, 1, 0 },
1066 { OUTPUT, "pc", & HW_ENT (HW_H_PC), CGEN_MODE_USI, 0, 0, 0 },
1070 static const CGEN_OPERAND_INSTANCE fmt_ret_ops[] = {
1071 { INPUT, "h_dr_1", & HW_ENT (HW_H_DR), CGEN_MODE_SI, 0, 1, 0 },
1072 { OUTPUT, "pc", & HW_ENT (HW_H_PC), CGEN_MODE_USI, 0, 0, 0 },
1076 static const CGEN_OPERAND_INSTANCE fmt_int_ops[] = {
1077 { INPUT, "pc", & HW_ENT (HW_H_PC), CGEN_MODE_SI, 0, 0, 0 },
1078 { INPUT, "u8", & HW_ENT (HW_H_UINT), CGEN_MODE_SI, & OP_ENT (U8), 0, 0 },
1079 { OUTPUT, "h_dr_2", & HW_ENT (HW_H_DR), CGEN_MODE_SI, 0, 2, 0 },
1080 { OUTPUT, "ibit", & HW_ENT (HW_H_IBIT), CGEN_MODE_BI, 0, 0, 0 },
1081 { OUTPUT, "sbit", & HW_ENT (HW_H_SBIT), CGEN_MODE_BI, 0, 0, 0 },
1082 { OUTPUT, "pc", & HW_ENT (HW_H_PC), CGEN_MODE_SI, 0, 0, 0 },
1086 static const CGEN_OPERAND_INSTANCE fmt_reti_ops[] = {
1087 { INPUT, "sbit", & HW_ENT (HW_H_SBIT), CGEN_MODE_BI, 0, 0, 0 },
1088 { INPUT, "h_dr_2", & HW_ENT (HW_H_DR), CGEN_MODE_SI, 0, 2, COND_REF },
1089 { INPUT, "h_memory_reg__VM_h_dr_2", & HW_ENT (HW_H_MEMORY), CGEN_MODE_USI, 0, 0, COND_REF },
1090 { INPUT, "h_dr_3", & HW_ENT (HW_H_DR), CGEN_MODE_SI, 0, 3, COND_REF },
1091 { INPUT, "h_memory_reg__VM_h_dr_3", & HW_ENT (HW_H_MEMORY), CGEN_MODE_USI, 0, 0, COND_REF },
1092 { OUTPUT, "pc", & HW_ENT (HW_H_PC), CGEN_MODE_USI, 0, 0, COND_REF },
1093 { OUTPUT, "h_dr_2", & HW_ENT (HW_H_DR), CGEN_MODE_SI, 0, 2, COND_REF },
1094 { OUTPUT, "ps", & HW_ENT (HW_H_PS), CGEN_MODE_USI, 0, 0, COND_REF },
1095 { OUTPUT, "h_dr_3", & HW_ENT (HW_H_DR), CGEN_MODE_SI, 0, 3, COND_REF },
1099 static const CGEN_OPERAND_INSTANCE fmt_bra_ops[] = {
1100 { INPUT, "label9", & HW_ENT (HW_H_IADDR), CGEN_MODE_USI, & OP_ENT (LABEL9), 0, COND_REF },
1101 { OUTPUT, "pc", & HW_ENT (HW_H_PC), CGEN_MODE_USI, 0, 0, COND_REF },
1105 static const CGEN_OPERAND_INSTANCE fmt_beq_ops[] = {
1106 { INPUT, "zbit", & HW_ENT (HW_H_ZBIT), CGEN_MODE_BI, 0, 0, 0 },
1107 { INPUT, "label9", & HW_ENT (HW_H_IADDR), CGEN_MODE_USI, & OP_ENT (LABEL9), 0, COND_REF },
1108 { OUTPUT, "pc", & HW_ENT (HW_H_PC), CGEN_MODE_USI, 0, 0, COND_REF },
1112 static const CGEN_OPERAND_INSTANCE fmt_bc_ops[] = {
1113 { INPUT, "cbit", & HW_ENT (HW_H_CBIT), CGEN_MODE_BI, 0, 0, 0 },
1114 { INPUT, "label9", & HW_ENT (HW_H_IADDR), CGEN_MODE_USI, & OP_ENT (LABEL9), 0, COND_REF },
1115 { OUTPUT, "pc", & HW_ENT (HW_H_PC), CGEN_MODE_USI, 0, 0, COND_REF },
1119 static const CGEN_OPERAND_INSTANCE fmt_bn_ops[] = {
1120 { INPUT, "nbit", & HW_ENT (HW_H_NBIT), CGEN_MODE_BI, 0, 0, 0 },
1121 { INPUT, "label9", & HW_ENT (HW_H_IADDR), CGEN_MODE_USI, & OP_ENT (LABEL9), 0, COND_REF },
1122 { OUTPUT, "pc", & HW_ENT (HW_H_PC), CGEN_MODE_USI, 0, 0, COND_REF },
1126 static const CGEN_OPERAND_INSTANCE fmt_bv_ops[] = {
1127 { INPUT, "vbit", & HW_ENT (HW_H_VBIT), CGEN_MODE_BI, 0, 0, 0 },
1128 { INPUT, "label9", & HW_ENT (HW_H_IADDR), CGEN_MODE_USI, & OP_ENT (LABEL9), 0, COND_REF },
1129 { OUTPUT, "pc", & HW_ENT (HW_H_PC), CGEN_MODE_USI, 0, 0, COND_REF },
1133 static const CGEN_OPERAND_INSTANCE fmt_blt_ops[] = {
1134 { INPUT, "vbit", & HW_ENT (HW_H_VBIT), CGEN_MODE_BI, 0, 0, 0 },
1135 { INPUT, "nbit", & HW_ENT (HW_H_NBIT), CGEN_MODE_BI, 0, 0, 0 },
1136 { INPUT, "label9", & HW_ENT (HW_H_IADDR), CGEN_MODE_USI, & OP_ENT (LABEL9), 0, COND_REF },
1137 { OUTPUT, "pc", & HW_ENT (HW_H_PC), CGEN_MODE_USI, 0, 0, COND_REF },
1141 static const CGEN_OPERAND_INSTANCE fmt_ble_ops[] = {
1142 { INPUT, "vbit", & HW_ENT (HW_H_VBIT), CGEN_MODE_BI, 0, 0, 0 },
1143 { INPUT, "nbit", & HW_ENT (HW_H_NBIT), CGEN_MODE_BI, 0, 0, 0 },
1144 { INPUT, "zbit", & HW_ENT (HW_H_ZBIT), CGEN_MODE_BI, 0, 0, 0 },
1145 { INPUT, "label9", & HW_ENT (HW_H_IADDR), CGEN_MODE_USI, & OP_ENT (LABEL9), 0, COND_REF },
1146 { OUTPUT, "pc", & HW_ENT (HW_H_PC), CGEN_MODE_USI, 0, 0, COND_REF },
1150 static const CGEN_OPERAND_INSTANCE fmt_bls_ops[] = {
1151 { INPUT, "cbit", & HW_ENT (HW_H_CBIT), CGEN_MODE_BI, 0, 0, 0 },
1152 { INPUT, "zbit", & HW_ENT (HW_H_ZBIT), CGEN_MODE_BI, 0, 0, 0 },
1153 { INPUT, "label9", & HW_ENT (HW_H_IADDR), CGEN_MODE_USI, & OP_ENT (LABEL9), 0, COND_REF },
1154 { OUTPUT, "pc", & HW_ENT (HW_H_PC), CGEN_MODE_USI, 0, 0, COND_REF },
1158 static const CGEN_OPERAND_INSTANCE fmt_andccr_ops[] = {
1159 { INPUT, "ccr", & HW_ENT (HW_H_CCR), CGEN_MODE_UQI, 0, 0, 0 },
1160 { INPUT, "u8", & HW_ENT (HW_H_UINT), CGEN_MODE_USI, & OP_ENT (U8), 0, 0 },
1161 { OUTPUT, "ccr", & HW_ENT (HW_H_CCR), CGEN_MODE_UQI, 0, 0, 0 },
1169 /* Instruction formats. */
1171 #define F(f) & fr30_cgen_ifld_table[CONCAT2 (FR30_,f)]
1173 static const CGEN_IFMT fmt_add = {
1174 16, 16, 0xff00, { F (F_OP1), F (F_OP2), F (F_RJ), F (F_RI), 0 }
1177 static const CGEN_IFMT fmt_addi = {
1178 16, 16, 0xff00, { F (F_OP1), F (F_OP2), F (F_U4), F (F_RI), 0 }
1181 static const CGEN_IFMT fmt_add2 = {
1182 16, 16, 0xff00, { F (F_OP1), F (F_OP2), F (F_M4), F (F_RI), 0 }
1185 static const CGEN_IFMT fmt_addc = {
1186 16, 16, 0xff00, { F (F_OP1), F (F_OP2), F (F_RJ), F (F_RI), 0 }
1189 static const CGEN_IFMT fmt_addn = {
1190 16, 16, 0xff00, { F (F_OP1), F (F_OP2), F (F_RJ), F (F_RI), 0 }
1193 static const CGEN_IFMT fmt_addni = {
1194 16, 16, 0xff00, { F (F_OP1), F (F_OP2), F (F_U4), F (F_RI), 0 }
1197 static const CGEN_IFMT fmt_addn2 = {
1198 16, 16, 0xff00, { F (F_OP1), F (F_OP2), F (F_M4), F (F_RI), 0 }
1201 static const CGEN_IFMT fmt_cmp = {
1202 16, 16, 0xff00, { F (F_OP1), F (F_OP2), F (F_RJ), F (F_RI), 0 }
1205 static const CGEN_IFMT fmt_cmpi = {
1206 16, 16, 0xff00, { F (F_OP1), F (F_OP2), F (F_U4), F (F_RI), 0 }
1209 static const CGEN_IFMT fmt_cmp2 = {
1210 16, 16, 0xff00, { F (F_OP1), F (F_OP2), F (F_M4), F (F_RI), 0 }
1213 static const CGEN_IFMT fmt_and = {
1214 16, 16, 0xff00, { F (F_OP1), F (F_OP2), F (F_RJ), F (F_RI), 0 }
1217 static const CGEN_IFMT fmt_andm = {
1218 16, 16, 0xff00, { F (F_OP1), F (F_OP2), F (F_RJ), F (F_RI), 0 }
1221 static const CGEN_IFMT fmt_andh = {
1222 16, 16, 0xff00, { F (F_OP1), F (F_OP2), F (F_RJ), F (F_RI), 0 }
1225 static const CGEN_IFMT fmt_andb = {
1226 16, 16, 0xff00, { F (F_OP1), F (F_OP2), F (F_RJ), F (F_RI), 0 }
1229 static const CGEN_IFMT fmt_bandl = {
1230 16, 16, 0xff00, { F (F_OP1), F (F_OP2), F (F_U4), F (F_RI), 0 }
1233 static const CGEN_IFMT fmt_btstl = {
1234 16, 16, 0xff00, { F (F_OP1), F (F_OP2), F (F_U4), F (F_RI), 0 }
1237 static const CGEN_IFMT fmt_mul = {
1238 16, 16, 0xff00, { F (F_OP1), F (F_OP2), F (F_RJ), F (F_RI), 0 }
1241 static const CGEN_IFMT fmt_mulu = {
1242 16, 16, 0xff00, { F (F_OP1), F (F_OP2), F (F_RJ), F (F_RI), 0 }
1245 static const CGEN_IFMT fmt_mulh = {
1246 16, 16, 0xff00, { F (F_OP1), F (F_OP2), F (F_RJ), F (F_RI), 0 }
1249 static const CGEN_IFMT fmt_div0s = {
1250 16, 16, 0xfff0, { F (F_OP1), F (F_OP2), F (F_OP3), F (F_RI), 0 }
1253 static const CGEN_IFMT fmt_div3 = {
1254 16, 16, 0xffff, { F (F_OP1), F (F_OP2), F (F_OP3), F (F_OP4), 0 }
1257 static const CGEN_IFMT fmt_lsl = {
1258 16, 16, 0xff00, { F (F_OP1), F (F_OP2), F (F_RJ), F (F_RI), 0 }
1261 static const CGEN_IFMT fmt_lsli = {
1262 16, 16, 0xff00, { F (F_OP1), F (F_OP2), F (F_U4), F (F_RI), 0 }
1265 static const CGEN_IFMT fmt_ldi8 = {
1266 16, 16, 0xf000, { F (F_OP1), F (F_I8), F (F_RI), 0 }
1269 static const CGEN_IFMT fmt_ldi20 = {
1270 16, 32, 0xff00, { F (F_OP1), F (F_I20), F (F_OP2), F (F_RI), 0 }
1273 static const CGEN_IFMT fmt_ldi32 = {
1274 16, 48, 0xfff0, { F (F_OP1), F (F_I32), F (F_OP2), F (F_OP3), F (F_RI), 0 }
1277 static const CGEN_IFMT fmt_ld = {
1278 16, 16, 0xff00, { F (F_OP1), F (F_OP2), F (F_RJ), F (F_RI), 0 }
1281 static const CGEN_IFMT fmt_lduh = {
1282 16, 16, 0xff00, { F (F_OP1), F (F_OP2), F (F_RJ), F (F_RI), 0 }
1285 static const CGEN_IFMT fmt_ldub = {
1286 16, 16, 0xff00, { F (F_OP1), F (F_OP2), F (F_RJ), F (F_RI), 0 }
1289 static const CGEN_IFMT fmt_ldr13 = {
1290 16, 16, 0xff00, { F (F_OP1), F (F_OP2), F (F_RJ), F (F_RI), 0 }
1293 static const CGEN_IFMT fmt_ldr13uh = {
1294 16, 16, 0xff00, { F (F_OP1), F (F_OP2), F (F_RJ), F (F_RI), 0 }
1297 static const CGEN_IFMT fmt_ldr13ub = {
1298 16, 16, 0xff00, { F (F_OP1), F (F_OP2), F (F_RJ), F (F_RI), 0 }
1301 static const CGEN_IFMT fmt_ldr14 = {
1302 16, 16, 0xf000, { F (F_OP1), F (F_DISP10), F (F_RI), 0 }
1305 static const CGEN_IFMT fmt_ldr14uh = {
1306 16, 16, 0xf000, { F (F_OP1), F (F_DISP9), F (F_RI), 0 }
1309 static const CGEN_IFMT fmt_ldr14ub = {
1310 16, 16, 0xf000, { F (F_OP1), F (F_DISP8), F (F_RI), 0 }
1313 static const CGEN_IFMT fmt_ldr15 = {
1314 16, 16, 0xff00, { F (F_OP1), F (F_OP2), F (F_UDISP6), F (F_RI), 0 }
1317 static const CGEN_IFMT fmt_ldr15gr = {
1318 16, 16, 0xfff0, { F (F_OP1), F (F_OP2), F (F_OP3), F (F_RI), 0 }
1321 static const CGEN_IFMT fmt_ldr15dr = {
1322 16, 16, 0xfff0, { F (F_OP1), F (F_OP2), F (F_OP3), F (F_RS2), 0 }
1325 static const CGEN_IFMT fmt_ldr15ps = {
1326 16, 16, 0xffff, { F (F_OP1), F (F_OP2), F (F_OP3), F (F_OP4), 0 }
1329 static const CGEN_IFMT fmt_st = {
1330 16, 16, 0xff00, { F (F_OP1), F (F_OP2), F (F_RJ), F (F_RI), 0 }
1333 static const CGEN_IFMT fmt_sth = {
1334 16, 16, 0xff00, { F (F_OP1), F (F_OP2), F (F_RJ), F (F_RI), 0 }
1337 static const CGEN_IFMT fmt_stb = {
1338 16, 16, 0xff00, { F (F_OP1), F (F_OP2), F (F_RJ), F (F_RI), 0 }
1341 static const CGEN_IFMT fmt_str13 = {
1342 16, 16, 0xff00, { F (F_OP1), F (F_OP2), F (F_RJ), F (F_RI), 0 }
1345 static const CGEN_IFMT fmt_str13h = {
1346 16, 16, 0xff00, { F (F_OP1), F (F_OP2), F (F_RJ), F (F_RI), 0 }
1349 static const CGEN_IFMT fmt_str13b = {
1350 16, 16, 0xff00, { F (F_OP1), F (F_OP2), F (F_RJ), F (F_RI), 0 }
1353 static const CGEN_IFMT fmt_str14 = {
1354 16, 16, 0xf000, { F (F_OP1), F (F_DISP10), F (F_RI), 0 }
1357 static const CGEN_IFMT fmt_str14h = {
1358 16, 16, 0xf000, { F (F_OP1), F (F_DISP9), F (F_RI), 0 }
1361 static const CGEN_IFMT fmt_str14b = {
1362 16, 16, 0xf000, { F (F_OP1), F (F_DISP8), F (F_RI), 0 }
1365 static const CGEN_IFMT fmt_str15 = {
1366 16, 16, 0xff00, { F (F_OP1), F (F_OP2), F (F_UDISP6), F (F_RI), 0 }
1369 static const CGEN_IFMT fmt_str15gr = {
1370 16, 16, 0xfff0, { F (F_OP1), F (F_OP2), F (F_OP3), F (F_RI), 0 }
1373 static const CGEN_IFMT fmt_str15dr = {
1374 16, 16, 0xfff0, { F (F_OP1), F (F_OP2), F (F_OP3), F (F_RS2), 0 }
1377 static const CGEN_IFMT fmt_str15ps = {
1378 16, 16, 0xffff, { F (F_OP1), F (F_OP2), F (F_OP3), F (F_OP4), 0 }
1381 static const CGEN_IFMT fmt_mov = {
1382 16, 16, 0xff00, { F (F_OP1), F (F_OP2), F (F_RJ), F (F_RI), 0 }
1385 static const CGEN_IFMT fmt_movdr = {
1386 16, 16, 0xff00, { F (F_OP1), F (F_OP2), F (F_RS1), F (F_RI), 0 }
1389 static const CGEN_IFMT fmt_movps = {
1390 16, 16, 0xfff0, { F (F_OP1), F (F_OP2), F (F_OP3), F (F_RI), 0 }
1393 static const CGEN_IFMT fmt_mov2dr = {
1394 16, 16, 0xff00, { F (F_OP1), F (F_OP2), F (F_RS1), F (F_RI), 0 }
1397 static const CGEN_IFMT fmt_mov2ps = {
1398 16, 16, 0xfff0, { F (F_OP1), F (F_OP2), F (F_OP3), F (F_RI), 0 }
1401 static const CGEN_IFMT fmt_jmp = {
1402 16, 16, 0xfff0, { F (F_OP1), F (F_OP2), F (F_OP3), F (F_RI), 0 }
1405 static const CGEN_IFMT fmt_callr = {
1406 16, 16, 0xfff0, { F (F_OP1), F (F_OP2), F (F_OP3), F (F_RI), 0 }
1409 static const CGEN_IFMT fmt_call = {
1410 16, 16, 0xf800, { F (F_OP1), F (F_OP5), F (F_REL12), 0 }
1413 static const CGEN_IFMT fmt_ret = {
1414 16, 16, 0xffff, { F (F_OP1), F (F_OP2), F (F_OP3), F (F_OP4), 0 }
1417 static const CGEN_IFMT fmt_int = {
1418 16, 16, 0xff00, { F (F_OP1), F (F_OP2), F (F_U8), 0 }
1421 static const CGEN_IFMT fmt_reti = {
1422 16, 16, 0xffff, { F (F_OP1), F (F_OP2), F (F_OP3), F (F_OP4), 0 }
1425 static const CGEN_IFMT fmt_bra = {
1426 16, 16, 0xff00, { F (F_OP1), F (F_CC), F (F_REL9), 0 }
1429 static const CGEN_IFMT fmt_beq = {
1430 16, 16, 0xff00, { F (F_OP1), F (F_CC), F (F_REL9), 0 }
1433 static const CGEN_IFMT fmt_bc = {
1434 16, 16, 0xff00, { F (F_OP1), F (F_CC), F (F_REL9), 0 }
1437 static const CGEN_IFMT fmt_bn = {
1438 16, 16, 0xff00, { F (F_OP1), F (F_CC), F (F_REL9), 0 }
1441 static const CGEN_IFMT fmt_bv = {
1442 16, 16, 0xff00, { F (F_OP1), F (F_CC), F (F_REL9), 0 }
1445 static const CGEN_IFMT fmt_blt = {
1446 16, 16, 0xff00, { F (F_OP1), F (F_CC), F (F_REL9), 0 }
1449 static const CGEN_IFMT fmt_ble = {
1450 16, 16, 0xff00, { F (F_OP1), F (F_CC), F (F_REL9), 0 }
1453 static const CGEN_IFMT fmt_bls = {
1454 16, 16, 0xff00, { F (F_OP1), F (F_CC), F (F_REL9), 0 }
1457 static const CGEN_IFMT fmt_dmovr13 = {
1458 16, 16, 0xff00, { F (F_OP1), F (F_OP2), F (F_DIR10), 0 }
1461 static const CGEN_IFMT fmt_dmovr13h = {
1462 16, 16, 0xff00, { F (F_OP1), F (F_OP2), F (F_DIR9), 0 }
1465 static const CGEN_IFMT fmt_dmovr13b = {
1466 16, 16, 0xff00, { F (F_OP1), F (F_OP2), F (F_DIR8), 0 }
1469 static const CGEN_IFMT fmt_ldres = {
1470 16, 16, 0xff00, { F (F_OP1), F (F_OP2), F (F_U4), F (F_RI), 0 }
1473 static const CGEN_IFMT fmt_copop = {
1474 16, 32, 0xfff0, { F (F_OP1), F (F_CCC), F (F_OP2), F (F_OP3), F (F_CRJ), F (F_U4C), F (F_CRI), 0 }
1477 static const CGEN_IFMT fmt_copld = {
1478 16, 32, 0xfff0, { F (F_OP1), F (F_CCC), F (F_OP2), F (F_OP3), F (F_RJC), F (F_U4C), F (F_CRI), 0 }
1481 static const CGEN_IFMT fmt_copst = {
1482 16, 32, 0xfff0, { F (F_OP1), F (F_CCC), F (F_OP2), F (F_OP3), F (F_CRJ), F (F_U4C), F (F_RIC), 0 }
1485 static const CGEN_IFMT fmt_andccr = {
1486 16, 16, 0xff00, { F (F_OP1), F (F_OP2), F (F_U8), 0 }
1489 static const CGEN_IFMT fmt_stilm = {
1490 16, 16, 0xff00, { F (F_OP1), F (F_OP2), F (F_U8), 0 }
1493 static const CGEN_IFMT fmt_addsp = {
1494 16, 16, 0xff00, { F (F_OP1), F (F_OP2), F (F_S10), 0 }
1497 static const CGEN_IFMT fmt_ldm0 = {
1498 16, 16, 0xff00, { F (F_OP1), F (F_OP2), F (F_REGLIST_LOW), 0 }
1501 static const CGEN_IFMT fmt_ldm1 = {
1502 16, 16, 0xff00, { F (F_OP1), F (F_OP2), F (F_REGLIST_HI), 0 }
1505 static const CGEN_IFMT fmt_enter = {
1506 16, 16, 0xff00, { F (F_OP1), F (F_OP2), F (F_U10), 0 }
1509 static const CGEN_IFMT fmt_xchb = {
1510 16, 16, 0xff00, { F (F_OP1), F (F_OP2), F (F_RJ), F (F_RI), 0 }
1515 #define A(a) (1 << CONCAT2 (CGEN_INSN_,a))
1516 #define MNEM CGEN_SYNTAX_MNEMONIC /* syntax value for mnemonic */
1517 #define OP(field) CGEN_SYNTAX_MAKE_FIELD (OPERAND (field))
1519 /* The instruction table.
1520 This is currently non-static because the simulator accesses it
1523 const CGEN_INSN fr30_cgen_insn_table_entries[MAX_INSNS] =
1525 /* Special null first entry.
1526 A `num' value of zero is thus invalid.
1527 Also, the special `invalid' insn resides here. */
1532 FR30_INSN_ADD, "add", "add",
1533 { { MNEM, ' ', OP (RJ), ',', OP (RI), 0 } },
1534 & fmt_add, { 0xa600 },
1535 (PTR) & fmt_add_ops[0],
1541 FR30_INSN_ADDI, "addi", "add",
1542 { { MNEM, ' ', OP (U4), ',', OP (RI), 0 } },
1543 & fmt_addi, { 0xa400 },
1544 (PTR) & fmt_addi_ops[0],
1550 FR30_INSN_ADD2, "add2", "add2",
1551 { { MNEM, ' ', OP (M4), ',', OP (RI), 0 } },
1552 & fmt_add2, { 0xa500 },
1553 (PTR) & fmt_add2_ops[0],
1559 FR30_INSN_ADDC, "addc", "addc",
1560 { { MNEM, ' ', OP (RJ), ',', OP (RI), 0 } },
1561 & fmt_addc, { 0xa700 },
1562 (PTR) & fmt_addc_ops[0],
1568 FR30_INSN_ADDN, "addn", "addn",
1569 { { MNEM, ' ', OP (RJ), ',', OP (RI), 0 } },
1570 & fmt_addn, { 0xa200 },
1571 (PTR) & fmt_addn_ops[0],
1577 FR30_INSN_ADDNI, "addni", "addn",
1578 { { MNEM, ' ', OP (U4), ',', OP (RI), 0 } },
1579 & fmt_addni, { 0xa000 },
1580 (PTR) & fmt_addni_ops[0],
1586 FR30_INSN_ADDN2, "addn2", "addn2",
1587 { { MNEM, ' ', OP (M4), ',', OP (RI), 0 } },
1588 & fmt_addn2, { 0xa100 },
1589 (PTR) & fmt_addn2_ops[0],
1595 FR30_INSN_SUB, "sub", "sub",
1596 { { MNEM, ' ', OP (RJ), ',', OP (RI), 0 } },
1597 & fmt_add, { 0xac00 },
1598 (PTR) & fmt_add_ops[0],
1604 FR30_INSN_SUBC, "subc", "subc",
1605 { { MNEM, ' ', OP (RJ), ',', OP (RI), 0 } },
1606 & fmt_addc, { 0xad00 },
1607 (PTR) & fmt_addc_ops[0],
1613 FR30_INSN_SUBN, "subn", "subn",
1614 { { MNEM, ' ', OP (RJ), ',', OP (RI), 0 } },
1615 & fmt_addn, { 0xae00 },
1616 (PTR) & fmt_addn_ops[0],
1622 FR30_INSN_CMP, "cmp", "cmp",
1623 { { MNEM, ' ', OP (RJ), ',', OP (RI), 0 } },
1624 & fmt_cmp, { 0xaa00 },
1625 (PTR) & fmt_cmp_ops[0],
1631 FR30_INSN_CMPI, "cmpi", "cmp",
1632 { { MNEM, ' ', OP (U4), ',', OP (RI), 0 } },
1633 & fmt_cmpi, { 0xa800 },
1634 (PTR) & fmt_cmpi_ops[0],
1640 FR30_INSN_CMP2, "cmp2", "cmp2",
1641 { { MNEM, ' ', OP (M4), ',', OP (RI), 0 } },
1642 & fmt_cmp2, { 0xa900 },
1643 (PTR) & fmt_cmp2_ops[0],
1649 FR30_INSN_AND, "and", "and",
1650 { { MNEM, ' ', OP (RJ), ',', OP (RI), 0 } },
1651 & fmt_and, { 0x8200 },
1652 (PTR) & fmt_and_ops[0],
1658 FR30_INSN_OR, "or", "or",
1659 { { MNEM, ' ', OP (RJ), ',', OP (RI), 0 } },
1660 & fmt_and, { 0x9200 },
1661 (PTR) & fmt_and_ops[0],
1667 FR30_INSN_EOR, "eor", "eor",
1668 { { MNEM, ' ', OP (RJ), ',', OP (RI), 0 } },
1669 & fmt_and, { 0x9a00 },
1670 (PTR) & fmt_and_ops[0],
1676 FR30_INSN_ANDM, "andm", "and",
1677 { { MNEM, ' ', OP (RJ), ',', '@', OP (RI), 0 } },
1678 & fmt_andm, { 0x8400 },
1679 (PTR) & fmt_andm_ops[0],
1685 FR30_INSN_ANDH, "andh", "andh",
1686 { { MNEM, ' ', OP (RJ), ',', '@', OP (RI), 0 } },
1687 & fmt_andh, { 0x8500 },
1688 (PTR) & fmt_andh_ops[0],
1694 FR30_INSN_ANDB, "andb", "andb",
1695 { { MNEM, ' ', OP (RJ), ',', '@', OP (RI), 0 } },
1696 & fmt_andb, { 0x8600 },
1697 (PTR) & fmt_andb_ops[0],
1703 FR30_INSN_ORM, "orm", "or",
1704 { { MNEM, ' ', OP (RJ), ',', '@', OP (RI), 0 } },
1705 & fmt_andm, { 0x9400 },
1706 (PTR) & fmt_andm_ops[0],
1712 FR30_INSN_ORH, "orh", "orh",
1713 { { MNEM, ' ', OP (RJ), ',', '@', OP (RI), 0 } },
1714 & fmt_andh, { 0x9500 },
1715 (PTR) & fmt_andh_ops[0],
1721 FR30_INSN_ORB, "orb", "orb",
1722 { { MNEM, ' ', OP (RJ), ',', '@', OP (RI), 0 } },
1723 & fmt_andb, { 0x9600 },
1724 (PTR) & fmt_andb_ops[0],
1730 FR30_INSN_EORM, "eorm", "eor",
1731 { { MNEM, ' ', OP (RJ), ',', '@', OP (RI), 0 } },
1732 & fmt_andm, { 0x9c00 },
1733 (PTR) & fmt_andm_ops[0],
1739 FR30_INSN_EORH, "eorh", "eorh",
1740 { { MNEM, ' ', OP (RJ), ',', '@', OP (RI), 0 } },
1741 & fmt_andh, { 0x9d00 },
1742 (PTR) & fmt_andh_ops[0],
1748 FR30_INSN_EORB, "eorb", "eorb",
1749 { { MNEM, ' ', OP (RJ), ',', '@', OP (RI), 0 } },
1750 & fmt_andb, { 0x9e00 },
1751 (PTR) & fmt_andb_ops[0],
1754 /* bandl $u4,@$Ri */
1757 FR30_INSN_BANDL, "bandl", "bandl",
1758 { { MNEM, ' ', OP (U4), ',', '@', OP (RI), 0 } },
1759 & fmt_bandl, { 0x8000 },
1760 (PTR) & fmt_bandl_ops[0],
1766 FR30_INSN_BORL, "borl", "borl",
1767 { { MNEM, ' ', OP (U4), ',', '@', OP (RI), 0 } },
1768 & fmt_bandl, { 0x9000 },
1769 (PTR) & fmt_bandl_ops[0],
1772 /* beorl $u4,@$Ri */
1775 FR30_INSN_BEORL, "beorl", "beorl",
1776 { { MNEM, ' ', OP (U4), ',', '@', OP (RI), 0 } },
1777 & fmt_bandl, { 0x9800 },
1778 (PTR) & fmt_bandl_ops[0],
1781 /* bandh $u4,@$Ri */
1784 FR30_INSN_BANDH, "bandh", "bandh",
1785 { { MNEM, ' ', OP (U4), ',', '@', OP (RI), 0 } },
1786 & fmt_bandl, { 0x8100 },
1787 (PTR) & fmt_bandl_ops[0],
1793 FR30_INSN_BORH, "borh", "borh",
1794 { { MNEM, ' ', OP (U4), ',', '@', OP (RI), 0 } },
1795 & fmt_bandl, { 0x9100 },
1796 (PTR) & fmt_bandl_ops[0],
1799 /* beorh $u4,@$Ri */
1802 FR30_INSN_BEORH, "beorh", "beorh",
1803 { { MNEM, ' ', OP (U4), ',', '@', OP (RI), 0 } },
1804 & fmt_bandl, { 0x9900 },
1805 (PTR) & fmt_bandl_ops[0],
1808 /* btstl $u4,@$Ri */
1811 FR30_INSN_BTSTL, "btstl", "btstl",
1812 { { MNEM, ' ', OP (U4), ',', '@', OP (RI), 0 } },
1813 & fmt_btstl, { 0x8800 },
1814 (PTR) & fmt_btstl_ops[0],
1817 /* btsth $u4,@$Ri */
1820 FR30_INSN_BTSTH, "btsth", "btsth",
1821 { { MNEM, ' ', OP (U4), ',', '@', OP (RI), 0 } },
1822 & fmt_btstl, { 0x8900 },
1823 (PTR) & fmt_btstl_ops[0],
1829 FR30_INSN_MUL, "mul", "mul",
1830 { { MNEM, ' ', OP (RJ), ',', OP (RI), 0 } },
1831 & fmt_mul, { 0xaf00 },
1832 (PTR) & fmt_mul_ops[0],
1838 FR30_INSN_MULU, "mulu", "mulu",
1839 { { MNEM, ' ', OP (RJ), ',', OP (RI), 0 } },
1840 & fmt_mulu, { 0xab00 },
1841 (PTR) & fmt_mulu_ops[0],
1847 FR30_INSN_MULH, "mulh", "mulh",
1848 { { MNEM, ' ', OP (RJ), ',', OP (RI), 0 } },
1849 & fmt_mulh, { 0xbf00 },
1850 (PTR) & fmt_mulh_ops[0],
1856 FR30_INSN_MULUH, "muluh", "muluh",
1857 { { MNEM, ' ', OP (RJ), ',', OP (RI), 0 } },
1858 & fmt_mulh, { 0xbb00 },
1859 (PTR) & fmt_mulh_ops[0],
1865 FR30_INSN_DIV0S, "div0s", "div0s",
1866 { { MNEM, ' ', OP (RI), 0 } },
1867 & fmt_div0s, { 0x9740 },
1874 FR30_INSN_DIV0U, "div0u", "div0u",
1875 { { MNEM, ' ', OP (RI), 0 } },
1876 & fmt_div0s, { 0x9750 },
1883 FR30_INSN_DIV1, "div1", "div1",
1884 { { MNEM, ' ', OP (RI), 0 } },
1885 & fmt_div0s, { 0x9760 },
1892 FR30_INSN_DIV2, "div2", "div2",
1893 { { MNEM, ' ', OP (RI), 0 } },
1894 & fmt_div0s, { 0x9770 },
1901 FR30_INSN_DIV3, "div3", "div3",
1903 & fmt_div3, { 0x9f60 },
1910 FR30_INSN_DIV4S, "div4s", "div4s",
1912 & fmt_div3, { 0x9f70 },
1919 FR30_INSN_LSL, "lsl", "lsl",
1920 { { MNEM, ' ', OP (RJ), ',', OP (RI), 0 } },
1921 & fmt_lsl, { 0xb600 },
1922 (PTR) & fmt_lsl_ops[0],
1928 FR30_INSN_LSLI, "lsli", "lsl",
1929 { { MNEM, ' ', OP (U4), ',', OP (RI), 0 } },
1930 & fmt_lsli, { 0xb400 },
1931 (PTR) & fmt_lsli_ops[0],
1937 FR30_INSN_LSL2, "lsl2", "lsl2",
1938 { { MNEM, ' ', OP (U4), ',', OP (RI), 0 } },
1939 & fmt_lsli, { 0xb500 },
1940 (PTR) & fmt_lsli_ops[0],
1946 FR30_INSN_LSR, "lsr", "lsr",
1947 { { MNEM, ' ', OP (RJ), ',', OP (RI), 0 } },
1948 & fmt_lsl, { 0xb200 },
1949 (PTR) & fmt_lsl_ops[0],
1955 FR30_INSN_LSRI, "lsri", "lsr",
1956 { { MNEM, ' ', OP (U4), ',', OP (RI), 0 } },
1957 & fmt_lsli, { 0xb000 },
1958 (PTR) & fmt_lsli_ops[0],
1964 FR30_INSN_LSR2, "lsr2", "lsr2",
1965 { { MNEM, ' ', OP (U4), ',', OP (RI), 0 } },
1966 & fmt_lsli, { 0xb100 },
1967 (PTR) & fmt_lsli_ops[0],
1973 FR30_INSN_ASR, "asr", "asr",
1974 { { MNEM, ' ', OP (RJ), ',', OP (RI), 0 } },
1975 & fmt_lsl, { 0xba00 },
1976 (PTR) & fmt_lsl_ops[0],
1982 FR30_INSN_ASRI, "asri", "asr",
1983 { { MNEM, ' ', OP (U4), ',', OP (RI), 0 } },
1984 & fmt_lsli, { 0xb800 },
1985 (PTR) & fmt_lsli_ops[0],
1991 FR30_INSN_ASR2, "asr2", "asr2",
1992 { { MNEM, ' ', OP (U4), ',', OP (RI), 0 } },
1993 & fmt_lsli, { 0xb900 },
1994 (PTR) & fmt_lsli_ops[0],
2000 FR30_INSN_LDI8, "ldi8", "ldi:8",
2001 { { MNEM, ' ', OP (I8), ',', OP (RI), 0 } },
2002 & fmt_ldi8, { 0xc000 },
2003 (PTR) & fmt_ldi8_ops[0],
2006 /* ldi:20 $i20,$Ri */
2009 FR30_INSN_LDI20, "ldi20", "ldi:20",
2010 { { MNEM, ' ', OP (I20), ',', OP (RI), 0 } },
2011 & fmt_ldi20, { 0x9b00 },
2012 (PTR) & fmt_ldi20_ops[0],
2013 { 0, 0|A(NOT_IN_DELAY_SLOT), { 0 } }
2015 /* ldi:32 $i32,$Ri */
2018 FR30_INSN_LDI32, "ldi32", "ldi:32",
2019 { { MNEM, ' ', OP (I32), ',', OP (RI), 0 } },
2020 & fmt_ldi32, { 0x9f80 },
2021 (PTR) & fmt_ldi32_ops[0],
2027 FR30_INSN_LD, "ld", "ld",
2028 { { MNEM, ' ', '@', OP (RJ), ',', OP (RI), 0 } },
2029 & fmt_ld, { 0x400 },
2030 (PTR) & fmt_ld_ops[0],
2036 FR30_INSN_LDUH, "lduh", "lduh",
2037 { { MNEM, ' ', '@', OP (RJ), ',', OP (RI), 0 } },
2038 & fmt_lduh, { 0x500 },
2039 (PTR) & fmt_lduh_ops[0],
2045 FR30_INSN_LDUB, "ldub", "ldub",
2046 { { MNEM, ' ', '@', OP (RJ), ',', OP (RI), 0 } },
2047 & fmt_ldub, { 0x600 },
2048 (PTR) & fmt_ldub_ops[0],
2051 /* ld @($R13,$Rj),$Ri */
2054 FR30_INSN_LDR13, "ldr13", "ld",
2055 { { MNEM, ' ', '@', '(', OP (R13), ',', OP (RJ), ')', ',', OP (RI), 0 } },
2056 & fmt_ldr13, { 0x0 },
2057 (PTR) & fmt_ldr13_ops[0],
2060 /* lduh @($R13,$Rj),$Ri */
2063 FR30_INSN_LDR13UH, "ldr13uh", "lduh",
2064 { { MNEM, ' ', '@', '(', OP (R13), ',', OP (RJ), ')', ',', OP (RI), 0 } },
2065 & fmt_ldr13uh, { 0x100 },
2066 (PTR) & fmt_ldr13uh_ops[0],
2069 /* ldub @($R13,$Rj),$Ri */
2072 FR30_INSN_LDR13UB, "ldr13ub", "ldub",
2073 { { MNEM, ' ', '@', '(', OP (R13), ',', OP (RJ), ')', ',', OP (RI), 0 } },
2074 & fmt_ldr13ub, { 0x200 },
2075 (PTR) & fmt_ldr13ub_ops[0],
2078 /* ld @($R14,$disp10),$Ri */
2081 FR30_INSN_LDR14, "ldr14", "ld",
2082 { { MNEM, ' ', '@', '(', OP (R14), ',', OP (DISP10), ')', ',', OP (RI), 0 } },
2083 & fmt_ldr14, { 0x2000 },
2084 (PTR) & fmt_ldr14_ops[0],
2087 /* lduh @($R14,$disp9),$Ri */
2090 FR30_INSN_LDR14UH, "ldr14uh", "lduh",
2091 { { MNEM, ' ', '@', '(', OP (R14), ',', OP (DISP9), ')', ',', OP (RI), 0 } },
2092 & fmt_ldr14uh, { 0x4000 },
2093 (PTR) & fmt_ldr14uh_ops[0],
2096 /* ldub @($R14,$disp8),$Ri */
2099 FR30_INSN_LDR14UB, "ldr14ub", "ldub",
2100 { { MNEM, ' ', '@', '(', OP (R14), ',', OP (DISP8), ')', ',', OP (RI), 0 } },
2101 & fmt_ldr14ub, { 0x6000 },
2102 (PTR) & fmt_ldr14ub_ops[0],
2105 /* ld @($R15,$udisp6),$Ri */
2108 FR30_INSN_LDR15, "ldr15", "ld",
2109 { { MNEM, ' ', '@', '(', OP (R15), ',', OP (UDISP6), ')', ',', OP (RI), 0 } },
2110 & fmt_ldr15, { 0x300 },
2111 (PTR) & fmt_ldr15_ops[0],
2117 FR30_INSN_LDR15GR, "ldr15gr", "ld",
2118 { { MNEM, ' ', '@', OP (R15), '+', ',', OP (RI), 0 } },
2119 & fmt_ldr15gr, { 0x700 },
2120 (PTR) & fmt_ldr15gr_ops[0],
2123 /* ld @$R15+,$Rs2 */
2126 FR30_INSN_LDR15DR, "ldr15dr", "ld",
2127 { { MNEM, ' ', '@', OP (R15), '+', ',', OP (RS2), 0 } },
2128 & fmt_ldr15dr, { 0x780 },
2129 (PTR) & fmt_ldr15dr_ops[0],
2135 FR30_INSN_LDR15PS, "ldr15ps", "ld",
2136 { { MNEM, ' ', '@', OP (R15), '+', ',', OP (PS), 0 } },
2137 & fmt_ldr15ps, { 0x790 },
2138 (PTR) & fmt_ldr15ps_ops[0],
2144 FR30_INSN_ST, "st", "st",
2145 { { MNEM, ' ', OP (RI), ',', '@', OP (RJ), 0 } },
2146 & fmt_st, { 0x1400 },
2147 (PTR) & fmt_st_ops[0],
2153 FR30_INSN_STH, "sth", "sth",
2154 { { MNEM, ' ', OP (RI), ',', '@', OP (RJ), 0 } },
2155 & fmt_sth, { 0x1500 },
2156 (PTR) & fmt_sth_ops[0],
2162 FR30_INSN_STB, "stb", "stb",
2163 { { MNEM, ' ', OP (RI), ',', '@', OP (RJ), 0 } },
2164 & fmt_stb, { 0x1600 },
2165 (PTR) & fmt_stb_ops[0],
2168 /* st $Ri,@($R13,$Rj) */
2171 FR30_INSN_STR13, "str13", "st",
2172 { { MNEM, ' ', OP (RI), ',', '@', '(', OP (R13), ',', OP (RJ), ')', 0 } },
2173 & fmt_str13, { 0x1000 },
2174 (PTR) & fmt_str13_ops[0],
2177 /* sth $Ri,@($R13,$Rj) */
2180 FR30_INSN_STR13H, "str13h", "sth",
2181 { { MNEM, ' ', OP (RI), ',', '@', '(', OP (R13), ',', OP (RJ), ')', 0 } },
2182 & fmt_str13h, { 0x1100 },
2183 (PTR) & fmt_str13h_ops[0],
2186 /* stb $Ri,@($R13,$Rj) */
2189 FR30_INSN_STR13B, "str13b", "stb",
2190 { { MNEM, ' ', OP (RI), ',', '@', '(', OP (R13), ',', OP (RJ), ')', 0 } },
2191 & fmt_str13b, { 0x1200 },
2192 (PTR) & fmt_str13b_ops[0],
2195 /* st Ri,@($R14,$disp10) */
2198 FR30_INSN_STR14, "str14", "st",
2199 { { MNEM, ' ', 'R', 'i', ',', '@', '(', OP (R14), ',', OP (DISP10), ')', 0 } },
2200 & fmt_str14, { 0x3000 },
2201 (PTR) & fmt_str14_ops[0],
2204 /* sth Ri,@($R14,$disp9) */
2207 FR30_INSN_STR14H, "str14h", "sth",
2208 { { MNEM, ' ', 'R', 'i', ',', '@', '(', OP (R14), ',', OP (DISP9), ')', 0 } },
2209 & fmt_str14h, { 0x5000 },
2210 (PTR) & fmt_str14h_ops[0],
2213 /* stb Ri,@($R14,$disp8) */
2216 FR30_INSN_STR14B, "str14b", "stb",
2217 { { MNEM, ' ', 'R', 'i', ',', '@', '(', OP (R14), ',', OP (DISP8), ')', 0 } },
2218 & fmt_str14b, { 0x7000 },
2219 (PTR) & fmt_str14b_ops[0],
2222 /* st $Ri,@($R15,$udisp6) */
2225 FR30_INSN_STR15, "str15", "st",
2226 { { MNEM, ' ', OP (RI), ',', '@', '(', OP (R15), ',', OP (UDISP6), ')', 0 } },
2227 & fmt_str15, { 0x1300 },
2228 (PTR) & fmt_str15_ops[0],
2234 FR30_INSN_STR15GR, "str15gr", "st",
2235 { { MNEM, ' ', OP (RI), ',', '@', '-', OP (R15), 0 } },
2236 & fmt_str15gr, { 0x1700 },
2237 (PTR) & fmt_str15gr_ops[0],
2240 /* st $Rs2,@-$R15 */
2243 FR30_INSN_STR15DR, "str15dr", "st",
2244 { { MNEM, ' ', OP (RS2), ',', '@', '-', OP (R15), 0 } },
2245 & fmt_str15dr, { 0x1780 },
2246 (PTR) & fmt_str15dr_ops[0],
2252 FR30_INSN_STR15PS, "str15ps", "st",
2253 { { MNEM, ' ', OP (PS), ',', '@', '-', OP (R15), 0 } },
2254 & fmt_str15ps, { 0x1790 },
2255 (PTR) & fmt_str15ps_ops[0],
2261 FR30_INSN_MOV, "mov", "mov",
2262 { { MNEM, ' ', OP (RJ), ',', OP (RI), 0 } },
2263 & fmt_mov, { 0x8b00 },
2264 (PTR) & fmt_mov_ops[0],
2270 FR30_INSN_MOVDR, "movdr", "mov",
2271 { { MNEM, ' ', OP (RS1), ',', OP (RI), 0 } },
2272 & fmt_movdr, { 0xb700 },
2273 (PTR) & fmt_movdr_ops[0],
2279 FR30_INSN_MOVPS, "movps", "mov",
2280 { { MNEM, ' ', OP (PS), ',', OP (RI), 0 } },
2281 & fmt_movps, { 0x1710 },
2282 (PTR) & fmt_movps_ops[0],
2288 FR30_INSN_MOV2DR, "mov2dr", "mov",
2289 { { MNEM, ' ', OP (RI), ',', OP (RS1), 0 } },
2290 & fmt_mov2dr, { 0xb300 },
2291 (PTR) & fmt_mov2dr_ops[0],
2297 FR30_INSN_MOV2PS, "mov2ps", "mov",
2298 { { MNEM, ' ', OP (RI), ',', OP (PS), 0 } },
2299 & fmt_mov2ps, { 0x710 },
2300 (PTR) & fmt_mov2ps_ops[0],
2306 FR30_INSN_JMP, "jmp", "jmp",
2307 { { MNEM, ' ', '@', OP (RI), 0 } },
2308 & fmt_jmp, { 0x9700 },
2309 (PTR) & fmt_jmp_ops[0],
2310 { 0, 0|A(UNCOND_CTI), { 0 } }
2315 FR30_INSN_JMPD, "jmpd", "jmp:d",
2316 { { MNEM, ' ', '@', OP (RI), 0 } },
2317 & fmt_jmp, { 0x9f00 },
2318 (PTR) & fmt_jmp_ops[0],
2319 { 0, 0|A(NOT_IN_DELAY_SLOT)|A(DELAY_SLOT)|A(UNCOND_CTI), { 0 } }
2324 FR30_INSN_CALLR, "callr", "call",
2325 { { MNEM, ' ', '@', OP (RI), 0 } },
2326 & fmt_callr, { 0x9710 },
2327 (PTR) & fmt_callr_ops[0],
2328 { 0, 0|A(UNCOND_CTI), { 0 } }
2333 FR30_INSN_CALLRD, "callrd", "call:d",
2334 { { MNEM, ' ', '@', OP (RI), 0 } },
2335 & fmt_callr, { 0x9f10 },
2336 (PTR) & fmt_callr_ops[0],
2337 { 0, 0|A(DELAY_SLOT)|A(UNCOND_CTI), { 0 } }
2342 FR30_INSN_CALL, "call", "call",
2343 { { MNEM, ' ', OP (LABEL12), 0 } },
2344 & fmt_call, { 0xd000 },
2345 (PTR) & fmt_call_ops[0],
2346 { 0, 0|A(UNCOND_CTI), { 0 } }
2348 /* call:d $label12 */
2351 FR30_INSN_CALLD, "calld", "call:d",
2352 { { MNEM, ' ', OP (LABEL12), 0 } },
2353 & fmt_call, { 0xd800 },
2354 (PTR) & fmt_call_ops[0],
2355 { 0, 0|A(DELAY_SLOT)|A(UNCOND_CTI), { 0 } }
2360 FR30_INSN_RET, "ret", "ret",
2362 & fmt_ret, { 0x9720 },
2363 (PTR) & fmt_ret_ops[0],
2364 { 0, 0|A(UNCOND_CTI), { 0 } }
2369 FR30_INSN_RET_D, "ret:d", "ret:d",
2371 & fmt_ret, { 0x9f20 },
2372 (PTR) & fmt_ret_ops[0],
2373 { 0, 0|A(DELAY_SLOT)|A(UNCOND_CTI), { 0 } }
2378 FR30_INSN_INT, "int", "int",
2379 { { MNEM, ' ', OP (U8), 0 } },
2380 & fmt_int, { 0x1f00 },
2381 (PTR) & fmt_int_ops[0],
2382 { 0, 0|A(UNCOND_CTI), { 0 } }
2387 FR30_INSN_INTE, "inte", "inte",
2389 & fmt_div3, { 0x9f30 },
2396 FR30_INSN_RETI, "reti", "reti",
2398 & fmt_reti, { 0x9730 },
2399 (PTR) & fmt_reti_ops[0],
2400 { 0, 0|A(COND_CTI)|A(COND_CTI), { 0 } }
2405 FR30_INSN_BRA, "bra", "bra",
2406 { { MNEM, ' ', OP (LABEL9), 0 } },
2407 & fmt_bra, { 0xe000 },
2408 (PTR) & fmt_bra_ops[0],
2409 { 0, 0|A(COND_CTI)|A(COND_CTI), { 0 } }
2414 FR30_INSN_BRAD, "brad", "bra:d",
2415 { { MNEM, ' ', OP (LABEL9), 0 } },
2416 & fmt_bra, { 0xf000 },
2417 (PTR) & fmt_bra_ops[0],
2418 { 0, 0|A(COND_CTI)|A(COND_CTI), { 0 } }
2423 FR30_INSN_BNO, "bno", "bno",
2424 { { MNEM, ' ', OP (LABEL9), 0 } },
2425 & fmt_bra, { 0xe100 },
2426 (PTR) & fmt_bra_ops[0],
2427 { 0, 0|A(COND_CTI)|A(COND_CTI), { 0 } }
2432 FR30_INSN_BNOD, "bnod", "bno:d",
2433 { { MNEM, ' ', OP (LABEL9), 0 } },
2434 & fmt_bra, { 0xf100 },
2435 (PTR) & fmt_bra_ops[0],
2436 { 0, 0|A(COND_CTI)|A(COND_CTI), { 0 } }
2441 FR30_INSN_BEQ, "beq", "beq",
2442 { { MNEM, ' ', OP (LABEL9), 0 } },
2443 & fmt_beq, { 0xe200 },
2444 (PTR) & fmt_beq_ops[0],
2445 { 0, 0|A(COND_CTI)|A(COND_CTI), { 0 } }
2450 FR30_INSN_BEQD, "beqd", "beq:d",
2451 { { MNEM, ' ', OP (LABEL9), 0 } },
2452 & fmt_beq, { 0xf200 },
2453 (PTR) & fmt_beq_ops[0],
2454 { 0, 0|A(COND_CTI)|A(COND_CTI), { 0 } }
2459 FR30_INSN_BNE, "bne", "bne",
2460 { { MNEM, ' ', OP (LABEL9), 0 } },
2461 & fmt_beq, { 0xe300 },
2462 (PTR) & fmt_beq_ops[0],
2463 { 0, 0|A(COND_CTI)|A(COND_CTI), { 0 } }
2468 FR30_INSN_BNED, "bned", "bne:d",
2469 { { MNEM, ' ', OP (LABEL9), 0 } },
2470 & fmt_beq, { 0xf300 },
2471 (PTR) & fmt_beq_ops[0],
2472 { 0, 0|A(COND_CTI)|A(COND_CTI), { 0 } }
2477 FR30_INSN_BC, "bc", "bc",
2478 { { MNEM, ' ', OP (LABEL9), 0 } },
2479 & fmt_bc, { 0xe400 },
2480 (PTR) & fmt_bc_ops[0],
2481 { 0, 0|A(COND_CTI)|A(COND_CTI), { 0 } }
2486 FR30_INSN_BCD, "bcd", "bc:d",
2487 { { MNEM, ' ', OP (LABEL9), 0 } },
2488 & fmt_bc, { 0xf400 },
2489 (PTR) & fmt_bc_ops[0],
2490 { 0, 0|A(COND_CTI)|A(COND_CTI), { 0 } }
2495 FR30_INSN_BNC, "bnc", "bnc",
2496 { { MNEM, ' ', OP (LABEL9), 0 } },
2497 & fmt_bc, { 0xe500 },
2498 (PTR) & fmt_bc_ops[0],
2499 { 0, 0|A(COND_CTI)|A(COND_CTI), { 0 } }
2504 FR30_INSN_BNCD, "bncd", "bnc:d",
2505 { { MNEM, ' ', OP (LABEL9), 0 } },
2506 & fmt_bc, { 0xf500 },
2507 (PTR) & fmt_bc_ops[0],
2508 { 0, 0|A(COND_CTI)|A(COND_CTI), { 0 } }
2513 FR30_INSN_BN, "bn", "bn",
2514 { { MNEM, ' ', OP (LABEL9), 0 } },
2515 & fmt_bn, { 0xe600 },
2516 (PTR) & fmt_bn_ops[0],
2517 { 0, 0|A(COND_CTI)|A(COND_CTI), { 0 } }
2522 FR30_INSN_BND, "bnd", "bn:d",
2523 { { MNEM, ' ', OP (LABEL9), 0 } },
2524 & fmt_bn, { 0xf600 },
2525 (PTR) & fmt_bn_ops[0],
2526 { 0, 0|A(COND_CTI)|A(COND_CTI), { 0 } }
2531 FR30_INSN_BP, "bp", "bp",
2532 { { MNEM, ' ', OP (LABEL9), 0 } },
2533 & fmt_bn, { 0xe700 },
2534 (PTR) & fmt_bn_ops[0],
2535 { 0, 0|A(COND_CTI)|A(COND_CTI), { 0 } }
2540 FR30_INSN_BPD, "bpd", "bp:d",
2541 { { MNEM, ' ', OP (LABEL9), 0 } },
2542 & fmt_bn, { 0xf700 },
2543 (PTR) & fmt_bn_ops[0],
2544 { 0, 0|A(COND_CTI)|A(COND_CTI), { 0 } }
2549 FR30_INSN_BV, "bv", "bv",
2550 { { MNEM, ' ', OP (LABEL9), 0 } },
2551 & fmt_bv, { 0xe800 },
2552 (PTR) & fmt_bv_ops[0],
2553 { 0, 0|A(COND_CTI)|A(COND_CTI), { 0 } }
2558 FR30_INSN_BVD, "bvd", "bv:d",
2559 { { MNEM, ' ', OP (LABEL9), 0 } },
2560 & fmt_bv, { 0xf800 },
2561 (PTR) & fmt_bv_ops[0],
2562 { 0, 0|A(COND_CTI)|A(COND_CTI), { 0 } }
2567 FR30_INSN_BNV, "bnv", "bnv",
2568 { { MNEM, ' ', OP (LABEL9), 0 } },
2569 & fmt_bv, { 0xe900 },
2570 (PTR) & fmt_bv_ops[0],
2571 { 0, 0|A(COND_CTI)|A(COND_CTI), { 0 } }
2576 FR30_INSN_BNVD, "bnvd", "bnv:d",
2577 { { MNEM, ' ', OP (LABEL9), 0 } },
2578 & fmt_bv, { 0xf900 },
2579 (PTR) & fmt_bv_ops[0],
2580 { 0, 0|A(COND_CTI)|A(COND_CTI), { 0 } }
2585 FR30_INSN_BLT, "blt", "blt",
2586 { { MNEM, ' ', OP (LABEL9), 0 } },
2587 & fmt_blt, { 0xea00 },
2588 (PTR) & fmt_blt_ops[0],
2589 { 0, 0|A(COND_CTI)|A(COND_CTI), { 0 } }
2594 FR30_INSN_BLTD, "bltd", "blt:d",
2595 { { MNEM, ' ', OP (LABEL9), 0 } },
2596 & fmt_blt, { 0xfa00 },
2597 (PTR) & fmt_blt_ops[0],
2598 { 0, 0|A(COND_CTI)|A(COND_CTI), { 0 } }
2603 FR30_INSN_BGE, "bge", "bge",
2604 { { MNEM, ' ', OP (LABEL9), 0 } },
2605 & fmt_blt, { 0xeb00 },
2606 (PTR) & fmt_blt_ops[0],
2607 { 0, 0|A(COND_CTI)|A(COND_CTI), { 0 } }
2612 FR30_INSN_BGED, "bged", "bge:d",
2613 { { MNEM, ' ', OP (LABEL9), 0 } },
2614 & fmt_blt, { 0xfb00 },
2615 (PTR) & fmt_blt_ops[0],
2616 { 0, 0|A(COND_CTI)|A(COND_CTI), { 0 } }
2621 FR30_INSN_BLE, "ble", "ble",
2622 { { MNEM, ' ', OP (LABEL9), 0 } },
2623 & fmt_ble, { 0xec00 },
2624 (PTR) & fmt_ble_ops[0],
2625 { 0, 0|A(COND_CTI)|A(COND_CTI), { 0 } }
2630 FR30_INSN_BLED, "bled", "ble:d",
2631 { { MNEM, ' ', OP (LABEL9), 0 } },
2632 & fmt_ble, { 0xfc00 },
2633 (PTR) & fmt_ble_ops[0],
2634 { 0, 0|A(COND_CTI)|A(COND_CTI), { 0 } }
2639 FR30_INSN_BGT, "bgt", "bgt",
2640 { { MNEM, ' ', OP (LABEL9), 0 } },
2641 & fmt_ble, { 0xed00 },
2642 (PTR) & fmt_ble_ops[0],
2643 { 0, 0|A(COND_CTI)|A(COND_CTI), { 0 } }
2648 FR30_INSN_BGTD, "bgtd", "bgt:d",
2649 { { MNEM, ' ', OP (LABEL9), 0 } },
2650 & fmt_ble, { 0xfd00 },
2651 (PTR) & fmt_ble_ops[0],
2652 { 0, 0|A(COND_CTI)|A(COND_CTI), { 0 } }
2657 FR30_INSN_BLS, "bls", "bls",
2658 { { MNEM, ' ', OP (LABEL9), 0 } },
2659 & fmt_bls, { 0xee00 },
2660 (PTR) & fmt_bls_ops[0],
2661 { 0, 0|A(COND_CTI)|A(COND_CTI), { 0 } }
2666 FR30_INSN_BLSD, "blsd", "bls:d",
2667 { { MNEM, ' ', OP (LABEL9), 0 } },
2668 & fmt_bls, { 0xfe00 },
2669 (PTR) & fmt_bls_ops[0],
2670 { 0, 0|A(COND_CTI)|A(COND_CTI), { 0 } }
2675 FR30_INSN_BHI, "bhi", "bhi",
2676 { { MNEM, ' ', OP (LABEL9), 0 } },
2677 & fmt_bls, { 0xef00 },
2678 (PTR) & fmt_bls_ops[0],
2679 { 0, 0|A(COND_CTI)|A(COND_CTI), { 0 } }
2684 FR30_INSN_BHID, "bhid", "bhi:d",
2685 { { MNEM, ' ', OP (LABEL9), 0 } },
2686 & fmt_bls, { 0xff00 },
2687 (PTR) & fmt_bls_ops[0],
2688 { 0, 0|A(COND_CTI)|A(COND_CTI), { 0 } }
2690 /* dmov $R13,@$dir10 */
2693 FR30_INSN_DMOVR13, "dmovr13", "dmov",
2694 { { MNEM, ' ', OP (R13), ',', '@', OP (DIR10), 0 } },
2695 & fmt_dmovr13, { 0x1800 },
2699 /* dmovh $R13,@$dir9 */
2702 FR30_INSN_DMOVR13H, "dmovr13h", "dmovh",
2703 { { MNEM, ' ', OP (R13), ',', '@', OP (DIR9), 0 } },
2704 & fmt_dmovr13h, { 0x1900 },
2708 /* dmovb $R13,@$dir8 */
2711 FR30_INSN_DMOVR13B, "dmovr13b", "dmovb",
2712 { { MNEM, ' ', OP (R13), ',', '@', OP (DIR8), 0 } },
2713 & fmt_dmovr13b, { 0x1a00 },
2717 /* dmov @$R13+,@$dir10 */
2720 FR30_INSN_DMOVR13PI, "dmovr13pi", "dmov",
2721 { { MNEM, ' ', '@', OP (R13), '+', ',', '@', OP (DIR10), 0 } },
2722 & fmt_dmovr13, { 0x1c00 },
2726 /* dmovh @$R13+,@$dir9 */
2729 FR30_INSN_DMOVR13PIH, "dmovr13pih", "dmovh",
2730 { { MNEM, ' ', '@', OP (R13), '+', ',', '@', OP (DIR9), 0 } },
2731 & fmt_dmovr13h, { 0x1d00 },
2735 /* dmovb @$R13+,@$dir8 */
2738 FR30_INSN_DMOVR13PIB, "dmovr13pib", "dmovb",
2739 { { MNEM, ' ', '@', OP (R13), '+', ',', '@', OP (DIR8), 0 } },
2740 & fmt_dmovr13b, { 0x1e00 },
2744 /* dmov @$R15+,@$dir10 */
2747 FR30_INSN_DMOVR15PI, "dmovr15pi", "dmov",
2748 { { MNEM, ' ', '@', OP (R15), '+', ',', '@', OP (DIR10), 0 } },
2749 & fmt_dmovr13, { 0x1b00 },
2753 /* dmov @$dir10,$R13 */
2756 FR30_INSN_DMOV2R13, "dmov2r13", "dmov",
2757 { { MNEM, ' ', '@', OP (DIR10), ',', OP (R13), 0 } },
2758 & fmt_dmovr13, { 0x800 },
2762 /* dmovh @$dir9,$R13 */
2765 FR30_INSN_DMOV2R13H, "dmov2r13h", "dmovh",
2766 { { MNEM, ' ', '@', OP (DIR9), ',', OP (R13), 0 } },
2767 & fmt_dmovr13h, { 0x900 },
2771 /* dmovb @$dir8,$R13 */
2774 FR30_INSN_DMOV2R13B, "dmov2r13b", "dmovb",
2775 { { MNEM, ' ', '@', OP (DIR8), ',', OP (R13), 0 } },
2776 & fmt_dmovr13b, { 0xa00 },
2780 /* dmov @$dir10,@$R13+ */
2783 FR30_INSN_DMOV2R13PI, "dmov2r13pi", "dmov",
2784 { { MNEM, ' ', '@', OP (DIR10), ',', '@', OP (R13), '+', 0 } },
2785 & fmt_dmovr13, { 0xc00 },
2789 /* dmovh @$dir9,@$R13+ */
2792 FR30_INSN_DMOV2R13PIH, "dmov2r13pih", "dmovh",
2793 { { MNEM, ' ', '@', OP (DIR9), ',', '@', OP (R13), '+', 0 } },
2794 & fmt_dmovr13h, { 0xd00 },
2798 /* dmovb @$dir8,@$R13+ */
2801 FR30_INSN_DMOV2R13PIB, "dmov2r13pib", "dmovb",
2802 { { MNEM, ' ', '@', OP (DIR8), ',', '@', OP (R13), '+', 0 } },
2803 & fmt_dmovr13b, { 0xe00 },
2807 /* dmov @$dir10,@-$R15 */
2810 FR30_INSN_DMOV2R15PD, "dmov2r15pd", "dmov",
2811 { { MNEM, ' ', '@', OP (DIR10), ',', '@', '-', OP (R15), 0 } },
2812 & fmt_dmovr13, { 0xb00 },
2816 /* ldres @$Ri+,$u4 */
2819 FR30_INSN_LDRES, "ldres", "ldres",
2820 { { MNEM, ' ', '@', OP (RI), '+', ',', OP (U4), 0 } },
2821 & fmt_ldres, { 0xbc00 },
2825 /* stres $u4,@$Ri+ */
2828 FR30_INSN_STRES, "stres", "stres",
2829 { { MNEM, ' ', OP (U4), ',', '@', OP (RI), '+', 0 } },
2830 & fmt_ldres, { 0xbd00 },
2834 /* copop $u4c,$ccc,$CRj,$CRi */
2837 FR30_INSN_COPOP, "copop", "copop",
2838 { { MNEM, ' ', OP (U4C), ',', OP (CCC), ',', OP (CRJ), ',', OP (CRI), 0 } },
2839 & fmt_copop, { 0x9fc0 },
2843 /* copld $u4c,$ccc,$Rjc,$CRi */
2846 FR30_INSN_COPLD, "copld", "copld",
2847 { { MNEM, ' ', OP (U4C), ',', OP (CCC), ',', OP (RJC), ',', OP (CRI), 0 } },
2848 & fmt_copld, { 0x9fd0 },
2852 /* copst $u4c,$ccc,$CRj,$Ric */
2855 FR30_INSN_COPST, "copst", "copst",
2856 { { MNEM, ' ', OP (U4C), ',', OP (CCC), ',', OP (CRJ), ',', OP (RIC), 0 } },
2857 & fmt_copst, { 0x9fe0 },
2861 /* copsv $u4c,$ccc,$CRj,$Ric */
2864 FR30_INSN_COPSV, "copsv", "copsv",
2865 { { MNEM, ' ', OP (U4C), ',', OP (CCC), ',', OP (CRJ), ',', OP (RIC), 0 } },
2866 & fmt_copst, { 0x9ff0 },
2873 FR30_INSN_NOP, "nop", "nop",
2875 & fmt_div3, { 0x9fa0 },
2882 FR30_INSN_ANDCCR, "andccr", "andccr",
2883 { { MNEM, ' ', OP (U8), 0 } },
2884 & fmt_andccr, { 0x8300 },
2885 (PTR) & fmt_andccr_ops[0],
2891 FR30_INSN_ORCCR, "orccr", "orccr",
2892 { { MNEM, ' ', OP (U8), 0 } },
2893 & fmt_andccr, { 0x9300 },
2894 (PTR) & fmt_andccr_ops[0],
2900 FR30_INSN_STILM, "stilm", "stilm",
2901 { { MNEM, ' ', OP (U8), 0 } },
2902 & fmt_stilm, { 0x8700 },
2909 FR30_INSN_ADDSP, "addsp", "addsp",
2910 { { MNEM, ' ', OP (S10), 0 } },
2911 & fmt_addsp, { 0xa300 },
2918 FR30_INSN_EXTSB, "extsb", "extsb",
2919 { { MNEM, ' ', OP (RI), 0 } },
2920 & fmt_div0s, { 0x9780 },
2927 FR30_INSN_EXTUB, "extub", "extub",
2928 { { MNEM, ' ', OP (RI), 0 } },
2929 & fmt_div0s, { 0x9790 },
2936 FR30_INSN_EXTSH, "extsh", "extsh",
2937 { { MNEM, ' ', OP (RI), 0 } },
2938 & fmt_div0s, { 0x97a0 },
2945 FR30_INSN_EXTUH, "extuh", "extuh",
2946 { { MNEM, ' ', OP (RI), 0 } },
2947 & fmt_div0s, { 0x97b0 },
2951 /* ldm0 ($reglist_low) */
2954 FR30_INSN_LDM0, "ldm0", "ldm0",
2955 { { MNEM, ' ', '(', OP (REGLIST_LOW), ')', 0 } },
2956 & fmt_ldm0, { 0x8c00 },
2960 /* ldm1 ($reglist_hi) */
2963 FR30_INSN_LDM1, "ldm1", "ldm1",
2964 { { MNEM, ' ', '(', OP (REGLIST_HI), ')', 0 } },
2965 & fmt_ldm1, { 0x8d00 },
2969 /* stm0 ($reglist_low) */
2972 FR30_INSN_STM0, "stm0", "stm0",
2973 { { MNEM, ' ', '(', OP (REGLIST_LOW), ')', 0 } },
2974 & fmt_ldm0, { 0x8e00 },
2978 /* stm1 ($reglist_hi) */
2981 FR30_INSN_STM1, "stm1", "stm1",
2982 { { MNEM, ' ', '(', OP (REGLIST_HI), ')', 0 } },
2983 & fmt_ldm1, { 0x8f00 },
2990 FR30_INSN_ENTER, "enter", "enter",
2991 { { MNEM, ' ', OP (U10), 0 } },
2992 & fmt_enter, { 0xf00 },
2999 FR30_INSN_LEAVE, "leave", "leave",
3001 & fmt_div3, { 0x9f90 },
3008 FR30_INSN_XCHB, "xchb", "xchb",
3009 { { MNEM, ' ', '@', OP (RJ), ',', OP (RI), 0 } },
3010 & fmt_xchb, { 0x8a00 },
3020 static const CGEN_INSN_TABLE insn_table =
3022 & fr30_cgen_insn_table_entries[0],
3028 /* Formats for ALIAS macro-insns. */
3030 #define F(f) & fr30_cgen_ifld_table[CONCAT2 (FR30_,f)]
3032 static const CGEN_IFMT fmt_ldi8m = {
3033 16, 16, 0xf000, { F (F_OP1), F (F_I8), F (F_RI), 0 }
3036 static const CGEN_IFMT fmt_ldi20m = {
3037 16, 32, 0xff00, { F (F_OP1), F (F_I20), F (F_OP2), F (F_RI), 0 }
3040 static const CGEN_IFMT fmt_ldi32m = {
3041 16, 48, 0xfff0, { F (F_OP1), F (F_I32), F (F_OP2), F (F_OP3), F (F_RI), 0 }
3046 /* Each non-simple macro entry points to an array of expansion possibilities. */
3048 #define A(a) (1 << CONCAT2 (CGEN_INSN_,a))
3049 #define MNEM CGEN_SYNTAX_MNEMONIC /* syntax value for mnemonic */
3050 #define OP(field) CGEN_SYNTAX_MAKE_FIELD (OPERAND (field))
3052 /* The macro instruction table. */
3054 static const CGEN_INSN macro_insn_table_entries[] =
3059 -1, "ldi8m", "ldi8",
3060 { { MNEM, ' ', OP (I8), ',', OP (RI), 0 } },
3061 & fmt_ldi8m, { 0xc000 },
3063 { 0, 0|A(NO_DIS)|A(ALIAS), { 0 } }
3065 /* ldi20 $i20,$Ri */
3068 -1, "ldi20m", "ldi20",
3069 { { MNEM, ' ', OP (I20), ',', OP (RI), 0 } },
3070 & fmt_ldi20m, { 0x9b00 },
3072 { 0, 0|A(NO_DIS)|A(ALIAS), { 0 } }
3074 /* ldi32 $i32,$Ri */
3077 -1, "ldi32m", "ldi32",
3078 { { MNEM, ' ', OP (I32), ',', OP (RI), 0 } },
3079 & fmt_ldi32m, { 0x9f80 },
3081 { 0, 0|A(NO_DIS)|A(ALIAS), { 0 } }
3089 static const CGEN_INSN_TABLE macro_insn_table =
3091 & macro_insn_table_entries[0],
3093 (sizeof (macro_insn_table_entries) /
3094 sizeof (macro_insn_table_entries[0])),
3103 /* Return non-zero if INSN is to be added to the hash table.
3104 Targets are free to override CGEN_{ASM,DIS}_HASH_P in the .opc file. */
3107 asm_hash_insn_p (insn)
3108 const CGEN_INSN * insn;
3110 return CGEN_ASM_HASH_P (insn);
3114 dis_hash_insn_p (insn)
3115 const CGEN_INSN * insn;
3117 /* If building the hash table and the NO-DIS attribute is present,
3119 if (CGEN_INSN_ATTR (insn, CGEN_INSN_NO_DIS))
3121 return CGEN_DIS_HASH_P (insn);
3124 /* The result is the hash value of the insn.
3125 Targets are free to override CGEN_{ASM,DIS}_HASH in the .opc file. */
3128 asm_hash_insn (mnem)
3131 return CGEN_ASM_HASH (mnem);
3134 /* BUF is a pointer to the insn's bytes in target order.
3135 VALUE is an integer of the first CGEN_BASE_INSN_BITSIZE bits,
3139 dis_hash_insn (buf, value)
3141 CGEN_INSN_INT value;
3143 return CGEN_DIS_HASH (buf, value);
3146 /* Initialize an opcode table and return a descriptor.
3147 It's much like opening a file, and must be the first function called. */
3150 fr30_cgen_opcode_open (mach, endian)
3152 enum cgen_endian endian;
3154 CGEN_OPCODE_TABLE * table = (CGEN_OPCODE_TABLE *) xmalloc (sizeof (CGEN_OPCODE_TABLE));
3163 memset (table, 0, sizeof (*table));
3165 CGEN_OPCODE_MACH (table) = mach;
3166 CGEN_OPCODE_ENDIAN (table) = endian;
3167 /* FIXME: for the sparc case we can determine insn-endianness statically.
3168 The worry here is where both data and insn endian can be independently
3169 chosen, in which case this function will need another argument.
3170 Actually, will want to allow for more arguments in the future anyway. */
3171 CGEN_OPCODE_INSN_ENDIAN (table) = endian;
3173 CGEN_OPCODE_HW_LIST (table) = & fr30_cgen_hw_entries[0];
3175 CGEN_OPCODE_IFLD_TABLE (table) = & fr30_cgen_ifld_table[0];
3177 CGEN_OPCODE_OPERAND_TABLE (table) = & fr30_cgen_operand_table[0];
3179 * CGEN_OPCODE_INSN_TABLE (table) = insn_table;
3181 * CGEN_OPCODE_MACRO_INSN_TABLE (table) = macro_insn_table;
3183 CGEN_OPCODE_ASM_HASH_P (table) = asm_hash_insn_p;
3184 CGEN_OPCODE_ASM_HASH (table) = asm_hash_insn;
3185 CGEN_OPCODE_ASM_HASH_SIZE (table) = CGEN_ASM_HASH_SIZE;
3187 CGEN_OPCODE_DIS_HASH_P (table) = dis_hash_insn_p;
3188 CGEN_OPCODE_DIS_HASH (table) = dis_hash_insn;
3189 CGEN_OPCODE_DIS_HASH_SIZE (table) = CGEN_DIS_HASH_SIZE;
3191 return (CGEN_OPCODE_DESC) table;
3194 /* Close an opcode table. */
3197 fr30_cgen_opcode_close (desc)
3198 CGEN_OPCODE_DESC desc;
3203 /* Getting values from cgen_fields is handled by a collection of functions.
3204 They are distinguished by the type of the VALUE argument they return.
3205 TODO: floating point, inlining support, remove cases where result type
3209 fr30_cgen_get_int_operand (opindex, fields)
3211 const CGEN_FIELDS * fields;
3217 case FR30_OPERAND_RI :
3218 value = fields->f_Ri;
3220 case FR30_OPERAND_RJ :
3221 value = fields->f_Rj;
3223 case FR30_OPERAND_RIC :
3224 value = fields->f_Ric;
3226 case FR30_OPERAND_RJC :
3227 value = fields->f_Rjc;
3229 case FR30_OPERAND_CRI :
3230 value = fields->f_CRi;
3232 case FR30_OPERAND_CRJ :
3233 value = fields->f_CRj;
3235 case FR30_OPERAND_RS1 :
3236 value = fields->f_Rs1;
3238 case FR30_OPERAND_RS2 :
3239 value = fields->f_Rs2;
3241 case FR30_OPERAND_R13 :
3242 value = fields->f_nil;
3244 case FR30_OPERAND_R14 :
3245 value = fields->f_nil;
3247 case FR30_OPERAND_R15 :
3248 value = fields->f_nil;
3250 case FR30_OPERAND_PS :
3251 value = fields->f_nil;
3253 case FR30_OPERAND_U4 :
3254 value = fields->f_u4;
3256 case FR30_OPERAND_U4C :
3257 value = fields->f_u4c;
3259 case FR30_OPERAND_U8 :
3260 value = fields->f_u8;
3262 case FR30_OPERAND_I8 :
3263 value = fields->f_i8;
3265 case FR30_OPERAND_UDISP6 :
3266 value = fields->f_udisp6;
3268 case FR30_OPERAND_DISP8 :
3269 value = fields->f_disp8;
3271 case FR30_OPERAND_DISP9 :
3272 value = fields->f_disp9;
3274 case FR30_OPERAND_DISP10 :
3275 value = fields->f_disp10;
3277 case FR30_OPERAND_S10 :
3278 value = fields->f_s10;
3280 case FR30_OPERAND_U10 :
3281 value = fields->f_u10;
3283 case FR30_OPERAND_I32 :
3284 value = fields->f_i32;
3286 case FR30_OPERAND_M4 :
3287 value = fields->f_m4;
3289 case FR30_OPERAND_I20 :
3290 value = fields->f_i20;
3292 case FR30_OPERAND_DIR8 :
3293 value = fields->f_dir8;
3295 case FR30_OPERAND_DIR9 :
3296 value = fields->f_dir9;
3298 case FR30_OPERAND_DIR10 :
3299 value = fields->f_dir10;
3301 case FR30_OPERAND_LABEL9 :
3302 value = fields->f_rel9;
3304 case FR30_OPERAND_LABEL12 :
3305 value = fields->f_rel12;
3307 case FR30_OPERAND_REGLIST_LOW :
3308 value = fields->f_reglist_low;
3310 case FR30_OPERAND_REGLIST_HI :
3311 value = fields->f_reglist_hi;
3313 case FR30_OPERAND_CC :
3314 value = fields->f_cc;
3316 case FR30_OPERAND_CCC :
3317 value = fields->f_ccc;
3321 /* xgettext:c-format */
3322 fprintf (stderr, _("Unrecognized field %d while getting int operand.\n"),
3331 fr30_cgen_get_vma_operand (opindex, fields)
3333 const CGEN_FIELDS * fields;
3339 case FR30_OPERAND_RI :
3340 value = fields->f_Ri;
3342 case FR30_OPERAND_RJ :
3343 value = fields->f_Rj;
3345 case FR30_OPERAND_RIC :
3346 value = fields->f_Ric;
3348 case FR30_OPERAND_RJC :
3349 value = fields->f_Rjc;
3351 case FR30_OPERAND_CRI :
3352 value = fields->f_CRi;
3354 case FR30_OPERAND_CRJ :
3355 value = fields->f_CRj;
3357 case FR30_OPERAND_RS1 :
3358 value = fields->f_Rs1;
3360 case FR30_OPERAND_RS2 :
3361 value = fields->f_Rs2;
3363 case FR30_OPERAND_R13 :
3364 value = fields->f_nil;
3366 case FR30_OPERAND_R14 :
3367 value = fields->f_nil;
3369 case FR30_OPERAND_R15 :
3370 value = fields->f_nil;
3372 case FR30_OPERAND_PS :
3373 value = fields->f_nil;
3375 case FR30_OPERAND_U4 :
3376 value = fields->f_u4;
3378 case FR30_OPERAND_U4C :
3379 value = fields->f_u4c;
3381 case FR30_OPERAND_U8 :
3382 value = fields->f_u8;
3384 case FR30_OPERAND_I8 :
3385 value = fields->f_i8;
3387 case FR30_OPERAND_UDISP6 :
3388 value = fields->f_udisp6;
3390 case FR30_OPERAND_DISP8 :
3391 value = fields->f_disp8;
3393 case FR30_OPERAND_DISP9 :
3394 value = fields->f_disp9;
3396 case FR30_OPERAND_DISP10 :
3397 value = fields->f_disp10;
3399 case FR30_OPERAND_S10 :
3400 value = fields->f_s10;
3402 case FR30_OPERAND_U10 :
3403 value = fields->f_u10;
3405 case FR30_OPERAND_I32 :
3406 value = fields->f_i32;
3408 case FR30_OPERAND_M4 :
3409 value = fields->f_m4;
3411 case FR30_OPERAND_I20 :
3412 value = fields->f_i20;
3414 case FR30_OPERAND_DIR8 :
3415 value = fields->f_dir8;
3417 case FR30_OPERAND_DIR9 :
3418 value = fields->f_dir9;
3420 case FR30_OPERAND_DIR10 :
3421 value = fields->f_dir10;
3423 case FR30_OPERAND_LABEL9 :
3424 value = fields->f_rel9;
3426 case FR30_OPERAND_LABEL12 :
3427 value = fields->f_rel12;
3429 case FR30_OPERAND_REGLIST_LOW :
3430 value = fields->f_reglist_low;
3432 case FR30_OPERAND_REGLIST_HI :
3433 value = fields->f_reglist_hi;
3435 case FR30_OPERAND_CC :
3436 value = fields->f_cc;
3438 case FR30_OPERAND_CCC :
3439 value = fields->f_ccc;
3443 /* xgettext:c-format */
3444 fprintf (stderr, _("Unrecognized field %d while getting vma operand.\n"),
3452 /* Stuffing values in cgen_fields is handled by a collection of functions.
3453 They are distinguished by the type of the VALUE argument they accept.
3454 TODO: floating point, inlining support, remove cases where argument type
3458 fr30_cgen_set_int_operand (opindex, fields, value)
3460 CGEN_FIELDS * fields;
3465 case FR30_OPERAND_RI :
3466 fields->f_Ri = value;
3468 case FR30_OPERAND_RJ :
3469 fields->f_Rj = value;
3471 case FR30_OPERAND_RIC :
3472 fields->f_Ric = value;
3474 case FR30_OPERAND_RJC :
3475 fields->f_Rjc = value;
3477 case FR30_OPERAND_CRI :
3478 fields->f_CRi = value;
3480 case FR30_OPERAND_CRJ :
3481 fields->f_CRj = value;
3483 case FR30_OPERAND_RS1 :
3484 fields->f_Rs1 = value;
3486 case FR30_OPERAND_RS2 :
3487 fields->f_Rs2 = value;
3489 case FR30_OPERAND_R13 :
3490 fields->f_nil = value;
3492 case FR30_OPERAND_R14 :
3493 fields->f_nil = value;
3495 case FR30_OPERAND_R15 :
3496 fields->f_nil = value;
3498 case FR30_OPERAND_PS :
3499 fields->f_nil = value;
3501 case FR30_OPERAND_U4 :
3502 fields->f_u4 = value;
3504 case FR30_OPERAND_U4C :
3505 fields->f_u4c = value;
3507 case FR30_OPERAND_U8 :
3508 fields->f_u8 = value;
3510 case FR30_OPERAND_I8 :
3511 fields->f_i8 = value;
3513 case FR30_OPERAND_UDISP6 :
3514 fields->f_udisp6 = value;
3516 case FR30_OPERAND_DISP8 :
3517 fields->f_disp8 = value;
3519 case FR30_OPERAND_DISP9 :
3520 fields->f_disp9 = value;
3522 case FR30_OPERAND_DISP10 :
3523 fields->f_disp10 = value;
3525 case FR30_OPERAND_S10 :
3526 fields->f_s10 = value;
3528 case FR30_OPERAND_U10 :
3529 fields->f_u10 = value;
3531 case FR30_OPERAND_I32 :
3532 fields->f_i32 = value;
3534 case FR30_OPERAND_M4 :
3535 fields->f_m4 = value;
3537 case FR30_OPERAND_I20 :
3538 fields->f_i20 = value;
3540 case FR30_OPERAND_DIR8 :
3541 fields->f_dir8 = value;
3543 case FR30_OPERAND_DIR9 :
3544 fields->f_dir9 = value;
3546 case FR30_OPERAND_DIR10 :
3547 fields->f_dir10 = value;
3549 case FR30_OPERAND_LABEL9 :
3550 fields->f_rel9 = value;
3552 case FR30_OPERAND_LABEL12 :
3553 fields->f_rel12 = value;
3555 case FR30_OPERAND_REGLIST_LOW :
3556 fields->f_reglist_low = value;
3558 case FR30_OPERAND_REGLIST_HI :
3559 fields->f_reglist_hi = value;
3561 case FR30_OPERAND_CC :
3562 fields->f_cc = value;
3564 case FR30_OPERAND_CCC :
3565 fields->f_ccc = value;
3569 /* xgettext:c-format */
3570 fprintf (stderr, _("Unrecognized field %d while setting int operand.\n"),
3577 fr30_cgen_set_vma_operand (opindex, fields, value)
3579 CGEN_FIELDS * fields;
3584 case FR30_OPERAND_RI :
3585 fields->f_Ri = value;
3587 case FR30_OPERAND_RJ :
3588 fields->f_Rj = value;
3590 case FR30_OPERAND_RIC :
3591 fields->f_Ric = value;
3593 case FR30_OPERAND_RJC :
3594 fields->f_Rjc = value;
3596 case FR30_OPERAND_CRI :
3597 fields->f_CRi = value;
3599 case FR30_OPERAND_CRJ :
3600 fields->f_CRj = value;
3602 case FR30_OPERAND_RS1 :
3603 fields->f_Rs1 = value;
3605 case FR30_OPERAND_RS2 :
3606 fields->f_Rs2 = value;
3608 case FR30_OPERAND_R13 :
3609 fields->f_nil = value;
3611 case FR30_OPERAND_R14 :
3612 fields->f_nil = value;
3614 case FR30_OPERAND_R15 :
3615 fields->f_nil = value;
3617 case FR30_OPERAND_PS :
3618 fields->f_nil = value;
3620 case FR30_OPERAND_U4 :
3621 fields->f_u4 = value;
3623 case FR30_OPERAND_U4C :
3624 fields->f_u4c = value;
3626 case FR30_OPERAND_U8 :
3627 fields->f_u8 = value;
3629 case FR30_OPERAND_I8 :
3630 fields->f_i8 = value;
3632 case FR30_OPERAND_UDISP6 :
3633 fields->f_udisp6 = value;
3635 case FR30_OPERAND_DISP8 :
3636 fields->f_disp8 = value;
3638 case FR30_OPERAND_DISP9 :
3639 fields->f_disp9 = value;
3641 case FR30_OPERAND_DISP10 :
3642 fields->f_disp10 = value;
3644 case FR30_OPERAND_S10 :
3645 fields->f_s10 = value;
3647 case FR30_OPERAND_U10 :
3648 fields->f_u10 = value;
3650 case FR30_OPERAND_I32 :
3651 fields->f_i32 = value;
3653 case FR30_OPERAND_M4 :
3654 fields->f_m4 = value;
3656 case FR30_OPERAND_I20 :
3657 fields->f_i20 = value;
3659 case FR30_OPERAND_DIR8 :
3660 fields->f_dir8 = value;
3662 case FR30_OPERAND_DIR9 :
3663 fields->f_dir9 = value;
3665 case FR30_OPERAND_DIR10 :
3666 fields->f_dir10 = value;
3668 case FR30_OPERAND_LABEL9 :
3669 fields->f_rel9 = value;
3671 case FR30_OPERAND_LABEL12 :
3672 fields->f_rel12 = value;
3674 case FR30_OPERAND_REGLIST_LOW :
3675 fields->f_reglist_low = value;
3677 case FR30_OPERAND_REGLIST_HI :
3678 fields->f_reglist_hi = value;
3680 case FR30_OPERAND_CC :
3681 fields->f_cc = value;
3683 case FR30_OPERAND_CCC :
3684 fields->f_ccc = value;
3688 /* xgettext:c-format */
3689 fprintf (stderr, _("Unrecognized field %d while setting vma operand.\n"),