/* CPU data for i960. THIS FILE IS MACHINE GENERATED WITH CGEN. Copyright (C) 1996, 1997, 1998, 1999 Free Software Foundation, Inc. This file is part of the GNU Binutils and/or GDB, the GNU debugger. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "sysdep.h" #include #include #include "ansidecl.h" #include "bfd.h" #include "symcat.h" #include "i960-desc.h" #include "i960-opc.h" #include "opintl.h" /* Attributes. */ static const CGEN_ATTR_ENTRY bool_attr[] = { { "#f", 0 }, { "#t", 1 }, { 0, 0 } }; static const CGEN_ATTR_ENTRY MACH_attr[] = { { "base", MACH_BASE }, { "i960_ka_sa", MACH_I960_KA_SA }, { "i960_ca", MACH_I960_CA }, { "max", MACH_MAX }, { 0, 0 } }; const CGEN_ATTR_TABLE i960_cgen_ifield_attr_table[] = { { "MACH", & MACH_attr[0] }, { "VIRTUAL", &bool_attr[0], &bool_attr[0] }, { "UNSIGNED", &bool_attr[0], &bool_attr[0] }, { "PCREL-ADDR", &bool_attr[0], &bool_attr[0] }, { "ABS-ADDR", &bool_attr[0], &bool_attr[0] }, { "RESERVED", &bool_attr[0], &bool_attr[0] }, { "SIGN-OPT", &bool_attr[0], &bool_attr[0] }, { 0, 0, 0 } }; const CGEN_ATTR_TABLE i960_cgen_hardware_attr_table[] = { { "MACH", & MACH_attr[0] }, { "VIRTUAL", &bool_attr[0], &bool_attr[0] }, { "UNSIGNED", &bool_attr[0], &bool_attr[0] }, { "SIGNED", &bool_attr[0], &bool_attr[0] }, { "CACHE-ADDR", &bool_attr[0], &bool_attr[0] }, { "FUN-ACCESS", &bool_attr[0], &bool_attr[0] }, { "PC", &bool_attr[0], &bool_attr[0] }, { "PROFILE", &bool_attr[0], &bool_attr[0] }, { 0, 0, 0 } }; const CGEN_ATTR_TABLE i960_cgen_operand_attr_table[] = { { "MACH", & MACH_attr[0] }, { "VIRTUAL", &bool_attr[0], &bool_attr[0] }, { "UNSIGNED", &bool_attr[0], &bool_attr[0] }, { "PCREL-ADDR", &bool_attr[0], &bool_attr[0] }, { "ABS-ADDR", &bool_attr[0], &bool_attr[0] }, { "SIGN-OPT", &bool_attr[0], &bool_attr[0] }, { "NEGATIVE", &bool_attr[0], &bool_attr[0] }, { "RELAX", &bool_attr[0], &bool_attr[0] }, { "SEM-ONLY", &bool_attr[0], &bool_attr[0] }, { 0, 0, 0 } }; const CGEN_ATTR_TABLE i960_cgen_insn_attr_table[] = { { "MACH", & MACH_attr[0] }, { "ALIAS", &bool_attr[0], &bool_attr[0] }, { "VIRTUAL", &bool_attr[0], &bool_attr[0] }, { "UNCOND-CTI", &bool_attr[0], &bool_attr[0] }, { "COND-CTI", &bool_attr[0], &bool_attr[0] }, { "SKIP-CTI", &bool_attr[0], &bool_attr[0] }, { "DELAY-SLOT", &bool_attr[0], &bool_attr[0] }, { "RELAXABLE", &bool_attr[0], &bool_attr[0] }, { "RELAX", &bool_attr[0], &bool_attr[0] }, { "NO-DIS", &bool_attr[0], &bool_attr[0] }, { "PBB", &bool_attr[0], &bool_attr[0] }, { 0, 0, 0 } }; CGEN_KEYWORD_ENTRY i960_cgen_opval_h_gr_entries[] = { { "fp", 31 }, { "sp", 1 }, { "r0", 0 }, { "r1", 1 }, { "r2", 2 }, { "r3", 3 }, { "r4", 4 }, { "r5", 5 }, { "r6", 6 }, { "r7", 7 }, { "r8", 8 }, { "r9", 9 }, { "r10", 10 }, { "r11", 11 }, { "r12", 12 }, { "r13", 13 }, { "r14", 14 }, { "r15", 15 }, { "g0", 16 }, { "g1", 17 }, { "g2", 18 }, { "g3", 19 }, { "g4", 20 }, { "g5", 21 }, { "g6", 22 }, { "g7", 23 }, { "g8", 24 }, { "g9", 25 }, { "g10", 26 }, { "g11", 27 }, { "g12", 28 }, { "g13", 29 }, { "g14", 30 }, { "g15", 31 } }; CGEN_KEYWORD i960_cgen_opval_h_gr = { & i960_cgen_opval_h_gr_entries[0], 34 }; CGEN_KEYWORD_ENTRY i960_cgen_opval_h_cc_entries[] = { { "cc", 0 } }; CGEN_KEYWORD i960_cgen_opval_h_cc = { & i960_cgen_opval_h_cc_entries[0], 1 }; /* The hardware table. */ #define A(a) (1 << (CONCAT2 (CGEN_HW_,a) - CGEN_ATTR_BOOL_OFFSET)) #define HW_ENT(n) i960_cgen_hw_table[n] const CGEN_HW_ENTRY i960_cgen_hw_table[] = { { HW_H_PC, & HW_ENT (HW_H_PC + 1), "h-pc", CGEN_ASM_KEYWORD, (PTR) 0, { CGEN_HW_NBOOL_ATTRS, 0|A(PROFILE)|A(PC), { (1<mach = mach; cd->endian = endian; /* FIXME: for the sparc case we can determine insn-endianness statically. The worry here is where both data and insn endian can be independently chosen, in which case this function will need another argument. Actually, will want to allow for more arguments in the future anyway. */ cd->insn_endian = endian; cd->int_insn_p = CGEN_INT_INSN_P; cd->max_insn_size = CGEN_MAX_INSN_SIZE; cd->hw_list = & i960_cgen_hw_table[0]; cd->ifld_table = & i960_cgen_ifld_table[0]; cd->operand_table = & i960_cgen_operand_table[0]; { int i; const CGEN_IBASE *ib = & i960_cgen_insn_table[0]; CGEN_INSN *insns = (CGEN_INSN *) xmalloc (MAX_INSNS * sizeof (CGEN_INSN)); memset (insns, 0, MAX_INSNS * sizeof (CGEN_INSN)); for (i = 0; i < MAX_INSNS; ++i) insns[i].base = &ib[i]; cd->insn_table.init_entries = insns; } cd->insn_table.entry_size = sizeof (CGEN_IBASE); cd->insn_table.num_init_entries = MAX_INSNS; return (CGEN_CPU_DESC) cd; } /* Close a cpu table. */ void i960_cgen_cpu_close (cd) CGEN_CPU_DESC cd; { if (cd->insn_table.init_entries) free ((CGEN_INSN *) cd->insn_table.init_entries); free (cd); }