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 /* The hash functions are recorded here to help keep assembler code out of
34 the disassembler and vice versa. */
36 static int asm_hash_insn_p
PARAMS ((const CGEN_INSN
*));
37 static unsigned int asm_hash_insn
PARAMS ((const char *));
38 static int dis_hash_insn_p
PARAMS ((const CGEN_INSN
*));
39 static unsigned int dis_hash_insn
PARAMS ((const char *, CGEN_INSN_INT
));
41 /* Look up instruction INSN_VALUE and extract its fields.
42 INSN, if non-null, is the insn table entry.
43 Otherwise INSN_VALUE is examined to compute it.
44 LENGTH is the bit length of INSN_VALUE if known, otherwise 0.
45 0 is only valid if `insn == NULL && ! CGEN_INT_INSN_P'.
46 If INSN != NULL, LENGTH must be valid.
47 ALIAS_P is non-zero if alias insns are to be included in the search.
49 The result is a pointer to the insn table entry, or NULL if the instruction
53 fr30_cgen_lookup_insn (od
, insn
, insn_value
, length
, fields
, alias_p
)
55 const CGEN_INSN
*insn
;
56 CGEN_INSN_BYTES insn_value
;
61 unsigned char buf
[CGEN_MAX_INSN_SIZE
];
63 CGEN_INSN_INT base_insn
;
65 CGEN_EXTRACT_INFO
*info
= NULL
;
67 CGEN_EXTRACT_INFO ex_info
;
68 CGEN_EXTRACT_INFO
*info
= &ex_info
;
72 cgen_put_insn_value (od
, buf
, length
, insn_value
);
74 base_insn
= insn_value
; /*???*/
76 ex_info
.dis_info
= NULL
;
77 ex_info
.insn_bytes
= insn_value
;
79 base_insn
= cgen_get_insn_value (od
, buf
, length
);
85 const CGEN_INSN_LIST
*insn_list
;
87 /* The instructions are stored in hash lists.
88 Pick the first one and keep trying until we find the right one. */
90 insn_list
= CGEN_DIS_LOOKUP_INSN (od
, bufp
, base_insn
);
91 while (insn_list
!= NULL
)
93 insn
= insn_list
->insn
;
96 || ! CGEN_INSN_ATTR (insn
, CGEN_INSN_ALIAS
))
98 /* Basic bit mask must be correct. */
99 /* ??? May wish to allow target to defer this check until the
101 if ((base_insn
& CGEN_INSN_MASK (insn
)) == CGEN_INSN_VALUE (insn
))
103 /* ??? 0 is passed for `pc' */
104 int elength
= (*CGEN_EXTRACT_FN (insn
)) (od
, insn
, info
,
110 if (length
!= 0 && length
!= elength
)
117 insn_list
= CGEN_DIS_NEXT_INSN (insn_list
);
122 /* Sanity check: can't pass an alias insn if ! alias_p. */
124 && CGEN_INSN_ATTR (insn
, CGEN_INSN_ALIAS
))
126 /* Sanity check: length must be correct. */
127 if (length
!= CGEN_INSN_BITSIZE (insn
))
130 /* ??? 0 is passed for `pc' */
131 length
= (*CGEN_EXTRACT_FN (insn
)) (od
, insn
, info
, base_insn
, fields
,
133 /* Sanity check: must succeed.
134 Could relax this later if it ever proves useful. */
143 /* Fill in the operand instances used by INSN whose operands are FIELDS.
144 INDICES is a pointer to a buffer of MAX_OPERAND_INSTANCES ints to be filled
148 fr30_cgen_get_insn_operands (od
, insn
, fields
, indices
)
150 const CGEN_INSN
* insn
;
151 const CGEN_FIELDS
* fields
;
154 const CGEN_OPERAND_INSTANCE
*opinst
;
157 for (i
= 0, opinst
= CGEN_INSN_OPERANDS (insn
);
159 && CGEN_OPERAND_INSTANCE_TYPE (opinst
) != CGEN_OPERAND_INSTANCE_END
;
162 const CGEN_OPERAND
*op
= CGEN_OPERAND_INSTANCE_OPERAND (opinst
);
164 indices
[i
] = CGEN_OPERAND_INSTANCE_INDEX (opinst
);
166 indices
[i
] = fr30_cgen_get_int_operand (CGEN_OPERAND_INDEX (op
),
171 /* Cover function to fr30_cgen_get_insn_operands when either INSN or FIELDS
173 The INSN, INSN_VALUE, and LENGTH arguments are passed to
174 fr30_cgen_lookup_insn unchanged.
176 The result is the insn table entry or NULL if the instruction wasn't
180 fr30_cgen_lookup_get_insn_operands (od
, insn
, insn_value
, length
, indices
)
182 const CGEN_INSN
*insn
;
183 CGEN_INSN_BYTES insn_value
;
189 /* Pass non-zero for ALIAS_P only if INSN != NULL.
190 If INSN == NULL, we want a real insn. */
191 insn
= fr30_cgen_lookup_insn (od
, insn
, insn_value
, length
, &fields
,
196 fr30_cgen_get_insn_operands (od
, insn
, &fields
, indices
);
201 static const CGEN_ATTR_ENTRY MACH_attr
[] =
203 { "base", MACH_BASE
},
204 { "fr30", MACH_FR30
},
209 const CGEN_ATTR_TABLE fr30_cgen_hardware_attr_table
[] =
211 { "CACHE-ADDR", NULL
},
212 { "FUN-ACCESS", NULL
},
218 const CGEN_ATTR_TABLE fr30_cgen_operand_attr_table
[] =
220 { "ABS-ADDR", NULL
},
221 { "HASH-PREFIX", NULL
},
222 { "NEGATIVE", NULL
},
223 { "PCREL-ADDR", NULL
},
225 { "SEM-ONLY", NULL
},
226 { "SIGN-OPT", NULL
},
228 { "UNSIGNED", NULL
},
232 const CGEN_ATTR_TABLE fr30_cgen_insn_attr_table
[] =
235 { "COND-CTI", NULL
},
238 { "RELAXABLE", NULL
},
239 { "SKIP-CTI", NULL
},
240 { "UNCOND-CTI", NULL
},
245 CGEN_KEYWORD_ENTRY fr30_cgen_opval_h_gr_entries
[] =
268 CGEN_KEYWORD fr30_cgen_opval_h_gr
=
270 & fr30_cgen_opval_h_gr_entries
[0],
274 CGEN_KEYWORD_ENTRY fr30_cgen_opval_h_cr_entries
[] =
294 CGEN_KEYWORD fr30_cgen_opval_h_cr
=
296 & fr30_cgen_opval_h_cr_entries
[0],
300 CGEN_KEYWORD_ENTRY fr30_cgen_opval_h_dr_entries
[] =
310 CGEN_KEYWORD fr30_cgen_opval_h_dr
=
312 & fr30_cgen_opval_h_dr_entries
[0],
316 CGEN_KEYWORD_ENTRY fr30_cgen_opval_h_ps_entries
[] =
321 CGEN_KEYWORD fr30_cgen_opval_h_ps
=
323 & fr30_cgen_opval_h_ps_entries
[0],
327 CGEN_KEYWORD_ENTRY fr30_cgen_opval_h_r13_entries
[] =
332 CGEN_KEYWORD fr30_cgen_opval_h_r13
=
334 & fr30_cgen_opval_h_r13_entries
[0],
338 CGEN_KEYWORD_ENTRY fr30_cgen_opval_h_r14_entries
[] =
343 CGEN_KEYWORD fr30_cgen_opval_h_r14
=
345 & fr30_cgen_opval_h_r14_entries
[0],
349 CGEN_KEYWORD_ENTRY fr30_cgen_opval_h_r15_entries
[] =
354 CGEN_KEYWORD fr30_cgen_opval_h_r15
=
356 & fr30_cgen_opval_h_r15_entries
[0],
361 /* The hardware table. */
363 #define HW_ENT(n) fr30_cgen_hw_entries[n]
364 static const CGEN_HW_ENTRY fr30_cgen_hw_entries
[] =
366 { 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 } } },
367 { HW_H_MEMORY
, & HW_ENT (HW_H_MEMORY
+ 1), "h-memory", CGEN_ASM_KEYWORD
, (PTR
) 0, { 0, 0, { 0 } } },
368 { HW_H_SINT
, & HW_ENT (HW_H_SINT
+ 1), "h-sint", CGEN_ASM_KEYWORD
, (PTR
) 0, { 0, 0, { 0 } } },
369 { HW_H_UINT
, & HW_ENT (HW_H_UINT
+ 1), "h-uint", CGEN_ASM_KEYWORD
, (PTR
) 0, { 0, 0, { 0 } } },
370 { HW_H_ADDR
, & HW_ENT (HW_H_ADDR
+ 1), "h-addr", CGEN_ASM_KEYWORD
, (PTR
) 0, { 0, 0, { 0 } } },
371 { HW_H_IADDR
, & HW_ENT (HW_H_IADDR
+ 1), "h-iaddr", CGEN_ASM_KEYWORD
, (PTR
) 0, { 0, 0, { 0 } } },
372 { 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 } } },
373 { HW_H_CR
, & HW_ENT (HW_H_CR
+ 1), "h-cr", CGEN_ASM_KEYWORD
, (PTR
) & fr30_cgen_opval_h_cr
, { 0, 0|(1<<CGEN_HW_CACHE_ADDR
)|(1<<CGEN_HW_PROFILE
), { 0 } } },
374 { HW_H_DR
, & HW_ENT (HW_H_DR
+ 1), "h-dr", CGEN_ASM_KEYWORD
, (PTR
) & fr30_cgen_opval_h_dr
, { 0, 0, { 0 } } },
375 { 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 } } },
376 { HW_H_R13
, & HW_ENT (HW_H_R13
+ 1), "h-r13", CGEN_ASM_KEYWORD
, (PTR
) & fr30_cgen_opval_h_r13
, { 0, 0, { 0 } } },
377 { HW_H_R14
, & HW_ENT (HW_H_R14
+ 1), "h-r14", CGEN_ASM_KEYWORD
, (PTR
) & fr30_cgen_opval_h_r14
, { 0, 0, { 0 } } },
378 { HW_H_R15
, & HW_ENT (HW_H_R15
+ 1), "h-r15", CGEN_ASM_KEYWORD
, (PTR
) & fr30_cgen_opval_h_r15
, { 0, 0, { 0 } } },
379 { HW_H_NBIT
, & HW_ENT (HW_H_NBIT
+ 1), "h-nbit", CGEN_ASM_KEYWORD
, (PTR
) 0, { 0, 0, { 0 } } },
380 { HW_H_ZBIT
, & HW_ENT (HW_H_ZBIT
+ 1), "h-zbit", CGEN_ASM_KEYWORD
, (PTR
) 0, { 0, 0, { 0 } } },
381 { HW_H_VBIT
, & HW_ENT (HW_H_VBIT
+ 1), "h-vbit", CGEN_ASM_KEYWORD
, (PTR
) 0, { 0, 0, { 0 } } },
382 { HW_H_CBIT
, & HW_ENT (HW_H_CBIT
+ 1), "h-cbit", CGEN_ASM_KEYWORD
, (PTR
) 0, { 0, 0, { 0 } } },
383 { HW_H_IBIT
, & HW_ENT (HW_H_IBIT
+ 1), "h-ibit", CGEN_ASM_KEYWORD
, (PTR
) 0, { 0, 0, { 0 } } },
384 { HW_H_SBIT
, & HW_ENT (HW_H_SBIT
+ 1), "h-sbit", CGEN_ASM_KEYWORD
, (PTR
) 0, { 0, 0, { 0 } } },
388 /* The operand table. */
390 #define OPERAND(op) CONCAT2 (FR30_OPERAND_,op)
391 #define OP_ENT(op) fr30_cgen_operand_table[OPERAND (op)]
393 const CGEN_OPERAND fr30_cgen_operand_table
[MAX_OPERANDS
] =
395 /* pc: program counter */
396 { "pc", & HW_ENT (HW_H_PC
), 0, 0,
397 { 0, 0|(1<<CGEN_OPERAND_SEM_ONLY
), { 0 } } },
398 /* Ri: destination register */
399 { "Ri", & HW_ENT (HW_H_GR
), 12, 4,
400 { 0, 0|(1<<CGEN_OPERAND_UNSIGNED
), { 0 } } },
401 /* Rj: source register */
402 { "Rj", & HW_ENT (HW_H_GR
), 8, 4,
403 { 0, 0|(1<<CGEN_OPERAND_UNSIGNED
), { 0 } } },
404 /* Ric: target register coproc insn */
405 { "Ric", & HW_ENT (HW_H_GR
), 28, 4,
406 { 0, 0|(1<<CGEN_OPERAND_UNSIGNED
), { 0 } } },
407 /* Rjc: source register coproc insn */
408 { "Rjc", & HW_ENT (HW_H_GR
), 24, 4,
409 { 0, 0|(1<<CGEN_OPERAND_UNSIGNED
), { 0 } } },
410 /* CRi: coprocessor register */
411 { "CRi", & HW_ENT (HW_H_CR
), 28, 4,
412 { 0, 0|(1<<CGEN_OPERAND_UNSIGNED
), { 0 } } },
413 /* CRj: coprocessor register */
414 { "CRj", & HW_ENT (HW_H_CR
), 24, 4,
415 { 0, 0|(1<<CGEN_OPERAND_UNSIGNED
), { 0 } } },
416 /* Rs1: dedicated register */
417 { "Rs1", & HW_ENT (HW_H_DR
), 8, 4,
418 { 0, 0|(1<<CGEN_OPERAND_UNSIGNED
), { 0 } } },
419 /* Rs2: dedicated register */
420 { "Rs2", & HW_ENT (HW_H_DR
), 12, 4,
421 { 0, 0|(1<<CGEN_OPERAND_UNSIGNED
), { 0 } } },
422 /* R13: General Register 13 */
423 { "R13", & HW_ENT (HW_H_R13
), 0, 0,
425 /* R14: General Register 14 */
426 { "R14", & HW_ENT (HW_H_R14
), 0, 0,
428 /* R15: General Register 15 */
429 { "R15", & HW_ENT (HW_H_R15
), 0, 0,
431 /* ps: Program Status register */
432 { "ps", & HW_ENT (HW_H_PS
), 0, 0,
434 /* u4: 4 bit unsigned immediate */
435 { "u4", & HW_ENT (HW_H_UINT
), 8, 4,
436 { 0, 0|(1<<CGEN_OPERAND_HASH_PREFIX
)|(1<<CGEN_OPERAND_UNSIGNED
), { 0 } } },
437 /* u4c: 4 bit unsigned immediate */
438 { "u4c", & HW_ENT (HW_H_UINT
), 12, 4,
439 { 0, 0|(1<<CGEN_OPERAND_HASH_PREFIX
)|(1<<CGEN_OPERAND_UNSIGNED
), { 0 } } },
440 /* m4: 4 bit negative immediate */
441 { "m4", & HW_ENT (HW_H_UINT
), 8, 4,
442 { 0, 0|(1<<CGEN_OPERAND_HASH_PREFIX
)|(1<<CGEN_OPERAND_UNSIGNED
), { 0 } } },
443 /* u8: 8 bit unsigned immediate */
444 { "u8", & HW_ENT (HW_H_UINT
), 8, 8,
445 { 0, 0|(1<<CGEN_OPERAND_HASH_PREFIX
)|(1<<CGEN_OPERAND_UNSIGNED
), { 0 } } },
446 /* i8: 8 bit unsigned immediate */
447 { "i8", & HW_ENT (HW_H_UINT
), 4, 8,
448 { 0, 0|(1<<CGEN_OPERAND_HASH_PREFIX
)|(1<<CGEN_OPERAND_UNSIGNED
), { 0 } } },
449 /* udisp6: 6 bit unsigned immediate */
450 { "udisp6", & HW_ENT (HW_H_UINT
), 8, 4,
451 { 0, 0|(1<<CGEN_OPERAND_HASH_PREFIX
)|(1<<CGEN_OPERAND_UNSIGNED
), { 0 } } },
452 /* disp8: 8 bit signed immediate */
453 { "disp8", & HW_ENT (HW_H_SINT
), 4, 8,
454 { 0, 0|(1<<CGEN_OPERAND_HASH_PREFIX
)|(1<<CGEN_OPERAND_SIGNED
), { 0 } } },
455 /* disp9: 9 bit signed immediate */
456 { "disp9", & HW_ENT (HW_H_SINT
), 4, 8,
457 { 0, 0|(1<<CGEN_OPERAND_HASH_PREFIX
)|(1<<CGEN_OPERAND_SIGNED
), { 0 } } },
458 /* disp10: 10 bit signed immediate */
459 { "disp10", & HW_ENT (HW_H_SINT
), 4, 8,
460 { 0, 0|(1<<CGEN_OPERAND_HASH_PREFIX
)|(1<<CGEN_OPERAND_SIGNED
), { 0 } } },
461 /* s10: 10 bit signed immediate */
462 { "s10", & HW_ENT (HW_H_SINT
), 8, 8,
463 { 0, 0|(1<<CGEN_OPERAND_HASH_PREFIX
)|(1<<CGEN_OPERAND_SIGNED
), { 0 } } },
464 /* u10: 10 bit unsigned immediate */
465 { "u10", & HW_ENT (HW_H_UINT
), 8, 8,
466 { 0, 0|(1<<CGEN_OPERAND_HASH_PREFIX
)|(1<<CGEN_OPERAND_UNSIGNED
), { 0 } } },
467 /* i32: 32 bit immediate */
468 { "i32", & HW_ENT (HW_H_UINT
), 16, 32,
469 { 0, 0|(1<<CGEN_OPERAND_HASH_PREFIX
)|(1<<CGEN_OPERAND_SIGN_OPT
)|(1<<CGEN_OPERAND_UNSIGNED
), { 0 } } },
470 /* dir8: 8 bit direct address */
471 { "dir8", & HW_ENT (HW_H_UINT
), 8, 8,
472 { 0, 0|(1<<CGEN_OPERAND_UNSIGNED
), { 0 } } },
473 /* dir9: 9 bit direct address */
474 { "dir9", & HW_ENT (HW_H_UINT
), 8, 8,
475 { 0, 0|(1<<CGEN_OPERAND_UNSIGNED
), { 0 } } },
476 /* dir10: 10 bit direct address */
477 { "dir10", & HW_ENT (HW_H_UINT
), 8, 8,
478 { 0, 0|(1<<CGEN_OPERAND_UNSIGNED
), { 0 } } },
479 /* label9: 9 bit pc relative address */
480 { "label9", & HW_ENT (HW_H_SINT
), 8, 8,
481 { 0, 0|(1<<CGEN_OPERAND_SIGNED
), { 0 } } },
482 /* label12: 12 bit pc relative address */
483 { "label12", & HW_ENT (HW_H_SINT
), 5, 11,
484 { 0, 0|(1<<CGEN_OPERAND_SIGNED
), { 0 } } },
485 /* reglist_low: 8 bit register mask */
486 { "reglist_low", & HW_ENT (HW_H_UINT
), 8, 8,
487 { 0, 0|(1<<CGEN_OPERAND_UNSIGNED
), { 0 } } },
488 /* reglist_hi: 8 bit register mask */
489 { "reglist_hi", & HW_ENT (HW_H_UINT
), 8, 8,
490 { 0, 0|(1<<CGEN_OPERAND_UNSIGNED
), { 0 } } },
491 /* cc: condition codes */
492 { "cc", & HW_ENT (HW_H_UINT
), 4, 4,
493 { 0, 0|(1<<CGEN_OPERAND_UNSIGNED
), { 0 } } },
494 /* ccc: coprocessor calc */
495 { "ccc", & HW_ENT (HW_H_UINT
), 16, 8,
496 { 0, 0|(1<<CGEN_OPERAND_HASH_PREFIX
)|(1<<CGEN_OPERAND_UNSIGNED
), { 0 } } },
497 /* nbit: negative bit */
498 { "nbit", & HW_ENT (HW_H_NBIT
), 0, 0,
499 { 0, 0|(1<<CGEN_OPERAND_SEM_ONLY
), { 0 } } },
500 /* vbit: overflow bit */
501 { "vbit", & HW_ENT (HW_H_VBIT
), 0, 0,
502 { 0, 0|(1<<CGEN_OPERAND_SEM_ONLY
), { 0 } } },
504 { "zbit", & HW_ENT (HW_H_ZBIT
), 0, 0,
505 { 0, 0|(1<<CGEN_OPERAND_SEM_ONLY
), { 0 } } },
506 /* cbit: carry bit */
507 { "cbit", & HW_ENT (HW_H_CBIT
), 0, 0,
508 { 0, 0|(1<<CGEN_OPERAND_SEM_ONLY
), { 0 } } },
509 /* ibit: interrupt bit */
510 { "ibit", & HW_ENT (HW_H_IBIT
), 0, 0,
511 { 0, 0|(1<<CGEN_OPERAND_SEM_ONLY
), { 0 } } },
512 /* sbit: stack bit */
513 { "sbit", & HW_ENT (HW_H_SBIT
), 0, 0,
514 { 0, 0|(1<<CGEN_OPERAND_SEM_ONLY
), { 0 } } },
517 /* Operand references. */
519 #define INPUT CGEN_OPERAND_INSTANCE_INPUT
520 #define OUTPUT CGEN_OPERAND_INSTANCE_OUTPUT
521 #define COND_REF CGEN_OPERAND_INSTANCE_COND_REF
523 static const CGEN_OPERAND_INSTANCE fmt_add_ops
[] = {
524 { INPUT
, "Ri", & HW_ENT (HW_H_GR
), CGEN_MODE_SI
, & OP_ENT (RI
), 0, 0 },
525 { INPUT
, "Rj", & HW_ENT (HW_H_GR
), CGEN_MODE_SI
, & OP_ENT (RJ
), 0, 0 },
526 { OUTPUT
, "vbit", & HW_ENT (HW_H_VBIT
), CGEN_MODE_BI
, 0, 0, 0 },
527 { OUTPUT
, "cbit", & HW_ENT (HW_H_CBIT
), CGEN_MODE_BI
, 0, 0, 0 },
528 { OUTPUT
, "Ri", & HW_ENT (HW_H_GR
), CGEN_MODE_SI
, & OP_ENT (RI
), 0, 0 },
529 { OUTPUT
, "zbit", & HW_ENT (HW_H_ZBIT
), CGEN_MODE_BI
, 0, 0, 0 },
530 { OUTPUT
, "nbit", & HW_ENT (HW_H_NBIT
), CGEN_MODE_BI
, 0, 0, 0 },
534 static const CGEN_OPERAND_INSTANCE fmt_addi_ops
[] = {
535 { INPUT
, "Ri", & HW_ENT (HW_H_GR
), CGEN_MODE_SI
, & OP_ENT (RI
), 0, 0 },
536 { INPUT
, "u4", & HW_ENT (HW_H_UINT
), CGEN_MODE_USI
, & OP_ENT (U4
), 0, 0 },
537 { OUTPUT
, "vbit", & HW_ENT (HW_H_VBIT
), CGEN_MODE_BI
, 0, 0, 0 },
538 { OUTPUT
, "cbit", & HW_ENT (HW_H_CBIT
), CGEN_MODE_BI
, 0, 0, 0 },
539 { OUTPUT
, "Ri", & HW_ENT (HW_H_GR
), CGEN_MODE_SI
, & OP_ENT (RI
), 0, 0 },
540 { OUTPUT
, "zbit", & HW_ENT (HW_H_ZBIT
), CGEN_MODE_BI
, 0, 0, 0 },
541 { OUTPUT
, "nbit", & HW_ENT (HW_H_NBIT
), CGEN_MODE_BI
, 0, 0, 0 },
545 static const CGEN_OPERAND_INSTANCE fmt_add2_ops
[] = {
546 { INPUT
, "Ri", & HW_ENT (HW_H_GR
), CGEN_MODE_SI
, & OP_ENT (RI
), 0, 0 },
547 { INPUT
, "m4", & HW_ENT (HW_H_UINT
), CGEN_MODE_USI
, & OP_ENT (M4
), 0, 0 },
548 { OUTPUT
, "vbit", & HW_ENT (HW_H_VBIT
), CGEN_MODE_BI
, 0, 0, 0 },
549 { OUTPUT
, "cbit", & HW_ENT (HW_H_CBIT
), CGEN_MODE_BI
, 0, 0, 0 },
550 { OUTPUT
, "Ri", & HW_ENT (HW_H_GR
), CGEN_MODE_SI
, & OP_ENT (RI
), 0, 0 },
551 { OUTPUT
, "zbit", & HW_ENT (HW_H_ZBIT
), CGEN_MODE_BI
, 0, 0, 0 },
552 { OUTPUT
, "nbit", & HW_ENT (HW_H_NBIT
), CGEN_MODE_BI
, 0, 0, 0 },
556 static const CGEN_OPERAND_INSTANCE fmt_addc_ops
[] = {
557 { INPUT
, "Ri", & HW_ENT (HW_H_GR
), CGEN_MODE_SI
, & OP_ENT (RI
), 0, 0 },
558 { INPUT
, "Rj", & HW_ENT (HW_H_GR
), CGEN_MODE_SI
, & OP_ENT (RJ
), 0, 0 },
559 { INPUT
, "cbit", & HW_ENT (HW_H_CBIT
), CGEN_MODE_BI
, 0, 0, 0 },
560 { OUTPUT
, "vbit", & HW_ENT (HW_H_VBIT
), CGEN_MODE_BI
, 0, 0, 0 },
561 { OUTPUT
, "cbit", & HW_ENT (HW_H_CBIT
), CGEN_MODE_BI
, 0, 0, 0 },
562 { OUTPUT
, "Ri", & HW_ENT (HW_H_GR
), CGEN_MODE_SI
, & OP_ENT (RI
), 0, 0 },
563 { OUTPUT
, "zbit", & HW_ENT (HW_H_ZBIT
), CGEN_MODE_BI
, 0, 0, 0 },
564 { OUTPUT
, "nbit", & HW_ENT (HW_H_NBIT
), CGEN_MODE_BI
, 0, 0, 0 },
568 static const CGEN_OPERAND_INSTANCE fmt_addn_ops
[] = {
569 { INPUT
, "Ri", & HW_ENT (HW_H_GR
), CGEN_MODE_SI
, & OP_ENT (RI
), 0, 0 },
570 { INPUT
, "Rj", & HW_ENT (HW_H_GR
), CGEN_MODE_SI
, & OP_ENT (RJ
), 0, 0 },
571 { OUTPUT
, "Ri", & HW_ENT (HW_H_GR
), CGEN_MODE_SI
, & OP_ENT (RI
), 0, 0 },
575 static const CGEN_OPERAND_INSTANCE fmt_addni_ops
[] = {
576 { INPUT
, "Ri", & HW_ENT (HW_H_GR
), CGEN_MODE_SI
, & OP_ENT (RI
), 0, 0 },
577 { INPUT
, "u4", & HW_ENT (HW_H_UINT
), CGEN_MODE_USI
, & OP_ENT (U4
), 0, 0 },
578 { OUTPUT
, "Ri", & HW_ENT (HW_H_GR
), CGEN_MODE_SI
, & OP_ENT (RI
), 0, 0 },
582 static const CGEN_OPERAND_INSTANCE fmt_addn2_ops
[] = {
583 { INPUT
, "Ri", & HW_ENT (HW_H_GR
), CGEN_MODE_SI
, & OP_ENT (RI
), 0, 0 },
584 { INPUT
, "m4", & HW_ENT (HW_H_UINT
), CGEN_MODE_USI
, & OP_ENT (M4
), 0, 0 },
585 { OUTPUT
, "Ri", & HW_ENT (HW_H_GR
), CGEN_MODE_SI
, & OP_ENT (RI
), 0, 0 },
589 static const CGEN_OPERAND_INSTANCE fmt_cmp_ops
[] = {
590 { INPUT
, "Ri", & HW_ENT (HW_H_GR
), CGEN_MODE_SI
, & OP_ENT (RI
), 0, 0 },
591 { INPUT
, "Rj", & HW_ENT (HW_H_GR
), CGEN_MODE_SI
, & OP_ENT (RJ
), 0, 0 },
592 { OUTPUT
, "vbit", & HW_ENT (HW_H_VBIT
), CGEN_MODE_BI
, 0, 0, 0 },
593 { OUTPUT
, "cbit", & HW_ENT (HW_H_CBIT
), CGEN_MODE_BI
, 0, 0, 0 },
594 { OUTPUT
, "zbit", & HW_ENT (HW_H_ZBIT
), CGEN_MODE_BI
, 0, 0, 0 },
595 { OUTPUT
, "nbit", & HW_ENT (HW_H_NBIT
), CGEN_MODE_BI
, 0, 0, 0 },
599 static const CGEN_OPERAND_INSTANCE fmt_cmpi_ops
[] = {
600 { INPUT
, "Ri", & HW_ENT (HW_H_GR
), CGEN_MODE_SI
, & OP_ENT (RI
), 0, 0 },
601 { INPUT
, "u4", & HW_ENT (HW_H_UINT
), CGEN_MODE_USI
, & OP_ENT (U4
), 0, 0 },
602 { OUTPUT
, "vbit", & HW_ENT (HW_H_VBIT
), CGEN_MODE_BI
, 0, 0, 0 },
603 { OUTPUT
, "cbit", & HW_ENT (HW_H_CBIT
), CGEN_MODE_BI
, 0, 0, 0 },
604 { OUTPUT
, "zbit", & HW_ENT (HW_H_ZBIT
), CGEN_MODE_BI
, 0, 0, 0 },
605 { OUTPUT
, "nbit", & HW_ENT (HW_H_NBIT
), CGEN_MODE_BI
, 0, 0, 0 },
609 static const CGEN_OPERAND_INSTANCE fmt_cmp2_ops
[] = {
610 { INPUT
, "Ri", & HW_ENT (HW_H_GR
), CGEN_MODE_SI
, & OP_ENT (RI
), 0, 0 },
611 { INPUT
, "m4", & HW_ENT (HW_H_UINT
), CGEN_MODE_USI
, & OP_ENT (M4
), 0, 0 },
612 { OUTPUT
, "vbit", & HW_ENT (HW_H_VBIT
), CGEN_MODE_BI
, 0, 0, 0 },
613 { OUTPUT
, "cbit", & HW_ENT (HW_H_CBIT
), CGEN_MODE_BI
, 0, 0, 0 },
614 { OUTPUT
, "zbit", & HW_ENT (HW_H_ZBIT
), CGEN_MODE_BI
, 0, 0, 0 },
615 { OUTPUT
, "nbit", & HW_ENT (HW_H_NBIT
), CGEN_MODE_BI
, 0, 0, 0 },
619 static const CGEN_OPERAND_INSTANCE fmt_and_ops
[] = {
620 { INPUT
, "Ri", & HW_ENT (HW_H_GR
), CGEN_MODE_SI
, & OP_ENT (RI
), 0, 0 },
621 { INPUT
, "Rj", & HW_ENT (HW_H_GR
), CGEN_MODE_SI
, & OP_ENT (RJ
), 0, 0 },
622 { OUTPUT
, "Ri", & HW_ENT (HW_H_GR
), CGEN_MODE_SI
, & OP_ENT (RI
), 0, 0 },
623 { OUTPUT
, "zbit", & HW_ENT (HW_H_ZBIT
), CGEN_MODE_BI
, 0, 0, 0 },
624 { OUTPUT
, "nbit", & HW_ENT (HW_H_NBIT
), CGEN_MODE_BI
, 0, 0, 0 },
628 static const CGEN_OPERAND_INSTANCE fmt_andm_ops
[] = {
629 { INPUT
, "Ri", & HW_ENT (HW_H_GR
), CGEN_MODE_USI
, & OP_ENT (RI
), 0, 0 },
630 { INPUT
, "h_memory_Ri", & HW_ENT (HW_H_MEMORY
), CGEN_MODE_SI
, 0, 0, 0 },
631 { INPUT
, "Rj", & HW_ENT (HW_H_GR
), CGEN_MODE_SI
, & OP_ENT (RJ
), 0, 0 },
632 { OUTPUT
, "zbit", & HW_ENT (HW_H_ZBIT
), CGEN_MODE_BI
, 0, 0, 0 },
633 { OUTPUT
, "nbit", & HW_ENT (HW_H_NBIT
), CGEN_MODE_BI
, 0, 0, 0 },
634 { OUTPUT
, "h_memory_Ri", & HW_ENT (HW_H_MEMORY
), CGEN_MODE_SI
, 0, 0, 0 },
638 static const CGEN_OPERAND_INSTANCE fmt_andh_ops
[] = {
639 { INPUT
, "Ri", & HW_ENT (HW_H_GR
), CGEN_MODE_USI
, & OP_ENT (RI
), 0, 0 },
640 { INPUT
, "h_memory_Ri", & HW_ENT (HW_H_MEMORY
), CGEN_MODE_HI
, 0, 0, 0 },
641 { INPUT
, "Rj", & HW_ENT (HW_H_GR
), CGEN_MODE_HI
, & OP_ENT (RJ
), 0, 0 },
642 { OUTPUT
, "zbit", & HW_ENT (HW_H_ZBIT
), CGEN_MODE_BI
, 0, 0, 0 },
643 { OUTPUT
, "nbit", & HW_ENT (HW_H_NBIT
), CGEN_MODE_BI
, 0, 0, 0 },
644 { OUTPUT
, "h_memory_Ri", & HW_ENT (HW_H_MEMORY
), CGEN_MODE_HI
, 0, 0, 0 },
648 static const CGEN_OPERAND_INSTANCE fmt_andb_ops
[] = {
649 { INPUT
, "Ri", & HW_ENT (HW_H_GR
), CGEN_MODE_USI
, & OP_ENT (RI
), 0, 0 },
650 { INPUT
, "h_memory_Ri", & HW_ENT (HW_H_MEMORY
), CGEN_MODE_QI
, 0, 0, 0 },
651 { INPUT
, "Rj", & HW_ENT (HW_H_GR
), CGEN_MODE_QI
, & OP_ENT (RJ
), 0, 0 },
652 { OUTPUT
, "zbit", & HW_ENT (HW_H_ZBIT
), CGEN_MODE_BI
, 0, 0, 0 },
653 { OUTPUT
, "nbit", & HW_ENT (HW_H_NBIT
), CGEN_MODE_BI
, 0, 0, 0 },
654 { OUTPUT
, "h_memory_Ri", & HW_ENT (HW_H_MEMORY
), CGEN_MODE_QI
, 0, 0, 0 },
658 static const CGEN_OPERAND_INSTANCE fmt_ldi32_ops
[] = {
659 { INPUT
, "i32", & HW_ENT (HW_H_UINT
), CGEN_MODE_USI
, & OP_ENT (I32
), 0, 0 },
660 { OUTPUT
, "Ri", & HW_ENT (HW_H_GR
), CGEN_MODE_SI
, & OP_ENT (RI
), 0, 0 },
664 static const CGEN_OPERAND_INSTANCE fmt_mov2dr_ops
[] = {
665 { INPUT
, "Ri", & HW_ENT (HW_H_GR
), CGEN_MODE_SI
, & OP_ENT (RI
), 0, 0 },
666 { OUTPUT
, "Rs1", & HW_ENT (HW_H_DR
), CGEN_MODE_USI
, & OP_ENT (RS1
), 0, 0 },
670 static const CGEN_OPERAND_INSTANCE fmt_int_ops
[] = {
671 { INPUT
, "pc", & HW_ENT (HW_H_PC
), CGEN_MODE_SI
, 0, 0, 0 },
672 { INPUT
, "u8", & HW_ENT (HW_H_UINT
), CGEN_MODE_SI
, & OP_ENT (U8
), 0, 0 },
673 { OUTPUT
, "h_dr_2", & HW_ENT (HW_H_DR
), CGEN_MODE_USI
, 0, 2, 0 },
674 { OUTPUT
, "ibit", & HW_ENT (HW_H_IBIT
), CGEN_MODE_BI
, 0, 0, 0 },
675 { OUTPUT
, "sbit", & HW_ENT (HW_H_SBIT
), CGEN_MODE_BI
, 0, 0, 0 },
676 { OUTPUT
, "pc", & HW_ENT (HW_H_PC
), CGEN_MODE_SI
, 0, 0, 0 },
680 static const CGEN_OPERAND_INSTANCE fmt_reti_ops
[] = {
681 { INPUT
, "sbit", & HW_ENT (HW_H_SBIT
), CGEN_MODE_BI
, 0, 0, 0 },
682 { INPUT
, "h_dr_2", & HW_ENT (HW_H_DR
), CGEN_MODE_USI
, 0, 2, COND_REF
},
683 { INPUT
, "h_memory_reg__VM_h_dr_2", & HW_ENT (HW_H_MEMORY
), CGEN_MODE_USI
, 0, 0, COND_REF
},
684 { INPUT
, "h_dr_3", & HW_ENT (HW_H_DR
), CGEN_MODE_USI
, 0, 3, COND_REF
},
685 { INPUT
, "h_memory_reg__VM_h_dr_3", & HW_ENT (HW_H_MEMORY
), CGEN_MODE_USI
, 0, 0, COND_REF
},
686 { OUTPUT
, "pc", & HW_ENT (HW_H_PC
), CGEN_MODE_USI
, 0, 0, COND_REF
},
687 { OUTPUT
, "h_dr_2", & HW_ENT (HW_H_DR
), CGEN_MODE_USI
, 0, 2, COND_REF
},
688 { OUTPUT
, "ps", & HW_ENT (HW_H_PS
), CGEN_MODE_USI
, 0, 0, COND_REF
},
689 { OUTPUT
, "h_dr_3", & HW_ENT (HW_H_DR
), CGEN_MODE_USI
, 0, 3, COND_REF
},
697 #define A(a) (1 << CONCAT2 (CGEN_INSN_,a))
698 #define MNEM CGEN_SYNTAX_MNEMONIC /* syntax value for mnemonic */
699 #define OP(field) CGEN_SYNTAX_MAKE_FIELD (OPERAND (field))
701 /* The instruction table.
702 This is currently non-static because the simulator accesses it
705 const CGEN_INSN fr30_cgen_insn_table_entries
[MAX_INSNS
] =
707 /* Special null first entry.
708 A `num' value of zero is thus invalid.
709 Also, the special `invalid' insn resides here. */
714 FR30_INSN_ADD
, "add", "add",
715 { { MNEM
, ' ', OP (RJ
), ',', OP (RI
), 0 } },
716 { 16, 16, 0xff00 }, 0xa600,
717 (PTR
) & fmt_add_ops
[0],
723 FR30_INSN_ADDI
, "addi", "add",
724 { { MNEM
, ' ', OP (U4
), ',', OP (RI
), 0 } },
725 { 16, 16, 0xff00 }, 0xa400,
726 (PTR
) & fmt_addi_ops
[0],
732 FR30_INSN_ADD2
, "add2", "add2",
733 { { MNEM
, ' ', OP (M4
), ',', OP (RI
), 0 } },
734 { 16, 16, 0xff00 }, 0xa500,
735 (PTR
) & fmt_add2_ops
[0],
741 FR30_INSN_ADDC
, "addc", "addc",
742 { { MNEM
, ' ', OP (RJ
), ',', OP (RI
), 0 } },
743 { 16, 16, 0xff00 }, 0xa700,
744 (PTR
) & fmt_addc_ops
[0],
750 FR30_INSN_ADDN
, "addn", "addn",
751 { { MNEM
, ' ', OP (RJ
), ',', OP (RI
), 0 } },
752 { 16, 16, 0xff00 }, 0xa200,
753 (PTR
) & fmt_addn_ops
[0],
759 FR30_INSN_ADDNI
, "addni", "addn",
760 { { MNEM
, ' ', OP (U4
), ',', OP (RI
), 0 } },
761 { 16, 16, 0xff00 }, 0xa000,
762 (PTR
) & fmt_addni_ops
[0],
768 FR30_INSN_ADDN2
, "addn2", "addn2",
769 { { MNEM
, ' ', OP (M4
), ',', OP (RI
), 0 } },
770 { 16, 16, 0xff00 }, 0xa100,
771 (PTR
) & fmt_addn2_ops
[0],
777 FR30_INSN_SUB
, "sub", "sub",
778 { { MNEM
, ' ', OP (RJ
), ',', OP (RI
), 0 } },
779 { 16, 16, 0xff00 }, 0xac00,
780 (PTR
) & fmt_add_ops
[0],
786 FR30_INSN_SUBC
, "subc", "subc",
787 { { MNEM
, ' ', OP (RJ
), ',', OP (RI
), 0 } },
788 { 16, 16, 0xff00 }, 0xad00,
789 (PTR
) & fmt_addc_ops
[0],
795 FR30_INSN_SUBN
, "subn", "subn",
796 { { MNEM
, ' ', OP (RJ
), ',', OP (RI
), 0 } },
797 { 16, 16, 0xff00 }, 0xae00,
798 (PTR
) & fmt_addn_ops
[0],
804 FR30_INSN_CMP
, "cmp", "cmp",
805 { { MNEM
, ' ', OP (RJ
), ',', OP (RI
), 0 } },
806 { 16, 16, 0xff00 }, 0xaa00,
807 (PTR
) & fmt_cmp_ops
[0],
813 FR30_INSN_CMPI
, "cmpi", "cmp",
814 { { MNEM
, ' ', OP (U4
), ',', OP (RI
), 0 } },
815 { 16, 16, 0xff00 }, 0xa800,
816 (PTR
) & fmt_cmpi_ops
[0],
822 FR30_INSN_CMP2
, "cmp2", "cmp2",
823 { { MNEM
, ' ', OP (M4
), ',', OP (RI
), 0 } },
824 { 16, 16, 0xff00 }, 0xa900,
825 (PTR
) & fmt_cmp2_ops
[0],
831 FR30_INSN_AND
, "and", "and",
832 { { MNEM
, ' ', OP (RJ
), ',', OP (RI
), 0 } },
833 { 16, 16, 0xff00 }, 0x8200,
834 (PTR
) & fmt_and_ops
[0],
840 FR30_INSN_OR
, "or", "or",
841 { { MNEM
, ' ', OP (RJ
), ',', OP (RI
), 0 } },
842 { 16, 16, 0xff00 }, 0x9200,
843 (PTR
) & fmt_and_ops
[0],
849 FR30_INSN_EOR
, "eor", "eor",
850 { { MNEM
, ' ', OP (RJ
), ',', OP (RI
), 0 } },
851 { 16, 16, 0xff00 }, 0x9a00,
852 (PTR
) & fmt_and_ops
[0],
858 FR30_INSN_ANDM
, "andm", "and",
859 { { MNEM
, ' ', OP (RJ
), ',', '@', OP (RI
), 0 } },
860 { 16, 16, 0xff00 }, 0x8400,
861 (PTR
) & fmt_andm_ops
[0],
867 FR30_INSN_ANDH
, "andh", "andh",
868 { { MNEM
, ' ', OP (RJ
), ',', '@', OP (RI
), 0 } },
869 { 16, 16, 0xff00 }, 0x8500,
870 (PTR
) & fmt_andh_ops
[0],
876 FR30_INSN_ANDB
, "andb", "andb",
877 { { MNEM
, ' ', OP (RJ
), ',', '@', OP (RI
), 0 } },
878 { 16, 16, 0xff00 }, 0x8600,
879 (PTR
) & fmt_andb_ops
[0],
885 FR30_INSN_ORM
, "orm", "or",
886 { { MNEM
, ' ', OP (RJ
), ',', '@', OP (RI
), 0 } },
887 { 16, 16, 0xff00 }, 0x9400,
888 (PTR
) & fmt_andm_ops
[0],
894 FR30_INSN_ORH
, "orh", "orh",
895 { { MNEM
, ' ', OP (RJ
), ',', '@', OP (RI
), 0 } },
896 { 16, 16, 0xff00 }, 0x9500,
897 (PTR
) & fmt_andh_ops
[0],
903 FR30_INSN_ORB
, "orb", "orb",
904 { { MNEM
, ' ', OP (RJ
), ',', '@', OP (RI
), 0 } },
905 { 16, 16, 0xff00 }, 0x9600,
906 (PTR
) & fmt_andb_ops
[0],
912 FR30_INSN_EORM
, "eorm", "eor",
913 { { MNEM
, ' ', OP (RJ
), ',', '@', OP (RI
), 0 } },
914 { 16, 16, 0xff00 }, 0x9c00,
915 (PTR
) & fmt_andm_ops
[0],
921 FR30_INSN_EORH
, "eorh", "eorh",
922 { { MNEM
, ' ', OP (RJ
), ',', '@', OP (RI
), 0 } },
923 { 16, 16, 0xff00 }, 0x9d00,
924 (PTR
) & fmt_andh_ops
[0],
930 FR30_INSN_EORB
, "eorb", "eorb",
931 { { MNEM
, ' ', OP (RJ
), ',', '@', OP (RI
), 0 } },
932 { 16, 16, 0xff00 }, 0x9e00,
933 (PTR
) & fmt_andb_ops
[0],
939 FR30_INSN_BANDL
, "bandl", "bandl",
940 { { MNEM
, ' ', OP (U4
), ',', '@', OP (RI
), 0 } },
941 { 16, 16, 0xff00 }, 0x8000,
948 FR30_INSN_BORL
, "borl", "borl",
949 { { MNEM
, ' ', OP (U4
), ',', '@', OP (RI
), 0 } },
950 { 16, 16, 0xff00 }, 0x9000,
957 FR30_INSN_BEORL
, "beorl", "beorl",
958 { { MNEM
, ' ', OP (U4
), ',', '@', OP (RI
), 0 } },
959 { 16, 16, 0xff00 }, 0x9800,
966 FR30_INSN_BANDH
, "bandh", "bandh",
967 { { MNEM
, ' ', OP (U4
), ',', '@', OP (RI
), 0 } },
968 { 16, 16, 0xff00 }, 0x8100,
975 FR30_INSN_BORH
, "borh", "borh",
976 { { MNEM
, ' ', OP (U4
), ',', '@', OP (RI
), 0 } },
977 { 16, 16, 0xff00 }, 0x9100,
984 FR30_INSN_BEORH
, "beorh", "beorh",
985 { { MNEM
, ' ', OP (U4
), ',', '@', OP (RI
), 0 } },
986 { 16, 16, 0xff00 }, 0x9900,
993 FR30_INSN_BTSTL
, "btstl", "btstl",
994 { { MNEM
, ' ', OP (U4
), ',', '@', OP (RI
), 0 } },
995 { 16, 16, 0xff00 }, 0x8800,
1002 FR30_INSN_BTSTH
, "btsth", "btsth",
1003 { { MNEM
, ' ', OP (U4
), ',', '@', OP (RI
), 0 } },
1004 { 16, 16, 0xff00 }, 0x8900,
1011 FR30_INSN_MUL
, "mul", "mul",
1012 { { MNEM
, ' ', OP (RJ
), ',', OP (RI
), 0 } },
1013 { 16, 16, 0xff00 }, 0xaf00,
1020 FR30_INSN_MULU
, "mulu", "mulu",
1021 { { MNEM
, ' ', OP (RJ
), ',', OP (RI
), 0 } },
1022 { 16, 16, 0xff00 }, 0xab00,
1029 FR30_INSN_MULH
, "mulh", "mulh",
1030 { { MNEM
, ' ', OP (RJ
), ',', OP (RI
), 0 } },
1031 { 16, 16, 0xff00 }, 0xbf00,
1038 FR30_INSN_MULUH
, "muluh", "muluh",
1039 { { MNEM
, ' ', OP (RJ
), ',', OP (RI
), 0 } },
1040 { 16, 16, 0xff00 }, 0xbb00,
1047 FR30_INSN_DIV0S
, "div0s", "div0s",
1048 { { MNEM
, ' ', OP (RI
), 0 } },
1049 { 16, 16, 0xfff0 }, 0x9740,
1056 FR30_INSN_DIV0U
, "div0u", "div0u",
1057 { { MNEM
, ' ', OP (RI
), 0 } },
1058 { 16, 16, 0xfff0 }, 0x9750,
1065 FR30_INSN_DIV1
, "div1", "div1",
1066 { { MNEM
, ' ', OP (RI
), 0 } },
1067 { 16, 16, 0xfff0 }, 0x9760,
1074 FR30_INSN_DIV2
, "div2", "div2",
1075 { { MNEM
, ' ', OP (RI
), 0 } },
1076 { 16, 16, 0xfff0 }, 0x9770,
1083 FR30_INSN_DIV3
, "div3", "div3",
1085 { 16, 16, 0xffff }, 0x9f60,
1092 FR30_INSN_DIV4S
, "div4s", "div4s",
1094 { 16, 16, 0xffff }, 0x9f70,
1101 FR30_INSN_LSL
, "lsl", "lsl",
1102 { { MNEM
, ' ', OP (RJ
), ',', OP (RI
), 0 } },
1103 { 16, 16, 0xff00 }, 0xb600,
1110 FR30_INSN_LSLI
, "lsli", "lsl",
1111 { { MNEM
, ' ', OP (U4
), ',', OP (RI
), 0 } },
1112 { 16, 16, 0xff00 }, 0xb400,
1119 FR30_INSN_LSL2
, "lsl2", "lsl2",
1120 { { MNEM
, ' ', OP (U4
), ',', OP (RI
), 0 } },
1121 { 16, 16, 0xff00 }, 0xb500,
1128 FR30_INSN_LSR
, "lsr", "lsr",
1129 { { MNEM
, ' ', OP (RJ
), ',', OP (RI
), 0 } },
1130 { 16, 16, 0xff00 }, 0xb200,
1137 FR30_INSN_LSRI
, "lsri", "lsr",
1138 { { MNEM
, ' ', OP (U4
), ',', OP (RI
), 0 } },
1139 { 16, 16, 0xff00 }, 0xb000,
1146 FR30_INSN_LSR2
, "lsr2", "lsr2",
1147 { { MNEM
, ' ', OP (U4
), ',', OP (RI
), 0 } },
1148 { 16, 16, 0xff00 }, 0xb100,
1155 FR30_INSN_ASR
, "asr", "asr",
1156 { { MNEM
, ' ', OP (RJ
), ',', OP (RI
), 0 } },
1157 { 16, 16, 0xff00 }, 0xba00,
1164 FR30_INSN_ASRI
, "asri", "asr",
1165 { { MNEM
, ' ', OP (U4
), ',', OP (RI
), 0 } },
1166 { 16, 16, 0xff00 }, 0xb800,
1173 FR30_INSN_ASR2
, "asr2", "asr2",
1174 { { MNEM
, ' ', OP (U4
), ',', OP (RI
), 0 } },
1175 { 16, 16, 0xff00 }, 0xb900,
1182 FR30_INSN_LDI_8
, "ldi:8", "ldi:8",
1183 { { MNEM
, ' ', OP (I8
), ',', OP (RI
), 0 } },
1184 { 16, 16, 0xf000 }, 0xc000,
1188 /* ldi:32 $i32,$Ri */
1191 FR30_INSN_LDI32
, "ldi32", "ldi:32",
1192 { { MNEM
, ' ', OP (I32
), ',', OP (RI
), 0 } },
1193 { 16, 48, 0xfff0 }, 0x9f80,
1194 (PTR
) & fmt_ldi32_ops
[0],
1200 FR30_INSN_LD
, "ld", "ld",
1201 { { MNEM
, ' ', '@', OP (RJ
), ',', OP (RI
), 0 } },
1202 { 16, 16, 0xff00 }, 0x400,
1209 FR30_INSN_LDUH
, "lduh", "lduh",
1210 { { MNEM
, ' ', '@', OP (RJ
), ',', OP (RI
), 0 } },
1211 { 16, 16, 0xff00 }, 0x500,
1218 FR30_INSN_LDUB
, "ldub", "ldub",
1219 { { MNEM
, ' ', '@', OP (RJ
), ',', OP (RI
), 0 } },
1220 { 16, 16, 0xff00 }, 0x600,
1224 /* ld @($r13,$Rj),$Ri */
1227 FR30_INSN_LDR13
, "ldr13", "ld",
1228 { { MNEM
, ' ', '@', '(', OP (R13
), ',', OP (RJ
), ')', ',', OP (RI
), 0 } },
1229 { 16, 16, 0xff00 }, 0x0,
1233 /* lduh @($r13,$Rj),$Ri */
1236 FR30_INSN_LDR13UH
, "ldr13uh", "lduh",
1237 { { MNEM
, ' ', '@', '(', OP (R13
), ',', OP (RJ
), ')', ',', OP (RI
), 0 } },
1238 { 16, 16, 0xff00 }, 0x100,
1242 /* ldub @($r13,$Rj),$Ri */
1245 FR30_INSN_LDR13UB
, "ldr13ub", "ldub",
1246 { { MNEM
, ' ', '@', '(', OP (R13
), ',', OP (RJ
), ')', ',', OP (RI
), 0 } },
1247 { 16, 16, 0xff00 }, 0x200,
1251 /* ld @($r14,$disp10),$Ri */
1254 FR30_INSN_LDR14
, "ldr14", "ld",
1255 { { MNEM
, ' ', '@', '(', OP (R14
), ',', OP (DISP10
), ')', ',', OP (RI
), 0 } },
1256 { 16, 16, 0xf000 }, 0x2000,
1260 /* lduh @($r14,$disp9),$Ri */
1263 FR30_INSN_LDR14UH
, "ldr14uh", "lduh",
1264 { { MNEM
, ' ', '@', '(', OP (R14
), ',', OP (DISP9
), ')', ',', OP (RI
), 0 } },
1265 { 16, 16, 0xf000 }, 0x4000,
1269 /* ldub @($r14,$disp8),$Ri */
1272 FR30_INSN_LDR14UB
, "ldr14ub", "ldub",
1273 { { MNEM
, ' ', '@', '(', OP (R14
), ',', OP (DISP8
), ')', ',', OP (RI
), 0 } },
1274 { 16, 16, 0xf000 }, 0x6000,
1278 /* ld @($r15,$udisp6),$Ri */
1281 FR30_INSN_LDR15
, "ldr15", "ld",
1282 { { MNEM
, ' ', '@', '(', OP (R15
), ',', OP (UDISP6
), ')', ',', OP (RI
), 0 } },
1283 { 16, 16, 0xff00 }, 0x300,
1290 FR30_INSN_LDR15GR
, "ldr15gr", "ld",
1291 { { MNEM
, ' ', '@', OP (R15
), '+', ',', OP (RI
), 0 } },
1292 { 16, 16, 0xfff0 }, 0x700,
1296 /* ld @$r15+,$Rs2 */
1299 FR30_INSN_LDR15DR
, "ldr15dr", "ld",
1300 { { MNEM
, ' ', '@', OP (R15
), '+', ',', OP (RS2
), 0 } },
1301 { 16, 16, 0xfff0 }, 0x780,
1308 FR30_INSN_LDR15PS
, "ldr15ps", "ld",
1309 { { MNEM
, ' ', '@', OP (R15
), '+', ',', OP (PS
), 0 } },
1310 { 16, 16, 0xffff }, 0x790,
1317 FR30_INSN_ST
, "st", "st",
1318 { { MNEM
, ' ', OP (RI
), ',', '@', OP (RJ
), 0 } },
1319 { 16, 16, 0xff00 }, 0x1400,
1326 FR30_INSN_STH
, "sth", "sth",
1327 { { MNEM
, ' ', OP (RI
), ',', '@', OP (RJ
), 0 } },
1328 { 16, 16, 0xff00 }, 0x1500,
1335 FR30_INSN_STB
, "stb", "stb",
1336 { { MNEM
, ' ', OP (RI
), ',', '@', OP (RJ
), 0 } },
1337 { 16, 16, 0xff00 }, 0x1600,
1341 /* st $Ri,@($r13,$Rj) */
1344 FR30_INSN_STR13
, "str13", "st",
1345 { { MNEM
, ' ', OP (RI
), ',', '@', '(', OP (R13
), ',', OP (RJ
), ')', 0 } },
1346 { 16, 16, 0xff00 }, 0x1000,
1350 /* sth $Ri,@($r13,$Rj) */
1353 FR30_INSN_STR13H
, "str13h", "sth",
1354 { { MNEM
, ' ', OP (RI
), ',', '@', '(', OP (R13
), ',', OP (RJ
), ')', 0 } },
1355 { 16, 16, 0xff00 }, 0x1100,
1359 /* stb $Ri,@($r13,$Rj) */
1362 FR30_INSN_STR13B
, "stR13b", "stb",
1363 { { MNEM
, ' ', OP (RI
), ',', '@', '(', OP (R13
), ',', OP (RJ
), ')', 0 } },
1364 { 16, 16, 0xff00 }, 0x1200,
1368 /* st $Ri,@($r14,$disp10) */
1371 FR30_INSN_STR14
, "str14", "st",
1372 { { MNEM
, ' ', OP (RI
), ',', '@', '(', OP (R14
), ',', OP (DISP10
), ')', 0 } },
1373 { 16, 16, 0xf000 }, 0x3000,
1377 /* sth $Ri,@($r14,$disp9) */
1380 FR30_INSN_STR14H
, "str14h", "sth",
1381 { { MNEM
, ' ', OP (RI
), ',', '@', '(', OP (R14
), ',', OP (DISP9
), ')', 0 } },
1382 { 16, 16, 0xf000 }, 0x5000,
1386 /* stb $Ri,@($r14,$disp8) */
1389 FR30_INSN_STR14B
, "str14b", "stb",
1390 { { MNEM
, ' ', OP (RI
), ',', '@', '(', OP (R14
), ',', OP (DISP8
), ')', 0 } },
1391 { 16, 16, 0xf000 }, 0x7000,
1395 /* st $Ri,@($r15,$udisp6) */
1398 FR30_INSN_STR15
, "str15", "st",
1399 { { MNEM
, ' ', OP (RI
), ',', '@', '(', OP (R15
), ',', OP (UDISP6
), ')', 0 } },
1400 { 16, 16, 0xff00 }, 0x1300,
1407 FR30_INSN_STR15GR
, "str15gr", "st",
1408 { { MNEM
, ' ', OP (RI
), ',', '@', '-', OP (R15
), 0 } },
1409 { 16, 16, 0xfff0 }, 0x1700,
1413 /* st $Rs2,@-$r15 */
1416 FR30_INSN_STR15DR
, "str15dr", "st",
1417 { { MNEM
, ' ', OP (RS2
), ',', '@', '-', OP (R15
), 0 } },
1418 { 16, 16, 0xfff0 }, 0x1780,
1425 FR30_INSN_STR15PS
, "str15ps", "st",
1426 { { MNEM
, ' ', OP (PS
), ',', '@', '-', OP (R15
), 0 } },
1427 { 16, 16, 0xffff }, 0x1790,
1434 FR30_INSN_MOV
, "mov", "mov",
1435 { { MNEM
, ' ', OP (RJ
), ',', OP (RI
), 0 } },
1436 { 16, 16, 0xff00 }, 0x8b00,
1443 FR30_INSN_MOVDR
, "movdr", "mov",
1444 { { MNEM
, ' ', OP (RS1
), ',', OP (RI
), 0 } },
1445 { 16, 16, 0xff00 }, 0xb700,
1452 FR30_INSN_MOVPS
, "movps", "mov",
1453 { { MNEM
, ' ', OP (PS
), ',', OP (RI
), 0 } },
1454 { 16, 16, 0xfff0 }, 0x1710,
1461 FR30_INSN_MOV2DR
, "mov2dr", "mov",
1462 { { MNEM
, ' ', OP (RI
), ',', OP (RS1
), 0 } },
1463 { 16, 16, 0xff00 }, 0xb300,
1464 (PTR
) & fmt_mov2dr_ops
[0],
1470 FR30_INSN_MOV2PS
, "mov2ps", "mov",
1471 { { MNEM
, ' ', OP (RI
), ',', OP (PS
), 0 } },
1472 { 16, 16, 0xfff0 }, 0x710,
1479 FR30_INSN_JMP
, "jmp", "jmp",
1480 { { MNEM
, ' ', '@', OP (RI
), 0 } },
1481 { 16, 16, 0xfff0 }, 0x9700,
1488 FR30_INSN_JMPD
, "jmpd", "jmp:D",
1489 { { MNEM
, ' ', '@', OP (RI
), 0 } },
1490 { 16, 16, 0xfff0 }, 0x9f00,
1497 FR30_INSN_CALLR
, "callr", "call",
1498 { { MNEM
, ' ', '@', OP (RI
), 0 } },
1499 { 16, 16, 0xfff0 }, 0x9710,
1506 FR30_INSN_CALLRD
, "callrd", "call:D",
1507 { { MNEM
, ' ', '@', OP (RI
), 0 } },
1508 { 16, 16, 0xfff0 }, 0x9f10,
1515 FR30_INSN_CALL
, "call", "call",
1516 { { MNEM
, ' ', OP (LABEL12
), 0 } },
1517 { 16, 16, 0xf400 }, 0xd000,
1521 /* call:D $label12 */
1524 FR30_INSN_CALLD
, "calld", "call:D",
1525 { { MNEM
, ' ', OP (LABEL12
), 0 } },
1526 { 16, 16, 0xf400 }, 0xd400,
1533 FR30_INSN_RET
, "ret", "ret",
1535 { 16, 16, 0xffff }, 0x9720,
1542 FR30_INSN_RETD
, "retd", "ret:D",
1544 { 16, 16, 0xffff }, 0x9f20,
1551 FR30_INSN_INT
, "int", "int",
1552 { { MNEM
, ' ', OP (U8
), 0 } },
1553 { 16, 16, 0xff00 }, 0x1f00,
1554 (PTR
) & fmt_int_ops
[0],
1555 { 0, 0|A(UNCOND_CTI
), { 0 } }
1560 FR30_INSN_INTE
, "inte", "inte",
1562 { 16, 16, 0xffff }, 0x9f30,
1569 FR30_INSN_RETI
, "reti", "reti",
1571 { 16, 16, 0xffff }, 0x9730,
1572 (PTR
) & fmt_reti_ops
[0],
1573 { 0, 0|A(COND_CTI
)|A(COND_CTI
), { 0 } }
1578 FR30_INSN_BRA
, "bra", "bra",
1579 { { MNEM
, ' ', OP (LABEL9
), 0 } },
1580 { 16, 16, 0xff00 }, 0xe000,
1587 FR30_INSN_BNO
, "bno", "bno",
1588 { { MNEM
, ' ', OP (LABEL9
), 0 } },
1589 { 16, 16, 0xff00 }, 0xe100,
1596 FR30_INSN_BEQ
, "beq", "beq",
1597 { { MNEM
, ' ', OP (LABEL9
), 0 } },
1598 { 16, 16, 0xff00 }, 0xe200,
1605 FR30_INSN_BNE
, "bne", "bne",
1606 { { MNEM
, ' ', OP (LABEL9
), 0 } },
1607 { 16, 16, 0xff00 }, 0xe300,
1614 FR30_INSN_BC
, "bc", "bc",
1615 { { MNEM
, ' ', OP (LABEL9
), 0 } },
1616 { 16, 16, 0xff00 }, 0xe400,
1623 FR30_INSN_BNC
, "bnc", "bnc",
1624 { { MNEM
, ' ', OP (LABEL9
), 0 } },
1625 { 16, 16, 0xff00 }, 0xe500,
1632 FR30_INSN_BN
, "bn", "bn",
1633 { { MNEM
, ' ', OP (LABEL9
), 0 } },
1634 { 16, 16, 0xff00 }, 0xe600,
1641 FR30_INSN_BP
, "bp", "bp",
1642 { { MNEM
, ' ', OP (LABEL9
), 0 } },
1643 { 16, 16, 0xff00 }, 0xe700,
1650 FR30_INSN_BV
, "bv", "bv",
1651 { { MNEM
, ' ', OP (LABEL9
), 0 } },
1652 { 16, 16, 0xff00 }, 0xe800,
1659 FR30_INSN_BNV
, "bnv", "bnv",
1660 { { MNEM
, ' ', OP (LABEL9
), 0 } },
1661 { 16, 16, 0xff00 }, 0xe900,
1668 FR30_INSN_BLT
, "blt", "blt",
1669 { { MNEM
, ' ', OP (LABEL9
), 0 } },
1670 { 16, 16, 0xff00 }, 0xea00,
1677 FR30_INSN_BGE
, "bge", "bge",
1678 { { MNEM
, ' ', OP (LABEL9
), 0 } },
1679 { 16, 16, 0xff00 }, 0xeb00,
1686 FR30_INSN_BLE
, "ble", "ble",
1687 { { MNEM
, ' ', OP (LABEL9
), 0 } },
1688 { 16, 16, 0xff00 }, 0xec00,
1695 FR30_INSN_BGT
, "bgt", "bgt",
1696 { { MNEM
, ' ', OP (LABEL9
), 0 } },
1697 { 16, 16, 0xff00 }, 0xed00,
1704 FR30_INSN_BLS
, "bls", "bls",
1705 { { MNEM
, ' ', OP (LABEL9
), 0 } },
1706 { 16, 16, 0xff00 }, 0xee00,
1713 FR30_INSN_BHI
, "bhi", "bhi",
1714 { { MNEM
, ' ', OP (LABEL9
), 0 } },
1715 { 16, 16, 0xff00 }, 0xef00,
1722 FR30_INSN_BRAD
, "brad", "bra:D",
1723 { { MNEM
, ' ', OP (LABEL9
), 0 } },
1724 { 16, 16, 0xff00 }, 0xf000,
1731 FR30_INSN_BNOD
, "bnod", "bno:D",
1732 { { MNEM
, ' ', OP (LABEL9
), 0 } },
1733 { 16, 16, 0xff00 }, 0xf100,
1740 FR30_INSN_BEQD
, "beqd", "beq:D",
1741 { { MNEM
, ' ', OP (LABEL9
), 0 } },
1742 { 16, 16, 0xff00 }, 0xf200,
1749 FR30_INSN_BNED
, "bned", "bne:D",
1750 { { MNEM
, ' ', OP (LABEL9
), 0 } },
1751 { 16, 16, 0xff00 }, 0xf300,
1758 FR30_INSN_BCD
, "bcd", "bc:D",
1759 { { MNEM
, ' ', OP (LABEL9
), 0 } },
1760 { 16, 16, 0xff00 }, 0xf400,
1767 FR30_INSN_BNCD
, "bncd", "bnc:D",
1768 { { MNEM
, ' ', OP (LABEL9
), 0 } },
1769 { 16, 16, 0xff00 }, 0xf500,
1776 FR30_INSN_BND
, "bnd", "bn:D",
1777 { { MNEM
, ' ', OP (LABEL9
), 0 } },
1778 { 16, 16, 0xff00 }, 0xf600,
1785 FR30_INSN_BPD
, "bpd", "bp:D",
1786 { { MNEM
, ' ', OP (LABEL9
), 0 } },
1787 { 16, 16, 0xff00 }, 0xf700,
1794 FR30_INSN_BVD
, "bvd", "bv:D",
1795 { { MNEM
, ' ', OP (LABEL9
), 0 } },
1796 { 16, 16, 0xff00 }, 0xf800,
1803 FR30_INSN_BNVD
, "bnvd", "bnv:D",
1804 { { MNEM
, ' ', OP (LABEL9
), 0 } },
1805 { 16, 16, 0xff00 }, 0xf900,
1812 FR30_INSN_BLTD
, "bltd", "blt:D",
1813 { { MNEM
, ' ', OP (LABEL9
), 0 } },
1814 { 16, 16, 0xff00 }, 0xfa00,
1821 FR30_INSN_BGED
, "bged", "bge:D",
1822 { { MNEM
, ' ', OP (LABEL9
), 0 } },
1823 { 16, 16, 0xff00 }, 0xfb00,
1830 FR30_INSN_BLED
, "bled", "ble:D",
1831 { { MNEM
, ' ', OP (LABEL9
), 0 } },
1832 { 16, 16, 0xff00 }, 0xfc00,
1839 FR30_INSN_BGTD
, "bgtd", "bgt:D",
1840 { { MNEM
, ' ', OP (LABEL9
), 0 } },
1841 { 16, 16, 0xff00 }, 0xfd00,
1848 FR30_INSN_BLSD
, "blsd", "bls:D",
1849 { { MNEM
, ' ', OP (LABEL9
), 0 } },
1850 { 16, 16, 0xff00 }, 0xfe00,
1857 FR30_INSN_BHID
, "bhid", "bhi:D",
1858 { { MNEM
, ' ', OP (LABEL9
), 0 } },
1859 { 16, 16, 0xff00 }, 0xff00,
1863 /* dmov $R13,@$dir10 */
1866 FR30_INSN_DMOVR13
, "dmovr13", "dmov",
1867 { { MNEM
, ' ', OP (R13
), ',', '@', OP (DIR10
), 0 } },
1868 { 16, 16, 0xff00 }, 0x1800,
1872 /* dmovh $R13,@$dir9 */
1875 FR30_INSN_DMOVR13H
, "dmovr13h", "dmovh",
1876 { { MNEM
, ' ', OP (R13
), ',', '@', OP (DIR9
), 0 } },
1877 { 16, 16, 0xff00 }, 0x1900,
1881 /* dmovb $R13,@$dir8 */
1884 FR30_INSN_DMOVR13B
, "dmovr13b", "dmovb",
1885 { { MNEM
, ' ', OP (R13
), ',', '@', OP (DIR8
), 0 } },
1886 { 16, 16, 0xff00 }, 0x1a00,
1890 /* dmov @$R13+,@$dir10 */
1893 FR30_INSN_DMOVR13PI
, "dmovr13pi", "dmov",
1894 { { MNEM
, ' ', '@', OP (R13
), '+', ',', '@', OP (DIR10
), 0 } },
1895 { 16, 16, 0xff00 }, 0x1c00,
1899 /* dmovh @$R13+,@$dir9 */
1902 FR30_INSN_DMOVR13PIH
, "dmovr13pih", "dmovh",
1903 { { MNEM
, ' ', '@', OP (R13
), '+', ',', '@', OP (DIR9
), 0 } },
1904 { 16, 16, 0xff00 }, 0x1d00,
1908 /* dmovb @$R13+,@$dir8 */
1911 FR30_INSN_DMOVR13PIB
, "dmovr13pib", "dmovb",
1912 { { MNEM
, ' ', '@', OP (R13
), '+', ',', '@', OP (DIR8
), 0 } },
1913 { 16, 16, 0xff00 }, 0x1e00,
1917 /* dmov @$R15+,@$dir10 */
1920 FR30_INSN_DMOVR15PI
, "dmovr15pi", "dmov",
1921 { { MNEM
, ' ', '@', OP (R15
), '+', ',', '@', OP (DIR10
), 0 } },
1922 { 16, 16, 0xff00 }, 0x1b00,
1926 /* dmov @$dir10,$R13 */
1929 FR30_INSN_DMOV2R13
, "dmov2r13", "dmov",
1930 { { MNEM
, ' ', '@', OP (DIR10
), ',', OP (R13
), 0 } },
1931 { 16, 16, 0xff00 }, 0x800,
1935 /* dmovh @$dir9,$R13 */
1938 FR30_INSN_DMOV2R13H
, "dmov2r13h", "dmovh",
1939 { { MNEM
, ' ', '@', OP (DIR9
), ',', OP (R13
), 0 } },
1940 { 16, 16, 0xff00 }, 0x900,
1944 /* dmovb @$dir8,$R13 */
1947 FR30_INSN_DMOV2R13B
, "dmov2r13b", "dmovb",
1948 { { MNEM
, ' ', '@', OP (DIR8
), ',', OP (R13
), 0 } },
1949 { 16, 16, 0xff00 }, 0xa00,
1953 /* dmov @$dir10,@$R13+ */
1956 FR30_INSN_DMOV2R13PI
, "dmov2r13pi", "dmov",
1957 { { MNEM
, ' ', '@', OP (DIR10
), ',', '@', OP (R13
), '+', 0 } },
1958 { 16, 16, 0xff00 }, 0xc00,
1962 /* dmovh @$dir9,@$R13+ */
1965 FR30_INSN_DMOV2R13PIH
, "dmov2r13pih", "dmovh",
1966 { { MNEM
, ' ', '@', OP (DIR9
), ',', '@', OP (R13
), '+', 0 } },
1967 { 16, 16, 0xff00 }, 0xd00,
1971 /* dmovb @$dir8,@$R13+ */
1974 FR30_INSN_DMOV2R13PIB
, "dmov2r13pib", "dmovb",
1975 { { MNEM
, ' ', '@', OP (DIR8
), ',', '@', OP (R13
), '+', 0 } },
1976 { 16, 16, 0xff00 }, 0xe00,
1980 /* dmov @$dir10,@-$R15 */
1983 FR30_INSN_DMOV2R15PD
, "dmov2r15pd", "dmov",
1984 { { MNEM
, ' ', '@', OP (DIR10
), ',', '@', '-', OP (R15
), 0 } },
1985 { 16, 16, 0xff00 }, 0xb00,
1989 /* ldres @$Ri+,$u4 */
1992 FR30_INSN_LDRES
, "ldres", "ldres",
1993 { { MNEM
, ' ', '@', OP (RI
), '+', ',', OP (U4
), 0 } },
1994 { 16, 16, 0xff00 }, 0xbc00,
1998 /* stres $u4,@$Ri+ */
2001 FR30_INSN_STRES
, "stres", "stres",
2002 { { MNEM
, ' ', OP (U4
), ',', '@', OP (RI
), '+', 0 } },
2003 { 16, 16, 0xff00 }, 0xbd00,
2007 /* copop $u4c,$ccc,$CRj,$CRi */
2010 FR30_INSN_COPOP
, "copop", "copop",
2011 { { MNEM
, ' ', OP (U4C
), ',', OP (CCC
), ',', OP (CRJ
), ',', OP (CRI
), 0 } },
2012 { 16, 32, 0xfff0 }, 0x9fc0,
2016 /* copld $u4c,$ccc,$Rjc,$CRi */
2019 FR30_INSN_COPLD
, "copld", "copld",
2020 { { MNEM
, ' ', OP (U4C
), ',', OP (CCC
), ',', OP (RJC
), ',', OP (CRI
), 0 } },
2021 { 16, 32, 0xfff0 }, 0x9fd0,
2025 /* copst $u4c,$ccc,$CRj,$Ric */
2028 FR30_INSN_COPST
, "copst", "copst",
2029 { { MNEM
, ' ', OP (U4C
), ',', OP (CCC
), ',', OP (CRJ
), ',', OP (RIC
), 0 } },
2030 { 16, 32, 0xfff0 }, 0x9fe0,
2034 /* copsv $u4c,$ccc,$CRj,$Ric */
2037 FR30_INSN_COPSV
, "copsv", "copsv",
2038 { { MNEM
, ' ', OP (U4C
), ',', OP (CCC
), ',', OP (CRJ
), ',', OP (RIC
), 0 } },
2039 { 16, 32, 0xfff0 }, 0x9ff0,
2046 FR30_INSN_NOP
, "nop", "nop",
2048 { 16, 16, 0xffff }, 0x9fa0,
2055 FR30_INSN_ANDCCR
, "andccr", "andccr",
2056 { { MNEM
, ' ', OP (U8
), 0 } },
2057 { 16, 16, 0xff00 }, 0x8300,
2064 FR30_INSN_ORCCR
, "orccr", "orccr",
2065 { { MNEM
, ' ', OP (U8
), 0 } },
2066 { 16, 16, 0xff00 }, 0x9300,
2073 FR30_INSN_STILM
, "stilm", "stilm",
2074 { { MNEM
, ' ', OP (U8
), 0 } },
2075 { 16, 16, 0xff00 }, 0x8700,
2082 FR30_INSN_ADDSP
, "addsp", "addsp",
2083 { { MNEM
, ' ', OP (S10
), 0 } },
2084 { 16, 16, 0xff00 }, 0xa300,
2091 FR30_INSN_EXTSB
, "extsb", "extsb",
2092 { { MNEM
, ' ', OP (RI
), 0 } },
2093 { 16, 16, 0xfff0 }, 0x9780,
2100 FR30_INSN_EXTUB
, "extub", "extub",
2101 { { MNEM
, ' ', OP (RI
), 0 } },
2102 { 16, 16, 0xfff0 }, 0x9790,
2109 FR30_INSN_EXTSH
, "extsh", "extsh",
2110 { { MNEM
, ' ', OP (RI
), 0 } },
2111 { 16, 16, 0xfff0 }, 0x97a0,
2118 FR30_INSN_EXTUH
, "extuh", "extuh",
2119 { { MNEM
, ' ', OP (RI
), 0 } },
2120 { 16, 16, 0xfff0 }, 0x97b0,
2124 /* ldm0 ($reglist_low) */
2127 FR30_INSN_LDM0
, "ldm0", "ldm0",
2128 { { MNEM
, ' ', '(', OP (REGLIST_LOW
), ')', 0 } },
2129 { 16, 16, 0xff00 }, 0x8c00,
2133 /* ldm1 ($reglist_hi) */
2136 FR30_INSN_LDM1
, "ldm1", "ldm1",
2137 { { MNEM
, ' ', '(', OP (REGLIST_HI
), ')', 0 } },
2138 { 16, 16, 0xff00 }, 0x8d00,
2142 /* stm0 ($reglist_low) */
2145 FR30_INSN_STM0
, "stm0", "stm0",
2146 { { MNEM
, ' ', '(', OP (REGLIST_LOW
), ')', 0 } },
2147 { 16, 16, 0xff00 }, 0x8e00,
2151 /* stm1 ($reglist_hi) */
2154 FR30_INSN_STM1
, "stm1", "stm1",
2155 { { MNEM
, ' ', '(', OP (REGLIST_HI
), ')', 0 } },
2156 { 16, 16, 0xff00 }, 0x8f00,
2163 FR30_INSN_ENTER
, "enter", "enter",
2164 { { MNEM
, ' ', OP (U10
), 0 } },
2165 { 16, 16, 0xff00 }, 0xf00,
2172 FR30_INSN_LEAVE
, "leave", "leave",
2174 { 16, 16, 0xffff }, 0x9f90,
2181 FR30_INSN_XCHB
, "xchb", "xchb",
2182 { { MNEM
, ' ', '@', OP (RJ
), ',', OP (RI
), 0 } },
2183 { 16, 16, 0xff00 }, 0x8a00,
2193 static const CGEN_INSN_TABLE insn_table
=
2195 & fr30_cgen_insn_table_entries
[0],
2201 /* Each non-simple macro entry points to an array of expansion possibilities. */
2203 #define A(a) (1 << CONCAT2 (CGEN_INSN_,a))
2204 #define MNEM CGEN_SYNTAX_MNEMONIC /* syntax value for mnemonic */
2205 #define OP(field) CGEN_SYNTAX_MAKE_FIELD (OPERAND (field))
2207 /* The macro instruction table. */
2209 static const CGEN_INSN macro_insn_table_entries
[] =
2211 /* ldi32 $i32,$Ri */
2214 -1, "ldi32m", "ldi32",
2215 { { MNEM
, ' ', OP (I32
), ',', OP (RI
), 0 } },
2216 { 16, 48, 0xfff0 }, 0x9f80,
2218 { 0, 0|A(NO_DIS
)|A(ALIAS
), { 0 } }
2226 static const CGEN_INSN_TABLE macro_insn_table
=
2228 & macro_insn_table_entries
[0],
2230 (sizeof (macro_insn_table_entries
) /
2231 sizeof (macro_insn_table_entries
[0])),
2240 /* Return non-zero if INSN is to be added to the hash table.
2241 Targets are free to override CGEN_{ASM,DIS}_HASH_P in the .opc file. */
2244 asm_hash_insn_p (insn
)
2245 const CGEN_INSN
* insn
;
2247 return CGEN_ASM_HASH_P (insn
);
2251 dis_hash_insn_p (insn
)
2252 const CGEN_INSN
* insn
;
2254 /* If building the hash table and the NO-DIS attribute is present,
2256 if (CGEN_INSN_ATTR (insn
, CGEN_INSN_NO_DIS
))
2258 return CGEN_DIS_HASH_P (insn
);
2261 /* The result is the hash value of the insn.
2262 Targets are free to override CGEN_{ASM,DIS}_HASH in the .opc file. */
2265 asm_hash_insn (mnem
)
2268 return CGEN_ASM_HASH (mnem
);
2271 /* BUF is a pointer to the insn's bytes in target order.
2272 VALUE is an integer of the first CGEN_BASE_INSN_BITSIZE bits,
2276 dis_hash_insn (buf
, value
)
2278 CGEN_INSN_INT value
;
2280 return CGEN_DIS_HASH (buf
, value
);
2283 /* Initialize an opcode table and return a descriptor.
2284 It's much like opening a file, and must be the first function called. */
2287 fr30_cgen_opcode_open (mach
, endian
)
2289 enum cgen_endian endian
;
2291 CGEN_OPCODE_TABLE
* table
= (CGEN_OPCODE_TABLE
*) xmalloc (sizeof (CGEN_OPCODE_TABLE
));
2300 memset (table
, 0, sizeof (*table
));
2302 CGEN_OPCODE_MACH (table
) = mach
;
2303 CGEN_OPCODE_ENDIAN (table
) = endian
;
2304 /* FIXME: for the sparc case we can determine insn-endianness statically.
2305 The worry here is where both data and insn endian can be independently
2306 chosen, in which case this function will need another argument.
2307 Actually, will want to allow for more arguments in the future anyway. */
2308 CGEN_OPCODE_INSN_ENDIAN (table
) = endian
;
2310 CGEN_OPCODE_HW_LIST (table
) = & fr30_cgen_hw_entries
[0];
2312 CGEN_OPCODE_OPERAND_TABLE (table
) = & fr30_cgen_operand_table
[0];
2314 * CGEN_OPCODE_INSN_TABLE (table
) = insn_table
;
2316 * CGEN_OPCODE_MACRO_INSN_TABLE (table
) = macro_insn_table
;
2318 CGEN_OPCODE_ASM_HASH_P (table
) = asm_hash_insn_p
;
2319 CGEN_OPCODE_ASM_HASH (table
) = asm_hash_insn
;
2320 CGEN_OPCODE_ASM_HASH_SIZE (table
) = CGEN_ASM_HASH_SIZE
;
2322 CGEN_OPCODE_DIS_HASH_P (table
) = dis_hash_insn_p
;
2323 CGEN_OPCODE_DIS_HASH (table
) = dis_hash_insn
;
2324 CGEN_OPCODE_DIS_HASH_SIZE (table
) = CGEN_DIS_HASH_SIZE
;
2326 return (CGEN_OPCODE_DESC
) table
;
2329 /* Close an opcode table. */
2332 fr30_cgen_opcode_close (desc
)
2333 CGEN_OPCODE_DESC desc
;
2338 /* Getting values from cgen_fields is handled by a collection of functions.
2339 They are distinguished by the type of the VALUE argument they return.
2340 TODO: floating point, inlining support, remove cases where result type
2344 fr30_cgen_get_int_operand (opindex
, fields
)
2346 const CGEN_FIELDS
* fields
;
2352 case FR30_OPERAND_RI
:
2353 value
= fields
->f_Ri
;
2355 case FR30_OPERAND_RJ
:
2356 value
= fields
->f_Rj
;
2358 case FR30_OPERAND_RIC
:
2359 value
= fields
->f_Ric
;
2361 case FR30_OPERAND_RJC
:
2362 value
= fields
->f_Rjc
;
2364 case FR30_OPERAND_CRI
:
2365 value
= fields
->f_CRi
;
2367 case FR30_OPERAND_CRJ
:
2368 value
= fields
->f_CRj
;
2370 case FR30_OPERAND_RS1
:
2371 value
= fields
->f_Rs1
;
2373 case FR30_OPERAND_RS2
:
2374 value
= fields
->f_Rs2
;
2376 case FR30_OPERAND_R13
:
2377 value
= fields
->f_nil
;
2379 case FR30_OPERAND_R14
:
2380 value
= fields
->f_nil
;
2382 case FR30_OPERAND_R15
:
2383 value
= fields
->f_nil
;
2385 case FR30_OPERAND_PS
:
2386 value
= fields
->f_nil
;
2388 case FR30_OPERAND_U4
:
2389 value
= fields
->f_u4
;
2391 case FR30_OPERAND_U4C
:
2392 value
= fields
->f_u4c
;
2394 case FR30_OPERAND_M4
:
2395 value
= fields
->f_m4
;
2397 case FR30_OPERAND_U8
:
2398 value
= fields
->f_u8
;
2400 case FR30_OPERAND_I8
:
2401 value
= fields
->f_i8
;
2403 case FR30_OPERAND_UDISP6
:
2404 value
= fields
->f_udisp6
;
2406 case FR30_OPERAND_DISP8
:
2407 value
= fields
->f_disp8
;
2409 case FR30_OPERAND_DISP9
:
2410 value
= fields
->f_disp9
;
2412 case FR30_OPERAND_DISP10
:
2413 value
= fields
->f_disp10
;
2415 case FR30_OPERAND_S10
:
2416 value
= fields
->f_s10
;
2418 case FR30_OPERAND_U10
:
2419 value
= fields
->f_u10
;
2421 case FR30_OPERAND_I32
:
2422 value
= fields
->f_i32
;
2424 case FR30_OPERAND_DIR8
:
2425 value
= fields
->f_dir8
;
2427 case FR30_OPERAND_DIR9
:
2428 value
= fields
->f_dir9
;
2430 case FR30_OPERAND_DIR10
:
2431 value
= fields
->f_dir10
;
2433 case FR30_OPERAND_LABEL9
:
2434 value
= fields
->f_rel9
;
2436 case FR30_OPERAND_LABEL12
:
2437 value
= fields
->f_rel12
;
2439 case FR30_OPERAND_REGLIST_LOW
:
2440 value
= fields
->f_reglist_low
;
2442 case FR30_OPERAND_REGLIST_HI
:
2443 value
= fields
->f_reglist_hi
;
2445 case FR30_OPERAND_CC
:
2446 value
= fields
->f_cc
;
2448 case FR30_OPERAND_CCC
:
2449 value
= fields
->f_ccc
;
2453 /* xgettext:c-format */
2454 fprintf (stderr
, _("Unrecognized field %d while getting int operand.\n"),
2463 fr30_cgen_get_vma_operand (opindex
, fields
)
2465 const CGEN_FIELDS
* fields
;
2471 case FR30_OPERAND_RI
:
2472 value
= fields
->f_Ri
;
2474 case FR30_OPERAND_RJ
:
2475 value
= fields
->f_Rj
;
2477 case FR30_OPERAND_RIC
:
2478 value
= fields
->f_Ric
;
2480 case FR30_OPERAND_RJC
:
2481 value
= fields
->f_Rjc
;
2483 case FR30_OPERAND_CRI
:
2484 value
= fields
->f_CRi
;
2486 case FR30_OPERAND_CRJ
:
2487 value
= fields
->f_CRj
;
2489 case FR30_OPERAND_RS1
:
2490 value
= fields
->f_Rs1
;
2492 case FR30_OPERAND_RS2
:
2493 value
= fields
->f_Rs2
;
2495 case FR30_OPERAND_R13
:
2496 value
= fields
->f_nil
;
2498 case FR30_OPERAND_R14
:
2499 value
= fields
->f_nil
;
2501 case FR30_OPERAND_R15
:
2502 value
= fields
->f_nil
;
2504 case FR30_OPERAND_PS
:
2505 value
= fields
->f_nil
;
2507 case FR30_OPERAND_U4
:
2508 value
= fields
->f_u4
;
2510 case FR30_OPERAND_U4C
:
2511 value
= fields
->f_u4c
;
2513 case FR30_OPERAND_M4
:
2514 value
= fields
->f_m4
;
2516 case FR30_OPERAND_U8
:
2517 value
= fields
->f_u8
;
2519 case FR30_OPERAND_I8
:
2520 value
= fields
->f_i8
;
2522 case FR30_OPERAND_UDISP6
:
2523 value
= fields
->f_udisp6
;
2525 case FR30_OPERAND_DISP8
:
2526 value
= fields
->f_disp8
;
2528 case FR30_OPERAND_DISP9
:
2529 value
= fields
->f_disp9
;
2531 case FR30_OPERAND_DISP10
:
2532 value
= fields
->f_disp10
;
2534 case FR30_OPERAND_S10
:
2535 value
= fields
->f_s10
;
2537 case FR30_OPERAND_U10
:
2538 value
= fields
->f_u10
;
2540 case FR30_OPERAND_I32
:
2541 value
= fields
->f_i32
;
2543 case FR30_OPERAND_DIR8
:
2544 value
= fields
->f_dir8
;
2546 case FR30_OPERAND_DIR9
:
2547 value
= fields
->f_dir9
;
2549 case FR30_OPERAND_DIR10
:
2550 value
= fields
->f_dir10
;
2552 case FR30_OPERAND_LABEL9
:
2553 value
= fields
->f_rel9
;
2555 case FR30_OPERAND_LABEL12
:
2556 value
= fields
->f_rel12
;
2558 case FR30_OPERAND_REGLIST_LOW
:
2559 value
= fields
->f_reglist_low
;
2561 case FR30_OPERAND_REGLIST_HI
:
2562 value
= fields
->f_reglist_hi
;
2564 case FR30_OPERAND_CC
:
2565 value
= fields
->f_cc
;
2567 case FR30_OPERAND_CCC
:
2568 value
= fields
->f_ccc
;
2572 /* xgettext:c-format */
2573 fprintf (stderr
, _("Unrecognized field %d while getting vma operand.\n"),
2581 /* Stuffing values in cgen_fields is handled by a collection of functions.
2582 They are distinguished by the type of the VALUE argument they accept.
2583 TODO: floating point, inlining support, remove cases where argument type
2587 fr30_cgen_set_int_operand (opindex
, fields
, value
)
2589 CGEN_FIELDS
* fields
;
2594 case FR30_OPERAND_RI
:
2595 fields
->f_Ri
= value
;
2597 case FR30_OPERAND_RJ
:
2598 fields
->f_Rj
= value
;
2600 case FR30_OPERAND_RIC
:
2601 fields
->f_Ric
= value
;
2603 case FR30_OPERAND_RJC
:
2604 fields
->f_Rjc
= value
;
2606 case FR30_OPERAND_CRI
:
2607 fields
->f_CRi
= value
;
2609 case FR30_OPERAND_CRJ
:
2610 fields
->f_CRj
= value
;
2612 case FR30_OPERAND_RS1
:
2613 fields
->f_Rs1
= value
;
2615 case FR30_OPERAND_RS2
:
2616 fields
->f_Rs2
= value
;
2618 case FR30_OPERAND_R13
:
2619 fields
->f_nil
= value
;
2621 case FR30_OPERAND_R14
:
2622 fields
->f_nil
= value
;
2624 case FR30_OPERAND_R15
:
2625 fields
->f_nil
= value
;
2627 case FR30_OPERAND_PS
:
2628 fields
->f_nil
= value
;
2630 case FR30_OPERAND_U4
:
2631 fields
->f_u4
= value
;
2633 case FR30_OPERAND_U4C
:
2634 fields
->f_u4c
= value
;
2636 case FR30_OPERAND_M4
:
2637 fields
->f_m4
= value
;
2639 case FR30_OPERAND_U8
:
2640 fields
->f_u8
= value
;
2642 case FR30_OPERAND_I8
:
2643 fields
->f_i8
= value
;
2645 case FR30_OPERAND_UDISP6
:
2646 fields
->f_udisp6
= value
;
2648 case FR30_OPERAND_DISP8
:
2649 fields
->f_disp8
= value
;
2651 case FR30_OPERAND_DISP9
:
2652 fields
->f_disp9
= value
;
2654 case FR30_OPERAND_DISP10
:
2655 fields
->f_disp10
= value
;
2657 case FR30_OPERAND_S10
:
2658 fields
->f_s10
= value
;
2660 case FR30_OPERAND_U10
:
2661 fields
->f_u10
= value
;
2663 case FR30_OPERAND_I32
:
2664 fields
->f_i32
= value
;
2666 case FR30_OPERAND_DIR8
:
2667 fields
->f_dir8
= value
;
2669 case FR30_OPERAND_DIR9
:
2670 fields
->f_dir9
= value
;
2672 case FR30_OPERAND_DIR10
:
2673 fields
->f_dir10
= value
;
2675 case FR30_OPERAND_LABEL9
:
2676 fields
->f_rel9
= value
;
2678 case FR30_OPERAND_LABEL12
:
2679 fields
->f_rel12
= value
;
2681 case FR30_OPERAND_REGLIST_LOW
:
2682 fields
->f_reglist_low
= value
;
2684 case FR30_OPERAND_REGLIST_HI
:
2685 fields
->f_reglist_hi
= value
;
2687 case FR30_OPERAND_CC
:
2688 fields
->f_cc
= value
;
2690 case FR30_OPERAND_CCC
:
2691 fields
->f_ccc
= value
;
2695 /* xgettext:c-format */
2696 fprintf (stderr
, _("Unrecognized field %d while setting int operand.\n"),
2703 fr30_cgen_set_vma_operand (opindex
, fields
, value
)
2705 CGEN_FIELDS
* fields
;
2710 case FR30_OPERAND_RI
:
2711 fields
->f_Ri
= value
;
2713 case FR30_OPERAND_RJ
:
2714 fields
->f_Rj
= value
;
2716 case FR30_OPERAND_RIC
:
2717 fields
->f_Ric
= value
;
2719 case FR30_OPERAND_RJC
:
2720 fields
->f_Rjc
= value
;
2722 case FR30_OPERAND_CRI
:
2723 fields
->f_CRi
= value
;
2725 case FR30_OPERAND_CRJ
:
2726 fields
->f_CRj
= value
;
2728 case FR30_OPERAND_RS1
:
2729 fields
->f_Rs1
= value
;
2731 case FR30_OPERAND_RS2
:
2732 fields
->f_Rs2
= value
;
2734 case FR30_OPERAND_R13
:
2735 fields
->f_nil
= value
;
2737 case FR30_OPERAND_R14
:
2738 fields
->f_nil
= value
;
2740 case FR30_OPERAND_R15
:
2741 fields
->f_nil
= value
;
2743 case FR30_OPERAND_PS
:
2744 fields
->f_nil
= value
;
2746 case FR30_OPERAND_U4
:
2747 fields
->f_u4
= value
;
2749 case FR30_OPERAND_U4C
:
2750 fields
->f_u4c
= value
;
2752 case FR30_OPERAND_M4
:
2753 fields
->f_m4
= value
;
2755 case FR30_OPERAND_U8
:
2756 fields
->f_u8
= value
;
2758 case FR30_OPERAND_I8
:
2759 fields
->f_i8
= value
;
2761 case FR30_OPERAND_UDISP6
:
2762 fields
->f_udisp6
= value
;
2764 case FR30_OPERAND_DISP8
:
2765 fields
->f_disp8
= value
;
2767 case FR30_OPERAND_DISP9
:
2768 fields
->f_disp9
= value
;
2770 case FR30_OPERAND_DISP10
:
2771 fields
->f_disp10
= value
;
2773 case FR30_OPERAND_S10
:
2774 fields
->f_s10
= value
;
2776 case FR30_OPERAND_U10
:
2777 fields
->f_u10
= value
;
2779 case FR30_OPERAND_I32
:
2780 fields
->f_i32
= value
;
2782 case FR30_OPERAND_DIR8
:
2783 fields
->f_dir8
= value
;
2785 case FR30_OPERAND_DIR9
:
2786 fields
->f_dir9
= value
;
2788 case FR30_OPERAND_DIR10
:
2789 fields
->f_dir10
= value
;
2791 case FR30_OPERAND_LABEL9
:
2792 fields
->f_rel9
= value
;
2794 case FR30_OPERAND_LABEL12
:
2795 fields
->f_rel12
= value
;
2797 case FR30_OPERAND_REGLIST_LOW
:
2798 fields
->f_reglist_low
= value
;
2800 case FR30_OPERAND_REGLIST_HI
:
2801 fields
->f_reglist_hi
= value
;
2803 case FR30_OPERAND_CC
:
2804 fields
->f_cc
= value
;
2806 case FR30_OPERAND_CCC
:
2807 fields
->f_ccc
= value
;
2811 /* xgettext:c-format */
2812 fprintf (stderr
, _("Unrecognized field %d while setting vma operand.\n"),