This patch adds support to objdump for disassembly of NFP (Netronome Flow Processor...
[deliverable/binutils-gdb.git] / include / opcode / nfp.h
1 /* nfp.h. NFP opcode list.
2 Copyright (C) 2017-2018 Free Software Foundation, Inc.
3 Contributed by Francois H. Theron <francois.theron@netronome.com>
4
5 This file is part of the GNU opcodes library.
6
7 GDB, GAS, and the GNU binutils are free software; you can redistribute
8 them and/or modify them under the terms of the GNU General Public
9 License as published by the Free Software Foundation; either version 3,
10 or (at your option) any later version.
11
12 GDB, GAS, and the GNU binutils are distributed in the hope that they
13 will be useful, but WITHOUT ANY WARRANTY; without even the implied
14 warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
15 the GNU General Public License for more details.
16
17 You should have received a copy of the GNU General Public License
18 along with this file; see the file COPYING3. If not, write to the Free
19 Software Foundation, 51 Franklin Street - Fifth Floor, Boston,
20 MA 02110-1301, USA. */
21
22 #ifndef _NFP_H_
23 #define _NFP_H_
24
25 #include "bfd.h"
26 #include "elf/nfp.h"
27
28 #ifdef __cplusplus
29 extern "C"
30 {
31 #endif
32
33 /* The bfd_vma type has the description below, so we use that and BFD_VMA_FMT
34 instead of uint64_t or bfd_uint64_t.
35 "Represent a target address. Also used as a generic unsigned type
36 which is guaranteed to be big enough to hold any arithmetic types
37 we need to deal with."
38
39 We use ME versions for most of this rather than NFP family and revision
40 numbers. The version numbers are currently 2.7 and 2.8 and to avoid long
41 names with many underscores we'll just use 27 and 28 until some feature
42 number makes it necessary to do something different. */
43
44 #define NFP_ME27_INSTR_MASK_CMD ((bfd_vma) 0x008000000000)
45 #define NFP_ME27_INSTR_CMD ((bfd_vma) 0x000000000000)
46 #define NFP_ME27_INSTR_IS_CMD(instr) \
47 ((instr & NFP_ME27_INSTR_MASK_CMD) == NFP_ME27_INSTR_CMD)
48
49 #define NFP_ME27_INSTR_MASK_ALU_SHF ((bfd_vma) 0x1ee000000000)
50 #define NFP_ME27_INSTR_ALU_SHF ((bfd_vma) 0x008000000000)
51 #define NFP_ME27_INSTR_IS_ALU_SHF(instr) \
52 ((instr & NFP_ME27_INSTR_MASK_ALU_SHF) == NFP_ME27_INSTR_ALU_SHF)
53
54 #define NFP_ME27_INSTR_MASK_ALU ((bfd_vma) 0x1ee000000000)
55 #define NFP_ME27_INSTR_ALU ((bfd_vma) 0x00a000000000)
56 #define NFP_ME27_INSTR_IS_ALU(instr) \
57 ((instr & NFP_ME27_INSTR_MASK_ALU) == NFP_ME27_INSTR_ALU)
58
59 #define NFP_ME27_INSTR_MASK_IMMED ((bfd_vma) 0x1ff900000000)
60 #define NFP_ME27_INSTR_IMMED ((bfd_vma) 0x00f000000000)
61 #define NFP_ME27_INSTR_IS_IMMED(instr) \
62 ((instr & NFP_ME27_INSTR_MASK_IMMED) == NFP_ME27_INSTR_IMMED)
63
64 #define NFP_ME27_INSTR_MASK_LD_FIELD ((bfd_vma) 0x1ffa00e00000)
65 #define NFP_ME27_INSTR_LD_FIELD ((bfd_vma) 0x00c000000000)
66 #define NFP_ME27_INSTR_IS_LD_FIELD(instr) \
67 ((instr & NFP_ME27_INSTR_MASK_LD_FIELD) == NFP_ME27_INSTR_LD_FIELD)
68
69 #define NFP_ME27_INSTR_MASK_CTX_ARB ((bfd_vma) 0x00f800000000)
70 #define NFP_ME27_INSTR_CTX_ARB ((bfd_vma) 0x00e000000000)
71 #define NFP_ME27_INSTR_IS_CTX_ARB(instr) \
72 ((instr & NFP_ME27_INSTR_MASK_CTX_ARB) == NFP_ME27_INSTR_CTX_ARB)
73
74 #define NFP_ME27_INSTR_MASK_LOCAL_CSR ((bfd_vma) 0x1ffe00100000)
75 #define NFP_ME27_INSTR_LOCAL_CSR ((bfd_vma) 0x00fc00000000)
76 #define NFP_ME27_INSTR_IS_LOCAL_CSR(instr) \
77 ((instr & NFP_ME27_INSTR_MASK_LOCAL_CSR) == NFP_ME27_INSTR_LOCAL_CSR)
78
79 #define NFP_ME27_INSTR_MASK_BRANCH ((bfd_vma) 0x00f8000c3ce0)
80 #define NFP_ME27_INSTR_BRANCH ((bfd_vma) 0x00d800000020)
81 #define NFP_ME27_INSTR_IS_BRANCH(instr) \
82 ((instr & NFP_ME27_INSTR_MASK_BRANCH) == NFP_ME27_INSTR_BRANCH)
83
84 #define NFP_ME27_INSTR_MASK_BR_BYTE ((bfd_vma) 0x00f800000000)
85 #define NFP_ME27_INSTR_BR_BYTE ((bfd_vma) 0x00c800000000)
86 #define NFP_ME27_INSTR_IS_BR_BYTE(instr) \
87 ((instr & NFP_ME27_INSTR_MASK_BR_BYTE) == NFP_ME27_INSTR_BR_BYTE)
88
89 #define NFP_ME27_INSTR_MASK_BR_BIT ((bfd_vma) 0x00f800080300)
90 #define NFP_ME27_INSTR_BR_BIT ((bfd_vma) 0x00d000000000)
91 #define NFP_ME27_INSTR_IS_BR_BIT(instr) \
92 ((instr & NFP_ME27_INSTR_MASK_BR_BIT) == NFP_ME27_INSTR_BR_BIT)
93
94 #define NFP_ME27_INSTR_MASK_BR_ALU ((bfd_vma) 0x1fff80000000)
95 #define NFP_ME27_INSTR_BR_ALU ((bfd_vma) 0x00e800000000)
96 #define NFP_ME27_INSTR_IS_BR_ALU(instr) \
97 ((instr & NFP_ME27_INSTR_MASK_BR_ALU) == NFP_ME27_INSTR_BR_ALU)
98
99 #define NFP_ME27_INSTR_MASK_MULT ((bfd_vma) 0x1efe3f000000)
100 #define NFP_ME27_INSTR_MULT ((bfd_vma) 0x00f800000000)
101 #define NFP_ME27_INSTR_IS_MULT(instr) \
102 ((instr & NFP_ME27_INSTR_MASK_MULT) == NFP_ME27_INSTR_MULT)
103
104
105 #define NFP_ME28_INSTR_MASK_CMD ((bfd_vma) 0x008000000000)
106 #define NFP_ME28_INSTR_CMD ((bfd_vma) 0x000000000000)
107 #define NFP_ME28_INSTR_IS_CMD(instr) \
108 ((instr & NFP_ME28_INSTR_MASK_CMD) == NFP_ME28_INSTR_CMD)
109
110 #define NFP_ME28_INSTR_MASK_ALU_SHF ((bfd_vma) 0x00e000000000)
111 #define NFP_ME28_INSTR_ALU_SHF ((bfd_vma) 0x008000000000)
112 #define NFP_ME28_INSTR_IS_ALU_SHF(instr) \
113 ((instr & NFP_ME28_INSTR_MASK_ALU_SHF) == NFP_ME28_INSTR_ALU_SHF)
114
115 #define NFP_ME28_INSTR_MASK_ALU ((bfd_vma) 0x00e000000000)
116 #define NFP_ME28_INSTR_ALU ((bfd_vma) 0x00a000000000)
117 #define NFP_ME28_INSTR_IS_ALU(instr) \
118 ((instr & NFP_ME28_INSTR_MASK_ALU) == NFP_ME28_INSTR_ALU)
119
120 #define NFP_ME28_INSTR_MASK_IMMED ((bfd_vma) 0x01f900000000)
121 #define NFP_ME28_INSTR_IMMED ((bfd_vma) 0x00f000000000)
122 #define NFP_ME28_INSTR_IS_IMMED(instr) \
123 ((instr & NFP_ME28_INSTR_MASK_IMMED) == NFP_ME28_INSTR_IMMED)
124
125 #define NFP_ME28_INSTR_MASK_LD_FIELD ((bfd_vma) 0x01fa00e00000)
126 #define NFP_ME28_INSTR_LD_FIELD ((bfd_vma) 0x00c000000000)
127 #define NFP_ME28_INSTR_IS_LD_FIELD(instr) \
128 ((instr & NFP_ME28_INSTR_MASK_LD_FIELD) == NFP_ME28_INSTR_LD_FIELD)
129
130 #define NFP_ME28_INSTR_MASK_CTX_ARB ((bfd_vma) 0x00f800000000)
131 #define NFP_ME28_INSTR_CTX_ARB ((bfd_vma) 0x00e000000000)
132 #define NFP_ME28_INSTR_IS_CTX_ARB(instr) \
133 ((instr & NFP_ME28_INSTR_MASK_CTX_ARB) == NFP_ME28_INSTR_CTX_ARB)
134
135 #define NFP_ME28_INSTR_MASK_LOCAL_CSR ((bfd_vma) 0x01fe00100000)
136 #define NFP_ME28_INSTR_LOCAL_CSR ((bfd_vma) 0x00fc00000000)
137 #define NFP_ME28_INSTR_IS_LOCAL_CSR(instr) \
138 ((instr & NFP_ME28_INSTR_MASK_LOCAL_CSR) == NFP_ME28_INSTR_LOCAL_CSR)
139
140 #define NFP_ME28_INSTR_MASK_BRANCH ((bfd_vma) 0x00f8000c3ce0)
141 #define NFP_ME28_INSTR_BRANCH ((bfd_vma) 0x00d800000020)
142 #define NFP_ME28_INSTR_IS_BRANCH(instr) \
143 ((instr & NFP_ME28_INSTR_MASK_BRANCH) == NFP_ME28_INSTR_BRANCH)
144
145 #define NFP_ME28_INSTR_MASK_BR_BYTE ((bfd_vma) 0x00f800000000)
146 #define NFP_ME28_INSTR_BR_BYTE ((bfd_vma) 0x00c800000000)
147 #define NFP_ME28_INSTR_IS_BR_BYTE(instr) \
148 ((instr & NFP_ME28_INSTR_MASK_BR_BYTE) == NFP_ME28_INSTR_BR_BYTE)
149
150 #define NFP_ME28_INSTR_MASK_BR_BIT ((bfd_vma) 0x00f800080300)
151 #define NFP_ME28_INSTR_BR_BIT ((bfd_vma) 0x00d000000000)
152 #define NFP_ME28_INSTR_IS_BR_BIT(instr) \
153 ((instr & NFP_ME28_INSTR_MASK_BR_BIT) == NFP_ME28_INSTR_BR_BIT)
154
155 #define NFP_ME28_INSTR_MASK_BR_ALU ((bfd_vma) 0x00ff80000000)
156 #define NFP_ME28_INSTR_BR_ALU ((bfd_vma) 0x00e800000000)
157 #define NFP_ME28_INSTR_IS_BR_ALU(instr) \
158 ((instr & NFP_ME28_INSTR_MASK_BR_ALU) == NFP_ME28_INSTR_BR_ALU)
159
160 #define NFP_ME28_INSTR_MASK_MULT ((bfd_vma) 0x00fe3f000000)
161 #define NFP_ME28_INSTR_MULT ((bfd_vma) 0x00f800000000)
162 #define NFP_ME28_INSTR_IS_MULT(instr) \
163 ((instr & NFP_ME28_INSTR_MASK_MULT) == NFP_ME28_INSTR_MULT)
164
165 typedef struct
166 {
167 int cpp_target;
168 int cpp_action;
169 int cpp_token;
170 unsigned int len_fixed;
171 unsigned int len_mask;
172 const char *mnemonic;
173 }
174 nfp_cmd_mnemonic;
175
176 #ifdef __cplusplus
177 }
178 #endif
179
180 #endif /* _NFP_H_ */
This page took 0.033188 seconds and 4 git commands to generate.