Home | History | Annotate | Line # | Download | only in opcode
csky.h revision 1.1
      1  1.1  christos /* C-SKY assembler/disassembler support.
      2  1.1  christos    Copyright (C) 2004-2020 Free Software Foundation, Inc.
      3  1.1  christos    Contributed by C-SKY Microsystems and Mentor Graphics.
      4  1.1  christos 
      5  1.1  christos    This file is part of GDB and GAS.
      6  1.1  christos 
      7  1.1  christos    GDB and GAS are free software; you can redistribute it and/or
      8  1.1  christos    modify it under the terms of the GNU General Public License as
      9  1.1  christos    published by the Free Software Foundation; either version 3, or (at
     10  1.1  christos    your option) any later version.
     11  1.1  christos 
     12  1.1  christos    GDB and GAS are distributed in the hope that it will be useful, but
     13  1.1  christos    WITHOUT ANY WARRANTY; without even the implied warranty of
     14  1.1  christos    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
     15  1.1  christos    General Public License for more details.
     16  1.1  christos 
     17  1.1  christos    You should have received a copy of the GNU General Public License
     18  1.1  christos    along with GDB or GAS; see the file COPYING3.  If not, write to the
     19  1.1  christos    Free Software Foundation, 51 Franklin Street - Fifth Floor, Boston,
     20  1.1  christos    MA 02110-1301, USA.  */
     21  1.1  christos 
     22  1.1  christos #include "dis-asm.h"
     23  1.1  christos 
     24  1.1  christos /* The following bitmasks control instruction set architecture.  */
     25  1.1  christos #define CSKYV1_ISA_E1       (1 << 0)
     26  1.1  christos #define CSKYV2_ISA_E1       (1 << 1)
     27  1.1  christos #define CSKYV2_ISA_1E2      (1 << 2)
     28  1.1  christos #define CSKYV2_ISA_2E3      (1 << 3)
     29  1.1  christos #define CSKYV2_ISA_3E7      (1 << 4)
     30  1.1  christos #define CSKYV2_ISA_7E10     (1 << 5)
     31  1.1  christos #define CSKYV2_ISA_3E3R1    (1 << 6)
     32  1.1  christos 
     33  1.1  christos #define CSKY_ISA_TRUST      (1 << 11)
     34  1.1  christos #define CSKY_ISA_CACHE      (1 << 12)
     35  1.1  christos #define CSKY_ISA_NVIC       (1 << 13)
     36  1.1  christos #define CSKY_ISA_CP         (1 << 14)
     37  1.1  christos #define CSKY_ISA_MP         (1 << 15)
     38  1.1  christos #define CSKY_ISA_MP_1E2     (1 << 16)
     39  1.1  christos #define CSKY_ISA_JAVA       (1 << 17)
     40  1.1  christos #define CSKY_ISA_MAC        (1 << 18)
     41  1.1  christos #define CSKY_ISA_MAC_DSP    (1 << 19)
     42  1.1  christos 
     43  1.1  christos /* Base ISA for csky v1 and v2.  */
     44  1.1  christos #define CSKY_ISA_DSP        (1 << 20)
     45  1.1  christos #define CSKY_ISA_DSP_1E2    (1 << 21)
     46  1.1  christos #define CSKY_ISA_DSP_ENHANCE (1 << 22)
     47  1.1  christos 
     48  1.1  christos /* Base float instruction (803f & 810f).  */
     49  1.1  christos #define CSKY_ISA_FLOAT_E1   (1 << 25)
     50  1.1  christos /* M_FLOAT support (810f).  */
     51  1.1  christos #define CSKY_ISA_FLOAT_1E2  (1 << 26)
     52  1.1  christos /* 803 support (803f).  */
     53  1.1  christos #define CSKY_ISA_FLOAT_1E3  (1 << 27)
     54  1.1  christos /* 807 support (803f & 807f).  */
     55  1.1  christos #define CSKY_ISA_FLOAT_3E4  (1 << 28)
     56  1.1  christos /* Vector DSP support.  */
     57  1.1  christos #define CSKY_ISA_VDSP       (1 << 29)
     58  1.1  christos 
     59  1.1  christos /* The following bitmasks control cpu architecture for CSKY.  */
     60  1.1  christos #define CSKY_ABI_V1         (1 << 28)
     61  1.1  christos #define CSKY_ABI_V2         (2 << 28)
     62  1.1  christos #define CSKY_ARCH_MASK      0x0000001F
     63  1.1  christos #define CSKY_ABI_MASK       0xF0000000
     64  1.1  christos 
     65  1.1  christos #define CSKY_ARCH_510       0x1
     66  1.1  christos #define CSKY_ARCH_610       0x2
     67  1.1  christos #define CSKY_ARCH_801       0xa
     68  1.1  christos #define CSKY_ARCH_802       0x10
     69  1.1  christos #define CSKY_ARCH_803       0x9
     70  1.1  christos #define CSKY_ARCH_807       0x6
     71  1.1  christos #define CSKY_ARCH_810       0x8
     72  1.1  christos 
     73  1.1  christos #define CSKY_ARCH_MAC       (1 << 15)
     74  1.1  christos #define CSKY_ARCH_DSP       (1 << 14)
     75  1.1  christos #define CSKY_ARCH_FLOAT     (1 << 13)
     76  1.1  christos #define CSKY_ARCH_SIMD      (1 << 12)
     77  1.1  christos #define CSKY_ARCH_CP        (1 << 11)
     78  1.1  christos #define CSKY_ARCH_MP        (1 << 10)
     79  1.1  christos #define CSKY_ARCH_CACHE     (1 << 9)
     80  1.1  christos #define CSKY_ARCH_JAVA      (1 << 8)
     81  1.1  christos #define CSKY_ARCH_APS       (1 << 7)
     82  1.1  christos 
     83  1.1  christos #define IS_CSKY_V1(a) \
     84  1.1  christos   (((a) & CSKY_ABI_MASK) == CSKY_ABI_V1)
     85  1.1  christos #define IS_CSKY_V2(a) \
     86  1.1  christos   (((a) & CSKY_ABI_MASK) == CSKY_ABI_V2)
     87  1.1  christos #define IS_CSKY_ARCH_V1(a) \
     88  1.1  christos   (((a) & CSKY_ARCH_MASK) == CSKY_ARCH_510				\
     89  1.1  christos    || ((a) & CSKY_ARCH_MASK) == CSKY_ARCH_610)
     90  1.1  christos #define IS_CSKY_ARCH_V2(a)  \
     91  1.1  christos   (!(IS_CSKY_ARCH_V1 (a)))
     92  1.1  christos 
     93  1.1  christos #define IS_CSKY_ARCH_510(a)	(((a) & CSKY_ARCH_MASK) == CSKY_ARCH_510)
     94  1.1  christos #define IS_CSKY_ARCH_610(a)	(((a) & CSKY_ARCH_MASK) == CSKY_ARCH_610)
     95  1.1  christos #define IS_CSKY_ARCH_801(a)	(((a) & CSKY_ARCH_MASK) == CSKY_ARCH_801)
     96  1.1  christos #define IS_CSKY_ARCH_802(a)	(((a) & CSKY_ARCH_MASK) == CSKY_ARCH_802)
     97  1.1  christos #define IS_CSKY_ARCH_803(a)	(((a) & CSKY_ARCH_MASK) == CSKY_ARCH_803)
     98  1.1  christos #define IS_CSKY_ARCH_807(a)	(((a) & CSKY_ARCH_MASK) == CSKY_ARCH_807)
     99  1.1  christos #define IS_CSKY_ARCH_810(a)	(((a) & CSKY_ARCH_MASK) == CSKY_ARCH_810)
    100  1.1  christos 
    101  1.1  christos #define CPU_ARCH_MASK \
    102  1.1  christos   (CSKY_ARCH_JAVA | CSKY_ARCH_FLOAT | CSKY_ARCH_DSP | CSKY_ARCH_MASK)
    103  1.1  christos 
    104  1.1  christos #ifdef __cplusplus
    105  1.1  christos extern "C" {
    106  1.1  christos #endif
    107  1.1  christos extern int print_insn_csky (bfd_vma memaddr, struct disassemble_info *info);
    108  1.1  christos #ifdef __cplusplus
    109  1.1  christos }
    110  1.1  christos #endif
    111