41 #define ARC_MACH_ARC4 1
42 #define ARC_MACH_ARC5 2
43 #define ARC_MACH_ARC6 4
44 #define ARC_MACH_ARC7 8
45 #define ARC_MACH_ARC601 16
47 #define E_ARC_MACH_A4 0x00000000
48 #define EM_ARCOMPACT 93
51 #define ARC_MACH_BIG 32
54 #define ARCOMPACT (ARC_MACH_ARC5 | ARC_MACH_ARC6 | ARC_MACH_ARC601 | ARC_MACH_ARC7)
57 #define ARC_MACH_CPU_MASK (ARC_MACH_BIG - 1)
59 #define ARC_MACH_MASK ((ARC_MACH_BIG << 1) - 1)
73 #define ARC_OPCODE_CPU(bits) ((bits) & ARC_MACH_CPU_MASK)
75 #define ARC_OPCODE_MACH(bits) ((bits) & ARC_MACH_MASK)
77 #define ARC_OPCODE_FLAG_START (ARC_MACH_MASK + 1)
80 #define ARC_OPCODE_COND_BRANCH (ARC_OPCODE_FLAG_START)
81 #define SYNTAX_LENGTH (ARC_OPCODE_COND_BRANCH << 1)
82 #define SYNTAX_3OP (SYNTAX_LENGTH )
83 #define SYNTAX_2OP (SYNTAX_3OP << 1)
84 #define SYNTAX_1OP (SYNTAX_2OP << 1)
85 #define SYNTAX_NOP (SYNTAX_1OP << 1)
86 #define OP1_DEST_IGNORED (SYNTAX_NOP << 1)
87 #define OP1_MUST_BE_IMM (OP1_DEST_IGNORED << 1)
88 #define OP1_IMM_IMPLIED (OP1_MUST_BE_IMM << 1)
89 #define SUFFIX_NONE (OP1_IMM_IMPLIED << 1)
90 #define SUFFIX_COND (SUFFIX_NONE << 1)
91 #define SUFFIX_FLAG (SUFFIX_COND << 1)
92 #define SYNTAX_VALID (SUFFIX_FLAG << 1)
93 #define SIMD_LONG_INST (SYNTAX_VALID << 1)
95 #define AC_SYNTAX_3OP (0x01)
96 #define AC_SYNTAX_2OP (AC_SYNTAX_3OP << 1)
97 #define AC_SYNTAX_1OP (AC_SYNTAX_2OP << 1)
98 #define AC_SYNTAX_NOP (AC_SYNTAX_1OP << 1)
99 #define AC_SYNTAX_SIMD (AC_SYNTAX_NOP << 1)
100 #define AC_OP1_DEST_IGNORED (AC_SYNTAX_SIMD << 1)
101 #define AC_OP1_MUST_BE_IMM (AC_OP1_DEST_IGNORED << 1)
102 #define AC_OP1_IMM_IMPLIED (AC_OP1_MUST_BE_IMM << 1)
103 #define AC_SIMD_SYNTAX_DISC (AC_OP1_IMM_IMPLIED << 1)
104 #define AC_SIMD_IREGA (AC_SIMD_SYNTAX_DISC << 1)
105 #define AC_SIMD_IREGB (AC_SIMD_IREGA << 1)
107 #define AC_SIMD_SYNTAX_VVV (AC_SIMD_IREGB << 1)
108 #define AC_SIMD_SYNTAX_VV0 (AC_SIMD_SYNTAX_VVV << 1)
109 #define AC_SIMD_SYNTAX_VbI0 (AC_SIMD_SYNTAX_VV0 << 1)
110 #define AC_SIMD_SYNTAX_Vb00 (AC_SIMD_SYNTAX_VbI0 << 1)
111 #define AC_SIMD_SYNTAX_VbC0 (AC_SIMD_SYNTAX_Vb00 << 1)
112 #define AC_SIMD_SYNTAX_V00 (AC_SIMD_SYNTAX_VbC0 << 1)
113 #define AC_SIMD_SYNTAX_VC0 (AC_SIMD_SYNTAX_V00 << 1)
114 #define AC_SIMD_SYNTAX_VVC (AC_SIMD_SYNTAX_VC0 << 1)
115 #define AC_SIMD_SYNTAX_VV (AC_SIMD_SYNTAX_VVC << 1)
116 #define AC_SIMD_SYNTAX_VVI (AC_SIMD_SYNTAX_VV << 1)
117 #define AC_SIMD_SYNTAX_C (AC_SIMD_SYNTAX_VVI << 1)
118 #define AC_SIMD_SYNTAX_0 (AC_SIMD_SYNTAX_C << 1)
119 #define AC_SIMD_SYNTAX_CC (AC_SIMD_SYNTAX_0 << 1)
120 #define AC_SIMD_SYNTAX_C0 (AC_SIMD_SYNTAX_CC << 1)
121 #define AC_SIMD_SYNTAX_DC (AC_SIMD_SYNTAX_C0 << 1)
122 #define AC_SIMD_SYNTAX_D0 (AC_SIMD_SYNTAX_DC << 1)
123 #define AC_SIMD_SYNTAX_VD (AC_SIMD_SYNTAX_D0 << 1)
124 #define AC_SIMD_SYNTAX_VVL (AC_SIMD_SYNTAX_VD << 1)
125 #define AC_SIMD_SYNTAX_VU0 (AC_SIMD_SYNTAX_VVL << 1)
126 #define AC_SIMD_SYNTAX_VL0 (AC_SIMD_SYNTAX_VU0 << 1)
127 #define AC_SIMD_SYNTAX_C00 (AC_SIMD_SYNTAX_VL0 << 1)
131 #define AC_SUFFIX_NONE (0x1)
133 #define AC_SUFFIX_DIRECT (AC_SUFFIX_NONE << 1)
135 #define AC_SUFFIX_COND (AC_SUFFIX_DIRECT << 1)
136 #define AC_SUFFIX_FLAG (AC_SUFFIX_COND << 1)
137 #define AC_SIMD_FLAGS_NONE (AC_SUFFIX_FLAG << 1)
138 #define AC_SIMD_FLAG_SET (AC_SIMD_FLAGS_NONE << 1)
139 #define AC_SIMD_FLAG1_SET (AC_SIMD_FLAG_SET << 1)
140 #define AC_SIMD_FLAG2_SET (AC_SIMD_FLAG1_SET << 1)
141 #define AC_SIMD_ENCODE_U8 (AC_SIMD_FLAG2_SET << 1)
142 #define AC_SIMD_ENCODE_U6 (AC_SIMD_ENCODE_U8 << 1)
143 #define AC_SIMD_SCALE_1 (AC_SIMD_ENCODE_U6 << 1)
144 #define AC_SIMD_SCALE_2 (AC_SIMD_SCALE_1 << 1)
145 #define AC_SIMD_SCALE_3 (AC_SIMD_SCALE_2 << 1)
146 #define AC_SIMD_SCALE_4 (AC_SIMD_SCALE_3 << 1)
147 #define AC_SIMD_SCALE_0 (AC_SIMD_SCALE_4 << 1)
148 #define AC_SIMD_ENCODE_LIMM (AC_SIMD_SCALE_0 << 1)
149 #define AC_SIMD_EXTENDED (AC_SIMD_ENCODE_LIMM << 1)
150 #define AC_SIMD_EXTEND2 (AC_SIMD_EXTENDED << 1)
151 #define AC_SIMD_EXTEND3 (AC_SIMD_EXTEND2 << 1)
152 #define AC_SUFFIX_LANEMASK (AC_SIMD_EXTEND3 << 1)
153 #define AC_SIMD_ENCODE_S12 (AC_SUFFIX_LANEMASK << 1)
154 #define AC_SIMD_ZERVA (AC_SIMD_ENCODE_S12 << 1)
155 #define AC_SIMD_ZERVB (AC_SIMD_ZERVA << 1)
156 #define AC_SIMD_ZERVC (AC_SIMD_ZERVB << 1)
157 #define AC_SIMD_SETLM (AC_SIMD_ZERVC << 1)
158 #define AC_SIMD_EXTEND1 (AC_SIMD_SETLM << 1)
159 #define AC_SIMD_KREG (AC_SIMD_EXTEND1 << 1)
160 #define AC_SIMD_ENCODE_U16 (AC_SIMD_KREG << 1)
161 #define AC_SIMD_ENCODE_ZR (AC_SIMD_ENCODE_U16 << 1)
162 #define AC_EXTENDED_MULTIPLY AC_SIMD_EXTENDED
164 #define I(x) (((unsigned) (x) & 31) << 27)
165 #define A(x) (((unsigned) (x) & ARC_MASK_REG) << ARC_SHIFT_REGA)
166 #define B(x) (((unsigned) (x) & ARC_MASK_REG) << ARC_SHIFT_REGB)
167 #define C(x) (((unsigned) (x) & ARC_MASK_REG) << ARC_SHIFT_REGC)
168 #define R(x,b,m) (((unsigned) (x) & (m)) << (b))
177 #define ARC_HASH_OPCODE(string) \
178 ((string)[0] >= 'a' && (string)[0] <= 'z' ? (string)[0] - 'a' : 26)
179 #define ARC_HASH_ICODE(insn) \
180 ((unsigned int) (insn) >> 27)
184 #define ARC_OPCODE_NEXT_ASM(op) ((op)->next_asm)
185 #define ARC_OPCODE_NEXT_DIS(op) ((op)->next_dis)
198 #define ARC_OPVAL_CPU(bits) ((bits) & ARC_MACH_CPU_MASK)
200 #define ARC_OPVAL_MACH(bits) ((bits) & ARC_MACH_MASK)
229 #define ARC_OPERAND_SUFFIX 1
233 #define ARC_OPERAND_RELATIVE_BRANCH 2
237 #define ARC_OPERAND_ABSOLUTE_BRANCH 4
241 #define ARC_OPERAND_ADDRESS 8
244 #define ARC_OPERAND_LIMM 0x10
247 #define ARC_OPERAND_SIGNED 0x20
252 #define ARC_OPERAND_SIGNOPT 0x40
259 #define ARC_OPERAND_NEGATIVE 0x80
263 #define ARC_OPERAND_FAKE 0x100
266 #define ARC_OPERAND_JUMPFLAGS 0x200
270 #define ARC_OPERAND_WARN 0x400
271 #define ARC_OPERAND_ERROR 0x800
274 #define ARC_OPERAND_LOAD 0x8000
277 #define ARC_OPERAND_STORE 0x10000
280 #define ARC_OPERAND_UNSIGNED 0x20000
283 #define ARC_OPERAND_2BYTE_ALIGNED 0x40000
286 #define ARC_OPERAND_4BYTE_ALIGNED 0x80000
290 #define ARC_MOD_DOT 0x1000
293 #define ARC_MOD_REG 0x2000
296 #define ARC_MOD_AUXREG 0x4000
299 #define ARC_MOD_SDASYM 0x100000
302 #define ARC_MOD_BITS 0x107000
305 #define ARC_MOD_P(X) ((X) & ARC_MOD_BITS)
309 #define ARC_REGISTER_READONLY 0x01
310 #define ARC_REGISTER_WRITEONLY 0x02
311 #define ARC_REGISTER_NOSHORT_CUT 0x04
314 #define ARC_REGISTER_16 0x8
323 #define ARC_INCR_U6 0x100000
325 #define ARC_SIMD_SCALE1 (ARC_INCR_U6 << 0x1)
326 #define ARC_SIMD_SCALE2 (ARC_SIMD_SCALE1 << 0x1)
327 #define ARC_SIMD_SCALE3 (ARC_SIMD_SCALE2 << 0x1)
328 #define ARC_SIMD_SCALE4 (ARC_SIMD_SCALE3 << 0x1)
329 #define ARC_SIMD_LANEMASK (ARC_SIMD_SCALE4 <<0x1)
330 #define ARC_SIMD_REGISTER (ARC_SIMD_LANEMASK <<0x1)
331 #define ARC_SIMD_ZERVA (ARC_SIMD_REGISTER <<0x1)
332 #define ARC_SIMD_ZERVB (ARC_SIMD_ZERVA <<0x1)
333 #define ARC_SIMD_ZERVC (ARC_SIMD_ZERVB <<0x1)
334 #define ARC_SIMD_SETLM (ARC_SIMD_ZERVC <<0x1)
337 #define ARC_REGISTER_SIMD_VR 0x10
338 #define ARC_REGISTER_SIMD_I 0x20
339 #define ARC_REGISTER_SIMD_DR 0x40
340 #define ARC_REGISTER_SIMD_K 0x80
366 long value,
const char **errmsg);
402 #define ARC_HAVE_CPU(bits) ((bits) & ARC_MACH_CPU_MASK)
404 #define ARC_HAVE_MACH(bits) ((bits) & ARC_MACH_MASK)
407 #define ARC_REG_SHIMM_UPDATE 61
408 #define ARC_REG_SHIMM 63
409 #define ARC_REG_LIMM 62
412 #define ARC_REG_CONSTANT_P(REG) ((REG) >= 61)
415 #define ARC_SHIFT_REGA 21
416 #define ARC_SHIFT_REGB 15
417 #define ARC_SHIFT_REGC 9
418 #define ARC_SHIFT_REGA_AC 0
419 #define ARC_SHIFT_REGB_LOW_AC 24
420 #define ARC_SHIFT_REGB_HIGH_AC 12
421 #define ARC_SHIFT_REGC_AC 6
422 #define ARC_MASK_REG 63
425 #define ARC_DELAY_NONE 0
426 #define ARC_DELAY_NORMAL 1
427 #define ARC_DELAY_JUMP 2
430 #define ARC_SHIMM_CONST_P(x) ((long) (x) >= -256 && (long) (x) <= 255)
char * arc_aux_reg_name(int)
int ac_get_store_sdasym_insn_type(arc_insn, int)
int ARC700_register_simd_operand(char)
int ac_add_reg_sdasym_insn(arc_insn)
const struct arc_opcode * arc_opcode_lookup_dis(unsigned int)
int ac_constant_operand(const struct arc_operand *)
int ac_get_load_sdasym_insn_type(arc_insn, int)
int arc_opcode_limm_p(long *)
int arc_opval_supported(const struct arc_operand_value *)
void arc_opcode_init_tables(int)
void arc_opcode_init_insert(void)
const struct arc_operand_value * arc_reg_names
const struct arc_operand * arc_operands
struct arc_ext_operand_value * arc_ext_operands
int ac_branch_or_jump_insn(arc_insn, int)
int arc_get_opcode_mach(int, int)
void arc_opcode_init_extract(void)
int arc_operand_type(int)
const struct arc_operand_value * arc_opcode_lookup_suffix(const struct arc_operand *type, int value)
int arc_opcode_supported(const struct arc_opcode *)
const struct arc_opcode * arc_opcode_lookup_asm(const char *)
int ac_lpcc_insn(arc_insn)
int ac_register_operand(const struct arc_operand *)
const struct arc_operand_value * arc_suffixes
unsigned long arc_ld_ext_mask
unsigned char * arc_operand_map
int arc_insn_not_jl(arc_insn)
struct arc_operand_value * get_ext_suffix(char *, char)
int arc_limm_fixup_adjust(arc_insn)
int ac_symbol_operand(const struct arc_operand *)
static RzILOpBitVector * extend(ut32 dst_bits, arm64_extender ext, RZ_OWN RzILOpBitVector *v, ut32 v_bits)
static static sync static getppid static getegid const char static filename char static len const char char static bufsiz static mask static vfork const void static prot static getpgrp const char static swapflags long
struct arc_ext_operand_value * next
struct arc_opcode * next_asm
struct arc_opcode * next_dis
long(* extract)(arc_insn *insn, const struct arc_operand *operand, int mods, const struct arc_operand_value **opval, int *invalid)
arc_insn(* insert)(arc_insn insn, long *extend, const struct arc_operand *operand, int mods, const struct arc_operand_value *reg, long value, const char **errmsg)