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