Home | History | Annotate | Line # | Download | only in opcode
      1   1.1  christos /* score-inst.h -- Score Instructions Table
      2  1.10  christos    Copyright (C) 2006-2025 Free Software Foundation, Inc.
      3   1.1  christos    Contributed by:
      4   1.1  christos    Brain.lin (brain.lin (at) sunplusct.com)
      5   1.1  christos    Mei Ligang (ligang (at) sunnorth.com.cn)
      6   1.1  christos    Pei-Lin Tsai (pltsai (at) sunplus.com)
      7   1.1  christos 
      8   1.1  christos    This file is part of GAS, the GNU Assembler.
      9   1.1  christos 
     10   1.1  christos    GAS 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    GAS is distributed in the hope that it will be useful,
     16   1.1  christos    but WITHOUT ANY WARRANTY; without even the implied warranty of
     17   1.1  christos    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     18   1.1  christos    GNU General Public License for more details.
     19   1.1  christos 
     20   1.1  christos    You should have received a copy of the GNU General Public License
     21   1.1  christos    along with GAS; see the file COPYING3.  If not, write to the Free
     22   1.1  christos    Software Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
     23   1.1  christos    02110-1301, USA.  */
     24   1.1  christos 
     25   1.1  christos #ifndef SCORE_INST_H
     26   1.1  christos #define SCORE_INST_H
     27   1.1  christos 
     28   1.1  christos #define LDST_UNALIGN_MASK 0x0000007f
     29   1.1  christos #define UA_LCB		  0x00000060
     30   1.1  christos #define UA_LCW		  0x00000062
     31   1.1  christos #define UA_LCE		  0x00000066
     32   1.1  christos #define UA_SCB		  0x00000068
     33   1.1  christos #define UA_SCW		  0x0000006a
     34   1.1  christos #define UA_SCE		  0x0000006e
     35   1.1  christos #define UA_LL		  0x0000000c
     36   1.1  christos #define UA_SC		  0x0000000e
     37   1.1  christos #define LDST16_RR_MASK   0x0000000f
     38   1.1  christos #define N16_LW           8
     39   1.1  christos #define N16_LH           9
     40   1.1  christos #define N16_POP          10
     41   1.1  christos #define N16_LBU          11
     42   1.1  christos #define N16_SW           12
     43   1.1  christos #define N16_SH           13
     44   1.1  christos #define N16_PUSH         14
     45   1.1  christos #define N16_SB           15
     46   1.1  christos #define LDST16_RI_MASK   0x7007
     47   1.1  christos #define N16_LWP          0x7000
     48   1.1  christos #define N16_LHP          0x7001
     49   1.1  christos #define N16_LBUP         0x7003
     50   1.1  christos #define N16_SWP          0x7004
     51   1.1  christos #define N16_SHP          0x7005
     52   1.1  christos #define N16_SBP          0x7007
     53   1.1  christos #define N16_LIU          0x5000
     54   1.1  christos 
     55   1.1  christos #define OPC_PSEUDOLDST_MASK	0x00000007
     56   1.1  christos 
     57   1.1  christos enum
     58   1.1  christos {
     59   1.1  christos   INSN_LW = 0,
     60   1.1  christos   INSN_LH = 1,
     61   1.1  christos   INSN_LHU = 2,
     62   1.1  christos   INSN_LB = 3,
     63   1.1  christos   INSN_SW = 4,
     64   1.1  christos   INSN_SH = 5,
     65   1.1  christos   INSN_LBU = 6,
     66   1.1  christos   INSN_SB = 7,
     67   1.1  christos };
     68   1.1  christos 
     69   1.1  christos /* Sub opcdoe opcode.  */
     70   1.1  christos enum
     71   1.1  christos {
     72   1.1  christos   INSN16_LBU = 11,
     73   1.1  christos   INSN16_LH = 9,
     74   1.1  christos   INSN16_LW = 8,
     75   1.1  christos   INSN16_SB = 15,
     76   1.1  christos   INSN16_SH = 13,
     77   1.1  christos   INSN16_SW = 12,
     78   1.1  christos };
     79   1.1  christos 
     80   1.1  christos enum
     81   1.1  christos {
     82   1.1  christos   LDST_NOUPDATE = 0,
     83   1.1  christos   LDST_PRE = 1,
     84   1.1  christos   LDST_POST = 2,
     85   1.1  christos };
     86   1.1  christos 
     87   1.1  christos enum score_insn_type
     88   1.1  christos {
     89   1.1  christos   Rd_I4,
     90   1.1  christos   Rd_I5,
     91   1.1  christos   Rd_rvalueBP_I5,
     92   1.1  christos   Rd_lvalueBP_I5,
     93   1.1  christos   Rd_Rs_I5,
     94   1.1  christos   x_Rs_I5,
     95   1.1  christos   x_I5_x,
     96   1.1  christos   Rd_I8,
     97   1.1  christos   Rd_Rs_I14,
     98   1.1  christos   I15,
     99   1.1  christos   Rd_I16,
    100   1.1  christos   Rd_I30,
    101   1.1  christos   Rd_I32,
    102   1.1  christos   Rd_rvalueRs_SI10,
    103   1.1  christos   Rd_lvalueRs_SI10,
    104   1.1  christos   Rd_rvalueRs_preSI12,
    105   1.1  christos   Rd_rvalueRs_postSI12,
    106   1.1  christos   Rd_lvalueRs_preSI12,
    107   1.1  christos   Rd_lvalueRs_postSI12,
    108   1.1  christos   Rd_Rs_SI14,
    109   1.1  christos   Rd_rvalueRs_SI15,
    110   1.1  christos   Rd_lvalueRs_SI15,
    111   1.1  christos   Rd_SI5,
    112   1.1  christos   Rd_SI6,
    113   1.1  christos   Rd_SI16,
    114   1.1  christos   PC_DISP8div2,
    115   1.1  christos   PC_DISP11div2,
    116   1.1  christos   PC_DISP19div2,
    117   1.1  christos   PC_DISP24div2,
    118   1.1  christos   Rd_Rs_Rs,
    119   1.1  christos   x_Rs_x,
    120   1.1  christos   x_Rs_Rs,
    121   1.1  christos   Rd_Rs_x,
    122   1.1  christos   Rd_x_Rs,
    123   1.1  christos   Rd_x_x,
    124   1.1  christos   Rd_Rs,
    125   1.1  christos   Rd_HighRs,
    126   1.1  christos   Rd_lvalueRs,
    127   1.1  christos   Rd_rvalueRs,
    128   1.1  christos   Rd_lvalue32Rs,
    129   1.1  christos   Rd_rvalue32Rs,
    130   1.1  christos   x_Rs,
    131   1.1  christos   NO_OPD,
    132   1.1  christos   NO16_OPD,
    133   1.1  christos   OP5_rvalueRs_SI15,
    134   1.1  christos   I5_Rs_Rs_I5_OP5,
    135   1.1  christos   x_rvalueRs_post4,
    136   1.1  christos   Rd_rvalueRs_post4,
    137   1.1  christos   Rd_x_I5,
    138   1.1  christos   Rd_lvalueRs_post4,
    139   1.1  christos   x_lvalueRs_post4,
    140   1.1  christos   Rd_LowRs,
    141   1.1  christos   Rd_Rs_Rs_imm,
    142   1.1  christos   Insn_Type_PCE,
    143   1.1  christos   Insn_Type_SYN,
    144   1.1  christos   Insn_GP,
    145   1.1  christos   Insn_PIC,
    146   1.1  christos   Insn_internal,
    147   1.1  christos   Insn_BCMP,
    148   1.1  christos   Ra_I9_I5,
    149   1.1  christos };
    150   1.1  christos 
    151   1.1  christos enum score_data_type
    152   1.1  christos {
    153   1.1  christos   _IMM4 = 0,
    154   1.1  christos   _IMM5,
    155   1.1  christos   _IMM8,
    156   1.1  christos   _IMM14,
    157   1.1  christos   _IMM15,
    158   1.1  christos   _IMM16,
    159   1.1  christos   _SIMM10 = 6,
    160   1.1  christos   _SIMM12,
    161   1.1  christos   _SIMM14,
    162   1.1  christos   _SIMM15,
    163   1.1  christos   _SIMM16,
    164   1.1  christos   _SIMM14_NEG = 11,
    165   1.1  christos   _IMM16_NEG,
    166   1.1  christos   _SIMM16_NEG,
    167   1.1  christos   _IMM20,
    168   1.1  christos   _IMM25,
    169   1.1  christos   _DISP8div2 = 16,
    170   1.1  christos   _DISP11div2,
    171   1.1  christos   _DISP19div2,
    172   1.1  christos   _DISP24div2,
    173   1.1  christos   _VALUE,
    174   1.1  christos   _VALUE_HI16,
    175   1.1  christos   _VALUE_LO16,
    176   1.1  christos   _VALUE_LDST_LO16 = 23,
    177   1.1  christos   _SIMM16_LA,
    178   1.1  christos   _IMM5_RSHIFT_1,
    179   1.1  christos   _IMM5_RSHIFT_2,
    180   1.1  christos   _SIMM16_LA_POS,
    181   1.1  christos   _IMM5_RANGE_8_31,
    182   1.1  christos   _IMM10_RSHIFT_2,
    183   1.1  christos   _GP_IMM15 = 30,
    184   1.1  christos   _GP_IMM14 = 31,
    185   1.1  christos   _SIMM16_pic = 42,   /* Index in score_df_range.  */
    186   1.1  christos   _IMM16_LO16_pic = 43,
    187   1.1  christos   _IMM16_pic = 44,
    188   1.1  christos 
    189   1.1  christos   _SIMM5 = 45,
    190   1.1  christos   _SIMM6 = 46,
    191   1.1  christos   _IMM32 = 47,
    192   1.1  christos   _SIMM32 = 48,
    193   1.1  christos   _IMM11 = 49,
    194   1.1  christos   _IMM5_MULTI_LOAD = 50,
    195   1.1  christos };
    196   1.1  christos 
    197   1.1  christos #define REG_TMP			  1
    198   1.1  christos 
    199   1.1  christos #define OP_REG_TYPE             (1 << 6)
    200   1.1  christos #define OP_IMM_TYPE             (1 << 7)
    201   1.1  christos #define OP_SH_REGD              (OP_REG_TYPE |20)
    202   1.1  christos #define	OP_SH_REGS1             (OP_REG_TYPE |15)
    203   1.1  christos #define OP_SH_REGS2             (OP_REG_TYPE |10)
    204   1.1  christos #define OP_SH_I                 (OP_IMM_TYPE | 1)
    205   1.1  christos #define OP_SH_RI15              (OP_IMM_TYPE | 0)
    206   1.1  christos #define OP_SH_I12               (OP_IMM_TYPE | 3)
    207   1.1  christos #define OP_SH_DISP24            (OP_IMM_TYPE | 1)
    208   1.1  christos #define OP_SH_DISP19_p1         (OP_IMM_TYPE |15)
    209   1.1  christos #define OP_SH_DISP19_p2         (OP_IMM_TYPE | 1)
    210   1.1  christos #define OP_SH_I5                (OP_IMM_TYPE |10)
    211   1.1  christos #define OP_SH_I10               (OP_IMM_TYPE | 5)
    212   1.1  christos #define OP_SH_COPID             (OP_IMM_TYPE | 5)
    213   1.1  christos #define OP_SH_TRAPI5            (OP_IMM_TYPE |15)
    214   1.1  christos #define OP_SH_I15               (OP_IMM_TYPE |10)
    215   1.1  christos 
    216   1.1  christos #define OP16_SH_REGD            (OP_REG_TYPE | 8)
    217   1.1  christos #define	OP16_SH_REGS1           (OP_REG_TYPE | 4)
    218   1.1  christos #define	OP16_SH_I45             (OP_IMM_TYPE | 3)
    219   1.1  christos #define	OP16_SH_I8              (OP_IMM_TYPE | 0)
    220   1.1  christos #define OP16_SH_DISP8           (OP_IMM_TYPE | 0)
    221   1.1  christos #define OP16_SH_DISP11          (OP_IMM_TYPE | 1)
    222   1.1  christos 
    223   1.1  christos enum insn_class
    224   1.1  christos {
    225   1.1  christos   INSN_CLASS_16,
    226   1.1  christos   INSN_CLASS_32,
    227   1.1  christos   INSN_CLASS_48,
    228   1.1  christos   INSN_CLASS_PCE,
    229   1.1  christos   INSN_CLASS_SYN
    230   1.1  christos };
    231   1.1  christos 
    232   1.1  christos /* s3_s7: Globals for both tc-score.c and elf32-score.c.  */
    233   1.1  christos extern int score3;
    234   1.1  christos extern int score7;
    235   1.1  christos 
    236   1.1  christos #endif
    237