1ede78133Schristos /* DO NOT EDIT! -*- buffer-read-only: t -*- vi:set ro: */
275fd0b74Schristos /* Disassembler interface for targets using CGEN. -*- C -*-
375fd0b74Schristos CGEN: Cpu tools GENerator
475fd0b74Schristos
575fd0b74Schristos THIS FILE IS MACHINE GENERATED WITH CGEN.
675fd0b74Schristos - the resultant file is machine generated, cgen-dis.in isn't
775fd0b74Schristos
8*e992f068Schristos Copyright (C) 1996-2022 Free Software Foundation, Inc.
975fd0b74Schristos
1075fd0b74Schristos This file is part of libopcodes.
1175fd0b74Schristos
1275fd0b74Schristos This library is free software; you can redistribute it and/or modify
1375fd0b74Schristos it under the terms of the GNU General Public License as published by
1475fd0b74Schristos the Free Software Foundation; either version 3, or (at your option)
1575fd0b74Schristos any later version.
1675fd0b74Schristos
1775fd0b74Schristos It is distributed in the hope that it will be useful, but WITHOUT
1875fd0b74Schristos ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
1975fd0b74Schristos or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
2075fd0b74Schristos License for more details.
2175fd0b74Schristos
2275fd0b74Schristos You should have received a copy of the GNU General Public License
2375fd0b74Schristos along with this program; if not, write to the Free Software Foundation, Inc.,
2475fd0b74Schristos 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */
2575fd0b74Schristos
2675fd0b74Schristos /* ??? Eventually more and more of this stuff can go to cpu-independent files.
2775fd0b74Schristos Keep that in mind. */
2875fd0b74Schristos
2975fd0b74Schristos #include "sysdep.h"
3075fd0b74Schristos #include <stdio.h>
3175fd0b74Schristos #include "ansidecl.h"
32ede78133Schristos #include "disassemble.h"
3375fd0b74Schristos #include "bfd.h"
3475fd0b74Schristos #include "symcat.h"
3575fd0b74Schristos #include "libiberty.h"
3675fd0b74Schristos #include "m32c-desc.h"
3775fd0b74Schristos #include "m32c-opc.h"
3875fd0b74Schristos #include "opintl.h"
3975fd0b74Schristos
4075fd0b74Schristos /* Default text to print if an instruction isn't recognized. */
4175fd0b74Schristos #define UNKNOWN_INSN_MSG _("*unknown*")
4275fd0b74Schristos
4375fd0b74Schristos static void print_normal
4475fd0b74Schristos (CGEN_CPU_DESC, void *, long, unsigned int, bfd_vma, int);
4575fd0b74Schristos static void print_address
4675fd0b74Schristos (CGEN_CPU_DESC, void *, bfd_vma, unsigned int, bfd_vma, int) ATTRIBUTE_UNUSED;
4775fd0b74Schristos static void print_keyword
4875fd0b74Schristos (CGEN_CPU_DESC, void *, CGEN_KEYWORD *, long, unsigned int) ATTRIBUTE_UNUSED;
4975fd0b74Schristos static void print_insn_normal
5075fd0b74Schristos (CGEN_CPU_DESC, void *, const CGEN_INSN *, CGEN_FIELDS *, bfd_vma, int);
5175fd0b74Schristos static int print_insn
5275fd0b74Schristos (CGEN_CPU_DESC, bfd_vma, disassemble_info *, bfd_byte *, unsigned);
5375fd0b74Schristos static int default_print_insn
5475fd0b74Schristos (CGEN_CPU_DESC, bfd_vma, disassemble_info *) ATTRIBUTE_UNUSED;
5575fd0b74Schristos static int read_insn
5675fd0b74Schristos (CGEN_CPU_DESC, bfd_vma, disassemble_info *, bfd_byte *, int, CGEN_EXTRACT_INFO *,
5775fd0b74Schristos unsigned long *);
5875fd0b74Schristos
5975fd0b74Schristos /* -- disassembler routines inserted here. */
6075fd0b74Schristos
6175fd0b74Schristos /* -- dis.c */
6275fd0b74Schristos
6375fd0b74Schristos #include "elf/m32c.h"
6475fd0b74Schristos #include "elf-bfd.h"
6575fd0b74Schristos
6675fd0b74Schristos /* Always print the short insn format suffix as ':<char>'. */
6775fd0b74Schristos
6875fd0b74Schristos static void
print_suffix(void * dis_info,char suffix)6975fd0b74Schristos print_suffix (void * dis_info, char suffix)
7075fd0b74Schristos {
7175fd0b74Schristos disassemble_info *info = dis_info;
7275fd0b74Schristos
7375fd0b74Schristos (*info->fprintf_func) (info->stream, ":%c", suffix);
7475fd0b74Schristos }
7575fd0b74Schristos
7675fd0b74Schristos static void
print_S(CGEN_CPU_DESC cd ATTRIBUTE_UNUSED,void * dis_info,long value ATTRIBUTE_UNUSED,unsigned int attrs ATTRIBUTE_UNUSED,bfd_vma pc ATTRIBUTE_UNUSED,int length ATTRIBUTE_UNUSED)7775fd0b74Schristos print_S (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED,
7875fd0b74Schristos void * dis_info,
7975fd0b74Schristos long value ATTRIBUTE_UNUSED,
8075fd0b74Schristos unsigned int attrs ATTRIBUTE_UNUSED,
8175fd0b74Schristos bfd_vma pc ATTRIBUTE_UNUSED,
8275fd0b74Schristos int length ATTRIBUTE_UNUSED)
8375fd0b74Schristos {
8475fd0b74Schristos print_suffix (dis_info, 's');
8575fd0b74Schristos }
8675fd0b74Schristos
8775fd0b74Schristos
8875fd0b74Schristos static void
print_G(CGEN_CPU_DESC cd ATTRIBUTE_UNUSED,void * dis_info,long value ATTRIBUTE_UNUSED,unsigned int attrs ATTRIBUTE_UNUSED,bfd_vma pc ATTRIBUTE_UNUSED,int length ATTRIBUTE_UNUSED)8975fd0b74Schristos print_G (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED,
9075fd0b74Schristos void * dis_info,
9175fd0b74Schristos long value ATTRIBUTE_UNUSED,
9275fd0b74Schristos unsigned int attrs ATTRIBUTE_UNUSED,
9375fd0b74Schristos bfd_vma pc ATTRIBUTE_UNUSED,
9475fd0b74Schristos int length ATTRIBUTE_UNUSED)
9575fd0b74Schristos {
9675fd0b74Schristos print_suffix (dis_info, 'g');
9775fd0b74Schristos }
9875fd0b74Schristos
9975fd0b74Schristos static void
print_Q(CGEN_CPU_DESC cd ATTRIBUTE_UNUSED,void * dis_info,long value ATTRIBUTE_UNUSED,unsigned int attrs ATTRIBUTE_UNUSED,bfd_vma pc ATTRIBUTE_UNUSED,int length ATTRIBUTE_UNUSED)10075fd0b74Schristos print_Q (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED,
10175fd0b74Schristos void * dis_info,
10275fd0b74Schristos long value ATTRIBUTE_UNUSED,
10375fd0b74Schristos unsigned int attrs ATTRIBUTE_UNUSED,
10475fd0b74Schristos bfd_vma pc ATTRIBUTE_UNUSED,
10575fd0b74Schristos int length ATTRIBUTE_UNUSED)
10675fd0b74Schristos {
10775fd0b74Schristos print_suffix (dis_info, 'q');
10875fd0b74Schristos }
10975fd0b74Schristos
11075fd0b74Schristos static void
print_Z(CGEN_CPU_DESC cd ATTRIBUTE_UNUSED,void * dis_info,long value ATTRIBUTE_UNUSED,unsigned int attrs ATTRIBUTE_UNUSED,bfd_vma pc ATTRIBUTE_UNUSED,int length ATTRIBUTE_UNUSED)11175fd0b74Schristos print_Z (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED,
11275fd0b74Schristos void * dis_info,
11375fd0b74Schristos long value ATTRIBUTE_UNUSED,
11475fd0b74Schristos unsigned int attrs ATTRIBUTE_UNUSED,
11575fd0b74Schristos bfd_vma pc ATTRIBUTE_UNUSED,
11675fd0b74Schristos int length ATTRIBUTE_UNUSED)
11775fd0b74Schristos {
11875fd0b74Schristos print_suffix (dis_info, 'z');
11975fd0b74Schristos }
12075fd0b74Schristos
12175fd0b74Schristos /* Print the empty suffix. */
12275fd0b74Schristos
12375fd0b74Schristos static void
print_X(CGEN_CPU_DESC cd ATTRIBUTE_UNUSED,void * dis_info ATTRIBUTE_UNUSED,long value ATTRIBUTE_UNUSED,unsigned int attrs ATTRIBUTE_UNUSED,bfd_vma pc ATTRIBUTE_UNUSED,int length ATTRIBUTE_UNUSED)12475fd0b74Schristos print_X (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED,
12575fd0b74Schristos void * dis_info ATTRIBUTE_UNUSED,
12675fd0b74Schristos long value ATTRIBUTE_UNUSED,
12775fd0b74Schristos unsigned int attrs ATTRIBUTE_UNUSED,
12875fd0b74Schristos bfd_vma pc ATTRIBUTE_UNUSED,
12975fd0b74Schristos int length ATTRIBUTE_UNUSED)
13075fd0b74Schristos {
13175fd0b74Schristos return;
13275fd0b74Schristos }
13375fd0b74Schristos
13475fd0b74Schristos static void
print_r0l_r0h(CGEN_CPU_DESC cd ATTRIBUTE_UNUSED,void * dis_info,long value,unsigned int attrs ATTRIBUTE_UNUSED,bfd_vma pc ATTRIBUTE_UNUSED,int length ATTRIBUTE_UNUSED)13575fd0b74Schristos print_r0l_r0h (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED,
13675fd0b74Schristos void * dis_info,
13775fd0b74Schristos long value,
13875fd0b74Schristos unsigned int attrs ATTRIBUTE_UNUSED,
13975fd0b74Schristos bfd_vma pc ATTRIBUTE_UNUSED,
14075fd0b74Schristos int length ATTRIBUTE_UNUSED)
14175fd0b74Schristos {
14275fd0b74Schristos disassemble_info *info = dis_info;
14375fd0b74Schristos
14475fd0b74Schristos if (value == 0)
14575fd0b74Schristos (*info->fprintf_func) (info->stream, "r0h,r0l");
14675fd0b74Schristos else
14775fd0b74Schristos (*info->fprintf_func) (info->stream, "r0l,r0h");
14875fd0b74Schristos }
14975fd0b74Schristos
15075fd0b74Schristos static void
print_unsigned_bitbase(CGEN_CPU_DESC cd ATTRIBUTE_UNUSED,void * dis_info,unsigned long value,unsigned int attrs ATTRIBUTE_UNUSED,bfd_vma pc ATTRIBUTE_UNUSED,int length ATTRIBUTE_UNUSED)15175fd0b74Schristos print_unsigned_bitbase (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED,
15275fd0b74Schristos void * dis_info,
15375fd0b74Schristos unsigned long value,
15475fd0b74Schristos unsigned int attrs ATTRIBUTE_UNUSED,
15575fd0b74Schristos bfd_vma pc ATTRIBUTE_UNUSED,
15675fd0b74Schristos int length ATTRIBUTE_UNUSED)
15775fd0b74Schristos {
15875fd0b74Schristos disassemble_info *info = dis_info;
15975fd0b74Schristos
16075fd0b74Schristos (*info->fprintf_func) (info->stream, "%ld,0x%lx", value & 0x7, value >> 3);
16175fd0b74Schristos }
16275fd0b74Schristos
16375fd0b74Schristos static void
print_signed_bitbase(CGEN_CPU_DESC cd ATTRIBUTE_UNUSED,void * dis_info,signed long value,unsigned int attrs ATTRIBUTE_UNUSED,bfd_vma pc ATTRIBUTE_UNUSED,int length ATTRIBUTE_UNUSED)16475fd0b74Schristos print_signed_bitbase (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED,
16575fd0b74Schristos void * dis_info,
16675fd0b74Schristos signed long value,
16775fd0b74Schristos unsigned int attrs ATTRIBUTE_UNUSED,
16875fd0b74Schristos bfd_vma pc ATTRIBUTE_UNUSED,
16975fd0b74Schristos int length ATTRIBUTE_UNUSED)
17075fd0b74Schristos {
17175fd0b74Schristos disassemble_info *info = dis_info;
17275fd0b74Schristos
17375fd0b74Schristos (*info->fprintf_func) (info->stream, "%ld,%ld", value & 0x7, value >> 3);
17475fd0b74Schristos }
17575fd0b74Schristos
17675fd0b74Schristos static void
print_size(CGEN_CPU_DESC cd ATTRIBUTE_UNUSED,void * dis_info,long value ATTRIBUTE_UNUSED,unsigned int attrs ATTRIBUTE_UNUSED,bfd_vma pc ATTRIBUTE_UNUSED,int length ATTRIBUTE_UNUSED)17775fd0b74Schristos print_size (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED,
17875fd0b74Schristos void * dis_info,
17975fd0b74Schristos long value ATTRIBUTE_UNUSED,
18075fd0b74Schristos unsigned int attrs ATTRIBUTE_UNUSED,
18175fd0b74Schristos bfd_vma pc ATTRIBUTE_UNUSED,
18275fd0b74Schristos int length ATTRIBUTE_UNUSED)
18375fd0b74Schristos {
18475fd0b74Schristos /* Always print the size as '.w'. */
18575fd0b74Schristos disassemble_info *info = dis_info;
18675fd0b74Schristos
18775fd0b74Schristos (*info->fprintf_func) (info->stream, ".w");
18875fd0b74Schristos }
18975fd0b74Schristos
19075fd0b74Schristos #define POP 0
19175fd0b74Schristos #define PUSH 1
19275fd0b74Schristos
19375fd0b74Schristos static void print_pop_regset (CGEN_CPU_DESC, void *, long, unsigned int, bfd_vma, int);
19475fd0b74Schristos static void print_push_regset (CGEN_CPU_DESC, void *, long, unsigned int, bfd_vma, int);
19575fd0b74Schristos
19675fd0b74Schristos /* Print a set of registers, R0,R1,A0,A1,SB,FB. */
19775fd0b74Schristos
19875fd0b74Schristos static void
print_regset(CGEN_CPU_DESC cd ATTRIBUTE_UNUSED,void * dis_info,long value,unsigned int attrs ATTRIBUTE_UNUSED,bfd_vma pc ATTRIBUTE_UNUSED,int length ATTRIBUTE_UNUSED,int push)19975fd0b74Schristos print_regset (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED,
20075fd0b74Schristos void * dis_info,
20175fd0b74Schristos long value,
20275fd0b74Schristos unsigned int attrs ATTRIBUTE_UNUSED,
20375fd0b74Schristos bfd_vma pc ATTRIBUTE_UNUSED,
20475fd0b74Schristos int length ATTRIBUTE_UNUSED,
20575fd0b74Schristos int push)
20675fd0b74Schristos {
20775fd0b74Schristos static char * m16c_register_names [] =
20875fd0b74Schristos {
20975fd0b74Schristos "r0", "r1", "r2", "r3", "a0", "a1", "sb", "fb"
21075fd0b74Schristos };
21175fd0b74Schristos disassemble_info *info = dis_info;
21275fd0b74Schristos int mask;
21375fd0b74Schristos int reg_index = 0;
21475fd0b74Schristos char* comma = "";
21575fd0b74Schristos
21675fd0b74Schristos if (push)
21775fd0b74Schristos mask = 0x80;
21875fd0b74Schristos else
21975fd0b74Schristos mask = 1;
22075fd0b74Schristos
22175fd0b74Schristos if (value & mask)
22275fd0b74Schristos {
22375fd0b74Schristos (*info->fprintf_func) (info->stream, "%s", m16c_register_names [0]);
22475fd0b74Schristos comma = ",";
22575fd0b74Schristos }
22675fd0b74Schristos
22775fd0b74Schristos for (reg_index = 1; reg_index <= 7; ++reg_index)
22875fd0b74Schristos {
22975fd0b74Schristos if (push)
23075fd0b74Schristos mask >>= 1;
23175fd0b74Schristos else
23275fd0b74Schristos mask <<= 1;
23375fd0b74Schristos
23475fd0b74Schristos if (value & mask)
23575fd0b74Schristos {
23675fd0b74Schristos (*info->fprintf_func) (info->stream, "%s%s", comma,
23775fd0b74Schristos m16c_register_names [reg_index]);
23875fd0b74Schristos comma = ",";
23975fd0b74Schristos }
24075fd0b74Schristos }
24175fd0b74Schristos }
24275fd0b74Schristos
24375fd0b74Schristos static void
print_pop_regset(CGEN_CPU_DESC cd ATTRIBUTE_UNUSED,void * dis_info,long value,unsigned int attrs ATTRIBUTE_UNUSED,bfd_vma pc ATTRIBUTE_UNUSED,int length ATTRIBUTE_UNUSED)24475fd0b74Schristos print_pop_regset (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED,
24575fd0b74Schristos void * dis_info,
24675fd0b74Schristos long value,
24775fd0b74Schristos unsigned int attrs ATTRIBUTE_UNUSED,
24875fd0b74Schristos bfd_vma pc ATTRIBUTE_UNUSED,
24975fd0b74Schristos int length ATTRIBUTE_UNUSED)
25075fd0b74Schristos {
25175fd0b74Schristos print_regset (cd, dis_info, value, attrs, pc, length, POP);
25275fd0b74Schristos }
25375fd0b74Schristos
25475fd0b74Schristos static void
print_push_regset(CGEN_CPU_DESC cd ATTRIBUTE_UNUSED,void * dis_info,long value,unsigned int attrs ATTRIBUTE_UNUSED,bfd_vma pc ATTRIBUTE_UNUSED,int length ATTRIBUTE_UNUSED)25575fd0b74Schristos print_push_regset (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED,
25675fd0b74Schristos void * dis_info,
25775fd0b74Schristos long value,
25875fd0b74Schristos unsigned int attrs ATTRIBUTE_UNUSED,
25975fd0b74Schristos bfd_vma pc ATTRIBUTE_UNUSED,
26075fd0b74Schristos int length ATTRIBUTE_UNUSED)
26175fd0b74Schristos {
26275fd0b74Schristos print_regset (cd, dis_info, value, attrs, pc, length, PUSH);
26375fd0b74Schristos }
26475fd0b74Schristos
26575fd0b74Schristos static void
print_signed4n(CGEN_CPU_DESC cd ATTRIBUTE_UNUSED,void * dis_info,signed long value,unsigned int attrs ATTRIBUTE_UNUSED,bfd_vma pc ATTRIBUTE_UNUSED,int length ATTRIBUTE_UNUSED)26675fd0b74Schristos print_signed4n (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED,
26775fd0b74Schristos void * dis_info,
26875fd0b74Schristos signed long value,
26975fd0b74Schristos unsigned int attrs ATTRIBUTE_UNUSED,
27075fd0b74Schristos bfd_vma pc ATTRIBUTE_UNUSED,
27175fd0b74Schristos int length ATTRIBUTE_UNUSED)
27275fd0b74Schristos {
27375fd0b74Schristos disassemble_info *info = dis_info;
27475fd0b74Schristos
27575fd0b74Schristos (*info->fprintf_func) (info->stream, "%ld", -value);
27675fd0b74Schristos }
27775fd0b74Schristos
27875fd0b74Schristos void m32c_cgen_print_operand
279*e992f068Schristos (CGEN_CPU_DESC, int, void *, CGEN_FIELDS *, void const *, bfd_vma, int);
28075fd0b74Schristos
28175fd0b74Schristos /* Main entry point for printing operands.
28275fd0b74Schristos XINFO is a `void *' and not a `disassemble_info *' to not put a requirement
28375fd0b74Schristos of dis-asm.h on cgen.h.
28475fd0b74Schristos
28575fd0b74Schristos This function is basically just a big switch statement. Earlier versions
28675fd0b74Schristos used tables to look up the function to use, but
28775fd0b74Schristos - if the table contains both assembler and disassembler functions then
28875fd0b74Schristos the disassembler contains much of the assembler and vice-versa,
28975fd0b74Schristos - there's a lot of inlining possibilities as things grow,
29075fd0b74Schristos - using a switch statement avoids the function call overhead.
29175fd0b74Schristos
29275fd0b74Schristos This function could be moved into `print_insn_normal', but keeping it
29375fd0b74Schristos separate makes clear the interface between `print_insn_normal' and each of
29475fd0b74Schristos the handlers. */
29575fd0b74Schristos
29675fd0b74Schristos void
m32c_cgen_print_operand(CGEN_CPU_DESC cd,int opindex,void * xinfo,CGEN_FIELDS * fields,void const * attrs ATTRIBUTE_UNUSED,bfd_vma pc,int length)29775fd0b74Schristos m32c_cgen_print_operand (CGEN_CPU_DESC cd,
29875fd0b74Schristos int opindex,
29975fd0b74Schristos void * xinfo,
30075fd0b74Schristos CGEN_FIELDS *fields,
30175fd0b74Schristos void const *attrs ATTRIBUTE_UNUSED,
30275fd0b74Schristos bfd_vma pc,
30375fd0b74Schristos int length)
30475fd0b74Schristos {
30575fd0b74Schristos disassemble_info *info = (disassemble_info *) xinfo;
30675fd0b74Schristos
30775fd0b74Schristos switch (opindex)
30875fd0b74Schristos {
30975fd0b74Schristos case M32C_OPERAND_A0 :
31075fd0b74Schristos print_keyword (cd, info, & m32c_cgen_opval_h_a0, 0, 0);
31175fd0b74Schristos break;
31275fd0b74Schristos case M32C_OPERAND_A1 :
31375fd0b74Schristos print_keyword (cd, info, & m32c_cgen_opval_h_a1, 0, 0);
31475fd0b74Schristos break;
31575fd0b74Schristos case M32C_OPERAND_AN16_PUSH_S :
31675fd0b74Schristos print_keyword (cd, info, & m32c_cgen_opval_h_ar_HI, fields->f_4_1, 0);
31775fd0b74Schristos break;
31875fd0b74Schristos case M32C_OPERAND_BIT16AN :
31975fd0b74Schristos print_keyword (cd, info, & m32c_cgen_opval_h_ar, fields->f_dst16_an, 0);
32075fd0b74Schristos break;
32175fd0b74Schristos case M32C_OPERAND_BIT16RN :
32275fd0b74Schristos print_keyword (cd, info, & m32c_cgen_opval_h_gr_HI, fields->f_dst16_rn, 0);
32375fd0b74Schristos break;
32475fd0b74Schristos case M32C_OPERAND_BIT3_S :
32575fd0b74Schristos print_normal (cd, info, fields->f_imm3_S, 0|(1<<CGEN_OPERAND_SIGNED)|(1<<CGEN_OPERAND_VIRTUAL), pc, length);
32675fd0b74Schristos break;
32775fd0b74Schristos case M32C_OPERAND_BIT32ANPREFIXED :
32875fd0b74Schristos print_keyword (cd, info, & m32c_cgen_opval_h_ar, fields->f_dst32_an_prefixed, 0);
32975fd0b74Schristos break;
33075fd0b74Schristos case M32C_OPERAND_BIT32ANUNPREFIXED :
33175fd0b74Schristos print_keyword (cd, info, & m32c_cgen_opval_h_ar, fields->f_dst32_an_unprefixed, 0);
33275fd0b74Schristos break;
33375fd0b74Schristos case M32C_OPERAND_BIT32RNPREFIXED :
33475fd0b74Schristos print_keyword (cd, info, & m32c_cgen_opval_h_gr_QI, fields->f_dst32_rn_prefixed_QI, 0);
33575fd0b74Schristos break;
33675fd0b74Schristos case M32C_OPERAND_BIT32RNUNPREFIXED :
33775fd0b74Schristos print_keyword (cd, info, & m32c_cgen_opval_h_gr_QI, fields->f_dst32_rn_unprefixed_QI, 0);
33875fd0b74Schristos break;
33975fd0b74Schristos case M32C_OPERAND_BITBASE16_16_S8 :
34075fd0b74Schristos print_signed_bitbase (cd, info, fields->f_dsp_16_s8, 0|(1<<CGEN_OPERAND_SIGNED), pc, length);
34175fd0b74Schristos break;
34275fd0b74Schristos case M32C_OPERAND_BITBASE16_16_U16 :
34375fd0b74Schristos print_unsigned_bitbase (cd, info, fields->f_dsp_16_u16, 0, pc, length);
34475fd0b74Schristos break;
34575fd0b74Schristos case M32C_OPERAND_BITBASE16_16_U8 :
34675fd0b74Schristos print_unsigned_bitbase (cd, info, fields->f_dsp_16_u8, 0, pc, length);
34775fd0b74Schristos break;
34875fd0b74Schristos case M32C_OPERAND_BITBASE16_8_U11_S :
34975fd0b74Schristos print_unsigned_bitbase (cd, info, fields->f_bitbase16_u11_S, 0|(1<<CGEN_OPERAND_VIRTUAL), pc, length);
35075fd0b74Schristos break;
35175fd0b74Schristos case M32C_OPERAND_BITBASE32_16_S11_UNPREFIXED :
35275fd0b74Schristos print_signed_bitbase (cd, info, fields->f_bitbase32_16_s11_unprefixed, 0|(1<<CGEN_OPERAND_SIGNED)|(1<<CGEN_OPERAND_VIRTUAL), pc, length);
35375fd0b74Schristos break;
35475fd0b74Schristos case M32C_OPERAND_BITBASE32_16_S19_UNPREFIXED :
35575fd0b74Schristos print_signed_bitbase (cd, info, fields->f_bitbase32_16_s19_unprefixed, 0|(1<<CGEN_OPERAND_SIGNED)|(1<<CGEN_OPERAND_VIRTUAL), pc, length);
35675fd0b74Schristos break;
35775fd0b74Schristos case M32C_OPERAND_BITBASE32_16_U11_UNPREFIXED :
35875fd0b74Schristos print_unsigned_bitbase (cd, info, fields->f_bitbase32_16_u11_unprefixed, 0|(1<<CGEN_OPERAND_VIRTUAL), pc, length);
35975fd0b74Schristos break;
36075fd0b74Schristos case M32C_OPERAND_BITBASE32_16_U19_UNPREFIXED :
36175fd0b74Schristos print_unsigned_bitbase (cd, info, fields->f_bitbase32_16_u19_unprefixed, 0|(1<<CGEN_OPERAND_VIRTUAL), pc, length);
36275fd0b74Schristos break;
36375fd0b74Schristos case M32C_OPERAND_BITBASE32_16_U27_UNPREFIXED :
36475fd0b74Schristos print_unsigned_bitbase (cd, info, fields->f_bitbase32_16_u27_unprefixed, 0|(1<<CGEN_OPERAND_VIRTUAL), pc, length);
36575fd0b74Schristos break;
36675fd0b74Schristos case M32C_OPERAND_BITBASE32_24_S11_PREFIXED :
36775fd0b74Schristos print_signed_bitbase (cd, info, fields->f_bitbase32_24_s11_prefixed, 0|(1<<CGEN_OPERAND_SIGNED)|(1<<CGEN_OPERAND_VIRTUAL), pc, length);
36875fd0b74Schristos break;
36975fd0b74Schristos case M32C_OPERAND_BITBASE32_24_S19_PREFIXED :
37075fd0b74Schristos print_signed_bitbase (cd, info, fields->f_bitbase32_24_s19_prefixed, 0|(1<<CGEN_OPERAND_SIGNED)|(1<<CGEN_OPERAND_VIRTUAL), pc, length);
37175fd0b74Schristos break;
37275fd0b74Schristos case M32C_OPERAND_BITBASE32_24_U11_PREFIXED :
37375fd0b74Schristos print_unsigned_bitbase (cd, info, fields->f_bitbase32_24_u11_prefixed, 0|(1<<CGEN_OPERAND_VIRTUAL), pc, length);
37475fd0b74Schristos break;
37575fd0b74Schristos case M32C_OPERAND_BITBASE32_24_U19_PREFIXED :
37675fd0b74Schristos print_unsigned_bitbase (cd, info, fields->f_bitbase32_24_u19_prefixed, 0|(1<<CGEN_OPERAND_VIRTUAL), pc, length);
37775fd0b74Schristos break;
37875fd0b74Schristos case M32C_OPERAND_BITBASE32_24_U27_PREFIXED :
37975fd0b74Schristos print_unsigned_bitbase (cd, info, fields->f_bitbase32_24_u27_prefixed, 0|(1<<CGEN_OPERAND_VIRTUAL), pc, length);
38075fd0b74Schristos break;
38175fd0b74Schristos case M32C_OPERAND_BITNO16R :
38275fd0b74Schristos print_normal (cd, info, fields->f_dsp_16_u8, 0, pc, length);
38375fd0b74Schristos break;
38475fd0b74Schristos case M32C_OPERAND_BITNO32PREFIXED :
38575fd0b74Schristos print_normal (cd, info, fields->f_bitno32_prefixed, 0, pc, length);
38675fd0b74Schristos break;
38775fd0b74Schristos case M32C_OPERAND_BITNO32UNPREFIXED :
38875fd0b74Schristos print_normal (cd, info, fields->f_bitno32_unprefixed, 0, pc, length);
38975fd0b74Schristos break;
39075fd0b74Schristos case M32C_OPERAND_DSP_10_U6 :
39175fd0b74Schristos print_normal (cd, info, fields->f_dsp_10_u6, 0, pc, length);
39275fd0b74Schristos break;
39375fd0b74Schristos case M32C_OPERAND_DSP_16_S16 :
39475fd0b74Schristos print_normal (cd, info, fields->f_dsp_16_s16, 0|(1<<CGEN_OPERAND_SIGNED), pc, length);
39575fd0b74Schristos break;
39675fd0b74Schristos case M32C_OPERAND_DSP_16_S8 :
39775fd0b74Schristos print_normal (cd, info, fields->f_dsp_16_s8, 0|(1<<CGEN_OPERAND_SIGNED), pc, length);
39875fd0b74Schristos break;
39975fd0b74Schristos case M32C_OPERAND_DSP_16_U16 :
40075fd0b74Schristos print_normal (cd, info, fields->f_dsp_16_u16, 0, pc, length);
40175fd0b74Schristos break;
40275fd0b74Schristos case M32C_OPERAND_DSP_16_U20 :
40375fd0b74Schristos print_normal (cd, info, fields->f_dsp_16_u24, 0|(1<<CGEN_OPERAND_VIRTUAL), pc, length);
40475fd0b74Schristos break;
40575fd0b74Schristos case M32C_OPERAND_DSP_16_U24 :
40675fd0b74Schristos print_normal (cd, info, fields->f_dsp_16_u24, 0|(1<<CGEN_OPERAND_VIRTUAL), pc, length);
40775fd0b74Schristos break;
40875fd0b74Schristos case M32C_OPERAND_DSP_16_U8 :
40975fd0b74Schristos print_normal (cd, info, fields->f_dsp_16_u8, 0, pc, length);
41075fd0b74Schristos break;
41175fd0b74Schristos case M32C_OPERAND_DSP_24_S16 :
41275fd0b74Schristos print_normal (cd, info, fields->f_dsp_24_s16, 0|(1<<CGEN_OPERAND_SIGNED)|(1<<CGEN_OPERAND_VIRTUAL), pc, length);
41375fd0b74Schristos break;
41475fd0b74Schristos case M32C_OPERAND_DSP_24_S8 :
41575fd0b74Schristos print_normal (cd, info, fields->f_dsp_24_s8, 0|(1<<CGEN_OPERAND_SIGNED), pc, length);
41675fd0b74Schristos break;
41775fd0b74Schristos case M32C_OPERAND_DSP_24_U16 :
41875fd0b74Schristos print_normal (cd, info, fields->f_dsp_24_u16, 0|(1<<CGEN_OPERAND_VIRTUAL), pc, length);
41975fd0b74Schristos break;
42075fd0b74Schristos case M32C_OPERAND_DSP_24_U20 :
42175fd0b74Schristos print_normal (cd, info, fields->f_dsp_24_u24, 0|(1<<CGEN_OPERAND_VIRTUAL), pc, length);
42275fd0b74Schristos break;
42375fd0b74Schristos case M32C_OPERAND_DSP_24_U24 :
42475fd0b74Schristos print_normal (cd, info, fields->f_dsp_24_u24, 0|(1<<CGEN_OPERAND_VIRTUAL), pc, length);
42575fd0b74Schristos break;
42675fd0b74Schristos case M32C_OPERAND_DSP_24_U8 :
42775fd0b74Schristos print_normal (cd, info, fields->f_dsp_24_u8, 0, pc, length);
42875fd0b74Schristos break;
42975fd0b74Schristos case M32C_OPERAND_DSP_32_S16 :
43075fd0b74Schristos print_normal (cd, info, fields->f_dsp_32_s16, 0|(1<<CGEN_OPERAND_SIGNED), pc, length);
43175fd0b74Schristos break;
43275fd0b74Schristos case M32C_OPERAND_DSP_32_S8 :
43375fd0b74Schristos print_normal (cd, info, fields->f_dsp_32_s8, 0|(1<<CGEN_OPERAND_SIGNED), pc, length);
43475fd0b74Schristos break;
43575fd0b74Schristos case M32C_OPERAND_DSP_32_U16 :
43675fd0b74Schristos print_normal (cd, info, fields->f_dsp_32_u16, 0, pc, length);
43775fd0b74Schristos break;
43875fd0b74Schristos case M32C_OPERAND_DSP_32_U20 :
43975fd0b74Schristos print_normal (cd, info, fields->f_dsp_32_u24, 0, pc, length);
44075fd0b74Schristos break;
44175fd0b74Schristos case M32C_OPERAND_DSP_32_U24 :
44275fd0b74Schristos print_normal (cd, info, fields->f_dsp_32_u24, 0, pc, length);
44375fd0b74Schristos break;
44475fd0b74Schristos case M32C_OPERAND_DSP_32_U8 :
44575fd0b74Schristos print_normal (cd, info, fields->f_dsp_32_u8, 0, pc, length);
44675fd0b74Schristos break;
44775fd0b74Schristos case M32C_OPERAND_DSP_40_S16 :
44875fd0b74Schristos print_normal (cd, info, fields->f_dsp_40_s16, 0|(1<<CGEN_OPERAND_SIGNED), pc, length);
44975fd0b74Schristos break;
45075fd0b74Schristos case M32C_OPERAND_DSP_40_S8 :
45175fd0b74Schristos print_normal (cd, info, fields->f_dsp_40_s8, 0|(1<<CGEN_OPERAND_SIGNED), pc, length);
45275fd0b74Schristos break;
45375fd0b74Schristos case M32C_OPERAND_DSP_40_U16 :
45475fd0b74Schristos print_normal (cd, info, fields->f_dsp_40_u16, 0, pc, length);
45575fd0b74Schristos break;
45675fd0b74Schristos case M32C_OPERAND_DSP_40_U20 :
45775fd0b74Schristos print_normal (cd, info, fields->f_dsp_40_u20, 0, pc, length);
45875fd0b74Schristos break;
45975fd0b74Schristos case M32C_OPERAND_DSP_40_U24 :
46075fd0b74Schristos print_normal (cd, info, fields->f_dsp_40_u24, 0, pc, length);
46175fd0b74Schristos break;
46275fd0b74Schristos case M32C_OPERAND_DSP_40_U8 :
46375fd0b74Schristos print_normal (cd, info, fields->f_dsp_40_u8, 0, pc, length);
46475fd0b74Schristos break;
46575fd0b74Schristos case M32C_OPERAND_DSP_48_S16 :
46675fd0b74Schristos print_normal (cd, info, fields->f_dsp_48_s16, 0|(1<<CGEN_OPERAND_SIGNED), pc, length);
46775fd0b74Schristos break;
46875fd0b74Schristos case M32C_OPERAND_DSP_48_S8 :
46975fd0b74Schristos print_normal (cd, info, fields->f_dsp_48_s8, 0|(1<<CGEN_OPERAND_SIGNED), pc, length);
47075fd0b74Schristos break;
47175fd0b74Schristos case M32C_OPERAND_DSP_48_U16 :
47275fd0b74Schristos print_normal (cd, info, fields->f_dsp_48_u16, 0, pc, length);
47375fd0b74Schristos break;
47475fd0b74Schristos case M32C_OPERAND_DSP_48_U20 :
47575fd0b74Schristos print_normal (cd, info, fields->f_dsp_48_u20, 0|(1<<CGEN_OPERAND_VIRTUAL), pc, length);
47675fd0b74Schristos break;
47775fd0b74Schristos case M32C_OPERAND_DSP_48_U24 :
47875fd0b74Schristos print_normal (cd, info, fields->f_dsp_48_u24, 0|(1<<CGEN_OPERAND_VIRTUAL), pc, length);
47975fd0b74Schristos break;
48075fd0b74Schristos case M32C_OPERAND_DSP_48_U8 :
48175fd0b74Schristos print_normal (cd, info, fields->f_dsp_48_u8, 0, pc, length);
48275fd0b74Schristos break;
48375fd0b74Schristos case M32C_OPERAND_DSP_8_S24 :
48475fd0b74Schristos print_normal (cd, info, fields->f_dsp_8_s24, 0|(1<<CGEN_OPERAND_SIGNED), pc, length);
48575fd0b74Schristos break;
48675fd0b74Schristos case M32C_OPERAND_DSP_8_S8 :
48775fd0b74Schristos print_normal (cd, info, fields->f_dsp_8_s8, 0|(1<<CGEN_OPERAND_SIGNED), pc, length);
48875fd0b74Schristos break;
48975fd0b74Schristos case M32C_OPERAND_DSP_8_U16 :
49075fd0b74Schristos print_normal (cd, info, fields->f_dsp_8_u16, 0, pc, length);
49175fd0b74Schristos break;
49275fd0b74Schristos case M32C_OPERAND_DSP_8_U24 :
49375fd0b74Schristos print_normal (cd, info, fields->f_dsp_8_u24, 0, pc, length);
49475fd0b74Schristos break;
49575fd0b74Schristos case M32C_OPERAND_DSP_8_U6 :
49675fd0b74Schristos print_normal (cd, info, fields->f_dsp_8_u6, 0, pc, length);
49775fd0b74Schristos break;
49875fd0b74Schristos case M32C_OPERAND_DSP_8_U8 :
49975fd0b74Schristos print_normal (cd, info, fields->f_dsp_8_u8, 0, pc, length);
50075fd0b74Schristos break;
50175fd0b74Schristos case M32C_OPERAND_DST16AN :
50275fd0b74Schristos print_keyword (cd, info, & m32c_cgen_opval_h_ar, fields->f_dst16_an, 0);
50375fd0b74Schristos break;
50475fd0b74Schristos case M32C_OPERAND_DST16AN_S :
50575fd0b74Schristos print_keyword (cd, info, & m32c_cgen_opval_h_ar_HI, fields->f_dst16_an_s, 0);
50675fd0b74Schristos break;
50775fd0b74Schristos case M32C_OPERAND_DST16ANHI :
50875fd0b74Schristos print_keyword (cd, info, & m32c_cgen_opval_h_ar_HI, fields->f_dst16_an, 0);
50975fd0b74Schristos break;
51075fd0b74Schristos case M32C_OPERAND_DST16ANQI :
51175fd0b74Schristos print_keyword (cd, info, & m32c_cgen_opval_h_ar_QI, fields->f_dst16_an, 0);
51275fd0b74Schristos break;
51375fd0b74Schristos case M32C_OPERAND_DST16ANQI_S :
51475fd0b74Schristos print_keyword (cd, info, & m32c_cgen_opval_h_ar_QI, fields->f_dst16_rn_QI_s, 0);
51575fd0b74Schristos break;
51675fd0b74Schristos case M32C_OPERAND_DST16ANSI :
51775fd0b74Schristos print_keyword (cd, info, & m32c_cgen_opval_h_ar_SI, fields->f_dst16_an, 0);
51875fd0b74Schristos break;
51975fd0b74Schristos case M32C_OPERAND_DST16RNEXTQI :
52075fd0b74Schristos print_keyword (cd, info, & m32c_cgen_opval_h_gr_ext_QI, fields->f_dst16_rn_ext, 0);
52175fd0b74Schristos break;
52275fd0b74Schristos case M32C_OPERAND_DST16RNHI :
52375fd0b74Schristos print_keyword (cd, info, & m32c_cgen_opval_h_gr_HI, fields->f_dst16_rn, 0);
52475fd0b74Schristos break;
52575fd0b74Schristos case M32C_OPERAND_DST16RNQI :
52675fd0b74Schristos print_keyword (cd, info, & m32c_cgen_opval_h_gr_QI, fields->f_dst16_rn, 0);
52775fd0b74Schristos break;
52875fd0b74Schristos case M32C_OPERAND_DST16RNQI_S :
52975fd0b74Schristos print_keyword (cd, info, & m32c_cgen_opval_h_r0l_r0h, fields->f_dst16_rn_QI_s, 0);
53075fd0b74Schristos break;
53175fd0b74Schristos case M32C_OPERAND_DST16RNSI :
53275fd0b74Schristos print_keyword (cd, info, & m32c_cgen_opval_h_gr_SI, fields->f_dst16_rn, 0);
53375fd0b74Schristos break;
53475fd0b74Schristos case M32C_OPERAND_DST32ANEXTUNPREFIXED :
53575fd0b74Schristos print_keyword (cd, info, & m32c_cgen_opval_h_ar, fields->f_dst32_an_unprefixed, 0);
53675fd0b74Schristos break;
53775fd0b74Schristos case M32C_OPERAND_DST32ANPREFIXED :
53875fd0b74Schristos print_keyword (cd, info, & m32c_cgen_opval_h_ar, fields->f_dst32_an_prefixed, 0);
53975fd0b74Schristos break;
54075fd0b74Schristos case M32C_OPERAND_DST32ANPREFIXEDHI :
54175fd0b74Schristos print_keyword (cd, info, & m32c_cgen_opval_h_ar_HI, fields->f_dst32_an_prefixed, 0);
54275fd0b74Schristos break;
54375fd0b74Schristos case M32C_OPERAND_DST32ANPREFIXEDQI :
54475fd0b74Schristos print_keyword (cd, info, & m32c_cgen_opval_h_ar_QI, fields->f_dst32_an_prefixed, 0);
54575fd0b74Schristos break;
54675fd0b74Schristos case M32C_OPERAND_DST32ANPREFIXEDSI :
54775fd0b74Schristos print_keyword (cd, info, & m32c_cgen_opval_h_ar, fields->f_dst32_an_prefixed, 0);
54875fd0b74Schristos break;
54975fd0b74Schristos case M32C_OPERAND_DST32ANUNPREFIXED :
55075fd0b74Schristos print_keyword (cd, info, & m32c_cgen_opval_h_ar, fields->f_dst32_an_unprefixed, 0);
55175fd0b74Schristos break;
55275fd0b74Schristos case M32C_OPERAND_DST32ANUNPREFIXEDHI :
55375fd0b74Schristos print_keyword (cd, info, & m32c_cgen_opval_h_ar_HI, fields->f_dst32_an_unprefixed, 0);
55475fd0b74Schristos break;
55575fd0b74Schristos case M32C_OPERAND_DST32ANUNPREFIXEDQI :
55675fd0b74Schristos print_keyword (cd, info, & m32c_cgen_opval_h_ar_QI, fields->f_dst32_an_unprefixed, 0);
55775fd0b74Schristos break;
55875fd0b74Schristos case M32C_OPERAND_DST32ANUNPREFIXEDSI :
55975fd0b74Schristos print_keyword (cd, info, & m32c_cgen_opval_h_ar, fields->f_dst32_an_unprefixed, 0);
56075fd0b74Schristos break;
56175fd0b74Schristos case M32C_OPERAND_DST32R0HI_S :
56275fd0b74Schristos print_keyword (cd, info, & m32c_cgen_opval_h_r0, 0, 0);
56375fd0b74Schristos break;
56475fd0b74Schristos case M32C_OPERAND_DST32R0QI_S :
56575fd0b74Schristos print_keyword (cd, info, & m32c_cgen_opval_h_r0l, 0, 0);
56675fd0b74Schristos break;
56775fd0b74Schristos case M32C_OPERAND_DST32RNEXTUNPREFIXEDHI :
56875fd0b74Schristos print_keyword (cd, info, & m32c_cgen_opval_h_gr_ext_HI, fields->f_dst32_rn_ext_unprefixed, 0);
56975fd0b74Schristos break;
57075fd0b74Schristos case M32C_OPERAND_DST32RNEXTUNPREFIXEDQI :
57175fd0b74Schristos print_keyword (cd, info, & m32c_cgen_opval_h_gr_ext_QI, fields->f_dst32_rn_ext_unprefixed, 0);
57275fd0b74Schristos break;
57375fd0b74Schristos case M32C_OPERAND_DST32RNPREFIXEDHI :
57475fd0b74Schristos print_keyword (cd, info, & m32c_cgen_opval_h_gr_HI, fields->f_dst32_rn_prefixed_HI, 0);
57575fd0b74Schristos break;
57675fd0b74Schristos case M32C_OPERAND_DST32RNPREFIXEDQI :
57775fd0b74Schristos print_keyword (cd, info, & m32c_cgen_opval_h_gr_QI, fields->f_dst32_rn_prefixed_QI, 0);
57875fd0b74Schristos break;
57975fd0b74Schristos case M32C_OPERAND_DST32RNPREFIXEDSI :
58075fd0b74Schristos print_keyword (cd, info, & m32c_cgen_opval_h_gr_SI, fields->f_dst32_rn_prefixed_SI, 0);
58175fd0b74Schristos break;
58275fd0b74Schristos case M32C_OPERAND_DST32RNUNPREFIXEDHI :
58375fd0b74Schristos print_keyword (cd, info, & m32c_cgen_opval_h_gr_HI, fields->f_dst32_rn_unprefixed_HI, 0);
58475fd0b74Schristos break;
58575fd0b74Schristos case M32C_OPERAND_DST32RNUNPREFIXEDQI :
58675fd0b74Schristos print_keyword (cd, info, & m32c_cgen_opval_h_gr_QI, fields->f_dst32_rn_unprefixed_QI, 0);
58775fd0b74Schristos break;
58875fd0b74Schristos case M32C_OPERAND_DST32RNUNPREFIXEDSI :
58975fd0b74Schristos print_keyword (cd, info, & m32c_cgen_opval_h_gr_SI, fields->f_dst32_rn_unprefixed_SI, 0);
59075fd0b74Schristos break;
59175fd0b74Schristos case M32C_OPERAND_G :
59275fd0b74Schristos print_G (cd, info, 0, 0|(1<<CGEN_OPERAND_SIGNED), pc, length);
59375fd0b74Schristos break;
59475fd0b74Schristos case M32C_OPERAND_IMM_12_S4 :
59575fd0b74Schristos print_normal (cd, info, fields->f_imm_12_s4, 0|(1<<CGEN_OPERAND_SIGNED), pc, length);
59675fd0b74Schristos break;
59775fd0b74Schristos case M32C_OPERAND_IMM_12_S4N :
59875fd0b74Schristos print_signed4n (cd, info, fields->f_imm_12_s4, 0|(1<<CGEN_OPERAND_SIGNED), pc, length);
59975fd0b74Schristos break;
60075fd0b74Schristos case M32C_OPERAND_IMM_13_U3 :
60175fd0b74Schristos print_normal (cd, info, fields->f_imm_13_u3, 0|(1<<CGEN_OPERAND_SIGNED), pc, length);
60275fd0b74Schristos break;
60375fd0b74Schristos case M32C_OPERAND_IMM_16_HI :
60475fd0b74Schristos print_normal (cd, info, fields->f_dsp_16_s16, 0|(1<<CGEN_OPERAND_SIGNED), pc, length);
60575fd0b74Schristos break;
60675fd0b74Schristos case M32C_OPERAND_IMM_16_QI :
60775fd0b74Schristos print_normal (cd, info, fields->f_dsp_16_s8, 0|(1<<CGEN_OPERAND_SIGNED), pc, length);
60875fd0b74Schristos break;
60975fd0b74Schristos case M32C_OPERAND_IMM_16_SI :
61075fd0b74Schristos print_normal (cd, info, fields->f_dsp_16_s32, 0|(1<<CGEN_OPERAND_SIGNED)|(1<<CGEN_OPERAND_VIRTUAL), pc, length);
61175fd0b74Schristos break;
61275fd0b74Schristos case M32C_OPERAND_IMM_20_S4 :
61375fd0b74Schristos print_normal (cd, info, fields->f_imm_20_s4, 0|(1<<CGEN_OPERAND_SIGNED), pc, length);
61475fd0b74Schristos break;
61575fd0b74Schristos case M32C_OPERAND_IMM_24_HI :
61675fd0b74Schristos print_normal (cd, info, fields->f_dsp_24_s16, 0|(1<<CGEN_OPERAND_SIGNED)|(1<<CGEN_OPERAND_VIRTUAL), pc, length);
61775fd0b74Schristos break;
61875fd0b74Schristos case M32C_OPERAND_IMM_24_QI :
61975fd0b74Schristos print_normal (cd, info, fields->f_dsp_24_s8, 0|(1<<CGEN_OPERAND_SIGNED), pc, length);
62075fd0b74Schristos break;
62175fd0b74Schristos case M32C_OPERAND_IMM_24_SI :
62275fd0b74Schristos print_normal (cd, info, fields->f_dsp_24_s32, 0|(1<<CGEN_OPERAND_SIGNED)|(1<<CGEN_OPERAND_VIRTUAL), pc, length);
62375fd0b74Schristos break;
62475fd0b74Schristos case M32C_OPERAND_IMM_32_HI :
62575fd0b74Schristos print_normal (cd, info, fields->f_dsp_32_s16, 0|(1<<CGEN_OPERAND_SIGNED), pc, length);
62675fd0b74Schristos break;
62775fd0b74Schristos case M32C_OPERAND_IMM_32_QI :
62875fd0b74Schristos print_normal (cd, info, fields->f_dsp_32_s8, 0|(1<<CGEN_OPERAND_SIGNED), pc, length);
62975fd0b74Schristos break;
63075fd0b74Schristos case M32C_OPERAND_IMM_32_SI :
63175fd0b74Schristos print_normal (cd, info, fields->f_dsp_32_s32, 0|(1<<CGEN_OPERAND_SIGNED), pc, length);
63275fd0b74Schristos break;
63375fd0b74Schristos case M32C_OPERAND_IMM_40_HI :
63475fd0b74Schristos print_normal (cd, info, fields->f_dsp_40_s16, 0|(1<<CGEN_OPERAND_SIGNED), pc, length);
63575fd0b74Schristos break;
63675fd0b74Schristos case M32C_OPERAND_IMM_40_QI :
63775fd0b74Schristos print_normal (cd, info, fields->f_dsp_40_s8, 0|(1<<CGEN_OPERAND_SIGNED), pc, length);
63875fd0b74Schristos break;
63975fd0b74Schristos case M32C_OPERAND_IMM_40_SI :
64075fd0b74Schristos print_normal (cd, info, fields->f_dsp_40_s32, 0|(1<<CGEN_OPERAND_SIGNED)|(1<<CGEN_OPERAND_VIRTUAL), pc, length);
64175fd0b74Schristos break;
64275fd0b74Schristos case M32C_OPERAND_IMM_48_HI :
64375fd0b74Schristos print_normal (cd, info, fields->f_dsp_48_s16, 0|(1<<CGEN_OPERAND_SIGNED), pc, length);
64475fd0b74Schristos break;
64575fd0b74Schristos case M32C_OPERAND_IMM_48_QI :
64675fd0b74Schristos print_normal (cd, info, fields->f_dsp_48_s8, 0|(1<<CGEN_OPERAND_SIGNED), pc, length);
64775fd0b74Schristos break;
64875fd0b74Schristos case M32C_OPERAND_IMM_48_SI :
64975fd0b74Schristos print_normal (cd, info, fields->f_dsp_48_s32, 0|(1<<CGEN_OPERAND_SIGNED)|(1<<CGEN_OPERAND_VIRTUAL), pc, length);
65075fd0b74Schristos break;
65175fd0b74Schristos case M32C_OPERAND_IMM_56_HI :
65275fd0b74Schristos print_normal (cd, info, fields->f_dsp_56_s16, 0|(1<<CGEN_OPERAND_SIGNED)|(1<<CGEN_OPERAND_VIRTUAL), pc, length);
65375fd0b74Schristos break;
65475fd0b74Schristos case M32C_OPERAND_IMM_56_QI :
65575fd0b74Schristos print_normal (cd, info, fields->f_dsp_56_s8, 0|(1<<CGEN_OPERAND_SIGNED), pc, length);
65675fd0b74Schristos break;
65775fd0b74Schristos case M32C_OPERAND_IMM_64_HI :
65875fd0b74Schristos print_normal (cd, info, fields->f_dsp_64_s16, 0|(1<<CGEN_OPERAND_SIGNED), pc, length);
65975fd0b74Schristos break;
66075fd0b74Schristos case M32C_OPERAND_IMM_8_HI :
66175fd0b74Schristos print_normal (cd, info, fields->f_dsp_8_s16, 0|(1<<CGEN_OPERAND_SIGNED), pc, length);
66275fd0b74Schristos break;
66375fd0b74Schristos case M32C_OPERAND_IMM_8_QI :
66475fd0b74Schristos print_normal (cd, info, fields->f_dsp_8_s8, 0|(1<<CGEN_OPERAND_SIGNED), pc, length);
66575fd0b74Schristos break;
66675fd0b74Schristos case M32C_OPERAND_IMM_8_S4 :
66775fd0b74Schristos print_normal (cd, info, fields->f_imm_8_s4, 0|(1<<CGEN_OPERAND_SIGNED), pc, length);
66875fd0b74Schristos break;
66975fd0b74Schristos case M32C_OPERAND_IMM_8_S4N :
67075fd0b74Schristos print_signed4n (cd, info, fields->f_imm_8_s4, 0|(1<<CGEN_OPERAND_SIGNED), pc, length);
67175fd0b74Schristos break;
67275fd0b74Schristos case M32C_OPERAND_IMM_SH_12_S4 :
67375fd0b74Schristos print_keyword (cd, info, & m32c_cgen_opval_h_shimm, fields->f_imm_12_s4, 0);
67475fd0b74Schristos break;
67575fd0b74Schristos case M32C_OPERAND_IMM_SH_20_S4 :
67675fd0b74Schristos print_keyword (cd, info, & m32c_cgen_opval_h_shimm, fields->f_imm_20_s4, 0);
67775fd0b74Schristos break;
67875fd0b74Schristos case M32C_OPERAND_IMM_SH_8_S4 :
67975fd0b74Schristos print_keyword (cd, info, & m32c_cgen_opval_h_shimm, fields->f_imm_8_s4, 0);
68075fd0b74Schristos break;
68175fd0b74Schristos case M32C_OPERAND_IMM1_S :
68275fd0b74Schristos print_normal (cd, info, fields->f_imm1_S, 0|(1<<CGEN_OPERAND_SIGNED), pc, length);
68375fd0b74Schristos break;
68475fd0b74Schristos case M32C_OPERAND_IMM3_S :
68575fd0b74Schristos print_normal (cd, info, fields->f_imm3_S, 0|(1<<CGEN_OPERAND_SIGNED)|(1<<CGEN_OPERAND_VIRTUAL), pc, length);
68675fd0b74Schristos break;
68775fd0b74Schristos case M32C_OPERAND_LAB_16_8 :
68875fd0b74Schristos print_address (cd, info, fields->f_lab_16_8, 0|(1<<CGEN_OPERAND_RELAX)|(1<<CGEN_OPERAND_PCREL_ADDR), pc, length);
68975fd0b74Schristos break;
69075fd0b74Schristos case M32C_OPERAND_LAB_24_8 :
69175fd0b74Schristos print_address (cd, info, fields->f_lab_24_8, 0|(1<<CGEN_OPERAND_RELAX)|(1<<CGEN_OPERAND_PCREL_ADDR), pc, length);
69275fd0b74Schristos break;
69375fd0b74Schristos case M32C_OPERAND_LAB_32_8 :
69475fd0b74Schristos print_address (cd, info, fields->f_lab_32_8, 0|(1<<CGEN_OPERAND_RELAX)|(1<<CGEN_OPERAND_PCREL_ADDR), pc, length);
69575fd0b74Schristos break;
69675fd0b74Schristos case M32C_OPERAND_LAB_40_8 :
69775fd0b74Schristos print_address (cd, info, fields->f_lab_40_8, 0|(1<<CGEN_OPERAND_RELAX)|(1<<CGEN_OPERAND_PCREL_ADDR), pc, length);
69875fd0b74Schristos break;
69975fd0b74Schristos case M32C_OPERAND_LAB_5_3 :
70075fd0b74Schristos print_address (cd, info, fields->f_lab_5_3, 0|(1<<CGEN_OPERAND_RELAX)|(1<<CGEN_OPERAND_PCREL_ADDR), pc, length);
70175fd0b74Schristos break;
70275fd0b74Schristos case M32C_OPERAND_LAB_8_16 :
70375fd0b74Schristos print_address (cd, info, fields->f_lab_8_16, 0|(1<<CGEN_OPERAND_RELAX)|(1<<CGEN_OPERAND_SIGN_OPT)|(1<<CGEN_OPERAND_PCREL_ADDR), pc, length);
70475fd0b74Schristos break;
70575fd0b74Schristos case M32C_OPERAND_LAB_8_24 :
70675fd0b74Schristos print_address (cd, info, fields->f_lab_8_24, 0|(1<<CGEN_OPERAND_RELAX)|(1<<CGEN_OPERAND_ABS_ADDR), pc, length);
70775fd0b74Schristos break;
70875fd0b74Schristos case M32C_OPERAND_LAB_8_8 :
70975fd0b74Schristos print_address (cd, info, fields->f_lab_8_8, 0|(1<<CGEN_OPERAND_RELAX)|(1<<CGEN_OPERAND_PCREL_ADDR), pc, length);
71075fd0b74Schristos break;
71175fd0b74Schristos case M32C_OPERAND_LAB32_JMP_S :
71275fd0b74Schristos print_address (cd, info, fields->f_lab32_jmp_s, 0|(1<<CGEN_OPERAND_RELAX)|(1<<CGEN_OPERAND_PCREL_ADDR)|(1<<CGEN_OPERAND_VIRTUAL), pc, length);
71375fd0b74Schristos break;
71475fd0b74Schristos case M32C_OPERAND_Q :
71575fd0b74Schristos print_Q (cd, info, 0, 0|(1<<CGEN_OPERAND_SIGNED), pc, length);
71675fd0b74Schristos break;
71775fd0b74Schristos case M32C_OPERAND_R0 :
71875fd0b74Schristos print_keyword (cd, info, & m32c_cgen_opval_h_r0, 0, 0);
71975fd0b74Schristos break;
72075fd0b74Schristos case M32C_OPERAND_R0H :
72175fd0b74Schristos print_keyword (cd, info, & m32c_cgen_opval_h_r0h, 0, 0);
72275fd0b74Schristos break;
72375fd0b74Schristos case M32C_OPERAND_R0L :
72475fd0b74Schristos print_keyword (cd, info, & m32c_cgen_opval_h_r0l, 0, 0);
72575fd0b74Schristos break;
72675fd0b74Schristos case M32C_OPERAND_R1 :
72775fd0b74Schristos print_keyword (cd, info, & m32c_cgen_opval_h_r1, 0, 0);
72875fd0b74Schristos break;
72975fd0b74Schristos case M32C_OPERAND_R1R2R0 :
73075fd0b74Schristos print_keyword (cd, info, & m32c_cgen_opval_h_r1r2r0, 0, 0);
73175fd0b74Schristos break;
73275fd0b74Schristos case M32C_OPERAND_R2 :
73375fd0b74Schristos print_keyword (cd, info, & m32c_cgen_opval_h_r2, 0, 0);
73475fd0b74Schristos break;
73575fd0b74Schristos case M32C_OPERAND_R2R0 :
73675fd0b74Schristos print_keyword (cd, info, & m32c_cgen_opval_h_r2r0, 0, 0);
73775fd0b74Schristos break;
73875fd0b74Schristos case M32C_OPERAND_R3 :
73975fd0b74Schristos print_keyword (cd, info, & m32c_cgen_opval_h_r3, 0, 0);
74075fd0b74Schristos break;
74175fd0b74Schristos case M32C_OPERAND_R3R1 :
74275fd0b74Schristos print_keyword (cd, info, & m32c_cgen_opval_h_r3r1, 0, 0);
74375fd0b74Schristos break;
74475fd0b74Schristos case M32C_OPERAND_REGSETPOP :
74575fd0b74Schristos print_pop_regset (cd, info, fields->f_8_8, 0, pc, length);
74675fd0b74Schristos break;
74775fd0b74Schristos case M32C_OPERAND_REGSETPUSH :
74875fd0b74Schristos print_push_regset (cd, info, fields->f_8_8, 0, pc, length);
74975fd0b74Schristos break;
75075fd0b74Schristos case M32C_OPERAND_RN16_PUSH_S :
75175fd0b74Schristos print_keyword (cd, info, & m32c_cgen_opval_h_gr_QI, fields->f_4_1, 0);
75275fd0b74Schristos break;
75375fd0b74Schristos case M32C_OPERAND_S :
75475fd0b74Schristos print_S (cd, info, 0, 0|(1<<CGEN_OPERAND_SIGNED), pc, length);
75575fd0b74Schristos break;
75675fd0b74Schristos case M32C_OPERAND_SRC16AN :
75775fd0b74Schristos print_keyword (cd, info, & m32c_cgen_opval_h_ar, fields->f_src16_an, 0);
75875fd0b74Schristos break;
75975fd0b74Schristos case M32C_OPERAND_SRC16ANHI :
76075fd0b74Schristos print_keyword (cd, info, & m32c_cgen_opval_h_ar_HI, fields->f_src16_an, 0);
76175fd0b74Schristos break;
76275fd0b74Schristos case M32C_OPERAND_SRC16ANQI :
76375fd0b74Schristos print_keyword (cd, info, & m32c_cgen_opval_h_ar_QI, fields->f_src16_an, 0);
76475fd0b74Schristos break;
76575fd0b74Schristos case M32C_OPERAND_SRC16RNHI :
76675fd0b74Schristos print_keyword (cd, info, & m32c_cgen_opval_h_gr_HI, fields->f_src16_rn, 0);
76775fd0b74Schristos break;
76875fd0b74Schristos case M32C_OPERAND_SRC16RNQI :
76975fd0b74Schristos print_keyword (cd, info, & m32c_cgen_opval_h_gr_QI, fields->f_src16_rn, 0);
77075fd0b74Schristos break;
77175fd0b74Schristos case M32C_OPERAND_SRC32ANPREFIXED :
77275fd0b74Schristos print_keyword (cd, info, & m32c_cgen_opval_h_ar, fields->f_src32_an_prefixed, 0);
77375fd0b74Schristos break;
77475fd0b74Schristos case M32C_OPERAND_SRC32ANPREFIXEDHI :
77575fd0b74Schristos print_keyword (cd, info, & m32c_cgen_opval_h_ar_HI, fields->f_src32_an_prefixed, 0);
77675fd0b74Schristos break;
77775fd0b74Schristos case M32C_OPERAND_SRC32ANPREFIXEDQI :
77875fd0b74Schristos print_keyword (cd, info, & m32c_cgen_opval_h_ar_QI, fields->f_src32_an_prefixed, 0);
77975fd0b74Schristos break;
78075fd0b74Schristos case M32C_OPERAND_SRC32ANPREFIXEDSI :
78175fd0b74Schristos print_keyword (cd, info, & m32c_cgen_opval_h_ar, fields->f_src32_an_prefixed, 0);
78275fd0b74Schristos break;
78375fd0b74Schristos case M32C_OPERAND_SRC32ANUNPREFIXED :
78475fd0b74Schristos print_keyword (cd, info, & m32c_cgen_opval_h_ar, fields->f_src32_an_unprefixed, 0);
78575fd0b74Schristos break;
78675fd0b74Schristos case M32C_OPERAND_SRC32ANUNPREFIXEDHI :
78775fd0b74Schristos print_keyword (cd, info, & m32c_cgen_opval_h_ar_HI, fields->f_src32_an_unprefixed, 0);
78875fd0b74Schristos break;
78975fd0b74Schristos case M32C_OPERAND_SRC32ANUNPREFIXEDQI :
79075fd0b74Schristos print_keyword (cd, info, & m32c_cgen_opval_h_ar_QI, fields->f_src32_an_unprefixed, 0);
79175fd0b74Schristos break;
79275fd0b74Schristos case M32C_OPERAND_SRC32ANUNPREFIXEDSI :
79375fd0b74Schristos print_keyword (cd, info, & m32c_cgen_opval_h_ar, fields->f_src32_an_unprefixed, 0);
79475fd0b74Schristos break;
79575fd0b74Schristos case M32C_OPERAND_SRC32RNPREFIXEDHI :
79675fd0b74Schristos print_keyword (cd, info, & m32c_cgen_opval_h_gr_HI, fields->f_src32_rn_prefixed_HI, 0);
79775fd0b74Schristos break;
79875fd0b74Schristos case M32C_OPERAND_SRC32RNPREFIXEDQI :
79975fd0b74Schristos print_keyword (cd, info, & m32c_cgen_opval_h_gr_QI, fields->f_src32_rn_prefixed_QI, 0);
80075fd0b74Schristos break;
80175fd0b74Schristos case M32C_OPERAND_SRC32RNPREFIXEDSI :
80275fd0b74Schristos print_keyword (cd, info, & m32c_cgen_opval_h_gr_SI, fields->f_src32_rn_prefixed_SI, 0);
80375fd0b74Schristos break;
80475fd0b74Schristos case M32C_OPERAND_SRC32RNUNPREFIXEDHI :
80575fd0b74Schristos print_keyword (cd, info, & m32c_cgen_opval_h_gr_HI, fields->f_src32_rn_unprefixed_HI, 0);
80675fd0b74Schristos break;
80775fd0b74Schristos case M32C_OPERAND_SRC32RNUNPREFIXEDQI :
80875fd0b74Schristos print_keyword (cd, info, & m32c_cgen_opval_h_gr_QI, fields->f_src32_rn_unprefixed_QI, 0);
80975fd0b74Schristos break;
81075fd0b74Schristos case M32C_OPERAND_SRC32RNUNPREFIXEDSI :
81175fd0b74Schristos print_keyword (cd, info, & m32c_cgen_opval_h_gr_SI, fields->f_src32_rn_unprefixed_SI, 0);
81275fd0b74Schristos break;
81375fd0b74Schristos case M32C_OPERAND_SRCDST16_R0L_R0H_S_NORMAL :
81475fd0b74Schristos print_r0l_r0h (cd, info, fields->f_5_1, 0|(1<<CGEN_OPERAND_SIGNED), pc, length);
81575fd0b74Schristos break;
81675fd0b74Schristos case M32C_OPERAND_X :
81775fd0b74Schristos print_X (cd, info, 0, 0|(1<<CGEN_OPERAND_SIGNED), pc, length);
81875fd0b74Schristos break;
81975fd0b74Schristos case M32C_OPERAND_Z :
82075fd0b74Schristos print_Z (cd, info, 0, 0|(1<<CGEN_OPERAND_SIGNED), pc, length);
82175fd0b74Schristos break;
82275fd0b74Schristos case M32C_OPERAND_COND16_16 :
82375fd0b74Schristos print_keyword (cd, info, & m32c_cgen_opval_h_cond16, fields->f_dsp_16_u8, 0);
82475fd0b74Schristos break;
82575fd0b74Schristos case M32C_OPERAND_COND16_24 :
82675fd0b74Schristos print_keyword (cd, info, & m32c_cgen_opval_h_cond16, fields->f_dsp_24_u8, 0);
82775fd0b74Schristos break;
82875fd0b74Schristos case M32C_OPERAND_COND16_32 :
82975fd0b74Schristos print_keyword (cd, info, & m32c_cgen_opval_h_cond16, fields->f_dsp_32_u8, 0);
83075fd0b74Schristos break;
83175fd0b74Schristos case M32C_OPERAND_COND16C :
83275fd0b74Schristos print_keyword (cd, info, & m32c_cgen_opval_h_cond16c, fields->f_cond16, 0);
83375fd0b74Schristos break;
83475fd0b74Schristos case M32C_OPERAND_COND16J :
83575fd0b74Schristos print_keyword (cd, info, & m32c_cgen_opval_h_cond16j, fields->f_cond16, 0);
83675fd0b74Schristos break;
83775fd0b74Schristos case M32C_OPERAND_COND16J5 :
83875fd0b74Schristos print_keyword (cd, info, & m32c_cgen_opval_h_cond16j_5, fields->f_cond16j_5, 0);
83975fd0b74Schristos break;
84075fd0b74Schristos case M32C_OPERAND_COND32 :
84175fd0b74Schristos print_keyword (cd, info, & m32c_cgen_opval_h_cond32, fields->f_cond32, 0|(1<<CGEN_OPERAND_VIRTUAL));
84275fd0b74Schristos break;
84375fd0b74Schristos case M32C_OPERAND_COND32_16 :
84475fd0b74Schristos print_keyword (cd, info, & m32c_cgen_opval_h_cond32, fields->f_dsp_16_u8, 0);
84575fd0b74Schristos break;
84675fd0b74Schristos case M32C_OPERAND_COND32_24 :
84775fd0b74Schristos print_keyword (cd, info, & m32c_cgen_opval_h_cond32, fields->f_dsp_24_u8, 0);
84875fd0b74Schristos break;
84975fd0b74Schristos case M32C_OPERAND_COND32_32 :
85075fd0b74Schristos print_keyword (cd, info, & m32c_cgen_opval_h_cond32, fields->f_dsp_32_u8, 0);
85175fd0b74Schristos break;
85275fd0b74Schristos case M32C_OPERAND_COND32_40 :
85375fd0b74Schristos print_keyword (cd, info, & m32c_cgen_opval_h_cond32, fields->f_dsp_40_u8, 0);
85475fd0b74Schristos break;
85575fd0b74Schristos case M32C_OPERAND_COND32J :
85675fd0b74Schristos print_keyword (cd, info, & m32c_cgen_opval_h_cond32, fields->f_cond32j, 0|(1<<CGEN_OPERAND_VIRTUAL));
85775fd0b74Schristos break;
85875fd0b74Schristos case M32C_OPERAND_CR1_PREFIXED_32 :
85975fd0b74Schristos print_keyword (cd, info, & m32c_cgen_opval_h_cr1_32, fields->f_21_3, 0);
86075fd0b74Schristos break;
86175fd0b74Schristos case M32C_OPERAND_CR1_UNPREFIXED_32 :
86275fd0b74Schristos print_keyword (cd, info, & m32c_cgen_opval_h_cr1_32, fields->f_13_3, 0);
86375fd0b74Schristos break;
86475fd0b74Schristos case M32C_OPERAND_CR16 :
86575fd0b74Schristos print_keyword (cd, info, & m32c_cgen_opval_h_cr_16, fields->f_9_3, 0);
86675fd0b74Schristos break;
86775fd0b74Schristos case M32C_OPERAND_CR2_32 :
86875fd0b74Schristos print_keyword (cd, info, & m32c_cgen_opval_h_cr2_32, fields->f_13_3, 0);
86975fd0b74Schristos break;
87075fd0b74Schristos case M32C_OPERAND_CR3_PREFIXED_32 :
87175fd0b74Schristos print_keyword (cd, info, & m32c_cgen_opval_h_cr3_32, fields->f_21_3, 0);
87275fd0b74Schristos break;
87375fd0b74Schristos case M32C_OPERAND_CR3_UNPREFIXED_32 :
87475fd0b74Schristos print_keyword (cd, info, & m32c_cgen_opval_h_cr3_32, fields->f_13_3, 0);
87575fd0b74Schristos break;
87675fd0b74Schristos case M32C_OPERAND_FLAGS16 :
87775fd0b74Schristos print_keyword (cd, info, & m32c_cgen_opval_h_flags, fields->f_9_3, 0);
87875fd0b74Schristos break;
87975fd0b74Schristos case M32C_OPERAND_FLAGS32 :
88075fd0b74Schristos print_keyword (cd, info, & m32c_cgen_opval_h_flags, fields->f_13_3, 0);
88175fd0b74Schristos break;
88275fd0b74Schristos case M32C_OPERAND_SCCOND32 :
88375fd0b74Schristos print_keyword (cd, info, & m32c_cgen_opval_h_cond32, fields->f_cond16, 0);
88475fd0b74Schristos break;
88575fd0b74Schristos case M32C_OPERAND_SIZE :
88675fd0b74Schristos print_size (cd, info, 0, 0|(1<<CGEN_OPERAND_SIGNED), pc, length);
88775fd0b74Schristos break;
88875fd0b74Schristos
88975fd0b74Schristos default :
89075fd0b74Schristos /* xgettext:c-format */
891ede78133Schristos opcodes_error_handler
892ede78133Schristos (_("internal error: unrecognized field %d while printing insn"),
89375fd0b74Schristos opindex);
89475fd0b74Schristos abort ();
89575fd0b74Schristos }
89675fd0b74Schristos }
89775fd0b74Schristos
89875fd0b74Schristos cgen_print_fn * const m32c_cgen_print_handlers[] =
89975fd0b74Schristos {
90075fd0b74Schristos print_insn_normal,
90175fd0b74Schristos };
90275fd0b74Schristos
90375fd0b74Schristos
90475fd0b74Schristos void
m32c_cgen_init_dis(CGEN_CPU_DESC cd)90575fd0b74Schristos m32c_cgen_init_dis (CGEN_CPU_DESC cd)
90675fd0b74Schristos {
90775fd0b74Schristos m32c_cgen_init_opcode_table (cd);
90875fd0b74Schristos m32c_cgen_init_ibld_table (cd);
90975fd0b74Schristos cd->print_handlers = & m32c_cgen_print_handlers[0];
91075fd0b74Schristos cd->print_operand = m32c_cgen_print_operand;
91175fd0b74Schristos }
91275fd0b74Schristos
91375fd0b74Schristos
91475fd0b74Schristos /* Default print handler. */
91575fd0b74Schristos
91675fd0b74Schristos static void
print_normal(CGEN_CPU_DESC cd ATTRIBUTE_UNUSED,void * dis_info,long value,unsigned int attrs,bfd_vma pc ATTRIBUTE_UNUSED,int length ATTRIBUTE_UNUSED)91775fd0b74Schristos print_normal (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED,
91875fd0b74Schristos void *dis_info,
91975fd0b74Schristos long value,
92075fd0b74Schristos unsigned int attrs,
92175fd0b74Schristos bfd_vma pc ATTRIBUTE_UNUSED,
92275fd0b74Schristos int length ATTRIBUTE_UNUSED)
92375fd0b74Schristos {
92475fd0b74Schristos disassemble_info *info = (disassemble_info *) dis_info;
92575fd0b74Schristos
92675fd0b74Schristos /* Print the operand as directed by the attributes. */
92775fd0b74Schristos if (CGEN_BOOL_ATTR (attrs, CGEN_OPERAND_SEM_ONLY))
92875fd0b74Schristos ; /* nothing to do */
92975fd0b74Schristos else if (CGEN_BOOL_ATTR (attrs, CGEN_OPERAND_SIGNED))
93075fd0b74Schristos (*info->fprintf_func) (info->stream, "%ld", value);
93175fd0b74Schristos else
93275fd0b74Schristos (*info->fprintf_func) (info->stream, "0x%lx", value);
93375fd0b74Schristos }
93475fd0b74Schristos
93575fd0b74Schristos /* Default address handler. */
93675fd0b74Schristos
93775fd0b74Schristos static void
print_address(CGEN_CPU_DESC cd ATTRIBUTE_UNUSED,void * dis_info,bfd_vma value,unsigned int attrs,bfd_vma pc ATTRIBUTE_UNUSED,int length ATTRIBUTE_UNUSED)93875fd0b74Schristos print_address (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED,
93975fd0b74Schristos void *dis_info,
94075fd0b74Schristos bfd_vma value,
94175fd0b74Schristos unsigned int attrs,
94275fd0b74Schristos bfd_vma pc ATTRIBUTE_UNUSED,
94375fd0b74Schristos int length ATTRIBUTE_UNUSED)
94475fd0b74Schristos {
94575fd0b74Schristos disassemble_info *info = (disassemble_info *) dis_info;
94675fd0b74Schristos
94775fd0b74Schristos /* Print the operand as directed by the attributes. */
94875fd0b74Schristos if (CGEN_BOOL_ATTR (attrs, CGEN_OPERAND_SEM_ONLY))
94975fd0b74Schristos ; /* Nothing to do. */
95075fd0b74Schristos else if (CGEN_BOOL_ATTR (attrs, CGEN_OPERAND_PCREL_ADDR))
95175fd0b74Schristos (*info->print_address_func) (value, info);
95275fd0b74Schristos else if (CGEN_BOOL_ATTR (attrs, CGEN_OPERAND_ABS_ADDR))
95375fd0b74Schristos (*info->print_address_func) (value, info);
95475fd0b74Schristos else if (CGEN_BOOL_ATTR (attrs, CGEN_OPERAND_SIGNED))
95575fd0b74Schristos (*info->fprintf_func) (info->stream, "%ld", (long) value);
95675fd0b74Schristos else
95775fd0b74Schristos (*info->fprintf_func) (info->stream, "0x%lx", (long) value);
95875fd0b74Schristos }
95975fd0b74Schristos
96075fd0b74Schristos /* Keyword print handler. */
96175fd0b74Schristos
96275fd0b74Schristos static void
print_keyword(CGEN_CPU_DESC cd ATTRIBUTE_UNUSED,void * dis_info,CGEN_KEYWORD * keyword_table,long value,unsigned int attrs ATTRIBUTE_UNUSED)96375fd0b74Schristos print_keyword (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED,
96475fd0b74Schristos void *dis_info,
96575fd0b74Schristos CGEN_KEYWORD *keyword_table,
96675fd0b74Schristos long value,
96775fd0b74Schristos unsigned int attrs ATTRIBUTE_UNUSED)
96875fd0b74Schristos {
96975fd0b74Schristos disassemble_info *info = (disassemble_info *) dis_info;
97075fd0b74Schristos const CGEN_KEYWORD_ENTRY *ke;
97175fd0b74Schristos
97275fd0b74Schristos ke = cgen_keyword_lookup_value (keyword_table, value);
97375fd0b74Schristos if (ke != NULL)
97475fd0b74Schristos (*info->fprintf_func) (info->stream, "%s", ke->name);
97575fd0b74Schristos else
97675fd0b74Schristos (*info->fprintf_func) (info->stream, "???");
97775fd0b74Schristos }
97875fd0b74Schristos
97975fd0b74Schristos /* Default insn printer.
98075fd0b74Schristos
98175fd0b74Schristos DIS_INFO is defined as `void *' so the disassembler needn't know anything
98275fd0b74Schristos about disassemble_info. */
98375fd0b74Schristos
98475fd0b74Schristos static void
print_insn_normal(CGEN_CPU_DESC cd,void * dis_info,const CGEN_INSN * insn,CGEN_FIELDS * fields,bfd_vma pc,int length)98575fd0b74Schristos print_insn_normal (CGEN_CPU_DESC cd,
98675fd0b74Schristos void *dis_info,
98775fd0b74Schristos const CGEN_INSN *insn,
98875fd0b74Schristos CGEN_FIELDS *fields,
98975fd0b74Schristos bfd_vma pc,
99075fd0b74Schristos int length)
99175fd0b74Schristos {
99275fd0b74Schristos const CGEN_SYNTAX *syntax = CGEN_INSN_SYNTAX (insn);
99375fd0b74Schristos disassemble_info *info = (disassemble_info *) dis_info;
99475fd0b74Schristos const CGEN_SYNTAX_CHAR_TYPE *syn;
99575fd0b74Schristos
99675fd0b74Schristos CGEN_INIT_PRINT (cd);
99775fd0b74Schristos
99875fd0b74Schristos for (syn = CGEN_SYNTAX_STRING (syntax); *syn; ++syn)
99975fd0b74Schristos {
100075fd0b74Schristos if (CGEN_SYNTAX_MNEMONIC_P (*syn))
100175fd0b74Schristos {
100275fd0b74Schristos (*info->fprintf_func) (info->stream, "%s", CGEN_INSN_MNEMONIC (insn));
100375fd0b74Schristos continue;
100475fd0b74Schristos }
100575fd0b74Schristos if (CGEN_SYNTAX_CHAR_P (*syn))
100675fd0b74Schristos {
100775fd0b74Schristos (*info->fprintf_func) (info->stream, "%c", CGEN_SYNTAX_CHAR (*syn));
100875fd0b74Schristos continue;
100975fd0b74Schristos }
101075fd0b74Schristos
101175fd0b74Schristos /* We have an operand. */
101275fd0b74Schristos m32c_cgen_print_operand (cd, CGEN_SYNTAX_FIELD (*syn), info,
101375fd0b74Schristos fields, CGEN_INSN_ATTRS (insn), pc, length);
101475fd0b74Schristos }
101575fd0b74Schristos }
101675fd0b74Schristos
101775fd0b74Schristos /* Subroutine of print_insn. Reads an insn into the given buffers and updates
101875fd0b74Schristos the extract info.
101975fd0b74Schristos Returns 0 if all is well, non-zero otherwise. */
102075fd0b74Schristos
102175fd0b74Schristos static int
read_insn(CGEN_CPU_DESC cd ATTRIBUTE_UNUSED,bfd_vma pc,disassemble_info * info,bfd_byte * buf,int buflen,CGEN_EXTRACT_INFO * ex_info,unsigned long * insn_value)102275fd0b74Schristos read_insn (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED,
102375fd0b74Schristos bfd_vma pc,
102475fd0b74Schristos disassemble_info *info,
102575fd0b74Schristos bfd_byte *buf,
102675fd0b74Schristos int buflen,
102775fd0b74Schristos CGEN_EXTRACT_INFO *ex_info,
102875fd0b74Schristos unsigned long *insn_value)
102975fd0b74Schristos {
103075fd0b74Schristos int status = (*info->read_memory_func) (pc, buf, buflen, info);
103175fd0b74Schristos
103275fd0b74Schristos if (status != 0)
103375fd0b74Schristos {
103475fd0b74Schristos (*info->memory_error_func) (status, pc, info);
103575fd0b74Schristos return -1;
103675fd0b74Schristos }
103775fd0b74Schristos
103875fd0b74Schristos ex_info->dis_info = info;
103975fd0b74Schristos ex_info->valid = (1 << buflen) - 1;
104075fd0b74Schristos ex_info->insn_bytes = buf;
104175fd0b74Schristos
104275fd0b74Schristos *insn_value = bfd_get_bits (buf, buflen * 8, info->endian == BFD_ENDIAN_BIG);
104375fd0b74Schristos return 0;
104475fd0b74Schristos }
104575fd0b74Schristos
104675fd0b74Schristos /* Utility to print an insn.
104775fd0b74Schristos BUF is the base part of the insn, target byte order, BUFLEN bytes long.
104875fd0b74Schristos The result is the size of the insn in bytes or zero for an unknown insn
104975fd0b74Schristos or -1 if an error occurs fetching data (memory_error_func will have
105075fd0b74Schristos been called). */
105175fd0b74Schristos
105275fd0b74Schristos static int
print_insn(CGEN_CPU_DESC cd,bfd_vma pc,disassemble_info * info,bfd_byte * buf,unsigned int buflen)105375fd0b74Schristos print_insn (CGEN_CPU_DESC cd,
105475fd0b74Schristos bfd_vma pc,
105575fd0b74Schristos disassemble_info *info,
105675fd0b74Schristos bfd_byte *buf,
105775fd0b74Schristos unsigned int buflen)
105875fd0b74Schristos {
105975fd0b74Schristos CGEN_INSN_INT insn_value;
106075fd0b74Schristos const CGEN_INSN_LIST *insn_list;
106175fd0b74Schristos CGEN_EXTRACT_INFO ex_info;
106275fd0b74Schristos int basesize;
106375fd0b74Schristos
106475fd0b74Schristos /* Extract base part of instruction, just in case CGEN_DIS_* uses it. */
106575fd0b74Schristos basesize = cd->base_insn_bitsize < buflen * 8 ?
106675fd0b74Schristos cd->base_insn_bitsize : buflen * 8;
1067*e992f068Schristos insn_value = cgen_get_insn_value (cd, buf, basesize, cd->insn_endian);
106875fd0b74Schristos
106975fd0b74Schristos
107075fd0b74Schristos /* Fill in ex_info fields like read_insn would. Don't actually call
107175fd0b74Schristos read_insn, since the incoming buffer is already read (and possibly
107275fd0b74Schristos modified a la m32r). */
107375fd0b74Schristos ex_info.valid = (1 << buflen) - 1;
107475fd0b74Schristos ex_info.dis_info = info;
107575fd0b74Schristos ex_info.insn_bytes = buf;
107675fd0b74Schristos
107775fd0b74Schristos /* The instructions are stored in hash lists.
107875fd0b74Schristos Pick the first one and keep trying until we find the right one. */
107975fd0b74Schristos
108075fd0b74Schristos insn_list = CGEN_DIS_LOOKUP_INSN (cd, (char *) buf, insn_value);
108175fd0b74Schristos while (insn_list != NULL)
108275fd0b74Schristos {
108375fd0b74Schristos const CGEN_INSN *insn = insn_list->insn;
108475fd0b74Schristos CGEN_FIELDS fields;
108575fd0b74Schristos int length;
108675fd0b74Schristos unsigned long insn_value_cropped;
108775fd0b74Schristos
108875fd0b74Schristos #ifdef CGEN_VALIDATE_INSN_SUPPORTED
108975fd0b74Schristos /* Not needed as insn shouldn't be in hash lists if not supported. */
109075fd0b74Schristos /* Supported by this cpu? */
109175fd0b74Schristos if (! m32c_cgen_insn_supported (cd, insn))
109275fd0b74Schristos {
109375fd0b74Schristos insn_list = CGEN_DIS_NEXT_INSN (insn_list);
109475fd0b74Schristos continue;
109575fd0b74Schristos }
109675fd0b74Schristos #endif
109775fd0b74Schristos
109875fd0b74Schristos /* Basic bit mask must be correct. */
109975fd0b74Schristos /* ??? May wish to allow target to defer this check until the extract
110075fd0b74Schristos handler. */
110175fd0b74Schristos
110275fd0b74Schristos /* Base size may exceed this instruction's size. Extract the
110375fd0b74Schristos relevant part from the buffer. */
110475fd0b74Schristos if ((unsigned) (CGEN_INSN_BITSIZE (insn) / 8) < buflen &&
110575fd0b74Schristos (unsigned) (CGEN_INSN_BITSIZE (insn) / 8) <= sizeof (unsigned long))
110675fd0b74Schristos insn_value_cropped = bfd_get_bits (buf, CGEN_INSN_BITSIZE (insn),
110775fd0b74Schristos info->endian == BFD_ENDIAN_BIG);
110875fd0b74Schristos else
110975fd0b74Schristos insn_value_cropped = insn_value;
111075fd0b74Schristos
111175fd0b74Schristos if ((insn_value_cropped & CGEN_INSN_BASE_MASK (insn))
111275fd0b74Schristos == CGEN_INSN_BASE_VALUE (insn))
111375fd0b74Schristos {
111475fd0b74Schristos /* Printing is handled in two passes. The first pass parses the
111575fd0b74Schristos machine insn and extracts the fields. The second pass prints
111675fd0b74Schristos them. */
111775fd0b74Schristos
111875fd0b74Schristos /* Make sure the entire insn is loaded into insn_value, if it
111975fd0b74Schristos can fit. */
112075fd0b74Schristos if (((unsigned) CGEN_INSN_BITSIZE (insn) > cd->base_insn_bitsize) &&
112175fd0b74Schristos (unsigned) (CGEN_INSN_BITSIZE (insn) / 8) <= sizeof (unsigned long))
112275fd0b74Schristos {
112375fd0b74Schristos unsigned long full_insn_value;
112475fd0b74Schristos int rc = read_insn (cd, pc, info, buf,
112575fd0b74Schristos CGEN_INSN_BITSIZE (insn) / 8,
112675fd0b74Schristos & ex_info, & full_insn_value);
112775fd0b74Schristos if (rc != 0)
112875fd0b74Schristos return rc;
112975fd0b74Schristos length = CGEN_EXTRACT_FN (cd, insn)
113075fd0b74Schristos (cd, insn, &ex_info, full_insn_value, &fields, pc);
113175fd0b74Schristos }
113275fd0b74Schristos else
113375fd0b74Schristos length = CGEN_EXTRACT_FN (cd, insn)
113475fd0b74Schristos (cd, insn, &ex_info, insn_value_cropped, &fields, pc);
113575fd0b74Schristos
113675fd0b74Schristos /* Length < 0 -> error. */
113775fd0b74Schristos if (length < 0)
113875fd0b74Schristos return length;
113975fd0b74Schristos if (length > 0)
114075fd0b74Schristos {
114175fd0b74Schristos CGEN_PRINT_FN (cd, insn) (cd, info, insn, &fields, pc, length);
114275fd0b74Schristos /* Length is in bits, result is in bytes. */
114375fd0b74Schristos return length / 8;
114475fd0b74Schristos }
114575fd0b74Schristos }
114675fd0b74Schristos
114775fd0b74Schristos insn_list = CGEN_DIS_NEXT_INSN (insn_list);
114875fd0b74Schristos }
114975fd0b74Schristos
115075fd0b74Schristos return 0;
115175fd0b74Schristos }
115275fd0b74Schristos
115375fd0b74Schristos /* Default value for CGEN_PRINT_INSN.
115475fd0b74Schristos The result is the size of the insn in bytes or zero for an unknown insn
115575fd0b74Schristos or -1 if an error occured fetching bytes. */
115675fd0b74Schristos
115775fd0b74Schristos #ifndef CGEN_PRINT_INSN
115875fd0b74Schristos #define CGEN_PRINT_INSN default_print_insn
115975fd0b74Schristos #endif
116075fd0b74Schristos
116175fd0b74Schristos static int
default_print_insn(CGEN_CPU_DESC cd,bfd_vma pc,disassemble_info * info)116275fd0b74Schristos default_print_insn (CGEN_CPU_DESC cd, bfd_vma pc, disassemble_info *info)
116375fd0b74Schristos {
116475fd0b74Schristos bfd_byte buf[CGEN_MAX_INSN_SIZE];
116575fd0b74Schristos int buflen;
116675fd0b74Schristos int status;
116775fd0b74Schristos
116875fd0b74Schristos /* Attempt to read the base part of the insn. */
116975fd0b74Schristos buflen = cd->base_insn_bitsize / 8;
117075fd0b74Schristos status = (*info->read_memory_func) (pc, buf, buflen, info);
117175fd0b74Schristos
117275fd0b74Schristos /* Try again with the minimum part, if min < base. */
117375fd0b74Schristos if (status != 0 && (cd->min_insn_bitsize < cd->base_insn_bitsize))
117475fd0b74Schristos {
117575fd0b74Schristos buflen = cd->min_insn_bitsize / 8;
117675fd0b74Schristos status = (*info->read_memory_func) (pc, buf, buflen, info);
117775fd0b74Schristos }
117875fd0b74Schristos
117975fd0b74Schristos if (status != 0)
118075fd0b74Schristos {
118175fd0b74Schristos (*info->memory_error_func) (status, pc, info);
118275fd0b74Schristos return -1;
118375fd0b74Schristos }
118475fd0b74Schristos
118575fd0b74Schristos return print_insn (cd, pc, info, buf, buflen);
118675fd0b74Schristos }
118775fd0b74Schristos
118875fd0b74Schristos /* Main entry point.
118975fd0b74Schristos Print one instruction from PC on INFO->STREAM.
119075fd0b74Schristos Return the size of the instruction (in bytes). */
119175fd0b74Schristos
119275fd0b74Schristos typedef struct cpu_desc_list
119375fd0b74Schristos {
119475fd0b74Schristos struct cpu_desc_list *next;
119575fd0b74Schristos CGEN_BITSET *isa;
119675fd0b74Schristos int mach;
119775fd0b74Schristos int endian;
1198*e992f068Schristos int insn_endian;
119975fd0b74Schristos CGEN_CPU_DESC cd;
120075fd0b74Schristos } cpu_desc_list;
120175fd0b74Schristos
120275fd0b74Schristos int
print_insn_m32c(bfd_vma pc,disassemble_info * info)120375fd0b74Schristos print_insn_m32c (bfd_vma pc, disassemble_info *info)
120475fd0b74Schristos {
120575fd0b74Schristos static cpu_desc_list *cd_list = 0;
120675fd0b74Schristos cpu_desc_list *cl = 0;
120775fd0b74Schristos static CGEN_CPU_DESC cd = 0;
120875fd0b74Schristos static CGEN_BITSET *prev_isa;
120975fd0b74Schristos static int prev_mach;
121075fd0b74Schristos static int prev_endian;
1211*e992f068Schristos static int prev_insn_endian;
121275fd0b74Schristos int length;
121375fd0b74Schristos CGEN_BITSET *isa;
121475fd0b74Schristos int mach;
121575fd0b74Schristos int endian = (info->endian == BFD_ENDIAN_BIG
121675fd0b74Schristos ? CGEN_ENDIAN_BIG
121775fd0b74Schristos : CGEN_ENDIAN_LITTLE);
1218*e992f068Schristos int insn_endian = (info->endian_code == BFD_ENDIAN_BIG
1219*e992f068Schristos ? CGEN_ENDIAN_BIG
1220*e992f068Schristos : CGEN_ENDIAN_LITTLE);
122175fd0b74Schristos enum bfd_architecture arch;
122275fd0b74Schristos
122375fd0b74Schristos /* ??? gdb will set mach but leave the architecture as "unknown" */
122475fd0b74Schristos #ifndef CGEN_BFD_ARCH
122575fd0b74Schristos #define CGEN_BFD_ARCH bfd_arch_m32c
122675fd0b74Schristos #endif
122775fd0b74Schristos arch = info->arch;
122875fd0b74Schristos if (arch == bfd_arch_unknown)
122975fd0b74Schristos arch = CGEN_BFD_ARCH;
123075fd0b74Schristos
123175fd0b74Schristos /* There's no standard way to compute the machine or isa number
123275fd0b74Schristos so we leave it to the target. */
123375fd0b74Schristos #ifdef CGEN_COMPUTE_MACH
123475fd0b74Schristos mach = CGEN_COMPUTE_MACH (info);
123575fd0b74Schristos #else
123675fd0b74Schristos mach = info->mach;
123775fd0b74Schristos #endif
123875fd0b74Schristos
123975fd0b74Schristos #ifdef CGEN_COMPUTE_ISA
124075fd0b74Schristos {
124175fd0b74Schristos static CGEN_BITSET *permanent_isa;
124275fd0b74Schristos
124375fd0b74Schristos if (!permanent_isa)
124475fd0b74Schristos permanent_isa = cgen_bitset_create (MAX_ISAS);
124575fd0b74Schristos isa = permanent_isa;
124675fd0b74Schristos cgen_bitset_clear (isa);
124775fd0b74Schristos cgen_bitset_add (isa, CGEN_COMPUTE_ISA (info));
124875fd0b74Schristos }
124975fd0b74Schristos #else
1250012573ebSchristos isa = info->private_data;
125175fd0b74Schristos #endif
125275fd0b74Schristos
125375fd0b74Schristos /* If we've switched cpu's, try to find a handle we've used before */
125475fd0b74Schristos if (cd
125575fd0b74Schristos && (cgen_bitset_compare (isa, prev_isa) != 0
125675fd0b74Schristos || mach != prev_mach
125775fd0b74Schristos || endian != prev_endian))
125875fd0b74Schristos {
125975fd0b74Schristos cd = 0;
126075fd0b74Schristos for (cl = cd_list; cl; cl = cl->next)
126175fd0b74Schristos {
126275fd0b74Schristos if (cgen_bitset_compare (cl->isa, isa) == 0 &&
126375fd0b74Schristos cl->mach == mach &&
126475fd0b74Schristos cl->endian == endian)
126575fd0b74Schristos {
126675fd0b74Schristos cd = cl->cd;
126775fd0b74Schristos prev_isa = cd->isas;
126875fd0b74Schristos break;
126975fd0b74Schristos }
127075fd0b74Schristos }
127175fd0b74Schristos }
127275fd0b74Schristos
127375fd0b74Schristos /* If we haven't initialized yet, initialize the opcode table. */
127475fd0b74Schristos if (! cd)
127575fd0b74Schristos {
127675fd0b74Schristos const bfd_arch_info_type *arch_type = bfd_lookup_arch (arch, mach);
127775fd0b74Schristos const char *mach_name;
127875fd0b74Schristos
127975fd0b74Schristos if (!arch_type)
128075fd0b74Schristos abort ();
128175fd0b74Schristos mach_name = arch_type->printable_name;
128275fd0b74Schristos
128375fd0b74Schristos prev_isa = cgen_bitset_copy (isa);
128475fd0b74Schristos prev_mach = mach;
128575fd0b74Schristos prev_endian = endian;
1286*e992f068Schristos prev_insn_endian = insn_endian;
128775fd0b74Schristos cd = m32c_cgen_cpu_open (CGEN_CPU_OPEN_ISAS, prev_isa,
128875fd0b74Schristos CGEN_CPU_OPEN_BFDMACH, mach_name,
128975fd0b74Schristos CGEN_CPU_OPEN_ENDIAN, prev_endian,
1290*e992f068Schristos CGEN_CPU_OPEN_INSN_ENDIAN, prev_insn_endian,
129175fd0b74Schristos CGEN_CPU_OPEN_END);
129275fd0b74Schristos if (!cd)
129375fd0b74Schristos abort ();
129475fd0b74Schristos
129575fd0b74Schristos /* Save this away for future reference. */
129675fd0b74Schristos cl = xmalloc (sizeof (struct cpu_desc_list));
129775fd0b74Schristos cl->cd = cd;
129875fd0b74Schristos cl->isa = prev_isa;
129975fd0b74Schristos cl->mach = mach;
130075fd0b74Schristos cl->endian = endian;
130175fd0b74Schristos cl->next = cd_list;
130275fd0b74Schristos cd_list = cl;
130375fd0b74Schristos
130475fd0b74Schristos m32c_cgen_init_dis (cd);
130575fd0b74Schristos }
130675fd0b74Schristos
130775fd0b74Schristos /* We try to have as much common code as possible.
130875fd0b74Schristos But at this point some targets need to take over. */
130975fd0b74Schristos /* ??? Some targets may need a hook elsewhere. Try to avoid this,
131075fd0b74Schristos but if not possible try to move this hook elsewhere rather than
131175fd0b74Schristos have two hooks. */
131275fd0b74Schristos length = CGEN_PRINT_INSN (cd, pc, info);
131375fd0b74Schristos if (length > 0)
131475fd0b74Schristos return length;
131575fd0b74Schristos if (length < 0)
131675fd0b74Schristos return -1;
131775fd0b74Schristos
131875fd0b74Schristos (*info->fprintf_func) (info->stream, UNKNOWN_INSN_MSG);
131975fd0b74Schristos return cd->default_insn_bitsize / 8;
132075fd0b74Schristos }
1321