Rizin
unix-like reverse engineering framework and cli tools
nios2.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: 2012, 2013 Free Software Foundation, Inc.
2 // SPDX-License-Identifier: GPL-3.0-or-later
3 
4 /* Nios II opcode list for GAS, the GNU assembler.
5  Copyright (C) 2012, 2013 Free Software Foundation, Inc.
6  Contributed by Nigel Gray (ngray@altera.com).
7  Contributed by Mentor Graphics, Inc.
8 
9  This file is part of GAS, the GNU Assembler, and GDB, the GNU disassembler.
10 
11  GAS/GDB is free software; you can redistribute it and/or modify
12  it under the terms of the GNU General Public License as published by
13  the Free Software Foundation; either version 3, or (at your option)
14  any later version.
15 
16  GAS/GDB is distributed in the hope that it will be useful,
17  but WITHOUT ANY WARRANTY; without even the implied warranty of
18  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19  GNU General Public License for more details.
20 
21  You should have received a copy of the GNU General Public License
22  along with GAS or GDB; see the file COPYING3. If not, write to
23  the Free Software Foundation, 51 Franklin Street - Fifth Floor,
24  Boston, MA 02110-1301, USA. */
25 
26 #ifndef _NIOS2_H_
27 #define _NIOS2_H_
28 
29 #include "mybfd.h"
30 
31 /****************************************************************************
32  * This file contains structures, bit masks and shift counts used
33  * by the GNU toolchain to define the Nios II instruction set and
34  * access various opcode fields.
35  ****************************************************************************/
36 
37 /* Identify different overflow situations for error messages. */
47 };
48 
49 /* This structure holds information for a particular instruction.
50 
51  The args field is a string describing the operands. The following
52  letters can appear in the args:
53  c - a 5-bit control register index
54  d - a 5-bit destination register index
55  s - a 5-bit left source register index
56  t - a 5-bit right source register index
57  i - a 16-bit signed immediate
58  u - a 16-bit unsigned immediate
59  o - a 16-bit signed program counter relative offset
60  j - a 5-bit unsigned immediate
61  b - a 5-bit break instruction constant
62  l - a 8-bit custom instruction constant
63  m - a 26-bit unsigned immediate
64  Literal ',', '(', and ')' characters may also appear in the args as
65  delimiters.
66 
67  The pinfo field is INSN_MACRO for a macro. Otherwise, it is a collection
68  of bits describing the instruction, notably any relevant hazard
69  information.
70 
71  When assembling, the match field contains the opcode template, which
72  is modified by the arguments to produce the actual opcode
73  that is emitted. If pinfo is INSN_MACRO, then this is 0.
74 
75  If pinfo is INSN_MACRO, the mask field stores the macro identifier.
76  Otherwise this is a bit mask for the relevant portions of the opcode
77  when disassembling. If the actual opcode anded with the match field
78  equals the opcode field, then we have found the correct instruction. */
79 
80 struct nios2_opcode {
81  const char *name; /* The name of the instruction. */
82  const char *args; /* A string describing the arguments for this
83  instruction. */
84  const char *args_test; /* Like args, but with an extra argument for
85  the expected opcode. */
86  unsigned long num_args; /* The number of arguments the instruction
87  takes. */
88  unsigned long match; /* The basic opcode for the instruction. */
89  unsigned long mask; /* Mask for the opcode field of the
90  instruction. */
91  unsigned long pinfo; /* Is this a real instruction or instruction
92  macro? */
93  enum overflow_type overflow_msg; /* Used to generate informative
94  message when fixup overflows. */
95 };
96 
97 /* This value is used in the nios2_opcode.pinfo field to indicate that the
98  instruction is a macro or pseudo-op. This requires special treatment by
99  the assembler, and is used by the disassembler to determine whether to
100  check for a nop. */
101 #define NIOS2_INSN_MACRO 0x80000000
102 #define NIOS2_INSN_MACRO_MOV 0x80000001
103 #define NIOS2_INSN_MACRO_MOVI 0x80000002
104 #define NIOS2_INSN_MACRO_MOVIA 0x80000004
105 
106 #define NIOS2_INSN_RELAXABLE 0x40000000
107 #define NIOS2_INSN_UBRANCH 0x00000010
108 #define NIOS2_INSN_CBRANCH 0x00000020
109 #define NIOS2_INSN_CALL 0x00000040
110 
111 #define NIOS2_INSN_ADDI 0x00000080
112 #define NIOS2_INSN_ANDI 0x00000100
113 #define NIOS2_INSN_ORI 0x00000200
114 #define NIOS2_INSN_XORI 0x00000400
115 
116 /* Associates a register name ($6) with a 5-bit index (eg 6). */
117 struct nios2_reg {
118  const char *name;
119  const int index;
120 };
121 
122 /* These are bit masks and shift counts for accessing the various
123  fields of a Nios II instruction. */
124 
125 /* Macros for getting and setting an instruction field. */
126 #define GET_INSN_FIELD(X, i) \
127  (((i)&OP_MASK_##X) >> OP_SH_##X)
128 #define SET_INSN_FIELD(X, i, j) \
129  ((i) = (((i) & ~OP_MASK_##X) | (((j) << OP_SH_##X) & OP_MASK_##X)))
130 
131 /* Instruction field definitions. */
132 #define IW_A_LSB 27
133 #define IW_A_MSB 31
134 #define IW_A_SZ 5
135 #define IW_A_MASK 0x1f
136 
137 #define IW_B_LSB 22
138 #define IW_B_MSB 26
139 #define IW_B_SZ 5
140 #define IW_B_MASK 0x1f
141 
142 #define IW_C_LSB 17
143 #define IW_C_MSB 21
144 #define IW_C_SZ 5
145 #define IW_C_MASK 0x1f
146 
147 #define IW_IMM16_LSB 6
148 #define IW_IMM16_MSB 21
149 #define IW_IMM16_SZ 16
150 #define IW_IMM16_MASK 0xffff
151 
152 #define IW_IMM26_LSB 6
153 #define IW_IMM26_MSB 31
154 #define IW_IMM26_SZ 26
155 #define IW_IMM26_MASK 0x3ffffff
156 
157 #define IW_OP_LSB 0
158 #define IW_OP_MSB 5
159 #define IW_OP_SZ 6
160 #define IW_OP_MASK 0x3f
161 
162 #define IW_OPX_LSB 11
163 #define IW_OPX_MSB 16
164 #define IW_OPX_SZ 6
165 #define IW_OPX_MASK 0x3f
166 
167 #define IW_SHIFT_IMM5_LSB 6
168 #define IW_SHIFT_IMM5_MSB 10
169 #define IW_SHIFT_IMM5_SZ 5
170 #define IW_SHIFT_IMM5_MASK 0x1f
171 
172 #define IW_CONTROL_REGNUM_LSB 6
173 #define IW_CONTROL_REGNUM_MSB 9
174 #define IW_CONTROL_REGNUM_SZ 4
175 #define IW_CONTROL_REGNUM_MASK 0xf
176 
177 /* Operator mask and shift. */
178 #define OP_MASK_OP (IW_OP_MASK << IW_OP_LSB)
179 #define OP_SH_OP IW_OP_LSB
180 
181 /* Masks and shifts for I-type instructions. */
182 #define OP_MASK_IOP (IW_OP_MASK << IW_OP_LSB)
183 #define OP_SH_IOP IW_OP_LSB
184 
185 #define OP_MASK_IMM16 (IW_IMM16_MASK << IW_IMM16_LSB)
186 #define OP_SH_IMM16 IW_IMM16_LSB
187 
188 #define OP_MASK_IRD (IW_B_MASK << IW_B_LSB)
189 #define OP_SH_IRD IW_B_LSB /* The same as T for I-type. */
190 
191 #define OP_MASK_IRT (IW_B_MASK << IW_B_LSB)
192 #define OP_SH_IRT IW_B_LSB
193 
194 #define OP_MASK_IRS (IW_A_MASK << IW_A_LSB)
195 #define OP_SH_IRS IW_A_LSB
196 
197 /* Masks and shifts for R-type instructions. */
198 #define OP_MASK_ROP (IW_OP_MASK << IW_OP_LSB)
199 #define OP_SH_ROP IW_OP_LSB
200 
201 #define OP_MASK_ROPX (IW_OPX_MASK << IW_OPX_LSB)
202 #define OP_SH_ROPX IW_OPX_LSB
203 
204 #define OP_MASK_RRD (IW_C_MASK << IW_C_LSB)
205 #define OP_SH_RRD IW_C_LSB
206 
207 #define OP_MASK_RRT (IW_B_MASK << IW_B_LSB)
208 #define OP_SH_RRT IW_B_LSB
209 
210 #define OP_MASK_RRS (IW_A_MASK << IW_A_LSB)
211 #define OP_SH_RRS IW_A_LSB
212 
213 /* Masks and shifts for J-type instructions. */
214 #define OP_MASK_JOP (IW_OP_MASK << IW_OP_LSB)
215 #define OP_SH_JOP IW_OP_LSB
216 
217 #define OP_MASK_IMM26 (IW_IMM26_MASK << IW_IMM26_LSB)
218 #define OP_SH_IMM26 IW_IMM26_LSB
219 
220 /* Masks and shifts for CTL instructions. */
221 #define OP_MASK_RCTL 0x000007c0
222 #define OP_SH_RCTL 6
223 
224 /* Break instruction imm5 field. */
225 #define OP_MASK_TRAP_IMM5 0x000007c0
226 #define OP_SH_TRAP_IMM5 6
227 
228 /* Instruction imm5 field. */
229 #define OP_MASK_IMM5 (IW_SHIFT_IMM5_MASK << IW_SHIFT_IMM5_LSB)
230 #define OP_SH_IMM5 IW_SHIFT_IMM5_LSB
231 
232 /* Cache operation fields (type j,i(s)). */
233 #define OP_MASK_CACHE_OPX (IW_B_MASK << IW_B_LSB)
234 #define OP_SH_CACHE_OPX IW_B_LSB
235 #define OP_MASK_CACHE_RRS (IW_A_MASK << IW_A_LSB)
236 #define OP_SH_CACHE_RRS IW_A_LSB
237 
238 /* Custom instruction masks. */
239 #define OP_MASK_CUSTOM_A 0x00010000
240 #define OP_SH_CUSTOM_A 16
241 
242 #define OP_MASK_CUSTOM_B 0x00008000
243 #define OP_SH_CUSTOM_B 15
244 
245 #define OP_MASK_CUSTOM_C 0x00004000
246 #define OP_SH_CUSTOM_C 14
247 
248 #define OP_MASK_CUSTOM_N 0x00003fc0
249 #define OP_SH_CUSTOM_N 6
250 #define OP_MAX_CUSTOM_N 255
251 
252 /* OP instruction values. */
253 #define OP_ADDI 4
254 #define OP_ANDHI 44
255 #define OP_ANDI 12
256 #define OP_BEQ 38
257 #define OP_BGE 14
258 #define OP_BGEU 46
259 #define OP_BLT 22
260 #define OP_BLTU 54
261 #define OP_BNE 30
262 #define OP_BR 6
263 #define OP_CALL 0
264 #define OP_CMPEQI 32
265 #define OP_CMPGEI 8
266 #define OP_CMPGEUI 40
267 #define OP_CMPLTI 16
268 #define OP_CMPLTUI 48
269 #define OP_CMPNEI 24
270 #define OP_CUSTOM 50
271 #define OP_FLUSHD 59
272 #define OP_FLUSHDA 27
273 #define OP_INITD 51
274 #define OP_INITDA 19
275 #define OP_JMPI 1
276 #define OP_LDB 7
277 #define OP_LDBIO 39
278 #define OP_LDBU 3
279 #define OP_LDBUIO 35
280 #define OP_LDH 15
281 #define OP_LDHIO 47
282 #define OP_LDHU 11
283 #define OP_LDHUIO 43
284 #define OP_LDL 31
285 #define OP_LDW 23
286 #define OP_LDWIO 55
287 #define OP_MULI 36
288 #define OP_OPX 58
289 #define OP_ORHI 52
290 #define OP_ORI 20
291 #define OP_RDPRS 56
292 #define OP_STB 5
293 #define OP_STBIO 37
294 #define OP_STC 29
295 #define OP_STH 13
296 #define OP_STHIO 45
297 #define OP_STW 21
298 #define OP_STWIO 53
299 #define OP_XORHI 60
300 #define OP_XORI 28
301 
302 /* OPX instruction values. */
303 #define OPX_ADD 49
304 #define OPX_AND 14
305 #define OPX_BREAK 52
306 #define OPX_BRET 9
307 #define OPX_CALLR 29
308 #define OPX_CMPEQ 32
309 #define OPX_CMPGE 8
310 #define OPX_CMPGEU 40
311 #define OPX_CMPLT 16
312 #define OPX_CMPLTU 48
313 #define OPX_CMPNE 24
314 #define OPX_CRST 62
315 #define OPX_DIV 37
316 #define OPX_DIVU 36
317 #define OPX_ERET 1
318 #define OPX_FLUSHI 12
319 #define OPX_FLUSHP 4
320 #define OPX_HBREAK 53
321 #define OPX_INITI 41
322 #define OPX_INTR 61
323 #define OPX_JMP 13
324 #define OPX_MUL 39
325 #define OPX_MULXSS 31
326 #define OPX_MULXSU 23
327 #define OPX_MULXUU 7
328 #define OPX_NEXTPC 28
329 #define OPX_NOR 6
330 #define OPX_OR 22
331 #define OPX_RDCTL 38
332 #define OPX_RET 5
333 #define OPX_ROL 3
334 #define OPX_ROLI 2
335 #define OPX_ROR 11
336 #define OPX_SLL 19
337 #define OPX_SLLI 18
338 #define OPX_SRA 59
339 #define OPX_SRAI 58
340 #define OPX_SRL 27
341 #define OPX_SRLI 26
342 #define OPX_SUB 57
343 #define OPX_SYNC 54
344 #define OPX_TRAP 45
345 #define OPX_WRCTL 46
346 #define OPX_WRPRS 20
347 #define OPX_XOR 30
348 
349 /* The following macros define the opcode matches for each
350  instruction code & OP_MASK_INST == OP_MATCH_INST. */
351 
352 /* OP instruction matches. */
353 #define OP_MATCH_ADDI OP_ADDI
354 #define OP_MATCH_ANDHI OP_ANDHI
355 #define OP_MATCH_ANDI OP_ANDI
356 #define OP_MATCH_BEQ OP_BEQ
357 #define OP_MATCH_BGE OP_BGE
358 #define OP_MATCH_BGEU OP_BGEU
359 #define OP_MATCH_BLT OP_BLT
360 #define OP_MATCH_BLTU OP_BLTU
361 #define OP_MATCH_BNE OP_BNE
362 #define OP_MATCH_BR OP_BR
363 #define OP_MATCH_FLUSHD OP_FLUSHD
364 #define OP_MATCH_FLUSHDA OP_FLUSHDA
365 #define OP_MATCH_INITD OP_INITD
366 #define OP_MATCH_INITDA OP_INITDA
367 #define OP_MATCH_CALL OP_CALL
368 #define OP_MATCH_CMPEQI OP_CMPEQI
369 #define OP_MATCH_CMPGEI OP_CMPGEI
370 #define OP_MATCH_CMPGEUI OP_CMPGEUI
371 #define OP_MATCH_CMPLTI OP_CMPLTI
372 #define OP_MATCH_CMPLTUI OP_CMPLTUI
373 #define OP_MATCH_CMPNEI OP_CMPNEI
374 #define OP_MATCH_JMPI OP_JMPI
375 #define OP_MATCH_LDB OP_LDB
376 #define OP_MATCH_LDBIO OP_LDBIO
377 #define OP_MATCH_LDBU OP_LDBU
378 #define OP_MATCH_LDBUIO OP_LDBUIO
379 #define OP_MATCH_LDH OP_LDH
380 #define OP_MATCH_LDHIO OP_LDHIO
381 #define OP_MATCH_LDHU OP_LDHU
382 #define OP_MATCH_LDHUIO OP_LDHUIO
383 #define OP_MATCH_LDL OP_LDL
384 #define OP_MATCH_LDW OP_LDW
385 #define OP_MATCH_LDWIO OP_LDWIO
386 #define OP_MATCH_MULI OP_MULI
387 #define OP_MATCH_OPX OP_OPX
388 #define OP_MATCH_ORHI OP_ORHI
389 #define OP_MATCH_ORI OP_ORI
390 #define OP_MATCH_RDPRS OP_RDPRS
391 #define OP_MATCH_STB OP_STB
392 #define OP_MATCH_STBIO OP_STBIO
393 #define OP_MATCH_STC OP_STC
394 #define OP_MATCH_STH OP_STH
395 #define OP_MATCH_STHIO OP_STHIO
396 #define OP_MATCH_STW OP_STW
397 #define OP_MATCH_STWIO OP_STWIO
398 #define OP_MATCH_CUSTOM OP_CUSTOM
399 #define OP_MATCH_XORHI OP_XORHI
400 #define OP_MATCH_XORI OP_XORI
401 #define OP_MATCH_OPX OP_OPX
402 
403 /* OPX instruction values. */
404 #define OPX_MATCH(code) ((code << IW_OPX_LSB) | OP_OPX)
405 
406 #define OP_MATCH_ADD OPX_MATCH(OPX_ADD)
407 #define OP_MATCH_AND OPX_MATCH(OPX_AND)
408 #define OP_MATCH_BREAK ((0x1e << 17) | OPX_MATCH(OPX_BREAK))
409 #define OP_MATCH_BRET (0xf0000000 | OPX_MATCH(OPX_BRET))
410 #define OP_MATCH_CALLR ((0x1f << 17) | OPX_MATCH(OPX_CALLR))
411 #define OP_MATCH_CMPEQ OPX_MATCH(OPX_CMPEQ)
412 #define OP_MATCH_CMPGE OPX_MATCH(OPX_CMPGE)
413 #define OP_MATCH_CMPGEU OPX_MATCH(OPX_CMPGEU)
414 #define OP_MATCH_CMPLT OPX_MATCH(OPX_CMPLT)
415 #define OP_MATCH_CMPLTU OPX_MATCH(OPX_CMPLTU)
416 #define OP_MATCH_CMPNE OPX_MATCH(OPX_CMPNE)
417 #define OP_MATCH_DIV OPX_MATCH(OPX_DIV)
418 #define OP_MATCH_DIVU OPX_MATCH(OPX_DIVU)
419 #define OP_MATCH_JMP OPX_MATCH(OPX_JMP)
420 #define OP_MATCH_MUL OPX_MATCH(OPX_MUL)
421 #define OP_MATCH_MULXSS OPX_MATCH(OPX_MULXSS)
422 #define OP_MATCH_MULXSU OPX_MATCH(OPX_MULXSU)
423 #define OP_MATCH_MULXUU OPX_MATCH(OPX_MULXUU)
424 #define OP_MATCH_NEXTPC OPX_MATCH(OPX_NEXTPC)
425 #define OP_MATCH_NOR OPX_MATCH(OPX_NOR)
426 #define OP_MATCH_OR OPX_MATCH(OPX_OR)
427 #define OP_MATCH_RDCTL OPX_MATCH(OPX_RDCTL)
428 #define OP_MATCH_RET (0xf8000000 | OPX_MATCH(OPX_RET))
429 #define OP_MATCH_ROL OPX_MATCH(OPX_ROL)
430 #define OP_MATCH_ROLI OPX_MATCH(OPX_ROLI)
431 #define OP_MATCH_ROR OPX_MATCH(OPX_ROR)
432 #define OP_MATCH_SLL OPX_MATCH(OPX_SLL)
433 #define OP_MATCH_SLLI OPX_MATCH(OPX_SLLI)
434 #define OP_MATCH_SRA OPX_MATCH(OPX_SRA)
435 #define OP_MATCH_SRAI OPX_MATCH(OPX_SRAI)
436 #define OP_MATCH_SRL OPX_MATCH(OPX_SRL)
437 #define OP_MATCH_SRLI OPX_MATCH(OPX_SRLI)
438 #define OP_MATCH_SUB OPX_MATCH(OPX_SUB)
439 #define OP_MATCH_SYNC OPX_MATCH(OPX_SYNC)
440 #define OP_MATCH_TRAP ((0x1d << 17) | OPX_MATCH(OPX_TRAP))
441 #define OP_MATCH_ERET (0xef800000 | OPX_MATCH(OPX_ERET))
442 #define OP_MATCH_WRCTL OPX_MATCH(OPX_WRCTL)
443 #define OP_MATCH_WRPRS OPX_MATCH(OPX_WRPRS)
444 #define OP_MATCH_XOR OPX_MATCH(OPX_XOR)
445 #define OP_MATCH_FLUSHI OPX_MATCH(OPX_FLUSHI)
446 #define OP_MATCH_FLUSHP OPX_MATCH(OPX_FLUSHP)
447 #define OP_MATCH_INITI OPX_MATCH(OPX_INITI)
448 
449 /* Some unusual op masks. */
450 #define OP_MASK_BREAK ((OP_MASK_RRS | OP_MASK_RRT | OP_MASK_RRD | OP_MASK_ROPX | OP_MASK_OP) & 0xfffff03f)
451 #define OP_MASK_CALLR ((OP_MASK_RRT | OP_MASK_RRD | OP_MASK_ROPX | OP_MASK_OP))
452 #define OP_MASK_JMP ((OP_MASK_RRT | OP_MASK_RRD | OP_MASK_ROPX | OP_MASK_OP))
453 #define OP_MASK_SYNC ((OP_MASK_RRT | OP_MASK_RRD | OP_MASK_ROPX | OP_MASK_OP))
454 #define OP_MASK_TRAP ((OP_MASK_RRS | OP_MASK_RRT | OP_MASK_RRD | OP_MASK_ROPX | OP_MASK_OP) & 0xfffff83f)
455 #define OP_MASK_WRCTL ((OP_MASK_RRT | OP_MASK_RRD | OP_MASK_ROPX | OP_MASK_OP)) /*& 0xfffff83f */
456 #define OP_MASK_NEXTPC ((OP_MASK_RRS | OP_MASK_RRT | OP_MASK_ROPX | OP_MASK_OP))
457 #define OP_MASK_FLUSHI ((OP_MASK_RRT | OP_MASK_RRD | OP_MASK_ROPX | OP_MASK_OP))
458 #define OP_MASK_INITI ((OP_MASK_RRT | OP_MASK_RRD | OP_MASK_ROPX | OP_MASK_OP))
459 
460 #define OP_MASK_ROLI ((OP_MASK_RRT | OP_MASK_ROPX | OP_MASK_OP))
461 #define OP_MASK_SLLI ((OP_MASK_RRT | OP_MASK_ROPX | OP_MASK_OP))
462 #define OP_MASK_SRAI ((OP_MASK_RRT | OP_MASK_ROPX | OP_MASK_OP))
463 #define OP_MASK_SRLI ((OP_MASK_RRT | OP_MASK_ROPX | OP_MASK_OP))
464 #define OP_MASK_RDCTL ((OP_MASK_RRS | OP_MASK_RRT | OP_MASK_ROPX | OP_MASK_OP)) /*& 0xfffff83f */
465 
466 #ifndef OP_MASK
467 #define OP_MASK 0xffffffff
468 #endif
469 
470 /* These convenience macros to extract instruction fields are used by GDB. */
471 #define GET_IW_A(Iw) \
472  (((Iw) >> IW_A_LSB) & IW_A_MASK)
473 #define GET_IW_B(Iw) \
474  (((Iw) >> IW_B_LSB) & IW_B_MASK)
475 #define GET_IW_C(Iw) \
476  (((Iw) >> IW_C_LSB) & IW_C_MASK)
477 #define GET_IW_CONTROL_REGNUM(Iw) \
478  (((Iw) >> IW_CONTROL_REGNUM_LSB) & IW_CONTROL_REGNUM_MASK)
479 #define GET_IW_IMM16(Iw) \
480  (((Iw) >> IW_IMM16_LSB) & IW_IMM16_MASK)
481 #define GET_IW_IMM26(Iw) \
482  (((Iw) >> IW_IMM26_LSB) & IW_IMM26_MASK)
483 #define GET_IW_OP(Iw) \
484  (((Iw) >> IW_OP_LSB) & IW_OP_MASK)
485 #define GET_IW_OPX(Iw) \
486  (((Iw) >> IW_OPX_LSB) & IW_OPX_MASK)
487 
488 /* These are the data structures we use to hold the instruction information. */
489 extern const struct nios2_opcode nios2_builtin_opcodes[];
490 extern const int bfd_nios2_num_builtin_opcodes;
491 extern struct nios2_opcode *nios2_opcodes;
492 extern int bfd_nios2_num_opcodes;
493 
494 /* These are the data structures used to hold the register information. */
495 extern const struct nios2_reg nios2_builtin_regs[];
496 extern struct nios2_reg *nios2_regs;
497 extern const int nios2_num_builtin_regs;
498 extern int nios2_num_regs;
499 
500 /* Machine-independent macro for number of opcodes. */
501 #define NUMOPCODES bfd_nios2_num_opcodes
502 #define NUMREGISTERS nios2_num_regs;
503 
504 /* This is made extern so that the assembler can use it to find out
505  what instruction caused an error. */
506 extern const struct nios2_opcode *nios2_find_opcode_hash(unsigned long);
507 
508 #endif /* _NIOS2_H */
const struct nios2_opcode nios2_builtin_opcodes[]
Definition: nios2-opc.c:175
const int bfd_nios2_num_builtin_opcodes
Definition: nios2-opc.c:408
const struct nios2_opcode * nios2_find_opcode_hash(unsigned long)
Definition: nios2-dis.c:126
struct nios2_reg * nios2_regs
Definition: nios2-opc.c:169
overflow_type
Definition: nios2.h:38
@ signed_immed16_overflow
Definition: nios2.h:42
@ branch_target_overflow
Definition: nios2.h:40
@ custom_opcode_overflow
Definition: nios2.h:45
@ address_offset_overflow
Definition: nios2.h:41
@ unsigned_immed5_overflow
Definition: nios2.h:44
@ call_target_overflow
Definition: nios2.h:39
@ no_overflow
Definition: nios2.h:46
@ unsigned_immed16_overflow
Definition: nios2.h:43
int bfd_nios2_num_opcodes
Definition: nios2-opc.c:414
struct nios2_opcode * nios2_opcodes
Definition: nios2-opc.c:412
int nios2_num_regs
Definition: nios2-opc.c:170
const int nios2_num_builtin_regs
Definition: nios2-opc.c:165
const struct nios2_reg nios2_builtin_regs[]
Definition: nios2-opc.c:29
enum overflow_type overflow_msg
Definition: nios2.h:93
const char * args
Definition: nios2.h:82
unsigned long num_args
Definition: nios2.h:86
unsigned long mask
Definition: nios2.h:89
const char * args_test
Definition: nios2.h:84
const char * name
Definition: nios2.h:81
unsigned long match
Definition: nios2.h:88
unsigned long pinfo
Definition: nios2.h:91
const char * name
Definition: nios2.h:118
const int index
Definition: nios2.h:119