X-Git-Url: http://drtracing.org/?a=blobdiff_plain;f=opcodes%2Fm32r-desc.c;h=de7bde44fdc9293a7a56a22085a65ecaeb0e27f9;hb=6a51a8a8d34f57a9b88de4961c67d0a4cb7026e3;hp=111eb2d9a0fcba8ae16e26d7defddf0bf2b2e898;hpb=060d22b0d0cbc7786f83c236ed9812343530dc80;p=deliverable%2Fbinutils-gdb.git diff --git a/opcodes/m32r-desc.c b/opcodes/m32r-desc.c index 111eb2d9a0..de7bde44fd 100644 --- a/opcodes/m32r-desc.c +++ b/opcodes/m32r-desc.c @@ -2,7 +2,7 @@ THIS FILE IS MACHINE GENERATED WITH CGEN. -Copyright 1996, 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc. +Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc. This file is part of the GNU Binutils and/or GDB, the GNU debugger. @@ -23,7 +23,6 @@ with this program; if not, write to the Free Software Foundation, Inc., */ #include "sysdep.h" -#include #include #include #include "ansidecl.h" @@ -136,9 +135,9 @@ static const CGEN_ISA m32r_cgen_isa_table[] = { /* Machine variants. */ static const CGEN_MACH m32r_cgen_mach_table[] = { - { "m32r", "m32r", MACH_M32R }, - { "m32rx", "m32rx", MACH_M32RX }, - { 0, 0, 0 } + { "m32r", "m32r", MACH_M32R, 0 }, + { "m32rx", "m32rx", MACH_M32RX, 0 }, + { 0, 0, 0, 0 } }; static CGEN_KEYWORD_ENTRY m32r_cgen_opval_gr_names_entries[] = @@ -168,7 +167,7 @@ CGEN_KEYWORD m32r_cgen_opval_gr_names = { & m32r_cgen_opval_gr_names_entries[0], 19, - 0, 0, 0, 0 + 0, 0, 0, 0, "" }; static CGEN_KEYWORD_ENTRY m32r_cgen_opval_cr_names_entries[] = @@ -202,7 +201,7 @@ CGEN_KEYWORD m32r_cgen_opval_cr_names = { & m32r_cgen_opval_cr_names_entries[0], 23, - 0, 0, 0, 0 + 0, 0, 0, 0, "" }; static CGEN_KEYWORD_ENTRY m32r_cgen_opval_h_accums_entries[] = @@ -215,7 +214,7 @@ CGEN_KEYWORD m32r_cgen_opval_h_accums = { & m32r_cgen_opval_h_accums_entries[0], 2, - 0, 0, 0, 0 + 0, 0, 0, 0, "" }; @@ -295,6 +294,14 @@ const CGEN_IFLD m32r_cgen_ifld_table[] = #undef A + +/* multi ifield declarations */ + + + +/* multi ifield definitions */ + + /* The operand table. */ #if defined (__STDC__) || defined (ALMOST_STDC) || defined (HAVE_STRINGIZE) @@ -312,81 +319,107 @@ const CGEN_OPERAND m32r_cgen_operand_table[] = { /* pc: program counter */ { "pc", M32R_OPERAND_PC, HW_H_PC, 0, 0, + { 0, &(m32r_cgen_ifld_table[0]) }, { 0|A(SEM_ONLY), { (1<isas; -#if 0 unsigned int machs = cd->machs; -#endif cd->int_insn_p = CGEN_INT_INSN_P; @@ -1219,8 +1259,8 @@ m32r_cgen_rebuild_tables (cd) { const CGEN_ISA *isa = & m32r_cgen_isa_table[i]; - /* Default insn sizes of all selected isas must be equal or we set - the result to 0, meaning "unknown". */ + /* Default insn sizes of all selected isas must be + equal or we set the result to 0, meaning "unknown". */ if (cd->default_insn_bitsize == UNSET) cd->default_insn_bitsize = isa->default_insn_bitsize; else if (isa->default_insn_bitsize == cd->default_insn_bitsize) @@ -1228,8 +1268,8 @@ m32r_cgen_rebuild_tables (cd) else cd->default_insn_bitsize = CGEN_SIZE_UNKNOWN; - /* Base insn sizes of all selected isas must be equal or we set - the result to 0, meaning "unknown". */ + /* Base insn sizes of all selected isas must be equal + or we set the result to 0, meaning "unknown". */ if (cd->base_insn_bitsize == UNSET) cd->base_insn_bitsize = isa->base_insn_bitsize; else if (isa->base_insn_bitsize == cd->base_insn_bitsize) @@ -1242,20 +1282,26 @@ m32r_cgen_rebuild_tables (cd) cd->min_insn_bitsize = isa->min_insn_bitsize; if (isa->max_insn_bitsize > cd->max_insn_bitsize) cd->max_insn_bitsize = isa->max_insn_bitsize; - - ++n_isas; } -#if 0 /* Does nothing?? */ /* Data derived from the mach spec. */ for (i = 0; i < MAX_MACHS; ++i) if (((1 << i) & machs) != 0) { const CGEN_MACH *mach = & m32r_cgen_mach_table[i]; - ++n_machs; + if (mach->insn_chunk_bitsize != 0) + { + if (cd->insn_chunk_bitsize != 0 && cd->insn_chunk_bitsize != mach->insn_chunk_bitsize) + { + fprintf (stderr, "m32r_cgen_rebuild_tables: conflicting insn-chunk-bitsize values: `%d' vs. `%d'\n", + cd->insn_chunk_bitsize, mach->insn_chunk_bitsize); + abort (); + } + + cd->insn_chunk_bitsize = mach->insn_chunk_bitsize; + } } -#endif /* Determine which hw elements are used by MACH. */ build_hw_table (cd); @@ -1324,7 +1370,7 @@ m32r_cgen_cpu_open (enum cgen_cpu_open_arg arg_type, ...) const CGEN_MACH *mach = lookup_mach_via_bfd_name (m32r_cgen_mach_table, name); - machs |= mach->num << 1; + machs |= 1 << mach->num; break; } case CGEN_CPU_OPEN_ENDIAN : @@ -1395,10 +1441,43 @@ void m32r_cgen_cpu_close (cd) CGEN_CPU_DESC cd; { + unsigned int i; + CGEN_INSN *insns; + + if (cd->macro_insn_table.init_entries) + { + insns = cd->macro_insn_table.init_entries; + for (i = 0; i < cd->macro_insn_table.num_init_entries; ++i, ++insns) + { + if (CGEN_INSN_RX ((insns))) + regfree(CGEN_INSN_RX (insns)); + } + } + + if (cd->insn_table.init_entries) + { + insns = cd->insn_table.init_entries; + for (i = 0; i < cd->insn_table.num_init_entries; ++i, ++insns) + { + if (CGEN_INSN_RX (insns)) + regfree(CGEN_INSN_RX (insns)); + } + } + + + + if (cd->macro_insn_table.init_entries) + free ((CGEN_INSN *) cd->macro_insn_table.init_entries); + if (cd->insn_table.init_entries) free ((CGEN_INSN *) cd->insn_table.init_entries); + if (cd->hw_table.entries) free ((CGEN_HW_ENTRY *) cd->hw_table.entries); + + if (cd->operand_table.entries) + free ((CGEN_HW_ENTRY *) cd->operand_table.entries); + free (cd); }