Home | History | Annotate | Line # | Download | only in opcodes
lm32-desc.h revision 1.1.1.4.2.1
      1      1.1.1.4  christos /* DO NOT EDIT!  -*- buffer-read-only: t -*- vi:set ro:  */
      2          1.1  christos /* CPU data header for lm32.
      3          1.1  christos 
      4          1.1  christos THIS FILE IS MACHINE GENERATED WITH CGEN.
      5          1.1  christos 
      6  1.1.1.4.2.1    martin Copyright (C) 1996-2020 Free Software Foundation, Inc.
      7          1.1  christos 
      8          1.1  christos This file is part of the GNU Binutils and/or GDB, the GNU debugger.
      9          1.1  christos 
     10          1.1  christos    This file is free software; you can redistribute it and/or modify
     11          1.1  christos    it under the terms of the GNU General Public License as published by
     12          1.1  christos    the Free Software Foundation; either version 3, or (at your option)
     13          1.1  christos    any later version.
     14          1.1  christos 
     15          1.1  christos    It is distributed in the hope that it will be useful, but WITHOUT
     16          1.1  christos    ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
     17          1.1  christos    or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public
     18          1.1  christos    License for more details.
     19          1.1  christos 
     20          1.1  christos    You should have received a copy of the GNU General Public License along
     21          1.1  christos    with this program; if not, write to the Free Software Foundation, Inc.,
     22          1.1  christos    51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
     23          1.1  christos 
     24          1.1  christos */
     25          1.1  christos 
     26          1.1  christos #ifndef LM32_CPU_H
     27          1.1  christos #define LM32_CPU_H
     28          1.1  christos 
     29      1.1.1.4  christos #ifdef __cplusplus
     30      1.1.1.4  christos extern "C" {
     31      1.1.1.4  christos #endif
     32      1.1.1.4  christos 
     33          1.1  christos #define CGEN_ARCH lm32
     34          1.1  christos 
     35          1.1  christos /* Given symbol S, return lm32_cgen_<S>.  */
     36          1.1  christos #define CGEN_SYM(s) lm32##_cgen_##s
     37          1.1  christos 
     38          1.1  christos 
     39          1.1  christos /* Selected cpu families.  */
     40          1.1  christos #define HAVE_CPU_LM32BF
     41          1.1  christos 
     42          1.1  christos #define CGEN_INSN_LSB0_P 1
     43          1.1  christos 
     44          1.1  christos /* Minimum size of any insn (in bytes).  */
     45          1.1  christos #define CGEN_MIN_INSN_SIZE 4
     46          1.1  christos 
     47          1.1  christos /* Maximum size of any insn (in bytes).  */
     48          1.1  christos #define CGEN_MAX_INSN_SIZE 4
     49          1.1  christos 
     50          1.1  christos #define CGEN_INT_INSN_P 1
     51          1.1  christos 
     52          1.1  christos /* Maximum number of syntax elements in an instruction.  */
     53          1.1  christos #define CGEN_ACTUAL_MAX_SYNTAX_ELEMENTS 15
     54          1.1  christos 
     55          1.1  christos /* CGEN_MNEMONIC_OPERANDS is defined if mnemonics have operands.
     56          1.1  christos    e.g. In "b,a foo" the ",a" is an operand.  If mnemonics have operands
     57          1.1  christos    we can't hash on everything up to the space.  */
     58          1.1  christos #define CGEN_MNEMONIC_OPERANDS
     59          1.1  christos 
     60          1.1  christos /* Maximum number of fields in an instruction.  */
     61          1.1  christos #define CGEN_ACTUAL_MAX_IFMT_OPERANDS 5
     62          1.1  christos 
     63          1.1  christos /* Enums.  */
     64          1.1  christos 
     65          1.1  christos /* Enum declaration for opcodes.  */
     66          1.1  christos typedef enum opcodes {
     67          1.1  christos   OP_ADD = 45, OP_ADDI = 13, OP_AND = 40, OP_ANDI = 8
     68          1.1  christos  , OP_ANDHI = 24, OP_B = 48, OP_BI = 56, OP_BE = 17
     69          1.1  christos  , OP_BG = 18, OP_BGE = 19, OP_BGEU = 20, OP_BGU = 21
     70          1.1  christos  , OP_BNE = 23, OP_CALL = 54, OP_CALLI = 62, OP_CMPE = 57
     71          1.1  christos  , OP_CMPEI = 25, OP_CMPG = 58, OP_CMPGI = 26, OP_CMPGE = 59
     72          1.1  christos  , OP_CMPGEI = 27, OP_CMPGEU = 60, OP_CMPGEUI = 28, OP_CMPGU = 61
     73          1.1  christos  , OP_CMPGUI = 29, OP_CMPNE = 63, OP_CMPNEI = 31, OP_DIVU = 35
     74          1.1  christos  , OP_LB = 4, OP_LBU = 16, OP_LH = 7, OP_LHU = 11
     75          1.1  christos  , OP_LW = 10, OP_MODU = 49, OP_MUL = 34, OP_MULI = 2
     76          1.1  christos  , OP_NOR = 33, OP_NORI = 1, OP_OR = 46, OP_ORI = 14
     77          1.1  christos  , OP_ORHI = 30, OP_RAISE = 43, OP_RCSR = 36, OP_SB = 12
     78          1.1  christos  , OP_SEXTB = 44, OP_SEXTH = 55, OP_SH = 3, OP_SL = 47
     79          1.1  christos  , OP_SLI = 15, OP_SR = 37, OP_SRI = 5, OP_SRU = 32
     80          1.1  christos  , OP_SRUI = 0, OP_SUB = 50, OP_SW = 22, OP_USER = 51
     81          1.1  christos  , OP_WCSR = 52, OP_XNOR = 41, OP_XNORI = 9, OP_XOR = 38
     82          1.1  christos  , OP_XORI = 6
     83          1.1  christos } OPCODES;
     84          1.1  christos 
     85          1.1  christos /* Attributes.  */
     86          1.1  christos 
     87          1.1  christos /* Enum declaration for machine type selection.  */
     88          1.1  christos typedef enum mach_attr {
     89          1.1  christos   MACH_BASE, MACH_LM32, MACH_MAX
     90          1.1  christos } MACH_ATTR;
     91          1.1  christos 
     92          1.1  christos /* Enum declaration for instruction set selection.  */
     93          1.1  christos typedef enum isa_attr {
     94          1.1  christos   ISA_LM32, ISA_MAX
     95          1.1  christos } ISA_ATTR;
     96          1.1  christos 
     97          1.1  christos /* Number of architecture variants.  */
     98          1.1  christos #define MAX_ISAS  1
     99          1.1  christos #define MAX_MACHS ((int) MACH_MAX)
    100          1.1  christos 
    101          1.1  christos /* Ifield support.  */
    102          1.1  christos 
    103          1.1  christos /* Ifield attribute indices.  */
    104          1.1  christos 
    105          1.1  christos /* Enum declaration for cgen_ifld attrs.  */
    106          1.1  christos typedef enum cgen_ifld_attr {
    107          1.1  christos   CGEN_IFLD_VIRTUAL, CGEN_IFLD_PCREL_ADDR, CGEN_IFLD_ABS_ADDR, CGEN_IFLD_RESERVED
    108          1.1  christos  , CGEN_IFLD_SIGN_OPT, CGEN_IFLD_SIGNED, CGEN_IFLD_END_BOOLS, CGEN_IFLD_START_NBOOLS = 31
    109          1.1  christos  , CGEN_IFLD_MACH, CGEN_IFLD_END_NBOOLS
    110          1.1  christos } CGEN_IFLD_ATTR;
    111          1.1  christos 
    112          1.1  christos /* Number of non-boolean elements in cgen_ifld_attr.  */
    113          1.1  christos #define CGEN_IFLD_NBOOL_ATTRS (CGEN_IFLD_END_NBOOLS - CGEN_IFLD_START_NBOOLS - 1)
    114          1.1  christos 
    115          1.1  christos /* cgen_ifld attribute accessor macros.  */
    116          1.1  christos #define CGEN_ATTR_CGEN_IFLD_MACH_VALUE(attrs) ((attrs)->nonbool[CGEN_IFLD_MACH-CGEN_IFLD_START_NBOOLS-1].nonbitset)
    117          1.1  christos #define CGEN_ATTR_CGEN_IFLD_VIRTUAL_VALUE(attrs) (((attrs)->bool_ & (1 << CGEN_IFLD_VIRTUAL)) != 0)
    118          1.1  christos #define CGEN_ATTR_CGEN_IFLD_PCREL_ADDR_VALUE(attrs) (((attrs)->bool_ & (1 << CGEN_IFLD_PCREL_ADDR)) != 0)
    119          1.1  christos #define CGEN_ATTR_CGEN_IFLD_ABS_ADDR_VALUE(attrs) (((attrs)->bool_ & (1 << CGEN_IFLD_ABS_ADDR)) != 0)
    120          1.1  christos #define CGEN_ATTR_CGEN_IFLD_RESERVED_VALUE(attrs) (((attrs)->bool_ & (1 << CGEN_IFLD_RESERVED)) != 0)
    121          1.1  christos #define CGEN_ATTR_CGEN_IFLD_SIGN_OPT_VALUE(attrs) (((attrs)->bool_ & (1 << CGEN_IFLD_SIGN_OPT)) != 0)
    122          1.1  christos #define CGEN_ATTR_CGEN_IFLD_SIGNED_VALUE(attrs) (((attrs)->bool_ & (1 << CGEN_IFLD_SIGNED)) != 0)
    123          1.1  christos 
    124          1.1  christos /* Enum declaration for lm32 ifield types.  */
    125          1.1  christos typedef enum ifield_type {
    126          1.1  christos   LM32_F_NIL, LM32_F_ANYOF, LM32_F_OPCODE, LM32_F_R0
    127          1.1  christos  , LM32_F_R1, LM32_F_R2, LM32_F_RESV0, LM32_F_SHIFT
    128          1.1  christos  , LM32_F_IMM, LM32_F_UIMM, LM32_F_CSR, LM32_F_USER
    129          1.1  christos  , LM32_F_EXCEPTION, LM32_F_BRANCH, LM32_F_CALL, LM32_F_MAX
    130          1.1  christos } IFIELD_TYPE;
    131          1.1  christos 
    132          1.1  christos #define MAX_IFLD ((int) LM32_F_MAX)
    133          1.1  christos 
    134          1.1  christos /* Hardware attribute indices.  */
    135          1.1  christos 
    136          1.1  christos /* Enum declaration for cgen_hw attrs.  */
    137          1.1  christos typedef enum cgen_hw_attr {
    138          1.1  christos   CGEN_HW_VIRTUAL, CGEN_HW_CACHE_ADDR, CGEN_HW_PC, CGEN_HW_PROFILE
    139          1.1  christos  , CGEN_HW_END_BOOLS, CGEN_HW_START_NBOOLS = 31, CGEN_HW_MACH, CGEN_HW_END_NBOOLS
    140          1.1  christos } CGEN_HW_ATTR;
    141          1.1  christos 
    142          1.1  christos /* Number of non-boolean elements in cgen_hw_attr.  */
    143          1.1  christos #define CGEN_HW_NBOOL_ATTRS (CGEN_HW_END_NBOOLS - CGEN_HW_START_NBOOLS - 1)
    144          1.1  christos 
    145          1.1  christos /* cgen_hw attribute accessor macros.  */
    146          1.1  christos #define CGEN_ATTR_CGEN_HW_MACH_VALUE(attrs) ((attrs)->nonbool[CGEN_HW_MACH-CGEN_HW_START_NBOOLS-1].nonbitset)
    147          1.1  christos #define CGEN_ATTR_CGEN_HW_VIRTUAL_VALUE(attrs) (((attrs)->bool_ & (1 << CGEN_HW_VIRTUAL)) != 0)
    148          1.1  christos #define CGEN_ATTR_CGEN_HW_CACHE_ADDR_VALUE(attrs) (((attrs)->bool_ & (1 << CGEN_HW_CACHE_ADDR)) != 0)
    149          1.1  christos #define CGEN_ATTR_CGEN_HW_PC_VALUE(attrs) (((attrs)->bool_ & (1 << CGEN_HW_PC)) != 0)
    150          1.1  christos #define CGEN_ATTR_CGEN_HW_PROFILE_VALUE(attrs) (((attrs)->bool_ & (1 << CGEN_HW_PROFILE)) != 0)
    151          1.1  christos 
    152          1.1  christos /* Enum declaration for lm32 hardware types.  */
    153          1.1  christos typedef enum cgen_hw_type {
    154          1.1  christos   HW_H_MEMORY, HW_H_SINT, HW_H_UINT, HW_H_ADDR
    155          1.1  christos  , HW_H_IADDR, HW_H_PC, HW_H_GR, HW_H_CSR
    156          1.1  christos  , HW_MAX
    157          1.1  christos } CGEN_HW_TYPE;
    158          1.1  christos 
    159          1.1  christos #define MAX_HW ((int) HW_MAX)
    160          1.1  christos 
    161          1.1  christos /* Operand attribute indices.  */
    162          1.1  christos 
    163          1.1  christos /* Enum declaration for cgen_operand attrs.  */
    164          1.1  christos typedef enum cgen_operand_attr {
    165          1.1  christos   CGEN_OPERAND_VIRTUAL, CGEN_OPERAND_PCREL_ADDR, CGEN_OPERAND_ABS_ADDR, CGEN_OPERAND_SIGN_OPT
    166          1.1  christos  , CGEN_OPERAND_SIGNED, CGEN_OPERAND_NEGATIVE, CGEN_OPERAND_RELAX, CGEN_OPERAND_SEM_ONLY
    167          1.1  christos  , CGEN_OPERAND_END_BOOLS, CGEN_OPERAND_START_NBOOLS = 31, CGEN_OPERAND_MACH, CGEN_OPERAND_END_NBOOLS
    168          1.1  christos } CGEN_OPERAND_ATTR;
    169          1.1  christos 
    170          1.1  christos /* Number of non-boolean elements in cgen_operand_attr.  */
    171          1.1  christos #define CGEN_OPERAND_NBOOL_ATTRS (CGEN_OPERAND_END_NBOOLS - CGEN_OPERAND_START_NBOOLS - 1)
    172          1.1  christos 
    173          1.1  christos /* cgen_operand attribute accessor macros.  */
    174          1.1  christos #define CGEN_ATTR_CGEN_OPERAND_MACH_VALUE(attrs) ((attrs)->nonbool[CGEN_OPERAND_MACH-CGEN_OPERAND_START_NBOOLS-1].nonbitset)
    175          1.1  christos #define CGEN_ATTR_CGEN_OPERAND_VIRTUAL_VALUE(attrs) (((attrs)->bool_ & (1 << CGEN_OPERAND_VIRTUAL)) != 0)
    176          1.1  christos #define CGEN_ATTR_CGEN_OPERAND_PCREL_ADDR_VALUE(attrs) (((attrs)->bool_ & (1 << CGEN_OPERAND_PCREL_ADDR)) != 0)
    177          1.1  christos #define CGEN_ATTR_CGEN_OPERAND_ABS_ADDR_VALUE(attrs) (((attrs)->bool_ & (1 << CGEN_OPERAND_ABS_ADDR)) != 0)
    178          1.1  christos #define CGEN_ATTR_CGEN_OPERAND_SIGN_OPT_VALUE(attrs) (((attrs)->bool_ & (1 << CGEN_OPERAND_SIGN_OPT)) != 0)
    179          1.1  christos #define CGEN_ATTR_CGEN_OPERAND_SIGNED_VALUE(attrs) (((attrs)->bool_ & (1 << CGEN_OPERAND_SIGNED)) != 0)
    180          1.1  christos #define CGEN_ATTR_CGEN_OPERAND_NEGATIVE_VALUE(attrs) (((attrs)->bool_ & (1 << CGEN_OPERAND_NEGATIVE)) != 0)
    181          1.1  christos #define CGEN_ATTR_CGEN_OPERAND_RELAX_VALUE(attrs) (((attrs)->bool_ & (1 << CGEN_OPERAND_RELAX)) != 0)
    182          1.1  christos #define CGEN_ATTR_CGEN_OPERAND_SEM_ONLY_VALUE(attrs) (((attrs)->bool_ & (1 << CGEN_OPERAND_SEM_ONLY)) != 0)
    183          1.1  christos 
    184          1.1  christos /* Enum declaration for lm32 operand types.  */
    185          1.1  christos typedef enum cgen_operand_type {
    186          1.1  christos   LM32_OPERAND_PC, LM32_OPERAND_R0, LM32_OPERAND_R1, LM32_OPERAND_R2
    187          1.1  christos  , LM32_OPERAND_SHIFT, LM32_OPERAND_IMM, LM32_OPERAND_UIMM, LM32_OPERAND_BRANCH
    188          1.1  christos  , LM32_OPERAND_CALL, LM32_OPERAND_CSR, LM32_OPERAND_USER, LM32_OPERAND_EXCEPTION
    189          1.1  christos  , LM32_OPERAND_HI16, LM32_OPERAND_LO16, LM32_OPERAND_GP16, LM32_OPERAND_GOT16
    190          1.1  christos  , LM32_OPERAND_GOTOFFHI16, LM32_OPERAND_GOTOFFLO16, LM32_OPERAND_MAX
    191          1.1  christos } CGEN_OPERAND_TYPE;
    192          1.1  christos 
    193          1.1  christos /* Number of operands types.  */
    194          1.1  christos #define MAX_OPERANDS 18
    195          1.1  christos 
    196          1.1  christos /* Maximum number of operands referenced by any insn.  */
    197          1.1  christos #define MAX_OPERAND_INSTANCES 5
    198          1.1  christos 
    199          1.1  christos /* Insn attribute indices.  */
    200          1.1  christos 
    201          1.1  christos /* Enum declaration for cgen_insn attrs.  */
    202          1.1  christos typedef enum cgen_insn_attr {
    203          1.1  christos   CGEN_INSN_ALIAS, CGEN_INSN_VIRTUAL, CGEN_INSN_UNCOND_CTI, CGEN_INSN_COND_CTI
    204          1.1  christos  , CGEN_INSN_SKIP_CTI, CGEN_INSN_DELAY_SLOT, CGEN_INSN_RELAXABLE, CGEN_INSN_RELAXED
    205          1.1  christos  , CGEN_INSN_NO_DIS, CGEN_INSN_PBB, CGEN_INSN_END_BOOLS, CGEN_INSN_START_NBOOLS = 31
    206          1.1  christos  , CGEN_INSN_MACH, CGEN_INSN_END_NBOOLS
    207          1.1  christos } CGEN_INSN_ATTR;
    208          1.1  christos 
    209          1.1  christos /* Number of non-boolean elements in cgen_insn_attr.  */
    210          1.1  christos #define CGEN_INSN_NBOOL_ATTRS (CGEN_INSN_END_NBOOLS - CGEN_INSN_START_NBOOLS - 1)
    211          1.1  christos 
    212          1.1  christos /* cgen_insn attribute accessor macros.  */
    213          1.1  christos #define CGEN_ATTR_CGEN_INSN_MACH_VALUE(attrs) ((attrs)->nonbool[CGEN_INSN_MACH-CGEN_INSN_START_NBOOLS-1].nonbitset)
    214          1.1  christos #define CGEN_ATTR_CGEN_INSN_ALIAS_VALUE(attrs) (((attrs)->bool_ & (1 << CGEN_INSN_ALIAS)) != 0)
    215          1.1  christos #define CGEN_ATTR_CGEN_INSN_VIRTUAL_VALUE(attrs) (((attrs)->bool_ & (1 << CGEN_INSN_VIRTUAL)) != 0)
    216          1.1  christos #define CGEN_ATTR_CGEN_INSN_UNCOND_CTI_VALUE(attrs) (((attrs)->bool_ & (1 << CGEN_INSN_UNCOND_CTI)) != 0)
    217          1.1  christos #define CGEN_ATTR_CGEN_INSN_COND_CTI_VALUE(attrs) (((attrs)->bool_ & (1 << CGEN_INSN_COND_CTI)) != 0)
    218          1.1  christos #define CGEN_ATTR_CGEN_INSN_SKIP_CTI_VALUE(attrs) (((attrs)->bool_ & (1 << CGEN_INSN_SKIP_CTI)) != 0)
    219          1.1  christos #define CGEN_ATTR_CGEN_INSN_DELAY_SLOT_VALUE(attrs) (((attrs)->bool_ & (1 << CGEN_INSN_DELAY_SLOT)) != 0)
    220          1.1  christos #define CGEN_ATTR_CGEN_INSN_RELAXABLE_VALUE(attrs) (((attrs)->bool_ & (1 << CGEN_INSN_RELAXABLE)) != 0)
    221          1.1  christos #define CGEN_ATTR_CGEN_INSN_RELAXED_VALUE(attrs) (((attrs)->bool_ & (1 << CGEN_INSN_RELAXED)) != 0)
    222          1.1  christos #define CGEN_ATTR_CGEN_INSN_NO_DIS_VALUE(attrs) (((attrs)->bool_ & (1 << CGEN_INSN_NO_DIS)) != 0)
    223          1.1  christos #define CGEN_ATTR_CGEN_INSN_PBB_VALUE(attrs) (((attrs)->bool_ & (1 << CGEN_INSN_PBB)) != 0)
    224          1.1  christos 
    225          1.1  christos /* cgen.h uses things we just defined.  */
    226          1.1  christos #include "opcode/cgen.h"
    227          1.1  christos 
    228          1.1  christos extern const struct cgen_ifld lm32_cgen_ifld_table[];
    229          1.1  christos 
    230          1.1  christos /* Attributes.  */
    231          1.1  christos extern const CGEN_ATTR_TABLE lm32_cgen_hardware_attr_table[];
    232          1.1  christos extern const CGEN_ATTR_TABLE lm32_cgen_ifield_attr_table[];
    233          1.1  christos extern const CGEN_ATTR_TABLE lm32_cgen_operand_attr_table[];
    234          1.1  christos extern const CGEN_ATTR_TABLE lm32_cgen_insn_attr_table[];
    235          1.1  christos 
    236          1.1  christos /* Hardware decls.  */
    237          1.1  christos 
    238          1.1  christos extern CGEN_KEYWORD lm32_cgen_opval_h_gr;
    239          1.1  christos extern CGEN_KEYWORD lm32_cgen_opval_h_csr;
    240          1.1  christos 
    241          1.1  christos extern const CGEN_HW_ENTRY lm32_cgen_hw_table[];
    242          1.1  christos 
    243          1.1  christos 
    244          1.1  christos 
    245      1.1.1.4  christos    #ifdef __cplusplus
    246      1.1.1.4  christos    }
    247      1.1.1.4  christos    #endif
    248      1.1.1.4  christos 
    249          1.1  christos #endif /* LM32_CPU_H */
    250