1 /* Disassembler structures definitions for the ARC.
2 Copyright (C) 1994-2019 Free Software Foundation, Inc.
4 Contributed by Claudiu Zissulescu (claziss@synopsys.com)
6 This file is part of libopcodes.
8 This library is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 3, or (at your option)
13 It is distributed in the hope that it will be useful, but WITHOUT
14 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
15 or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
16 License for more details.
18 You should have received a copy of the GNU General Public License
19 along with this program; if not, write to the Free Software Foundation,
20 Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */
29 enum arc_ldst_writeback_mode
33 ARC_WRITEBACK_A = ARC_WRITEBACK_AW,
39 enum arc_ldst_data_size
48 enum arc_condition_code
51 ARC_CC_RA = ARC_CC_AL,
55 ARC_CC_NZ = ARC_CC_NE,
62 ARC_CC_LO = ARC_CC_CS,
64 ARC_CC_NC = ARC_CC_CC,
65 ARC_CC_HS = ARC_CC_CC,
69 ARC_CC_NV = ARC_CC_VC,
97 ARC_OPERAND_KIND_UNKNOWN = 0,
99 ARC_OPERAND_KIND_SHIMM,
100 ARC_OPERAND_KIND_LIMM
103 struct arc_insn_operand
105 /* Operand value as encoded in instruction. */
108 enum arc_operand_kind kind;
111 /* Container for information about instruction. Provides a higher
112 level access to data that is contained in struct arc_opcode. */
114 struct arc_instruction
116 /* Address of this instruction. */
119 /* Whether this is a valid instruction. */
122 insn_class_t insn_class;
124 /* Length (without LIMM). */
127 /* Is there a LIMM in this instruction? */
130 /* Long immediate value. */
133 /* Is it a branch/jump instruction? */
136 /* Whether this instruction has a delay slot. */
139 /* Value of condition code field. */
140 enum arc_condition_code condition_code;
142 /* Load/store writeback mode. */
143 enum arc_ldst_writeback_mode writeback_mode;
145 /* Load/store data size. */
146 enum arc_ldst_data_size data_size_mode;
148 /* Amount of operands in instruction. Note that amount of operands
149 reported by opcodes disassembler can be different from the one
150 encoded in the instruction. Notable case is "ld a,[b,offset]",
151 when offset == 0. In this case opcodes disassembler presents
152 this instruction as "ld a,[b]", hence there are *two* operands,
153 not three. OPERANDS_COUNT and OPERANDS contain only those
154 explicit operands, hence it is up to invoker to handle the case
155 described above based on instruction opcodes. Another notable
156 thing is that in opcodes disassembler representation square
157 brackets (`[' and `]') are so called fake-operands - they are in
158 the list of operands, but do not have any value of they own.
159 Those "operands" are not present in this array. */
160 struct arc_insn_operand operands[MAX_INSN_ARGS];
162 unsigned int operands_count;
165 /* Fill INSN with data about instruction at specified ADDR. */
167 void arc_insn_decode (bfd_vma addr,
168 struct disassemble_info *di,
169 disassembler_ftype func,
170 struct arc_instruction *insn);