Rizin
unix-like reverse engineering framework and cli tools
arc.h File Reference

Go to the source code of this file.

Classes

struct  arc_opcode
 
struct  arc_operand_value
 
struct  arc_ext_operand_value
 
struct  arc_operand
 

Macros

#define ARC_MACH_ARC4   1
 
#define ARC_MACH_ARC5   2
 
#define ARC_MACH_ARC6   4
 
#define ARC_MACH_ARC7   8
 
#define ARC_MACH_ARC601   16
 
#define E_ARC_MACH_A4   0x00000000
 
#define EM_ARCOMPACT   93 /* ARC Cores */
 
#define ARC_MACH_BIG   32
 
#define ARCOMPACT   (ARC_MACH_ARC5 | ARC_MACH_ARC6 | ARC_MACH_ARC601 | ARC_MACH_ARC7)
 
#define ARC_MACH_CPU_MASK   (ARC_MACH_BIG - 1)
 
#define ARC_MACH_MASK   ((ARC_MACH_BIG << 1) - 1)
 
#define ARC_OPCODE_CPU(bits)   ((bits) & ARC_MACH_CPU_MASK)
 
#define ARC_OPCODE_MACH(bits)   ((bits) & ARC_MACH_MASK)
 
#define ARC_OPCODE_FLAG_START   (ARC_MACH_MASK + 1)
 
#define ARC_OPCODE_COND_BRANCH   (ARC_OPCODE_FLAG_START)
 
#define SYNTAX_LENGTH   (ARC_OPCODE_COND_BRANCH << 1)
 
#define SYNTAX_3OP   (SYNTAX_LENGTH )
 
#define SYNTAX_2OP   (SYNTAX_3OP << 1)
 
#define SYNTAX_1OP   (SYNTAX_2OP << 1)
 
#define SYNTAX_NOP   (SYNTAX_1OP << 1)
 
#define OP1_DEST_IGNORED   (SYNTAX_NOP << 1)
 
#define OP1_MUST_BE_IMM   (OP1_DEST_IGNORED << 1)
 
#define OP1_IMM_IMPLIED   (OP1_MUST_BE_IMM << 1)
 
#define SUFFIX_NONE   (OP1_IMM_IMPLIED << 1)
 
#define SUFFIX_COND   (SUFFIX_NONE << 1)
 
#define SUFFIX_FLAG   (SUFFIX_COND << 1)
 
#define SYNTAX_VALID   (SUFFIX_FLAG << 1)
 
#define SIMD_LONG_INST   (SYNTAX_VALID << 1)
 
#define AC_SYNTAX_3OP   (0x01)
 
#define AC_SYNTAX_2OP   (AC_SYNTAX_3OP << 1)
 
#define AC_SYNTAX_1OP   (AC_SYNTAX_2OP << 1)
 
#define AC_SYNTAX_NOP   (AC_SYNTAX_1OP << 1)
 
#define AC_SYNTAX_SIMD   (AC_SYNTAX_NOP << 1)
 
#define AC_OP1_DEST_IGNORED   (AC_SYNTAX_SIMD << 1)
 
#define AC_OP1_MUST_BE_IMM   (AC_OP1_DEST_IGNORED << 1)
 
#define AC_OP1_IMM_IMPLIED   (AC_OP1_MUST_BE_IMM << 1)
 
#define AC_SIMD_SYNTAX_DISC   (AC_OP1_IMM_IMPLIED << 1)
 
#define AC_SIMD_IREGA   (AC_SIMD_SYNTAX_DISC << 1)
 
#define AC_SIMD_IREGB   (AC_SIMD_IREGA << 1)
 
#define AC_SIMD_SYNTAX_VVV   (AC_SIMD_IREGB << 1)
 
#define AC_SIMD_SYNTAX_VV0   (AC_SIMD_SYNTAX_VVV << 1)
 
#define AC_SIMD_SYNTAX_VbI0   (AC_SIMD_SYNTAX_VV0 << 1)
 
#define AC_SIMD_SYNTAX_Vb00   (AC_SIMD_SYNTAX_VbI0 << 1)
 
#define AC_SIMD_SYNTAX_VbC0   (AC_SIMD_SYNTAX_Vb00 << 1)
 
#define AC_SIMD_SYNTAX_V00   (AC_SIMD_SYNTAX_VbC0 << 1)
 
#define AC_SIMD_SYNTAX_VC0   (AC_SIMD_SYNTAX_V00 << 1)
 
#define AC_SIMD_SYNTAX_VVC   (AC_SIMD_SYNTAX_VC0 << 1)
 
#define AC_SIMD_SYNTAX_VV   (AC_SIMD_SYNTAX_VVC << 1)
 
#define AC_SIMD_SYNTAX_VVI   (AC_SIMD_SYNTAX_VV << 1)
 
#define AC_SIMD_SYNTAX_C   (AC_SIMD_SYNTAX_VVI << 1)
 
#define AC_SIMD_SYNTAX_0   (AC_SIMD_SYNTAX_C << 1)
 
#define AC_SIMD_SYNTAX_CC   (AC_SIMD_SYNTAX_0 << 1)
 
#define AC_SIMD_SYNTAX_C0   (AC_SIMD_SYNTAX_CC << 1)
 
#define AC_SIMD_SYNTAX_DC   (AC_SIMD_SYNTAX_C0 << 1)
 
#define AC_SIMD_SYNTAX_D0   (AC_SIMD_SYNTAX_DC << 1)
 
#define AC_SIMD_SYNTAX_VD   (AC_SIMD_SYNTAX_D0 << 1)
 
#define AC_SIMD_SYNTAX_VVL   (AC_SIMD_SYNTAX_VD << 1)
 
#define AC_SIMD_SYNTAX_VU0   (AC_SIMD_SYNTAX_VVL << 1)
 
#define AC_SIMD_SYNTAX_VL0   (AC_SIMD_SYNTAX_VU0 << 1)
 
#define AC_SIMD_SYNTAX_C00   (AC_SIMD_SYNTAX_VL0 << 1)
 
#define AC_SUFFIX_NONE   (0x1)
 
#define AC_SUFFIX_DIRECT   (AC_SUFFIX_NONE << 1)
 
#define AC_SUFFIX_COND   (AC_SUFFIX_DIRECT << 1)
 
#define AC_SUFFIX_FLAG   (AC_SUFFIX_COND << 1)
 
#define AC_SIMD_FLAGS_NONE   (AC_SUFFIX_FLAG << 1)
 
#define AC_SIMD_FLAG_SET   (AC_SIMD_FLAGS_NONE << 1)
 
#define AC_SIMD_FLAG1_SET   (AC_SIMD_FLAG_SET << 1)
 
#define AC_SIMD_FLAG2_SET   (AC_SIMD_FLAG1_SET << 1)
 
#define AC_SIMD_ENCODE_U8   (AC_SIMD_FLAG2_SET << 1)
 
#define AC_SIMD_ENCODE_U6   (AC_SIMD_ENCODE_U8 << 1)
 
#define AC_SIMD_SCALE_1   (AC_SIMD_ENCODE_U6 << 1)
 
#define AC_SIMD_SCALE_2   (AC_SIMD_SCALE_1 << 1)
 
#define AC_SIMD_SCALE_3   (AC_SIMD_SCALE_2 << 1)
 
#define AC_SIMD_SCALE_4   (AC_SIMD_SCALE_3 << 1)
 
#define AC_SIMD_SCALE_0   (AC_SIMD_SCALE_4 << 1)
 
#define AC_SIMD_ENCODE_LIMM   (AC_SIMD_SCALE_0 << 1)
 
#define AC_SIMD_EXTENDED   (AC_SIMD_ENCODE_LIMM << 1)
 
#define AC_SIMD_EXTEND2   (AC_SIMD_EXTENDED << 1)
 
#define AC_SIMD_EXTEND3   (AC_SIMD_EXTEND2 << 1)
 
#define AC_SUFFIX_LANEMASK   (AC_SIMD_EXTEND3 << 1)
 
#define AC_SIMD_ENCODE_S12   (AC_SUFFIX_LANEMASK << 1)
 
#define AC_SIMD_ZERVA   (AC_SIMD_ENCODE_S12 << 1)
 
#define AC_SIMD_ZERVB   (AC_SIMD_ZERVA << 1)
 
#define AC_SIMD_ZERVC   (AC_SIMD_ZERVB << 1)
 
#define AC_SIMD_SETLM   (AC_SIMD_ZERVC << 1)
 
#define AC_SIMD_EXTEND1   (AC_SIMD_SETLM << 1)
 
#define AC_SIMD_KREG   (AC_SIMD_EXTEND1 << 1)
 
#define AC_SIMD_ENCODE_U16   (AC_SIMD_KREG << 1)
 
#define AC_SIMD_ENCODE_ZR   (AC_SIMD_ENCODE_U16 << 1)
 
#define AC_EXTENDED_MULTIPLY   AC_SIMD_EXTENDED
 
#define I(x)   (((unsigned) (x) & 31) << 27)
 
#define A(x)   (((unsigned) (x) & ARC_MASK_REG) << ARC_SHIFT_REGA)
 
#define B(x)   (((unsigned) (x) & ARC_MASK_REG) << ARC_SHIFT_REGB)
 
#define C(x)   (((unsigned) (x) & ARC_MASK_REG) << ARC_SHIFT_REGC)
 
#define R(x, b, m)   (((unsigned) (x) & (m)) << (b)) /* value X, mask M, at bit B */
 
#define ARC_HASH_OPCODE(string)    ((string)[0] >= 'a' && (string)[0] <= 'z' ? (string)[0] - 'a' : 26)
 
#define ARC_HASH_ICODE(insn)    ((unsigned int) (insn) >> 27)
 
#define ARC_OPCODE_NEXT_ASM(op)   ((op)->next_asm)
 
#define ARC_OPCODE_NEXT_DIS(op)   ((op)->next_dis)
 
#define ARC_OPVAL_CPU(bits)   ((bits) & ARC_MACH_CPU_MASK)
 
#define ARC_OPVAL_MACH(bits)   ((bits) & ARC_MACH_MASK)
 
#define ARC_OPERAND_SUFFIX   1
 
#define ARC_OPERAND_RELATIVE_BRANCH   2
 
#define ARC_OPERAND_ABSOLUTE_BRANCH   4
 
#define ARC_OPERAND_ADDRESS   8
 
#define ARC_OPERAND_LIMM   0x10
 
#define ARC_OPERAND_SIGNED   0x20
 
#define ARC_OPERAND_SIGNOPT   0x40
 
#define ARC_OPERAND_NEGATIVE   0x80
 
#define ARC_OPERAND_FAKE   0x100
 
#define ARC_OPERAND_JUMPFLAGS   0x200
 
#define ARC_OPERAND_WARN   0x400
 
#define ARC_OPERAND_ERROR   0x800
 
#define ARC_OPERAND_LOAD   0x8000
 
#define ARC_OPERAND_STORE   0x10000
 
#define ARC_OPERAND_UNSIGNED   0x20000
 
#define ARC_OPERAND_2BYTE_ALIGNED   0x40000
 
#define ARC_OPERAND_4BYTE_ALIGNED   0x80000
 
#define ARC_MOD_DOT   0x1000
 
#define ARC_MOD_REG   0x2000
 
#define ARC_MOD_AUXREG   0x4000
 
#define ARC_MOD_SDASYM   0x100000
 
#define ARC_MOD_BITS   0x107000
 
#define ARC_MOD_P(X)   ((X) & ARC_MOD_BITS)
 
#define ARC_REGISTER_READONLY   0x01
 
#define ARC_REGISTER_WRITEONLY   0x02
 
#define ARC_REGISTER_NOSHORT_CUT   0x04
 
#define ARC_REGISTER_16   0x8
 
#define ARC_INCR_U6   0x100000
 
#define ARC_SIMD_SCALE1   (ARC_INCR_U6 << 0x1)
 
#define ARC_SIMD_SCALE2   (ARC_SIMD_SCALE1 << 0x1)
 
#define ARC_SIMD_SCALE3   (ARC_SIMD_SCALE2 << 0x1)
 
#define ARC_SIMD_SCALE4   (ARC_SIMD_SCALE3 << 0x1)
 
#define ARC_SIMD_LANEMASK   (ARC_SIMD_SCALE4 <<0x1)
 
#define ARC_SIMD_REGISTER   (ARC_SIMD_LANEMASK <<0x1)
 
#define ARC_SIMD_ZERVA   (ARC_SIMD_REGISTER <<0x1)
 
#define ARC_SIMD_ZERVB   (ARC_SIMD_ZERVA <<0x1)
 
#define ARC_SIMD_ZERVC   (ARC_SIMD_ZERVB <<0x1)
 
#define ARC_SIMD_SETLM   (ARC_SIMD_ZERVC <<0x1)
 
#define ARC_REGISTER_SIMD_VR   0x10
 
#define ARC_REGISTER_SIMD_I   0x20
 
#define ARC_REGISTER_SIMD_DR   0x40
 
#define ARC_REGISTER_SIMD_K   0x80
 
#define ARC_HAVE_CPU(bits)   ((bits) & ARC_MACH_CPU_MASK)
 
#define ARC_HAVE_MACH(bits)   ((bits) & ARC_MACH_MASK)
 
#define ARC_REG_SHIMM_UPDATE   61
 
#define ARC_REG_SHIMM   63
 
#define ARC_REG_LIMM   62
 
#define ARC_REG_CONSTANT_P(REG)   ((REG) >= 61)
 
#define ARC_SHIFT_REGA   21
 
#define ARC_SHIFT_REGB   15
 
#define ARC_SHIFT_REGC   9
 
#define ARC_SHIFT_REGA_AC   0
 
#define ARC_SHIFT_REGB_LOW_AC   24
 
#define ARC_SHIFT_REGB_HIGH_AC   12
 
#define ARC_SHIFT_REGC_AC   6
 
#define ARC_MASK_REG   63
 
#define ARC_DELAY_NONE   0 /* no delay slot */
 
#define ARC_DELAY_NORMAL   1 /* delay slot in both cases */
 
#define ARC_DELAY_JUMP   2 /* delay slot only if branch taken */
 
#define ARC_SHIMM_CONST_P(x)   ((long) (x) >= -256 && (long) (x) <= 255)
 

Typedefs

typedef unsigned int arc_insn
 

Functions

int arc_get_opcode_mach (int, int)
 
void arc_opcode_init_tables (int)
 
void arc_opcode_init_insert (void)
 
void arc_opcode_init_extract (void)
 
const struct arc_opcodearc_opcode_lookup_asm (const char *)
 
const struct arc_opcodearc_opcode_lookup_dis (unsigned int)
 
int arc_opcode_limm_p (long *)
 
const struct arc_operand_valuearc_opcode_lookup_suffix (const struct arc_operand *type, int value)
 
int arc_opcode_supported (const struct arc_opcode *)
 
int arc_opval_supported (const struct arc_operand_value *)
 
int arc_insn_not_jl (arc_insn)
 
char * arc_aux_reg_name (int)
 
struct arc_operand_valueget_ext_suffix (char *, char)
 
int ac_branch_or_jump_insn (arc_insn, int)
 
int ac_lpcc_insn (arc_insn)
 
int ac_constant_operand (const struct arc_operand *)
 
int ac_register_operand (const struct arc_operand *)
 
int ac_symbol_operand (const struct arc_operand *)
 
int ARC700_register_simd_operand (char)
 
int arc_operand_type (int)
 
int ac_add_reg_sdasym_insn (arc_insn)
 
int ac_get_load_sdasym_insn_type (arc_insn, int)
 
int ac_get_store_sdasym_insn_type (arc_insn, int)
 
int arc_limm_fixup_adjust (arc_insn)
 
int arc_test_wb (void)
 

Variables

struct arc_ext_operand_valuearc_ext_operands
 
const struct arc_operandarc_operands
 
int arc_operand_count
 
const struct arc_operand_valuearc_suffixes
 
int arc_suffixes_count
 
const struct arc_operand_valuearc_reg_names
 
int arc_reg_names_count
 
unsigned char * arc_operand_map
 
int arc_cond_p
 
int arc_mach_a4
 
unsigned long arc_ld_ext_mask
 
int arc_user_mode_only
 

Macro Definition Documentation

◆ A

#define A (   x)    (((unsigned) (x) & ARC_MASK_REG) << ARC_SHIFT_REGA)

Definition at line 165 of file arc.h.

◆ AC_EXTENDED_MULTIPLY

#define AC_EXTENDED_MULTIPLY   AC_SIMD_EXTENDED

Definition at line 162 of file arc.h.

◆ AC_OP1_DEST_IGNORED

#define AC_OP1_DEST_IGNORED   (AC_SYNTAX_SIMD << 1)

Definition at line 100 of file arc.h.

◆ AC_OP1_IMM_IMPLIED

#define AC_OP1_IMM_IMPLIED   (AC_OP1_MUST_BE_IMM << 1)

Definition at line 102 of file arc.h.

◆ AC_OP1_MUST_BE_IMM

#define AC_OP1_MUST_BE_IMM   (AC_OP1_DEST_IGNORED << 1)

Definition at line 101 of file arc.h.

◆ AC_SIMD_ENCODE_LIMM

#define AC_SIMD_ENCODE_LIMM   (AC_SIMD_SCALE_0 << 1)

Definition at line 148 of file arc.h.

◆ AC_SIMD_ENCODE_S12

#define AC_SIMD_ENCODE_S12   (AC_SUFFIX_LANEMASK << 1)

Definition at line 153 of file arc.h.

◆ AC_SIMD_ENCODE_U16

#define AC_SIMD_ENCODE_U16   (AC_SIMD_KREG << 1)

Definition at line 160 of file arc.h.

◆ AC_SIMD_ENCODE_U6

#define AC_SIMD_ENCODE_U6   (AC_SIMD_ENCODE_U8 << 1)

Definition at line 142 of file arc.h.

◆ AC_SIMD_ENCODE_U8

#define AC_SIMD_ENCODE_U8   (AC_SIMD_FLAG2_SET << 1)

Definition at line 141 of file arc.h.

◆ AC_SIMD_ENCODE_ZR

#define AC_SIMD_ENCODE_ZR   (AC_SIMD_ENCODE_U16 << 1)

Definition at line 161 of file arc.h.

◆ AC_SIMD_EXTEND1

#define AC_SIMD_EXTEND1   (AC_SIMD_SETLM << 1)

Definition at line 158 of file arc.h.

◆ AC_SIMD_EXTEND2

#define AC_SIMD_EXTEND2   (AC_SIMD_EXTENDED << 1)

Definition at line 150 of file arc.h.

◆ AC_SIMD_EXTEND3

#define AC_SIMD_EXTEND3   (AC_SIMD_EXTEND2 << 1)

Definition at line 151 of file arc.h.

◆ AC_SIMD_EXTENDED

#define AC_SIMD_EXTENDED   (AC_SIMD_ENCODE_LIMM << 1)

Definition at line 149 of file arc.h.

◆ AC_SIMD_FLAG1_SET

#define AC_SIMD_FLAG1_SET   (AC_SIMD_FLAG_SET << 1)

Definition at line 139 of file arc.h.

◆ AC_SIMD_FLAG2_SET

#define AC_SIMD_FLAG2_SET   (AC_SIMD_FLAG1_SET << 1)

Definition at line 140 of file arc.h.

◆ AC_SIMD_FLAG_SET

#define AC_SIMD_FLAG_SET   (AC_SIMD_FLAGS_NONE << 1)

Definition at line 138 of file arc.h.

◆ AC_SIMD_FLAGS_NONE

#define AC_SIMD_FLAGS_NONE   (AC_SUFFIX_FLAG << 1)

Definition at line 137 of file arc.h.

◆ AC_SIMD_IREGA

#define AC_SIMD_IREGA   (AC_SIMD_SYNTAX_DISC << 1)

Definition at line 104 of file arc.h.

◆ AC_SIMD_IREGB

#define AC_SIMD_IREGB   (AC_SIMD_IREGA << 1)

Definition at line 105 of file arc.h.

◆ AC_SIMD_KREG

#define AC_SIMD_KREG   (AC_SIMD_EXTEND1 << 1)

Definition at line 159 of file arc.h.

◆ AC_SIMD_SCALE_0

#define AC_SIMD_SCALE_0   (AC_SIMD_SCALE_4 << 1)

Definition at line 147 of file arc.h.

◆ AC_SIMD_SCALE_1

#define AC_SIMD_SCALE_1   (AC_SIMD_ENCODE_U6 << 1)

Definition at line 143 of file arc.h.

◆ AC_SIMD_SCALE_2

#define AC_SIMD_SCALE_2   (AC_SIMD_SCALE_1 << 1)

Definition at line 144 of file arc.h.

◆ AC_SIMD_SCALE_3

#define AC_SIMD_SCALE_3   (AC_SIMD_SCALE_2 << 1)

Definition at line 145 of file arc.h.

◆ AC_SIMD_SCALE_4

#define AC_SIMD_SCALE_4   (AC_SIMD_SCALE_3 << 1)

Definition at line 146 of file arc.h.

◆ AC_SIMD_SETLM

#define AC_SIMD_SETLM   (AC_SIMD_ZERVC << 1)

Definition at line 157 of file arc.h.

◆ AC_SIMD_SYNTAX_0

#define AC_SIMD_SYNTAX_0   (AC_SIMD_SYNTAX_C << 1)

Definition at line 118 of file arc.h.

◆ AC_SIMD_SYNTAX_C

#define AC_SIMD_SYNTAX_C   (AC_SIMD_SYNTAX_VVI << 1)

Definition at line 117 of file arc.h.

◆ AC_SIMD_SYNTAX_C0

#define AC_SIMD_SYNTAX_C0   (AC_SIMD_SYNTAX_CC << 1)

Definition at line 120 of file arc.h.

◆ AC_SIMD_SYNTAX_C00

#define AC_SIMD_SYNTAX_C00   (AC_SIMD_SYNTAX_VL0 << 1)

Definition at line 127 of file arc.h.

◆ AC_SIMD_SYNTAX_CC

#define AC_SIMD_SYNTAX_CC   (AC_SIMD_SYNTAX_0 << 1)

Definition at line 119 of file arc.h.

◆ AC_SIMD_SYNTAX_D0

#define AC_SIMD_SYNTAX_D0   (AC_SIMD_SYNTAX_DC << 1)

Definition at line 122 of file arc.h.

◆ AC_SIMD_SYNTAX_DC

#define AC_SIMD_SYNTAX_DC   (AC_SIMD_SYNTAX_C0 << 1)

Definition at line 121 of file arc.h.

◆ AC_SIMD_SYNTAX_DISC

#define AC_SIMD_SYNTAX_DISC   (AC_OP1_IMM_IMPLIED << 1)

Definition at line 103 of file arc.h.

◆ AC_SIMD_SYNTAX_V00

#define AC_SIMD_SYNTAX_V00   (AC_SIMD_SYNTAX_VbC0 << 1)

Definition at line 112 of file arc.h.

◆ AC_SIMD_SYNTAX_Vb00

#define AC_SIMD_SYNTAX_Vb00   (AC_SIMD_SYNTAX_VbI0 << 1)

Definition at line 110 of file arc.h.

◆ AC_SIMD_SYNTAX_VbC0

#define AC_SIMD_SYNTAX_VbC0   (AC_SIMD_SYNTAX_Vb00 << 1)

Definition at line 111 of file arc.h.

◆ AC_SIMD_SYNTAX_VbI0

#define AC_SIMD_SYNTAX_VbI0   (AC_SIMD_SYNTAX_VV0 << 1)

Definition at line 109 of file arc.h.

◆ AC_SIMD_SYNTAX_VC0

#define AC_SIMD_SYNTAX_VC0   (AC_SIMD_SYNTAX_V00 << 1)

Definition at line 113 of file arc.h.

◆ AC_SIMD_SYNTAX_VD

#define AC_SIMD_SYNTAX_VD   (AC_SIMD_SYNTAX_D0 << 1)

Definition at line 123 of file arc.h.

◆ AC_SIMD_SYNTAX_VL0

#define AC_SIMD_SYNTAX_VL0   (AC_SIMD_SYNTAX_VU0 << 1)

Definition at line 126 of file arc.h.

◆ AC_SIMD_SYNTAX_VU0

#define AC_SIMD_SYNTAX_VU0   (AC_SIMD_SYNTAX_VVL << 1)

Definition at line 125 of file arc.h.

◆ AC_SIMD_SYNTAX_VV

#define AC_SIMD_SYNTAX_VV   (AC_SIMD_SYNTAX_VVC << 1)

Definition at line 115 of file arc.h.

◆ AC_SIMD_SYNTAX_VV0

#define AC_SIMD_SYNTAX_VV0   (AC_SIMD_SYNTAX_VVV << 1)

Definition at line 108 of file arc.h.

◆ AC_SIMD_SYNTAX_VVC

#define AC_SIMD_SYNTAX_VVC   (AC_SIMD_SYNTAX_VC0 << 1)

Definition at line 114 of file arc.h.

◆ AC_SIMD_SYNTAX_VVI

#define AC_SIMD_SYNTAX_VVI   (AC_SIMD_SYNTAX_VV << 1)

Definition at line 116 of file arc.h.

◆ AC_SIMD_SYNTAX_VVL

#define AC_SIMD_SYNTAX_VVL   (AC_SIMD_SYNTAX_VD << 1)

Definition at line 124 of file arc.h.

◆ AC_SIMD_SYNTAX_VVV

#define AC_SIMD_SYNTAX_VVV   (AC_SIMD_IREGB << 1)

Definition at line 107 of file arc.h.

◆ AC_SIMD_ZERVA

#define AC_SIMD_ZERVA   (AC_SIMD_ENCODE_S12 << 1)

Definition at line 154 of file arc.h.

◆ AC_SIMD_ZERVB

#define AC_SIMD_ZERVB   (AC_SIMD_ZERVA << 1)

Definition at line 155 of file arc.h.

◆ AC_SIMD_ZERVC

#define AC_SIMD_ZERVC   (AC_SIMD_ZERVB << 1)

Definition at line 156 of file arc.h.

◆ AC_SUFFIX_COND

#define AC_SUFFIX_COND   (AC_SUFFIX_DIRECT << 1)

Definition at line 135 of file arc.h.

◆ AC_SUFFIX_DIRECT

#define AC_SUFFIX_DIRECT   (AC_SUFFIX_NONE << 1)

Definition at line 133 of file arc.h.

◆ AC_SUFFIX_FLAG

#define AC_SUFFIX_FLAG   (AC_SUFFIX_COND << 1)

Definition at line 136 of file arc.h.

◆ AC_SUFFIX_LANEMASK

#define AC_SUFFIX_LANEMASK   (AC_SIMD_EXTEND3 << 1)

Definition at line 152 of file arc.h.

◆ AC_SUFFIX_NONE

#define AC_SUFFIX_NONE   (0x1)

Definition at line 131 of file arc.h.

◆ AC_SYNTAX_1OP

#define AC_SYNTAX_1OP   (AC_SYNTAX_2OP << 1)

Definition at line 97 of file arc.h.

◆ AC_SYNTAX_2OP

#define AC_SYNTAX_2OP   (AC_SYNTAX_3OP << 1)

Definition at line 96 of file arc.h.

◆ AC_SYNTAX_3OP

#define AC_SYNTAX_3OP   (0x01)

Definition at line 95 of file arc.h.

◆ AC_SYNTAX_NOP

#define AC_SYNTAX_NOP   (AC_SYNTAX_1OP << 1)

Definition at line 98 of file arc.h.

◆ AC_SYNTAX_SIMD

#define AC_SYNTAX_SIMD   (AC_SYNTAX_NOP << 1)

Definition at line 99 of file arc.h.

◆ ARC_DELAY_JUMP

#define ARC_DELAY_JUMP   2 /* delay slot only if branch taken */

Definition at line 427 of file arc.h.

◆ ARC_DELAY_NONE

#define ARC_DELAY_NONE   0 /* no delay slot */

Definition at line 425 of file arc.h.

◆ ARC_DELAY_NORMAL

#define ARC_DELAY_NORMAL   1 /* delay slot in both cases */

Definition at line 426 of file arc.h.

◆ ARC_HASH_ICODE

#define ARC_HASH_ICODE (   insn)     ((unsigned int) (insn) >> 27)

Definition at line 179 of file arc.h.

◆ ARC_HASH_OPCODE

#define ARC_HASH_OPCODE (   string)     ((string)[0] >= 'a' && (string)[0] <= 'z' ? (string)[0] - 'a' : 26)

Definition at line 177 of file arc.h.

◆ ARC_HAVE_CPU

#define ARC_HAVE_CPU (   bits)    ((bits) & ARC_MACH_CPU_MASK)

Definition at line 402 of file arc.h.

◆ ARC_HAVE_MACH

#define ARC_HAVE_MACH (   bits)    ((bits) & ARC_MACH_MASK)

Definition at line 404 of file arc.h.

◆ ARC_INCR_U6

#define ARC_INCR_U6   0x100000

Definition at line 323 of file arc.h.

◆ ARC_MACH_ARC4

#define ARC_MACH_ARC4   1

Definition at line 41 of file arc.h.

◆ ARC_MACH_ARC5

#define ARC_MACH_ARC5   2

Definition at line 42 of file arc.h.

◆ ARC_MACH_ARC6

#define ARC_MACH_ARC6   4

Definition at line 43 of file arc.h.

◆ ARC_MACH_ARC601

#define ARC_MACH_ARC601   16

Definition at line 45 of file arc.h.

◆ ARC_MACH_ARC7

#define ARC_MACH_ARC7   8

Definition at line 44 of file arc.h.

◆ ARC_MACH_BIG

#define ARC_MACH_BIG   32

Definition at line 51 of file arc.h.

◆ ARC_MACH_CPU_MASK

#define ARC_MACH_CPU_MASK   (ARC_MACH_BIG - 1)

Definition at line 57 of file arc.h.

◆ ARC_MACH_MASK

#define ARC_MACH_MASK   ((ARC_MACH_BIG << 1) - 1)

Definition at line 59 of file arc.h.

◆ ARC_MASK_REG

#define ARC_MASK_REG   63

Definition at line 422 of file arc.h.

◆ ARC_MOD_AUXREG

#define ARC_MOD_AUXREG   0x4000

Definition at line 296 of file arc.h.

◆ ARC_MOD_BITS

#define ARC_MOD_BITS   0x107000

Definition at line 302 of file arc.h.

◆ ARC_MOD_DOT

#define ARC_MOD_DOT   0x1000

Definition at line 290 of file arc.h.

◆ ARC_MOD_P

#define ARC_MOD_P (   X)    ((X) & ARC_MOD_BITS)

Definition at line 305 of file arc.h.

◆ ARC_MOD_REG

#define ARC_MOD_REG   0x2000

Definition at line 293 of file arc.h.

◆ ARC_MOD_SDASYM

#define ARC_MOD_SDASYM   0x100000

Definition at line 299 of file arc.h.

◆ ARC_OPCODE_COND_BRANCH

#define ARC_OPCODE_COND_BRANCH   (ARC_OPCODE_FLAG_START)

Definition at line 80 of file arc.h.

◆ ARC_OPCODE_CPU

#define ARC_OPCODE_CPU (   bits)    ((bits) & ARC_MACH_CPU_MASK)

Definition at line 73 of file arc.h.

◆ ARC_OPCODE_FLAG_START

#define ARC_OPCODE_FLAG_START   (ARC_MACH_MASK + 1)

Definition at line 77 of file arc.h.

◆ ARC_OPCODE_MACH

#define ARC_OPCODE_MACH (   bits)    ((bits) & ARC_MACH_MASK)

Definition at line 75 of file arc.h.

◆ ARC_OPCODE_NEXT_ASM

#define ARC_OPCODE_NEXT_ASM (   op)    ((op)->next_asm)

Definition at line 184 of file arc.h.

◆ ARC_OPCODE_NEXT_DIS

#define ARC_OPCODE_NEXT_DIS (   op)    ((op)->next_dis)

Definition at line 185 of file arc.h.

◆ ARC_OPERAND_2BYTE_ALIGNED

#define ARC_OPERAND_2BYTE_ALIGNED   0x40000

Definition at line 283 of file arc.h.

◆ ARC_OPERAND_4BYTE_ALIGNED

#define ARC_OPERAND_4BYTE_ALIGNED   0x80000

Definition at line 286 of file arc.h.

◆ ARC_OPERAND_ABSOLUTE_BRANCH

#define ARC_OPERAND_ABSOLUTE_BRANCH   4

Definition at line 237 of file arc.h.

◆ ARC_OPERAND_ADDRESS

#define ARC_OPERAND_ADDRESS   8

Definition at line 241 of file arc.h.

◆ ARC_OPERAND_ERROR

#define ARC_OPERAND_ERROR   0x800

Definition at line 271 of file arc.h.

◆ ARC_OPERAND_FAKE

#define ARC_OPERAND_FAKE   0x100

Definition at line 263 of file arc.h.

◆ ARC_OPERAND_JUMPFLAGS

#define ARC_OPERAND_JUMPFLAGS   0x200

Definition at line 266 of file arc.h.

◆ ARC_OPERAND_LIMM

#define ARC_OPERAND_LIMM   0x10

Definition at line 244 of file arc.h.

◆ ARC_OPERAND_LOAD

#define ARC_OPERAND_LOAD   0x8000

Definition at line 274 of file arc.h.

◆ ARC_OPERAND_NEGATIVE

#define ARC_OPERAND_NEGATIVE   0x80

Definition at line 259 of file arc.h.

◆ ARC_OPERAND_RELATIVE_BRANCH

#define ARC_OPERAND_RELATIVE_BRANCH   2

Definition at line 233 of file arc.h.

◆ ARC_OPERAND_SIGNED

#define ARC_OPERAND_SIGNED   0x20

Definition at line 247 of file arc.h.

◆ ARC_OPERAND_SIGNOPT

#define ARC_OPERAND_SIGNOPT   0x40

Definition at line 252 of file arc.h.

◆ ARC_OPERAND_STORE

#define ARC_OPERAND_STORE   0x10000

Definition at line 277 of file arc.h.

◆ ARC_OPERAND_SUFFIX

#define ARC_OPERAND_SUFFIX   1

Definition at line 229 of file arc.h.

◆ ARC_OPERAND_UNSIGNED

#define ARC_OPERAND_UNSIGNED   0x20000

Definition at line 280 of file arc.h.

◆ ARC_OPERAND_WARN

#define ARC_OPERAND_WARN   0x400

Definition at line 270 of file arc.h.

◆ ARC_OPVAL_CPU

#define ARC_OPVAL_CPU (   bits)    ((bits) & ARC_MACH_CPU_MASK)

Definition at line 198 of file arc.h.

◆ ARC_OPVAL_MACH

#define ARC_OPVAL_MACH (   bits)    ((bits) & ARC_MACH_MASK)

Definition at line 200 of file arc.h.

◆ ARC_REG_CONSTANT_P

#define ARC_REG_CONSTANT_P (   REG)    ((REG) >= 61)

Definition at line 412 of file arc.h.

◆ ARC_REG_LIMM

#define ARC_REG_LIMM   62

Definition at line 409 of file arc.h.

◆ ARC_REG_SHIMM

#define ARC_REG_SHIMM   63

Definition at line 408 of file arc.h.

◆ ARC_REG_SHIMM_UPDATE

#define ARC_REG_SHIMM_UPDATE   61

Definition at line 407 of file arc.h.

◆ ARC_REGISTER_16

#define ARC_REGISTER_16   0x8

Definition at line 314 of file arc.h.

◆ ARC_REGISTER_NOSHORT_CUT

#define ARC_REGISTER_NOSHORT_CUT   0x04

Definition at line 311 of file arc.h.

◆ ARC_REGISTER_READONLY

#define ARC_REGISTER_READONLY   0x01

Definition at line 309 of file arc.h.

◆ ARC_REGISTER_SIMD_DR

#define ARC_REGISTER_SIMD_DR   0x40

Definition at line 339 of file arc.h.

◆ ARC_REGISTER_SIMD_I

#define ARC_REGISTER_SIMD_I   0x20

Definition at line 338 of file arc.h.

◆ ARC_REGISTER_SIMD_K

#define ARC_REGISTER_SIMD_K   0x80

Definition at line 340 of file arc.h.

◆ ARC_REGISTER_SIMD_VR

#define ARC_REGISTER_SIMD_VR   0x10

Definition at line 337 of file arc.h.

◆ ARC_REGISTER_WRITEONLY

#define ARC_REGISTER_WRITEONLY   0x02

Definition at line 310 of file arc.h.

◆ ARC_SHIFT_REGA

#define ARC_SHIFT_REGA   21

Definition at line 415 of file arc.h.

◆ ARC_SHIFT_REGA_AC

#define ARC_SHIFT_REGA_AC   0

Definition at line 418 of file arc.h.

◆ ARC_SHIFT_REGB

#define ARC_SHIFT_REGB   15

Definition at line 416 of file arc.h.

◆ ARC_SHIFT_REGB_HIGH_AC

#define ARC_SHIFT_REGB_HIGH_AC   12

Definition at line 420 of file arc.h.

◆ ARC_SHIFT_REGB_LOW_AC

#define ARC_SHIFT_REGB_LOW_AC   24

Definition at line 419 of file arc.h.

◆ ARC_SHIFT_REGC

#define ARC_SHIFT_REGC   9

Definition at line 417 of file arc.h.

◆ ARC_SHIFT_REGC_AC

#define ARC_SHIFT_REGC_AC   6

Definition at line 421 of file arc.h.

◆ ARC_SHIMM_CONST_P

#define ARC_SHIMM_CONST_P (   x)    ((long) (x) >= -256 && (long) (x) <= 255)

Definition at line 430 of file arc.h.

◆ ARC_SIMD_LANEMASK

#define ARC_SIMD_LANEMASK   (ARC_SIMD_SCALE4 <<0x1)

Definition at line 329 of file arc.h.

◆ ARC_SIMD_REGISTER

#define ARC_SIMD_REGISTER   (ARC_SIMD_LANEMASK <<0x1)

Definition at line 330 of file arc.h.

◆ ARC_SIMD_SCALE1

#define ARC_SIMD_SCALE1   (ARC_INCR_U6 << 0x1)

Definition at line 325 of file arc.h.

◆ ARC_SIMD_SCALE2

#define ARC_SIMD_SCALE2   (ARC_SIMD_SCALE1 << 0x1)

Definition at line 326 of file arc.h.

◆ ARC_SIMD_SCALE3

#define ARC_SIMD_SCALE3   (ARC_SIMD_SCALE2 << 0x1)

Definition at line 327 of file arc.h.

◆ ARC_SIMD_SCALE4

#define ARC_SIMD_SCALE4   (ARC_SIMD_SCALE3 << 0x1)

Definition at line 328 of file arc.h.

◆ ARC_SIMD_SETLM

#define ARC_SIMD_SETLM   (ARC_SIMD_ZERVC <<0x1)

Definition at line 334 of file arc.h.

◆ ARC_SIMD_ZERVA

#define ARC_SIMD_ZERVA   (ARC_SIMD_REGISTER <<0x1)

Definition at line 331 of file arc.h.

◆ ARC_SIMD_ZERVB

#define ARC_SIMD_ZERVB   (ARC_SIMD_ZERVA <<0x1)

Definition at line 332 of file arc.h.

◆ ARC_SIMD_ZERVC

#define ARC_SIMD_ZERVC   (ARC_SIMD_ZERVB <<0x1)

Definition at line 333 of file arc.h.

◆ ARCOMPACT

#define ARCOMPACT   (ARC_MACH_ARC5 | ARC_MACH_ARC6 | ARC_MACH_ARC601 | ARC_MACH_ARC7)

Definition at line 54 of file arc.h.

◆ B

#define B (   x)    (((unsigned) (x) & ARC_MASK_REG) << ARC_SHIFT_REGB)

Definition at line 166 of file arc.h.

◆ C

#define C (   x)    (((unsigned) (x) & ARC_MASK_REG) << ARC_SHIFT_REGC)

Definition at line 167 of file arc.h.

◆ E_ARC_MACH_A4

#define E_ARC_MACH_A4   0x00000000

Definition at line 47 of file arc.h.

◆ EM_ARCOMPACT

#define EM_ARCOMPACT   93 /* ARC Cores */

Definition at line 48 of file arc.h.

◆ I

#define I (   x)    (((unsigned) (x) & 31) << 27)

Definition at line 164 of file arc.h.

◆ OP1_DEST_IGNORED

#define OP1_DEST_IGNORED   (SYNTAX_NOP << 1)

Definition at line 86 of file arc.h.

◆ OP1_IMM_IMPLIED

#define OP1_IMM_IMPLIED   (OP1_MUST_BE_IMM << 1)

Definition at line 88 of file arc.h.

◆ OP1_MUST_BE_IMM

#define OP1_MUST_BE_IMM   (OP1_DEST_IGNORED << 1)

Definition at line 87 of file arc.h.

◆ R

#define R (   x,
  b,
 
)    (((unsigned) (x) & (m)) << (b)) /* value X, mask M, at bit B */

Definition at line 168 of file arc.h.

◆ SIMD_LONG_INST

#define SIMD_LONG_INST   (SYNTAX_VALID << 1)

Definition at line 93 of file arc.h.

◆ SUFFIX_COND

#define SUFFIX_COND   (SUFFIX_NONE << 1)

Definition at line 90 of file arc.h.

◆ SUFFIX_FLAG

#define SUFFIX_FLAG   (SUFFIX_COND << 1)

Definition at line 91 of file arc.h.

◆ SUFFIX_NONE

#define SUFFIX_NONE   (OP1_IMM_IMPLIED << 1)

Definition at line 89 of file arc.h.

◆ SYNTAX_1OP

#define SYNTAX_1OP   (SYNTAX_2OP << 1)

Definition at line 84 of file arc.h.

◆ SYNTAX_2OP

#define SYNTAX_2OP   (SYNTAX_3OP << 1)

Definition at line 83 of file arc.h.

◆ SYNTAX_3OP

#define SYNTAX_3OP   (SYNTAX_LENGTH )

Definition at line 82 of file arc.h.

◆ SYNTAX_LENGTH

#define SYNTAX_LENGTH   (ARC_OPCODE_COND_BRANCH << 1)

Definition at line 81 of file arc.h.

◆ SYNTAX_NOP

#define SYNTAX_NOP   (SYNTAX_1OP << 1)

Definition at line 85 of file arc.h.

◆ SYNTAX_VALID

#define SYNTAX_VALID   (SUFFIX_FLAG << 1)

Definition at line 92 of file arc.h.

Typedef Documentation

◆ arc_insn

Definition at line 62 of file arc.h.

Function Documentation

◆ ac_add_reg_sdasym_insn()

int ac_add_reg_sdasym_insn ( arc_insn  insn)

Definition at line 4595 of file arc-opc.c.

4596 {
4597  return ((insn & 0xf8ff0fc0) == 0x20000f80);
4598 }

Referenced by insert_reg().

◆ ac_branch_or_jump_insn()

int ac_branch_or_jump_insn ( arc_insn  insn,
int  compact_insn_16 
)

Definition at line 4569 of file arc-opc.c.

4570 {
4571 
4572  return ((!compact_insn_16 && ((insn & I(-1)) == I(0x4)) &&
4573  (((insn >> 18) & 0xf) == 0x8)) ||
4574  (compact_insn_16 && ((insn & I(-1)) == I(0xf))) ||
4575  (!compact_insn_16 && ((insn & I(-1)) == I(0x1))) ||
4576  (compact_insn_16 && ((insn & I(-1)) == I(0x1f))) ||
4577  (!compact_insn_16 && ((insn & I(-1)) == I(0x0))) ||
4578  (compact_insn_16 && ((insn & I(-1)) == I(0x1e))));
4579 }
#define I(x)
Definition: arc.h:164

References I.

◆ ac_constant_operand()

int ac_constant_operand ( const struct arc_operand op)

Definition at line 4737 of file arc-opc.c.

4738 {
4739  switch (op->fmt)
4740  {
4741  case '@': /* This is valid only for A700 . The checks in the instruction patterns would take care of other checks.*/
4742 
4743  case 'u':
4744  case 'K':
4745  case 'L':
4746  case 'o':
4747  case 'e':
4748  case 'E':
4749  case 'j':
4750  case 'J':
4751  case 'k':
4752  case 'l':
4753  case 'm':
4754  case 'M':
4755  case 'O':
4756  case 'R':
4757  /* Operands for the Aurora SIMD ISA*/
4758  case '?':
4759  case '\14':
4760  case '\20':
4761  case '\21':
4762  case '\22':
4763  case '\23':
4764  case '\24':
4765  case '\25':
4766 
4767  return 1;
4768  }
4769  return 0;
4770 }
Definition: dis.c:32

◆ ac_get_load_sdasym_insn_type()

int ac_get_load_sdasym_insn_type ( arc_insn  insn,
int  compact_insn_16 
)

Definition at line 4625 of file arc-opc.c.

4626 {
4627  int load_type = -1;
4628 
4629  /* ld[b/w]_s */
4630  if (compact_insn_16)
4631  {
4632  switch (insn & 0xfe00)
4633  {
4634  /* ld_s */
4635  case 0xc800:
4636  load_type = 10;
4637  break;
4638 
4639  /* ldb_s */
4640  case 0xca00:
4641  load_type = 11;
4642  break;
4643 
4644  /* ldw_s */
4645  case 0xcc00:
4646  load_type = 12;
4647  break;
4648  }
4649  }
4650  else
4651  {
4652  /* ld/ldw/ldb */
4653  switch (insn & 0xf8000180)
4654  {
4655  /* ld */
4656  case 0x10000000:
4657  if (((insn >> 9) & 3) == 3) {
4658  load_type = 0;
4659  } else {
4660  load_type = 1;
4661  }
4662  break;
4663 
4664  /* ldw */
4665  case 0x10000100:
4666  if (((insn >> 9) & 3) == 3) {
4667  load_type = 2;
4668  } else {
4669  load_type = 1;
4670  }
4671  break;
4672 
4673  /* ldb */
4674  case 0x10000080:
4675  load_type = 1;
4676  break;
4677 
4678  }
4679  }
4680 
4681  return load_type;
4682 }

◆ ac_get_store_sdasym_insn_type()

int ac_get_store_sdasym_insn_type ( arc_insn  ,
int   
)

◆ ac_lpcc_insn()

int ac_lpcc_insn ( arc_insn  insn)

Definition at line 4586 of file arc-opc.c.

4587 {
4588  return ( ((insn & 0xfffff000) == 0x20a80000) ||
4589  ((insn & 0xfffff020) == 0x20a80020));
4590 }

◆ ac_register_operand()

int ac_register_operand ( const struct arc_operand op)

Definition at line 4803 of file arc-opc.c.

4804 {
4805  switch (op->fmt)
4806  {
4807  case 'a':
4808  case 'b':
4809  case 'c':
4810  case 'A':
4811  case 'B':
4812  case '#':
4813  case 'C':
4814  case 'U':
4815  case 'g':
4816  case 'G':
4817  case 'r':
4818  case '4':
4819  case '5':
4820  case '6':
4821  case '7':
4822  case '8':
4823  case '9':
4824  case '!':
4825  return 1;
4826  }
4827  return 0;
4828 }

◆ ac_symbol_operand()

int ac_symbol_operand ( const struct arc_operand op)

Definition at line 4833 of file arc-opc.c.

4834 {
4835  switch (op->fmt)
4836  {
4837  case 'L':
4838  case 'd':
4839  case 'h':
4840  case 'H':
4841  case 'i':
4842  case 'I':
4843  case 'y':
4844  case 'Y':
4845  case 's':
4846  case 'S':
4847  case 'Z':
4848  case 'W':
4849  return 1;
4850  }
4851  return 0;
4852 }

◆ ARC700_register_simd_operand()

int ARC700_register_simd_operand ( char  fmt)

Definition at line 4776 of file arc-opc.c.

4777 {
4778  switch (fmt)
4779  {
4780  case '*':
4781  case '(':
4782  case ')':
4783  return 1; /*If the operand belongs to the Vector register(Vrxx) set*/
4784  case '<':
4785  case '>':
4786  return 2; /*If the operand belongs to the DMA registers (DRxx) set*/
4787  case '\13':
4788  case '{':
4789  case '}':
4790  return 3; /*If the operand belongs to the Scalar register (Ixx) set*/
4791  case '\15':
4792  case '\16':
4793  case '\17':
4794  return 4; /*If the operand belongs to the Scalar register (Kxx) set*/
4795  }
4796  return 0;
4797 }

◆ arc_aux_reg_name()

char* arc_aux_reg_name ( int  regVal)

Definition at line 4965 of file arc-opc.c.

4966 {
4967  int i;
4968 
4969  for (i= arc_reg_names_count ; i > 0 ; i--)
4970  {
4971  if ((arc_reg_names[i].type == AUXREG_AC) && (arc_reg_names[i].value == regVal)) {
4972  return arc_reg_names[i].name;
4973  }
4974  }
4975 
4976  return NULL;
4977 }
lzma_index ** i
Definition: index.h:629
int arc_reg_names_count
Definition: arc-opc.c:4101
const struct arc_operand_value * arc_reg_names
Definition: arc-opc.c:4100
#define AUXREG_AC
static int value
Definition: cmd_api.c:93
#define NULL
Definition: cris-opc.c:27
int type
Definition: mipsasm.c:17
char * name
Definition: arc.h:190

References arc_reg_names, arc_reg_names_count, AUXREG_AC, i, arc_operand_value::name, NULL, type, and value.

Referenced by my_sprintf().

◆ arc_get_opcode_mach()

int arc_get_opcode_mach ( int  bfd_mach,
int  big_p 
)

Definition at line 4282 of file arc-opc.c.

4283 {
4284  static int mach_type_map[] =
4285  {
4286  ARC_MACH_ARC4,
4287  ARC_MACH_ARC5,
4288  ARC_MACH_ARC6,
4289  ARC_MACH_ARC7,
4291  };
4292 
4293  return mach_type_map[bfd_mach] | (big_p ? ARC_MACH_BIG : 0);
4294 }
#define ARC_MACH_ARC4
Definition: arc.h:41
#define ARC_MACH_ARC7
Definition: arc.h:44
#define ARC_MACH_ARC5
Definition: arc.h:42
#define ARC_MACH_ARC6
Definition: arc.h:43
#define ARC_MACH_BIG
Definition: arc.h:51
#define ARC_MACH_ARC601
Definition: arc.h:45

References ARC_MACH_ARC4, ARC_MACH_ARC5, ARC_MACH_ARC6, ARC_MACH_ARC601, ARC_MACH_ARC7, and ARC_MACH_BIG.

◆ arc_insn_not_jl()

int arc_insn_not_jl ( arc_insn  insn)

Definition at line 4539 of file arc-opc.c.

4540 {
4541  return ((insn & (I(-1)|A(-1)|C(-1)|R(-1,7,1)|R(-1,9,1)))
4542  != (I(0x7) | R(-1,9,1)));
4543 }
#define A(x)
Definition: arc.h:165
#define R(x, b, m)
Definition: arc.h:168
#define C(x)
Definition: arc.h:167

References A, C, I, and R.

◆ arc_limm_fixup_adjust()

int arc_limm_fixup_adjust ( arc_insn  insn)

Definition at line 1658 of file arc-opc.c.

1659 {
1660  int retval = 0;
1661 
1662  /* Check for st shimm,[limm]. */
1663 
1664  if ((insn & (I(-1) | C(-1) | B(-1))) ==
1665  (I(2) | C(ARC_REG_SHIMM) | B(ARC_REG_LIMM)))
1666  {
1667  retval = insn & 0x1ff;
1668  if (retval & 0x100) { /* Sign extend 9 bit offset. */
1669  retval |= ~0x1ff;
1670  }
1671  }
1672  return -retval; /* Negate offset for return. */
1673 }
#define ARC_REG_LIMM
Definition: analysis_arc.c:13
#define B(x)
Definition: arc.h:166
#define ARC_REG_SHIMM
Definition: arc.h:408

References ARC_REG_LIMM, ARC_REG_SHIMM, B, C, and I.

Referenced by insert_st_syntax().

◆ arc_opcode_init_extract()

void arc_opcode_init_extract ( void  )

Definition at line 2131 of file arc-opc.c.

2132 {
2134 }
void arc_opcode_init_insert(void)
Definition: arc-opc.c:4457

References arc_opcode_init_insert().

◆ arc_opcode_init_insert()

void arc_opcode_init_insert ( void  )

Definition at line 4457 of file arc-opc.c.

4458 {
4459  int i;
4460 
4461  for (i = 0; i < OPERANDS; i++) {
4462  ls_operand[i] = OP_NONE;
4463  }
4464 
4465  flag_p = 0;
4466  flagshimm_handled_p = 0;
4467  arc_cond_p = 0;
4468  addrwb_p = 0;
4469  shimm_p = 0;
4470  limm_p = 0;
4471  jumpflags_p = 0;
4472  nullify_p = 0;
4473  nullify = 0; /* The default is important. */
4474 }
static int flagshimm_handled_p
Definition: arc-opc.c:110
static int addrwb_p
Definition: arc-opc.c:113
static int flag_p
Definition: arc-opc.c:107
static enum operand ls_operand[OPERANDS]
Definition: arc-opc.c:154
static int nullify_p
Definition: arc-opc.c:116
static int limm_p
Definition: arc-opc.c:133
static int nullify
Definition: arc-opc.c:119
#define OPERANDS
Definition: arc-opc.c:152
@ OP_NONE
Definition: arc-opc.c:39
static int shimm_p
Definition: arc-opc.c:125
static int jumpflags_p
Definition: arc-opc.c:122
int arc_cond_p
Definition: arc-opc.c:858

References addrwb_p, arc_cond_p, flag_p, flagshimm_handled_p, i, jumpflags_p, limm_p, ls_operand, nullify, nullify_p, OP_NONE, OPERANDS, and shimm_p.

Referenced by arc_opcode_init_extract().

◆ arc_opcode_init_tables()

void arc_opcode_init_tables ( int  flags)

Definition at line 4304 of file arc-opc.c.

4305 {
4306  static int init_p = 0;
4307 
4308  /* If initialization was already done but current cpu type is different
4309  from the one for which initialization was done earlier, then do
4310  initialization again */
4311  if (init_p && cpu_type != flags) {
4312  init_p = 0;
4313  }
4314 
4315  cpu_type = flags;
4316 
4317  /* We may be intentionally called more than once (for example gdb will call
4318  us each time the user switches cpu). These tables only need to be init'd
4319  once though. */
4320  /* ??? We can remove the need for arc_opcode_supported by taking it into
4321  account here, but I'm not sure I want to do that yet (if ever). */
4322  if (!init_p)
4323  {
4324  int i;
4325 
4326  if (arc_mach_a4)
4327  {
4328  /* Initialize operand map table for ARCtanget-A4 */
4330 
4331  for (i = 0; i < (int)ELEMENTS_IN (arc_operands_a4); i++) {
4333  }
4334 
4335  /* Set the pointers to operand table, operand map table */
4342  }
4343  else
4344  {
4345  /* Initialize operand map table for ARCompact */
4347 
4348  for (i = 0; i < (int)ELEMENTS_IN (arc_operands_ac); i++) {
4350  }
4351 
4352  /* Set the pointers to operand table, operand map table */
4355 
4356  /* Codito :: Ideally all the checking should be on this
4357  basis and not on flags shared across the libraries as seems
4358  to be the case for A4. Would have to check that and test
4359  it at some point in time.
4360  */
4362  {
4365  }
4366  else
4367  {
4370  }
4373  }
4374 
4375  memset (opcode_map, 0, sizeof (opcode_map));
4376  memset (icode_map, 0, sizeof (icode_map));
4377 
4378  /* Scan the table backwards so macros appear at the front. */
4379  for (i = ELEMENTS_IN(arc_opcodes) - 1; i >= 0; --i)
4380  {
4381  int opcode_hash = ARC_HASH_OPCODE (arc_opcodes[i].syntax);
4382  int icode_hash = ARC_HASH_ICODE (arc_opcodes[i].value);
4383 
4384  arc_opcodes[i].next_asm = opcode_map[opcode_hash];
4385  opcode_map[opcode_hash] = &arc_opcodes[i];
4386 
4387  arc_opcodes[i].next_dis = icode_map[icode_hash];
4388  icode_map[icode_hash] = &arc_opcodes[i];
4389  }
4390 
4391  init_p = 1;
4392  }
4393 }
static int cpu_type
Definition: arc-opc.c:143
static struct arc_opcode * opcode_map[26+1]
Definition: arc-opc.c:4269
static unsigned char arc_operand_map_ac[256]
Definition: arc-opc.c:149
#define ELEMENTS_IN(arr)
Definition: arc-opc.c:46
static struct arc_opcode arc_opcodes[]
Definition: arc-opc.c:2487
static const struct arc_operand_value arc_reg_names_a4[]
Definition: arc-opc.c:3818
static const struct arc_operand_value arc_reg_names_a700[]
Definition: arc-opc.c:3937
static const struct arc_operand_value arc_suffixes_a4[]
Definition: arc-opc.c:4108
int arc_mach_a4
Definition: arc-opc.c:866
int arc_suffixes_count
Definition: arc-opc.c:4265
const struct arc_operand * arc_operands
Definition: arc-opc.c:893
static struct arc_opcode * icode_map[32]
Definition: arc-opc.c:4272
static unsigned char arc_operand_map_a4[256]
Definition: arc-opc.c:148
const struct arc_operand_value * arc_suffixes
Definition: arc-opc.c:4264
static const struct arc_operand arc_operands_ac[]
Definition: arc-opc.c:489
unsigned char * arc_operand_map
Definition: arc-opc.c:889
static const struct arc_operand_value arc_reg_names_a500600[]
Definition: arc-opc.c:3884
static const struct arc_operand arc_operands_a4[]
Definition: arc-opc.c:207
static const struct arc_operand_value arc_suffixes_ac[]
Definition: arc-opc.c:4199
#define ARC_HASH_ICODE(insn)
Definition: arc.h:179
#define ARC_OPCODE_CPU(bits)
Definition: arc.h:73
#define ARC_HASH_OPCODE(string)
Definition: arc.h:177
return memset(p, 0, total)
static struct sockaddr static addrlen static backlog const void static flags void flags
Definition: sfsocketcall.h:123
static int
Definition: sfsocketcall.h:114
struct arc_opcode * next_asm
Definition: arc.h:173
struct arc_opcode * next_dis
Definition: arc.h:174
unsigned char fmt
Definition: arc.h:214

References ARC_HASH_ICODE, ARC_HASH_OPCODE, arc_mach_a4, ARC_MACH_ARC7, ARC_OPCODE_CPU, arc_opcodes, arc_operand_map, arc_operand_map_a4, arc_operand_map_ac, arc_operands, arc_operands_a4, arc_operands_ac, arc_reg_names, arc_reg_names_a4, arc_reg_names_a500600, arc_reg_names_a700, arc_reg_names_count, arc_suffixes, arc_suffixes_a4, arc_suffixes_ac, arc_suffixes_count, cpu_type, ELEMENTS_IN, flags, arc_operand::fmt, i, icode_map, int, memset(), arc_opcode::next_asm, arc_opcode::next_dis, opcode_map, benchmark::syntax, and value.

◆ arc_opcode_limm_p()

int arc_opcode_limm_p ( long limmp)

Definition at line 4481 of file arc-opc.c.

4482 {
4483  if (limmp) {
4484  *limmp = limm;
4485  }
4486  return limm_p;
4487 }
static long limm
Definition: arc-opc.c:137

References limm, and limm_p.

◆ arc_opcode_lookup_asm()

const struct arc_opcode* arc_opcode_lookup_asm ( const char *  insn)

Definition at line 4432 of file arc-opc.c.

4433 {
4434  return opcode_map[ARC_HASH_OPCODE (insn)];
4435 }

References ARC_HASH_OPCODE, and opcode_map.

◆ arc_opcode_lookup_dis()

const struct arc_opcode* arc_opcode_lookup_dis ( unsigned int  insn)

Definition at line 4441 of file arc-opc.c.

4442 {
4443  return icode_map[ARC_HASH_ICODE (insn)];
4444 }

References ARC_HASH_ICODE, and icode_map.

◆ arc_opcode_lookup_suffix()

const struct arc_operand_value* arc_opcode_lookup_suffix ( const struct arc_operand type,
int  value 
)

Definition at line 4494 of file arc-opc.c.

4495 {
4496  const struct arc_operand_value *v,*end;
4497  struct arc_ext_operand_value *ext_oper = arc_ext_operands;
4498  while (ext_oper)
4499  {
4500  if (type == &arc_operands[ext_oper->operand.type] && value == ext_oper->operand.value) {
4501  return (&ext_oper->operand);
4502  }
4503  ext_oper = ext_oper->next;
4504  }
4505 
4506  /* ??? This is a little slow and can be speeded up. */
4507  for (v = arc_suffixes, end = arc_suffixes + arc_suffixes_count; v < end; ++v) {
4508  if (type == &arc_operands[v->type] && value == v->value) {
4509  return v;
4510  }
4511  }
4512  return 0;
4513 }
struct arc_ext_operand_value * arc_ext_operands
Definition: arc-opc.c:880
const char * v
Definition: dsignal.c:12
struct arc_ext_operand_value * next
Definition: arc.h:204
struct arc_operand_value operand
Definition: arc.h:205
short value
Definition: arc.h:191
unsigned char type
Definition: arc.h:192

References arc_ext_operands, arc_operands, arc_suffixes, arc_suffixes_count, test_evm::end, arc_ext_operand_value::next, arc_ext_operand_value::operand, arc_operand_value::type, type, v, arc_operand_value::value, and value.

Referenced by extract_cond(), and extract_flag().

◆ arc_opcode_supported()

int arc_opcode_supported ( const struct arc_opcode opcode)

Definition at line 4400 of file arc-opc.c.

4401 {
4402  if (ARC_OPCODE_CPU (opcode->flags) == 0) {
4403  return 1;
4404  }
4405  if (ARC_OPCODE_CPU (opcode->flags) & ARC_HAVE_CPU (cpu_type)) {
4406  return 1;
4407  }
4408  return 0;
4409 }
#define ARC_HAVE_CPU(bits)
Definition: arc.h:402
int flags
Definition: arc.h:67

References ARC_HAVE_CPU, ARC_OPCODE_CPU, cpu_type, and arc_opcode::flags.

◆ arc_operand_type()

int arc_operand_type ( int  opertype)

Definition at line 4856 of file arc-opc.c.

4857 {
4858  switch (opertype)
4859  {
4860  case 0:
4861  return (arc_mach_a4 ? COND : COND_AC);
4862  case 1:
4863  return (arc_mach_a4 ? REG : REG_AC);
4864  case 2:
4865  return (arc_mach_a4 ? AUXREG : AUXREG_AC);
4866  default:
4867  return 0; // abort
4868  }
4869 }
#define COND
#define REG
#define REG_AC
#define AUXREG
#define COND_AC

References arc_mach_a4, AUXREG, AUXREG_AC, COND, COND_AC, REG, and REG_AC.

◆ arc_opval_supported()

int arc_opval_supported ( const struct arc_operand_value )

◆ arc_test_wb()

int arc_test_wb ( void  )

Definition at line 4448 of file arc-opc.c.

4449 {
4450  return addrwb_p;
4451 }

References addrwb_p.

◆ get_ext_suffix()

struct arc_operand_value* get_ext_suffix ( char *  s,
char  field 
)

Definition at line 4873 of file arc-opc.c.

4874 {
4876  char ctype = 0;
4877 
4878  switch(field){
4879  case 'e' :
4880  ctype = arc_mach_a4 ? CACHEBYPASS5 : 0;
4881  break;
4882  case 'f' :
4883  ctype = arc_mach_a4 ? FLAG : FLAG_AC;
4884  break;
4885  case 'j' :
4886  ctype = arc_mach_a4 ? JUMPFLAGS : 0;
4887  break;
4888  case 'p' :
4889  ctype = arc_mach_a4 ? 0 : ADDRESS9_AC;
4890  break;
4891  case 'q' :
4892  ctype = arc_mach_a4 ? COND : COND_AC;
4893  break;
4894  case 't' :
4895  ctype = arc_mach_a4 ? 0 : SIZE7_AC;
4896  break;
4897  case 'v' :
4899  break;
4900  case 'w' :
4901  ctype = arc_mach_a4 ? ADDRESS3 : ADDRESS3_AC;
4902  break;
4903  case 'x' :
4904  ctype = arc_mach_a4 ? SIGN0 : SIGN6_AC;
4905  break;
4906  case 'y' :
4907  ctype = arc_mach_a4 ? SIZE22 : 0;
4908  break;
4909  case 'z' :
4910  ctype = arc_mach_a4 ? SIZE1 : SIZE1_AC;
4911  break;
4912  case 'D' :
4914  break;
4915  case 'E' :
4916  ctype = arc_mach_a4 ? CACHEBYPASS14 : 0;
4917  break;
4918  case 'P' :
4919  ctype = arc_mach_a4 ? 0 : ADDRESS22_AC;
4920  break;
4921  case 'T' :
4922  ctype = arc_mach_a4 ? 0 : SIZE17_AC;
4923  break;
4924  case 'V' :
4925  ctype = arc_mach_a4 ? 0 : CACHEBYPASS15_AC;
4926  break;
4927  case 'W' :
4928  ctype = arc_mach_a4 ? ADDRESS12 : 0;
4929  break;
4930  case 'X' :
4931  ctype = arc_mach_a4 ? SIGN9 : SIGN16_AC;
4932  break;
4933  case 'Z' :
4934  ctype = arc_mach_a4 ? SIZE10 : 0;
4935  break;
4936  case '&' :
4937  ctype = arc_mach_a4 ? 0 : ADDRESS22S_AC;
4938  break;
4939  default :
4940  ctype = arc_mach_a4 ? COND : COND_AC;
4941  break;
4942  } /* end switch(field) */
4943  if (ctype == 0) {
4944  ctype = arc_mach_a4 ? COND : COND_AC;
4945  }
4946  while (suffix) {
4947  if ((suffix->operand.type == ctype) && !strcmp (s, suffix->operand.name)) {
4948  return (&suffix->operand);
4949  }
4950  suffix = suffix->next;
4951  } /* end while(suffix) */
4952 
4953  return NULL;
4954 }
#define ADDRESS3
#define SIGN6_AC
#define SIGN0
#define ADDRESS24
#define ADDRESS22_AC
#define CACHEBYPASS5_AC
#define SIZE17_AC
#define CACHEBYPASS11_AC
#define ADDRESS3_AC
#define SIZE1
#define SIZE1_AC
#define ADDRESS12
#define CACHEBYPASS26
#define SIGN16_AC
#define SIGN9
#define CACHEBYPASS5
#define CACHEBYPASS15_AC
#define ADDRESS22S_AC
#define SIZE7_AC
#define CACHEBYPASS14
#define SIZE10
#define JUMPFLAGS
#define FLAG_AC
#define SIZE22
#define ADDRESS9_AC
#define FLAG
unsigned char suffix[65536]
Definition: gun.c:164
static RzSocket * s
Definition: rtr.c:28

References ADDRESS12, ADDRESS22_AC, ADDRESS22S_AC, ADDRESS24, ADDRESS3, ADDRESS3_AC, ADDRESS9_AC, arc_ext_operands, arc_mach_a4, CACHEBYPASS11_AC, CACHEBYPASS14, CACHEBYPASS15_AC, CACHEBYPASS26, CACHEBYPASS5, CACHEBYPASS5_AC, COND, COND_AC, test-lz4-speed::default, FLAG, FLAG_AC, JUMPFLAGS, NULL, s, SIGN0, SIGN16_AC, SIGN6_AC, SIGN9, SIZE1, SIZE10, SIZE17_AC, SIZE1_AC, SIZE22, SIZE7_AC, and suffix.

Variable Documentation

◆ arc_cond_p

int arc_cond_p
extern

◆ arc_ext_operands

struct arc_ext_operand_value* arc_ext_operands
extern

Definition at line 880 of file arc-opc.c.

Referenced by arc_opcode_lookup_suffix(), get_ext_suffix(), and lookup_register().

◆ arc_ld_ext_mask

unsigned long arc_ld_ext_mask
extern

Definition at line 876 of file arc-opc.c.

Referenced by insert_ex_syntax(), and insert_ld_syntax().

◆ arc_mach_a4

◆ arc_operand_count

int arc_operand_count
extern

◆ arc_operand_map

unsigned char* arc_operand_map
extern

Definition at line 889 of file arc-opc.c.

Referenced by arc_opcode_init_tables(), and extract_ld_offset().

◆ arc_operands

const struct arc_operand* arc_operands
extern

◆ arc_reg_names

const struct arc_operand_value* arc_reg_names
extern

Definition at line 4100 of file arc-opc.c.

Referenced by arc_aux_reg_name(), arc_opcode_init_tables(), and lookup_register().

◆ arc_reg_names_count

int arc_reg_names_count
extern

Definition at line 4101 of file arc-opc.c.

Referenced by arc_aux_reg_name(), arc_opcode_init_tables(), and lookup_register().

◆ arc_suffixes

const struct arc_operand_value* arc_suffixes
extern

Definition at line 4264 of file arc-opc.c.

Referenced by arc_opcode_init_tables(), and arc_opcode_lookup_suffix().

◆ arc_suffixes_count

int arc_suffixes_count
extern

Definition at line 4265 of file arc-opc.c.

Referenced by arc_opcode_init_tables(), and arc_opcode_lookup_suffix().

◆ arc_user_mode_only

int arc_user_mode_only
extern

Definition at line 878 of file arc-opc.c.

Referenced by insert_ex_syntax(), and insert_ld_syntax().