1f7cc78ecSespie /* CPU data header for m32r. 2f7cc78ecSespie 3f7cc78ecSespie THIS FILE IS MACHINE GENERATED WITH CGEN. 4f7cc78ecSespie 5d2201f2fSdrahn Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc. 6f7cc78ecSespie 7f7cc78ecSespie This file is part of the GNU Binutils and/or GDB, the GNU debugger. 8f7cc78ecSespie 9f7cc78ecSespie This program is free software; you can redistribute it and/or modify 10f7cc78ecSespie it under the terms of the GNU General Public License as published by 11f7cc78ecSespie the Free Software Foundation; either version 2, or (at your option) 12f7cc78ecSespie any later version. 13f7cc78ecSespie 14f7cc78ecSespie This program is distributed in the hope that it will be useful, 15f7cc78ecSespie but WITHOUT ANY WARRANTY; without even the implied warranty of 16f7cc78ecSespie MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17f7cc78ecSespie GNU General Public License for more details. 18f7cc78ecSespie 19f7cc78ecSespie You should have received a copy of the GNU General Public License along 20f7cc78ecSespie with this program; if not, write to the Free Software Foundation, Inc., 21f7cc78ecSespie 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 22f7cc78ecSespie 23f7cc78ecSespie */ 24f7cc78ecSespie 25f7cc78ecSespie #ifndef M32R_CPU_H 26f7cc78ecSespie #define M32R_CPU_H 27f7cc78ecSespie 28f7cc78ecSespie #define CGEN_ARCH m32r 29f7cc78ecSespie 30f7cc78ecSespie /* Given symbol S, return m32r_cgen_<S>. */ 31d2201f2fSdrahn #if defined (__STDC__) || defined (ALMOST_STDC) || defined (HAVE_STRINGIZE) 32d2201f2fSdrahn #define CGEN_SYM(s) m32r##_cgen_##s 33d2201f2fSdrahn #else 34d2201f2fSdrahn #define CGEN_SYM(s) m32r/**/_cgen_/**/s 35d2201f2fSdrahn #endif 36d2201f2fSdrahn 37f7cc78ecSespie 38f7cc78ecSespie /* Selected cpu families. */ 39f7cc78ecSespie #define HAVE_CPU_M32RBF 40f7cc78ecSespie #define HAVE_CPU_M32RXF 41*cf2f2c56Smiod #define HAVE_CPU_M32R2F 42f7cc78ecSespie 43f7cc78ecSespie #define CGEN_INSN_LSB0_P 0 44f7cc78ecSespie 45f7cc78ecSespie /* Minimum size of any insn (in bytes). */ 46f7cc78ecSespie #define CGEN_MIN_INSN_SIZE 2 47f7cc78ecSespie 48f7cc78ecSespie /* Maximum size of any insn (in bytes). */ 49f7cc78ecSespie #define CGEN_MAX_INSN_SIZE 4 50f7cc78ecSespie 51f7cc78ecSespie #define CGEN_INT_INSN_P 1 52f7cc78ecSespie 53d2201f2fSdrahn /* Maximum number of syntax elements in an instruction. */ 54d2201f2fSdrahn #define CGEN_ACTUAL_MAX_SYNTAX_ELEMENTS 15 55f7cc78ecSespie 56f7cc78ecSespie /* CGEN_MNEMONIC_OPERANDS is defined if mnemonics have operands. 57f7cc78ecSespie e.g. In "b,a foo" the ",a" is an operand. If mnemonics have operands 58f7cc78ecSespie we can't hash on everything up to the space. */ 59f7cc78ecSespie #define CGEN_MNEMONIC_OPERANDS 60f7cc78ecSespie 61f7cc78ecSespie /* Maximum number of fields in an instruction. */ 625f210c2aSfgsch #define CGEN_ACTUAL_MAX_IFMT_OPERANDS 7 63f7cc78ecSespie 64f7cc78ecSespie /* Enums. */ 65f7cc78ecSespie 66f7cc78ecSespie /* Enum declaration for insn format enums. */ 67f7cc78ecSespie typedef enum insn_op1 { 68f7cc78ecSespie OP1_0, OP1_1, OP1_2, OP1_3 69f7cc78ecSespie , OP1_4, OP1_5, OP1_6, OP1_7 70f7cc78ecSespie , OP1_8, OP1_9, OP1_10, OP1_11 71f7cc78ecSespie , OP1_12, OP1_13, OP1_14, OP1_15 72f7cc78ecSespie } INSN_OP1; 73f7cc78ecSespie 74f7cc78ecSespie /* Enum declaration for op2 enums. */ 75f7cc78ecSespie typedef enum insn_op2 { 76f7cc78ecSespie OP2_0, OP2_1, OP2_2, OP2_3 77f7cc78ecSespie , OP2_4, OP2_5, OP2_6, OP2_7 78f7cc78ecSespie , OP2_8, OP2_9, OP2_10, OP2_11 79f7cc78ecSespie , OP2_12, OP2_13, OP2_14, OP2_15 80f7cc78ecSespie } INSN_OP2; 81f7cc78ecSespie 82f7cc78ecSespie /* Enum declaration for . */ 83f7cc78ecSespie typedef enum gr_names { 84f7cc78ecSespie H_GR_FP = 13, H_GR_LR = 14, H_GR_SP = 15, H_GR_R0 = 0 85f7cc78ecSespie , H_GR_R1 = 1, H_GR_R2 = 2, H_GR_R3 = 3, H_GR_R4 = 4 86f7cc78ecSespie , H_GR_R5 = 5, H_GR_R6 = 6, H_GR_R7 = 7, H_GR_R8 = 8 87f7cc78ecSespie , H_GR_R9 = 9, H_GR_R10 = 10, H_GR_R11 = 11, H_GR_R12 = 12 88f7cc78ecSespie , H_GR_R13 = 13, H_GR_R14 = 14, H_GR_R15 = 15 89f7cc78ecSespie } GR_NAMES; 90f7cc78ecSespie 91f7cc78ecSespie /* Enum declaration for . */ 92f7cc78ecSespie typedef enum cr_names { 93f7cc78ecSespie H_CR_PSW = 0, H_CR_CBR = 1, H_CR_SPI = 2, H_CR_SPU = 3 94*cf2f2c56Smiod , H_CR_BPC = 6, H_CR_BBPSW = 8, H_CR_BBPC = 14, H_CR_EVB = 5 95*cf2f2c56Smiod , H_CR_CR0 = 0, H_CR_CR1 = 1, H_CR_CR2 = 2, H_CR_CR3 = 3 96*cf2f2c56Smiod , H_CR_CR4 = 4, H_CR_CR5 = 5, H_CR_CR6 = 6, H_CR_CR7 = 7 97*cf2f2c56Smiod , H_CR_CR8 = 8, H_CR_CR9 = 9, H_CR_CR10 = 10, H_CR_CR11 = 11 98*cf2f2c56Smiod , H_CR_CR12 = 12, H_CR_CR13 = 13, H_CR_CR14 = 14, H_CR_CR15 = 15 99f7cc78ecSespie } CR_NAMES; 100f7cc78ecSespie 101f7cc78ecSespie /* Attributes. */ 102f7cc78ecSespie 103f7cc78ecSespie /* Enum declaration for machine type selection. */ 104f7cc78ecSespie typedef enum mach_attr { 105*cf2f2c56Smiod MACH_BASE, MACH_M32R, MACH_M32RX, MACH_M32R2 106*cf2f2c56Smiod , MACH_MAX 107f7cc78ecSespie } MACH_ATTR; 108f7cc78ecSespie 109f7cc78ecSespie /* Enum declaration for instruction set selection. */ 110f7cc78ecSespie typedef enum isa_attr { 111f7cc78ecSespie ISA_M32R, ISA_MAX 112f7cc78ecSespie } ISA_ATTR; 113f7cc78ecSespie 114f7cc78ecSespie /* Enum declaration for parallel execution pipeline selection. */ 115f7cc78ecSespie typedef enum pipe_attr { 116f7cc78ecSespie PIPE_NONE, PIPE_O, PIPE_S, PIPE_OS 117*cf2f2c56Smiod , PIPE_O_OS 118f7cc78ecSespie } PIPE_ATTR; 119f7cc78ecSespie 120f7cc78ecSespie /* Number of architecture variants. */ 121f7cc78ecSespie #define MAX_ISAS 1 122f7cc78ecSespie #define MAX_MACHS ((int) MACH_MAX) 123f7cc78ecSespie 124f7cc78ecSespie /* Ifield support. */ 125f7cc78ecSespie 126f7cc78ecSespie extern const struct cgen_ifld m32r_cgen_ifld_table[]; 127f7cc78ecSespie 128f7cc78ecSespie /* Ifield attribute indices. */ 129f7cc78ecSespie 130f7cc78ecSespie /* Enum declaration for cgen_ifld attrs. */ 131f7cc78ecSespie typedef enum cgen_ifld_attr { 132f7cc78ecSespie CGEN_IFLD_VIRTUAL, CGEN_IFLD_PCREL_ADDR, CGEN_IFLD_ABS_ADDR, CGEN_IFLD_RESERVED 133f7cc78ecSespie , CGEN_IFLD_SIGN_OPT, CGEN_IFLD_SIGNED, CGEN_IFLD_RELOC, CGEN_IFLD_END_BOOLS 134f7cc78ecSespie , CGEN_IFLD_START_NBOOLS = 31, CGEN_IFLD_MACH, CGEN_IFLD_END_NBOOLS 135f7cc78ecSespie } CGEN_IFLD_ATTR; 136f7cc78ecSespie 137f7cc78ecSespie /* Number of non-boolean elements in cgen_ifld_attr. */ 138f7cc78ecSespie #define CGEN_IFLD_NBOOL_ATTRS (CGEN_IFLD_END_NBOOLS - CGEN_IFLD_START_NBOOLS - 1) 139f7cc78ecSespie 140f7cc78ecSespie /* Enum declaration for m32r ifield types. */ 141f7cc78ecSespie typedef enum ifield_type { 142f7cc78ecSespie M32R_F_NIL, M32R_F_ANYOF, M32R_F_OP1, M32R_F_OP2 143f7cc78ecSespie , M32R_F_COND, M32R_F_R1, M32R_F_R2, M32R_F_SIMM8 144*cf2f2c56Smiod , M32R_F_SIMM16, M32R_F_SHIFT_OP2, M32R_F_UIMM3, M32R_F_UIMM4 145*cf2f2c56Smiod , M32R_F_UIMM5, M32R_F_UIMM8, M32R_F_UIMM16, M32R_F_UIMM24 146*cf2f2c56Smiod , M32R_F_HI16, M32R_F_DISP8, M32R_F_DISP16, M32R_F_DISP24 147*cf2f2c56Smiod , M32R_F_OP23, M32R_F_OP3, M32R_F_ACC, M32R_F_ACCS 148*cf2f2c56Smiod , M32R_F_ACCD, M32R_F_BITS67, M32R_F_BIT4, M32R_F_BIT14 149*cf2f2c56Smiod , M32R_F_IMM1, M32R_F_MAX 150f7cc78ecSespie } IFIELD_TYPE; 151f7cc78ecSespie 152f7cc78ecSespie #define MAX_IFLD ((int) M32R_F_MAX) 153f7cc78ecSespie 154f7cc78ecSespie /* Hardware attribute indices. */ 155f7cc78ecSespie 156f7cc78ecSespie /* Enum declaration for cgen_hw attrs. */ 157f7cc78ecSespie typedef enum cgen_hw_attr { 158f7cc78ecSespie CGEN_HW_VIRTUAL, CGEN_HW_CACHE_ADDR, CGEN_HW_PC, CGEN_HW_PROFILE 159f7cc78ecSespie , CGEN_HW_END_BOOLS, CGEN_HW_START_NBOOLS = 31, CGEN_HW_MACH, CGEN_HW_END_NBOOLS 160f7cc78ecSespie } CGEN_HW_ATTR; 161f7cc78ecSespie 162f7cc78ecSespie /* Number of non-boolean elements in cgen_hw_attr. */ 163f7cc78ecSespie #define CGEN_HW_NBOOL_ATTRS (CGEN_HW_END_NBOOLS - CGEN_HW_START_NBOOLS - 1) 164f7cc78ecSespie 165f7cc78ecSespie /* Enum declaration for m32r hardware types. */ 166f7cc78ecSespie typedef enum cgen_hw_type { 167f7cc78ecSespie HW_H_MEMORY, HW_H_SINT, HW_H_UINT, HW_H_ADDR 168f7cc78ecSespie , HW_H_IADDR, HW_H_PC, HW_H_HI16, HW_H_SLO16 169f7cc78ecSespie , HW_H_ULO16, HW_H_GR, HW_H_CR, HW_H_ACCUM 170f7cc78ecSespie , HW_H_ACCUMS, HW_H_COND, HW_H_PSW, HW_H_BPSW 171f7cc78ecSespie , HW_H_BBPSW, HW_H_LOCK, HW_MAX 172f7cc78ecSespie } CGEN_HW_TYPE; 173f7cc78ecSespie 174f7cc78ecSespie #define MAX_HW ((int) HW_MAX) 175f7cc78ecSespie 176f7cc78ecSespie /* Operand attribute indices. */ 177f7cc78ecSespie 178f7cc78ecSespie /* Enum declaration for cgen_operand attrs. */ 179f7cc78ecSespie typedef enum cgen_operand_attr { 180f7cc78ecSespie CGEN_OPERAND_VIRTUAL, CGEN_OPERAND_PCREL_ADDR, CGEN_OPERAND_ABS_ADDR, CGEN_OPERAND_SIGN_OPT 181f7cc78ecSespie , CGEN_OPERAND_SIGNED, CGEN_OPERAND_NEGATIVE, CGEN_OPERAND_RELAX, CGEN_OPERAND_SEM_ONLY 182f7cc78ecSespie , CGEN_OPERAND_RELOC, CGEN_OPERAND_HASH_PREFIX, CGEN_OPERAND_END_BOOLS, CGEN_OPERAND_START_NBOOLS = 31 183f7cc78ecSespie , CGEN_OPERAND_MACH, CGEN_OPERAND_END_NBOOLS 184f7cc78ecSespie } CGEN_OPERAND_ATTR; 185f7cc78ecSespie 186f7cc78ecSespie /* Number of non-boolean elements in cgen_operand_attr. */ 187f7cc78ecSespie #define CGEN_OPERAND_NBOOL_ATTRS (CGEN_OPERAND_END_NBOOLS - CGEN_OPERAND_START_NBOOLS - 1) 188f7cc78ecSespie 189f7cc78ecSespie /* Enum declaration for m32r operand types. */ 190f7cc78ecSespie typedef enum cgen_operand_type { 191f7cc78ecSespie M32R_OPERAND_PC, M32R_OPERAND_SR, M32R_OPERAND_DR, M32R_OPERAND_SRC1 192f7cc78ecSespie , M32R_OPERAND_SRC2, M32R_OPERAND_SCR, M32R_OPERAND_DCR, M32R_OPERAND_SIMM8 193*cf2f2c56Smiod , M32R_OPERAND_SIMM16, M32R_OPERAND_UIMM3, M32R_OPERAND_UIMM4, M32R_OPERAND_UIMM5 194*cf2f2c56Smiod , M32R_OPERAND_UIMM8, M32R_OPERAND_UIMM16, M32R_OPERAND_IMM1, M32R_OPERAND_ACCD 195*cf2f2c56Smiod , M32R_OPERAND_ACCS, M32R_OPERAND_ACC, M32R_OPERAND_HASH, M32R_OPERAND_HI16 196*cf2f2c56Smiod , M32R_OPERAND_SLO16, M32R_OPERAND_ULO16, M32R_OPERAND_UIMM24, M32R_OPERAND_DISP8 197*cf2f2c56Smiod , M32R_OPERAND_DISP16, M32R_OPERAND_DISP24, M32R_OPERAND_CONDBIT, M32R_OPERAND_ACCUM 198*cf2f2c56Smiod , M32R_OPERAND_MAX 199f7cc78ecSespie } CGEN_OPERAND_TYPE; 200f7cc78ecSespie 201f7cc78ecSespie /* Number of operands types. */ 202*cf2f2c56Smiod #define MAX_OPERANDS 28 203f7cc78ecSespie 204f7cc78ecSespie /* Maximum number of operands referenced by any insn. */ 205f7cc78ecSespie #define MAX_OPERAND_INSTANCES 11 206f7cc78ecSespie 207f7cc78ecSespie /* Insn attribute indices. */ 208f7cc78ecSespie 209f7cc78ecSespie /* Enum declaration for cgen_insn attrs. */ 210f7cc78ecSespie typedef enum cgen_insn_attr { 211f7cc78ecSespie CGEN_INSN_ALIAS, CGEN_INSN_VIRTUAL, CGEN_INSN_UNCOND_CTI, CGEN_INSN_COND_CTI 212*cf2f2c56Smiod , CGEN_INSN_SKIP_CTI, CGEN_INSN_DELAY_SLOT, CGEN_INSN_RELAXABLE, CGEN_INSN_RELAXED 213f7cc78ecSespie , CGEN_INSN_NO_DIS, CGEN_INSN_PBB, CGEN_INSN_FILL_SLOT, CGEN_INSN_SPECIAL 214*cf2f2c56Smiod , CGEN_INSN_SPECIAL_M32R, CGEN_INSN_SPECIAL_FLOAT, CGEN_INSN_END_BOOLS, CGEN_INSN_START_NBOOLS = 31 215*cf2f2c56Smiod , CGEN_INSN_MACH, CGEN_INSN_PIPE, CGEN_INSN_END_NBOOLS 216f7cc78ecSespie } CGEN_INSN_ATTR; 217f7cc78ecSespie 218f7cc78ecSespie /* Number of non-boolean elements in cgen_insn_attr. */ 219f7cc78ecSespie #define CGEN_INSN_NBOOL_ATTRS (CGEN_INSN_END_NBOOLS - CGEN_INSN_START_NBOOLS - 1) 220f7cc78ecSespie 221f7cc78ecSespie /* cgen.h uses things we just defined. */ 222f7cc78ecSespie #include "opcode/cgen.h" 223f7cc78ecSespie 224f7cc78ecSespie /* Attributes. */ 225f7cc78ecSespie extern const CGEN_ATTR_TABLE m32r_cgen_hardware_attr_table[]; 226f7cc78ecSespie extern const CGEN_ATTR_TABLE m32r_cgen_ifield_attr_table[]; 227f7cc78ecSespie extern const CGEN_ATTR_TABLE m32r_cgen_operand_attr_table[]; 228f7cc78ecSespie extern const CGEN_ATTR_TABLE m32r_cgen_insn_attr_table[]; 229f7cc78ecSespie 230f7cc78ecSespie /* Hardware decls. */ 231f7cc78ecSespie 232f7cc78ecSespie extern CGEN_KEYWORD m32r_cgen_opval_gr_names; 233f7cc78ecSespie extern CGEN_KEYWORD m32r_cgen_opval_cr_names; 234f7cc78ecSespie extern CGEN_KEYWORD m32r_cgen_opval_h_accums; 235f7cc78ecSespie 236*cf2f2c56Smiod extern const CGEN_HW_ENTRY m32r_cgen_hw_table[]; 237f7cc78ecSespie 238f7cc78ecSespie 239f7cc78ecSespie 240f7cc78ecSespie #endif /* M32R_CPU_H */ 241