Rizin
unix-like reverse engineering framework and cli tools
aarch64-opc.h File Reference
#include <string.h>
#include <assert.h>
#include "aarch64.h"

Go to the source code of this file.

Classes

struct  aarch64_field
 
struct  aarch64_operand
 

Macros

#define OPD_F_HAS_INSERTER   0x00000001
 
#define OPD_F_HAS_EXTRACTOR   0x00000002
 
#define OPD_F_SIGN_EXT_T   0x00000004 /* Require sign-extension. */
 
#define OPD_F_SHIFT_BY_2
 
#define OPD_F_MAYBE_SP   0x00000010 /* May potentially be SP. */
 
#define OPD_F_OD_MASK   0x000000e0 /* Operand-dependent data. */
 
#define OPD_F_OD_LSB   5
 
#define OPD_F_NO_ZR   0x00000100 /* ZR index not allowed. */
 
#define F_DEPRECATED   (1 << 0) /* Deprecated system register. */
 
#define F_ARCHEXT   (1 << 1) /* Architecture dependent system register. */
 
#define F_HASXT
 
#define F_REG_READ
 
#define F_REG_WRITE
 

Typedefs

typedef struct aarch64_field aarch64_field
 
typedef struct aarch64_operand aarch64_operand
 

Enumerations

enum  aarch64_field_kind {
  FLD_NIL , FLD_cond2 , FLD_nzcv , FLD_defgh ,
  FLD_abc , FLD_imm19 , FLD_immhi , FLD_immlo ,
  FLD_size , FLD_vldst_size , FLD_op , FLD_Q ,
  FLD_Rt , FLD_Rd , FLD_Rn , FLD_Rt2 ,
  FLD_Ra , FLD_op2 , FLD_CRm , FLD_CRn ,
  FLD_op1 , FLD_op0 , FLD_imm3 , FLD_cond ,
  FLD_opcode , FLD_cmode , FLD_asisdlso_opcode , FLD_len ,
  FLD_Rm , FLD_Rs , FLD_option , FLD_S ,
  FLD_hw , FLD_opc , FLD_opc1 , FLD_shift ,
  FLD_type , FLD_ldst_size , FLD_imm6 , FLD_imm6_2 ,
  FLD_imm4 , FLD_imm4_2 , FLD_imm5 , FLD_imm7 ,
  FLD_imm8 , FLD_imm9 , FLD_imm12 , FLD_imm14 ,
  FLD_imm16 , FLD_imm26 , FLD_imms , FLD_immr ,
  FLD_immb , FLD_immh , FLD_S_imm10 , FLD_N ,
  FLD_index , FLD_index2 , FLD_sf , FLD_lse_sz ,
  FLD_H , FLD_L , FLD_M , FLD_b5 ,
  FLD_b40 , FLD_scale , FLD_SVE_M_4 , FLD_SVE_M_14 ,
  FLD_SVE_M_16 , FLD_SVE_N , FLD_SVE_Pd , FLD_SVE_Pg3 ,
  FLD_SVE_Pg4_5 , FLD_SVE_Pg4_10 , FLD_SVE_Pg4_16 , FLD_SVE_Pm ,
  FLD_SVE_Pn , FLD_SVE_Pt , FLD_SVE_Rm , FLD_SVE_Rn ,
  FLD_SVE_Vd , FLD_SVE_Vm , FLD_SVE_Vn , FLD_SVE_Za_5 ,
  FLD_SVE_Za_16 , FLD_SVE_Zd , FLD_SVE_Zm_5 , FLD_SVE_Zm_16 ,
  FLD_SVE_Zn , FLD_SVE_Zt , FLD_SVE_i1 , FLD_SVE_i3h ,
  FLD_SVE_imm3 , FLD_SVE_imm4 , FLD_SVE_imm5 , FLD_SVE_imm5b ,
  FLD_SVE_imm6 , FLD_SVE_imm7 , FLD_SVE_imm8 , FLD_SVE_imm9 ,
  FLD_SVE_immr , FLD_SVE_imms , FLD_SVE_msz , FLD_SVE_pattern ,
  FLD_SVE_prfop , FLD_SVE_rot1 , FLD_SVE_rot2 , FLD_SVE_sz ,
  FLD_SVE_tsz , FLD_SVE_tszh , FLD_SVE_tszl_8 , FLD_SVE_tszl_19 ,
  FLD_SVE_xs_14 , FLD_SVE_xs_22 , FLD_rotate1 , FLD_rotate2 ,
  FLD_rotate3 , FLD_SM3_imm2
}
 

Functions

static bfd_boolean operand_has_inserter (const aarch64_operand *operand)
 
static bfd_boolean operand_has_extractor (const aarch64_operand *operand)
 
static bfd_boolean operand_need_sign_extension (const aarch64_operand *operand)
 
static bfd_boolean operand_need_shift_by_two (const aarch64_operand *operand)
 
static bfd_boolean operand_maybe_stack_pointer (const aarch64_operand *operand)
 
static unsigned int get_operand_specific_data (const aarch64_operand *operand)
 
static unsigned get_operand_field_width (const aarch64_operand *operand, unsigned n)
 
static unsigned get_operand_fields_width (const aarch64_operand *operand)
 
static const aarch64_operandget_operand_from_code (enum aarch64_opnd code)
 
int aarch64_match_operands_constraint (aarch64_inst *, aarch64_operand_error *)
 
const char * aarch64_get_qualifier_name (aarch64_opnd_qualifier_t)
 
unsigned char aarch64_get_qualifier_nelem (aarch64_opnd_qualifier_t)
 
aarch64_insn aarch64_get_qualifier_standard_value (aarch64_opnd_qualifier_t)
 
int aarch64_find_best_match (const aarch64_inst *, const aarch64_opnd_qualifier_seq_t *, int, aarch64_opnd_qualifier_t *)
 
static void reset_operand_qualifier (aarch64_inst *inst, int idx)
 
static aarch64_insn gen_mask (int width)
 
static int gen_sub_field (enum aarch64_field_kind kind, int lsb_rel, int width, aarch64_field *ret)
 
static void insert_field_2 (const aarch64_field *field, aarch64_insn *code, aarch64_insn value, aarch64_insn mask)
 
static aarch64_insn extract_field_2 (const aarch64_field *field, aarch64_insn code, aarch64_insn mask)
 
static void insert_field (enum aarch64_field_kind kind, aarch64_insn *code, aarch64_insn value, aarch64_insn mask)
 
static aarch64_insn extract_field (enum aarch64_field_kind kind, aarch64_insn code, aarch64_insn mask)
 
aarch64_insn extract_fields (aarch64_insn code, aarch64_insn mask,...)
 
static int select_operand_for_sf_field_coding (const aarch64_opcode *opcode)
 
static int select_operand_for_fptype_field_coding (const aarch64_opcode *opcode)
 
static int select_operand_for_scalar_size_field_coding (const aarch64_opcode *opcode)
 
int aarch64_select_operand_for_sizeq_field_coding (const aarch64_opcode *)
 
aarch64_insn aarch64_get_operand_modifier_value (enum aarch64_modifier_kind)
 
enum aarch64_modifier_kind aarch64_get_operand_modifier_from_value (aarch64_insn, bfd_boolean)
 
bfd_boolean aarch64_wide_constant_p (int64_t, int, unsigned int *)
 
bfd_boolean aarch64_logical_immediate_p (uint64_t, int, aarch64_insn *)
 
int aarch64_shrink_expanded_imm8 (uint64_t)
 
static void copy_operand_info (aarch64_inst *inst, int dst, int src)
 
static unsigned int get_logsz (unsigned int size)
 

Variables

const aarch64_field fields []
 
const aarch64_operand aarch64_operands []
 

Macro Definition Documentation

◆ F_ARCHEXT

#define F_ARCHEXT   (1 << 1) /* Architecture dependent system register. */

Definition at line 207 of file aarch64-opc.h.

◆ F_DEPRECATED

#define F_DEPRECATED   (1 << 0) /* Deprecated system register. */

Definition at line 204 of file aarch64-opc.h.

◆ F_HASXT

#define F_HASXT
Value:
(1 << 2) /* System instruction register <Xt>
operand. */

Definition at line 210 of file aarch64-opc.h.

◆ F_REG_READ

#define F_REG_READ
Value:
(1 << 3) /* Register can only be used to read values
out of. */

Definition at line 213 of file aarch64-opc.h.

◆ F_REG_WRITE

#define F_REG_WRITE
Value:
(1 << 4) /* Register can only be written to but not
read from. */

Definition at line 216 of file aarch64-opc.h.

◆ OPD_F_HAS_EXTRACTOR

#define OPD_F_HAS_EXTRACTOR   0x00000002

Definition at line 193 of file aarch64-opc.h.

◆ OPD_F_HAS_INSERTER

#define OPD_F_HAS_INSERTER   0x00000001

Definition at line 192 of file aarch64-opc.h.

◆ OPD_F_MAYBE_SP

#define OPD_F_MAYBE_SP   0x00000010 /* May potentially be SP. */

Definition at line 196 of file aarch64-opc.h.

◆ OPD_F_NO_ZR

#define OPD_F_NO_ZR   0x00000100 /* ZR index not allowed. */

Definition at line 199 of file aarch64-opc.h.

◆ OPD_F_OD_LSB

#define OPD_F_OD_LSB   5

Definition at line 198 of file aarch64-opc.h.

◆ OPD_F_OD_MASK

#define OPD_F_OD_MASK   0x000000e0 /* Operand-dependent data. */

Definition at line 197 of file aarch64-opc.h.

◆ OPD_F_SHIFT_BY_2

#define OPD_F_SHIFT_BY_2
Value:
0x00000008 /* Need to left shift the field
value by 2 to get the value
of an immediate operand. */

Definition at line 195 of file aarch64-opc.h.

◆ OPD_F_SIGN_EXT_T

#define OPD_F_SIGN_EXT_T   0x00000004 /* Require sign-extension. */

Definition at line 194 of file aarch64-opc.h.

Typedef Documentation

◆ aarch64_field

typedef struct aarch64_field aarch64_field

Definition at line 1 of file aarch64-opc.h.

◆ aarch64_operand

Definition at line 164 of file aarch64-opc.h.

Enumeration Type Documentation

◆ aarch64_field_kind

Enumerator
FLD_NIL 
FLD_cond2 
FLD_nzcv 
FLD_defgh 
FLD_abc 
FLD_imm19 
FLD_immhi 
FLD_immlo 
FLD_size 
FLD_vldst_size 
FLD_op 
FLD_Q 
FLD_Rt 
FLD_Rd 
FLD_Rn 
FLD_Rt2 
FLD_Ra 
FLD_op2 
FLD_CRm 
FLD_CRn 
FLD_op1 
FLD_op0 
FLD_imm3 
FLD_cond 
FLD_opcode 
FLD_cmode 
FLD_asisdlso_opcode 
FLD_len 
FLD_Rm 
FLD_Rs 
FLD_option 
FLD_S 
FLD_hw 
FLD_opc 
FLD_opc1 
FLD_shift 
FLD_type 
FLD_ldst_size 
FLD_imm6 
FLD_imm6_2 
FLD_imm4 
FLD_imm4_2 
FLD_imm5 
FLD_imm7 
FLD_imm8 
FLD_imm9 
FLD_imm12 
FLD_imm14 
FLD_imm16 
FLD_imm26 
FLD_imms 
FLD_immr 
FLD_immb 
FLD_immh 
FLD_S_imm10 
FLD_N 
FLD_index 
FLD_index2 
FLD_sf 
FLD_lse_sz 
FLD_H 
FLD_L 
FLD_M 
FLD_b5 
FLD_b40 
FLD_scale 
FLD_SVE_M_4 
FLD_SVE_M_14 
FLD_SVE_M_16 
FLD_SVE_N 
FLD_SVE_Pd 
FLD_SVE_Pg3 
FLD_SVE_Pg4_5 
FLD_SVE_Pg4_10 
FLD_SVE_Pg4_16 
FLD_SVE_Pm 
FLD_SVE_Pn 
FLD_SVE_Pt 
FLD_SVE_Rm 
FLD_SVE_Rn 
FLD_SVE_Vd 
FLD_SVE_Vm 
FLD_SVE_Vn 
FLD_SVE_Za_5 
FLD_SVE_Za_16 
FLD_SVE_Zd 
FLD_SVE_Zm_5 
FLD_SVE_Zm_16 
FLD_SVE_Zn 
FLD_SVE_Zt 
FLD_SVE_i1 
FLD_SVE_i3h 
FLD_SVE_imm3 
FLD_SVE_imm4 
FLD_SVE_imm5 
FLD_SVE_imm5b 
FLD_SVE_imm6 
FLD_SVE_imm7 
FLD_SVE_imm8 
FLD_SVE_imm9 
FLD_SVE_immr 
FLD_SVE_imms 
FLD_SVE_msz 
FLD_SVE_pattern 
FLD_SVE_prfop 
FLD_SVE_rot1 
FLD_SVE_rot2 
FLD_SVE_sz 
FLD_SVE_tsz 
FLD_SVE_tszh 
FLD_SVE_tszl_8 
FLD_SVE_tszl_19 
FLD_SVE_xs_14 
FLD_SVE_xs_22 
FLD_rotate1 
FLD_rotate2 
FLD_rotate3 
FLD_SM3_imm2 

Definition at line 33 of file aarch64-opc.h.

34 {
35  FLD_NIL,
36  FLD_cond2,
37  FLD_nzcv,
38  FLD_defgh,
39  FLD_abc,
40  FLD_imm19,
41  FLD_immhi,
42  FLD_immlo,
43  FLD_size,
45  FLD_op,
46  FLD_Q,
47  FLD_Rt,
48  FLD_Rd,
49  FLD_Rn,
50  FLD_Rt2,
51  FLD_Ra,
52  FLD_op2,
53  FLD_CRm,
54  FLD_CRn,
55  FLD_op1,
56  FLD_op0,
57  FLD_imm3,
58  FLD_cond,
59  FLD_opcode,
60  FLD_cmode,
62  FLD_len,
63  FLD_Rm,
64  FLD_Rs,
65  FLD_option,
66  FLD_S,
67  FLD_hw,
68  FLD_opc,
69  FLD_opc1,
70  FLD_shift,
71  FLD_type,
73  FLD_imm6,
74  FLD_imm6_2,
75  FLD_imm4,
76  FLD_imm4_2,
77  FLD_imm5,
78  FLD_imm7,
79  FLD_imm8,
80  FLD_imm9,
81  FLD_imm12,
82  FLD_imm14,
83  FLD_imm16,
84  FLD_imm26,
85  FLD_imms,
86  FLD_immr,
87  FLD_immb,
88  FLD_immh,
90  FLD_N,
91  FLD_index,
92  FLD_index2,
93  FLD_sf,
94  FLD_lse_sz,
95  FLD_H,
96  FLD_L,
97  FLD_M,
98  FLD_b5,
99  FLD_b40,
100  FLD_scale,
101  FLD_SVE_M_4,
102  FLD_SVE_M_14,
103  FLD_SVE_M_16,
104  FLD_SVE_N,
105  FLD_SVE_Pd,
106  FLD_SVE_Pg3,
110  FLD_SVE_Pm,
111  FLD_SVE_Pn,
112  FLD_SVE_Pt,
113  FLD_SVE_Rm,
114  FLD_SVE_Rn,
115  FLD_SVE_Vd,
116  FLD_SVE_Vm,
117  FLD_SVE_Vn,
118  FLD_SVE_Za_5,
120  FLD_SVE_Zd,
121  FLD_SVE_Zm_5,
123  FLD_SVE_Zn,
124  FLD_SVE_Zt,
125  FLD_SVE_i1,
126  FLD_SVE_i3h,
127  FLD_SVE_imm3,
128  FLD_SVE_imm4,
129  FLD_SVE_imm5,
131  FLD_SVE_imm6,
132  FLD_SVE_imm7,
133  FLD_SVE_imm8,
134  FLD_SVE_imm9,
135  FLD_SVE_immr,
136  FLD_SVE_imms,
137  FLD_SVE_msz,
140  FLD_SVE_rot1,
141  FLD_SVE_rot2,
142  FLD_SVE_sz,
143  FLD_SVE_tsz,
144  FLD_SVE_tszh,
149  FLD_rotate1,
150  FLD_rotate2,
151  FLD_rotate3,
153 };
@ FLD_option
Definition: aarch64-opc.h:65
@ FLD_imm14
Definition: aarch64-opc.h:82
@ FLD_imm26
Definition: aarch64-opc.h:84
@ FLD_ldst_size
Definition: aarch64-opc.h:72
@ FLD_size
Definition: aarch64-opc.h:43
@ FLD_SVE_M_4
Definition: aarch64-opc.h:101
@ FLD_Rd
Definition: aarch64-opc.h:48
@ FLD_SVE_Rn
Definition: aarch64-opc.h:114
@ FLD_SVE_i3h
Definition: aarch64-opc.h:126
@ FLD_M
Definition: aarch64-opc.h:97
@ FLD_SVE_imm5b
Definition: aarch64-opc.h:130
@ FLD_immr
Definition: aarch64-opc.h:86
@ FLD_immlo
Definition: aarch64-opc.h:42
@ FLD_SVE_prfop
Definition: aarch64-opc.h:139
@ FLD_SVE_M_16
Definition: aarch64-opc.h:103
@ FLD_cond
Definition: aarch64-opc.h:58
@ FLD_SVE_Zt
Definition: aarch64-opc.h:124
@ FLD_imm8
Definition: aarch64-opc.h:79
@ FLD_Rn
Definition: aarch64-opc.h:49
@ FLD_hw
Definition: aarch64-opc.h:67
@ FLD_imms
Definition: aarch64-opc.h:85
@ FLD_SVE_Vd
Definition: aarch64-opc.h:115
@ FLD_NIL
Definition: aarch64-opc.h:35
@ FLD_index
Definition: aarch64-opc.h:91
@ FLD_imm6
Definition: aarch64-opc.h:73
@ FLD_index2
Definition: aarch64-opc.h:92
@ FLD_Rt2
Definition: aarch64-opc.h:50
@ FLD_imm3
Definition: aarch64-opc.h:57
@ FLD_type
Definition: aarch64-opc.h:71
@ FLD_SVE_imm3
Definition: aarch64-opc.h:127
@ FLD_N
Definition: aarch64-opc.h:90
@ FLD_S_imm10
Definition: aarch64-opc.h:89
@ FLD_SVE_Vm
Definition: aarch64-opc.h:116
@ FLD_imm4
Definition: aarch64-opc.h:75
@ FLD_scale
Definition: aarch64-opc.h:100
@ FLD_SVE_Rm
Definition: aarch64-opc.h:113
@ FLD_SVE_Zm_5
Definition: aarch64-opc.h:121
@ FLD_lse_sz
Definition: aarch64-opc.h:94
@ FLD_opc
Definition: aarch64-opc.h:68
@ FLD_SVE_imm9
Definition: aarch64-opc.h:134
@ FLD_Rt
Definition: aarch64-opc.h:47
@ FLD_cmode
Definition: aarch64-opc.h:60
@ FLD_imm4_2
Definition: aarch64-opc.h:76
@ FLD_Ra
Definition: aarch64-opc.h:51
@ FLD_b5
Definition: aarch64-opc.h:98
@ FLD_op0
Definition: aarch64-opc.h:56
@ FLD_SVE_Pg3
Definition: aarch64-opc.h:106
@ FLD_CRm
Definition: aarch64-opc.h:53
@ FLD_opc1
Definition: aarch64-opc.h:69
@ FLD_imm9
Definition: aarch64-opc.h:80
@ FLD_immh
Definition: aarch64-opc.h:88
@ FLD_nzcv
Definition: aarch64-opc.h:37
@ FLD_SVE_Zn
Definition: aarch64-opc.h:123
@ FLD_vldst_size
Definition: aarch64-opc.h:44
@ FLD_imm5
Definition: aarch64-opc.h:77
@ FLD_rotate3
Definition: aarch64-opc.h:151
@ FLD_SVE_Za_5
Definition: aarch64-opc.h:118
@ FLD_immb
Definition: aarch64-opc.h:87
@ FLD_SVE_Pg4_5
Definition: aarch64-opc.h:107
@ FLD_SVE_msz
Definition: aarch64-opc.h:137
@ FLD_SVE_rot1
Definition: aarch64-opc.h:140
@ FLD_b40
Definition: aarch64-opc.h:99
@ FLD_abc
Definition: aarch64-opc.h:39
@ FLD_imm6_2
Definition: aarch64-opc.h:74
@ FLD_op1
Definition: aarch64-opc.h:55
@ FLD_SVE_N
Definition: aarch64-opc.h:104
@ FLD_shift
Definition: aarch64-opc.h:70
@ FLD_defgh
Definition: aarch64-opc.h:38
@ FLD_imm7
Definition: aarch64-opc.h:78
@ FLD_SVE_tszl_19
Definition: aarch64-opc.h:146
@ FLD_SVE_Za_16
Definition: aarch64-opc.h:119
@ FLD_len
Definition: aarch64-opc.h:62
@ FLD_SVE_Pm
Definition: aarch64-opc.h:110
@ FLD_SVE_Zm_16
Definition: aarch64-opc.h:122
@ FLD_SVE_Pg4_16
Definition: aarch64-opc.h:109
@ FLD_SVE_tszl_8
Definition: aarch64-opc.h:145
@ FLD_imm19
Definition: aarch64-opc.h:40
@ FLD_SVE_tszh
Definition: aarch64-opc.h:144
@ FLD_SVE_Pg4_10
Definition: aarch64-opc.h:108
@ FLD_SVE_pattern
Definition: aarch64-opc.h:138
@ FLD_SVE_xs_14
Definition: aarch64-opc.h:147
@ FLD_SVE_sz
Definition: aarch64-opc.h:142
@ FLD_imm12
Definition: aarch64-opc.h:81
@ FLD_immhi
Definition: aarch64-opc.h:41
@ FLD_imm16
Definition: aarch64-opc.h:83
@ FLD_L
Definition: aarch64-opc.h:96
@ FLD_rotate2
Definition: aarch64-opc.h:150
@ FLD_SVE_immr
Definition: aarch64-opc.h:135
@ FLD_asisdlso_opcode
Definition: aarch64-opc.h:61
@ FLD_SVE_imm5
Definition: aarch64-opc.h:129
@ FLD_SVE_rot2
Definition: aarch64-opc.h:141
@ FLD_op
Definition: aarch64-opc.h:45
@ FLD_SVE_M_14
Definition: aarch64-opc.h:102
@ FLD_SVE_i1
Definition: aarch64-opc.h:125
@ FLD_sf
Definition: aarch64-opc.h:93
@ FLD_op2
Definition: aarch64-opc.h:52
@ FLD_SVE_imm7
Definition: aarch64-opc.h:132
@ FLD_opcode
Definition: aarch64-opc.h:59
@ FLD_CRn
Definition: aarch64-opc.h:54
@ FLD_Q
Definition: aarch64-opc.h:46
@ FLD_SVE_xs_22
Definition: aarch64-opc.h:148
@ FLD_cond2
Definition: aarch64-opc.h:36
@ FLD_SVE_Pd
Definition: aarch64-opc.h:105
@ FLD_Rm
Definition: aarch64-opc.h:63
@ FLD_H
Definition: aarch64-opc.h:95
@ FLD_SVE_imm6
Definition: aarch64-opc.h:131
@ FLD_SVE_imms
Definition: aarch64-opc.h:136
@ FLD_SM3_imm2
Definition: aarch64-opc.h:152
@ FLD_SVE_Pt
Definition: aarch64-opc.h:112
@ FLD_Rs
Definition: aarch64-opc.h:64
@ FLD_S
Definition: aarch64-opc.h:66
@ FLD_SVE_tsz
Definition: aarch64-opc.h:143
@ FLD_SVE_imm4
Definition: aarch64-opc.h:128
@ FLD_SVE_Zd
Definition: aarch64-opc.h:120
@ FLD_SVE_imm8
Definition: aarch64-opc.h:133
@ FLD_SVE_Pn
Definition: aarch64-opc.h:111
@ FLD_rotate1
Definition: aarch64-opc.h:149
@ FLD_SVE_Vn
Definition: aarch64-opc.h:117

Function Documentation

◆ aarch64_find_best_match()

int aarch64_find_best_match ( const aarch64_inst inst,
const aarch64_opnd_qualifier_seq_t qualifiers_list,
int  stop_at,
aarch64_opnd_qualifier_t ret 
)

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

879 {
880  int found = 0;
881  int i, num_opnds;
882  const aarch64_opnd_qualifier_t *qualifiers;
883 
884  num_opnds = aarch64_num_of_operands (inst->opcode);
885  if (num_opnds == 0)
886  {
887  DEBUG_TRACE ("SUCCEED: no operand");
888  return 1;
889  }
890 
891  if (stop_at < 0 || stop_at >= num_opnds)
892  stop_at = num_opnds - 1;
893 
894  /* For each pattern. */
895  for (i = 0; i < AARCH64_MAX_QLF_SEQ_NUM; ++i, ++qualifiers_list)
896  {
897  int j;
898  qualifiers = *qualifiers_list;
899 
900  /* Start as positive. */
901  found = 1;
902 
903  DEBUG_TRACE ("%d", i);
904 #ifdef DEBUG_AARCH64
905  if (debug_dump)
906  dump_match_qualifiers (inst->operands, qualifiers);
907 #endif
908 
909  /* Most opcodes has much fewer patterns in the list.
910  First NIL qualifier indicates the end in the list. */
911  if (empty_qualifier_sequence_p (qualifiers) == TRUE)
912  {
913  DEBUG_TRACE_IF (i == 0, "SUCCEED: empty qualifier list");
914  if (i)
915  found = 0;
916  break;
917  }
918 
919  for (j = 0; j < num_opnds && j <= stop_at; ++j, ++qualifiers)
920  {
921  if (inst->operands[j].qualifier == AARCH64_OPND_QLF_NIL)
922  {
923  /* Either the operand does not have qualifier, or the qualifier
924  for the operand needs to be deduced from the qualifier
925  sequence.
926  In the latter case, any constraint checking related with
927  the obtained qualifier should be done later in
928  operand_general_constraint_met_p. */
929  continue;
930  }
931  else if (*qualifiers != inst->operands[j].qualifier)
932  {
933  /* Unless the target qualifier can also qualify the operand
934  (which has already had a non-nil qualifier), non-equal
935  qualifiers are generally un-matched. */
936  if (operand_also_qualified_p (inst->operands + j, *qualifiers))
937  continue;
938  else
939  {
940  found = 0;
941  break;
942  }
943  }
944  else
945  continue; /* Equal qualifiers are certainly matched. */
946  }
947 
948  /* Qualifiers established. */
949  if (found == 1)
950  break;
951  }
952 
953  if (found == 1)
954  {
955  /* Fill the result in *RET. */
956  int j;
957  qualifiers = *qualifiers_list;
958 
959  DEBUG_TRACE ("complete qualifiers using list %d", i);
960 #ifdef DEBUG_AARCH64
961  if (debug_dump)
962  dump_qualifier_sequence (qualifiers);
963 #endif
964 
965  for (j = 0; j <= stop_at; ++j, ++qualifiers)
966  ret[j] = *qualifiers;
967  for (; j < AARCH64_MAX_OPND_NUM; ++j)
968  ret[j] = AARCH64_OPND_QLF_NIL;
969 
970  DEBUG_TRACE ("SUCCESS");
971  return 1;
972  }
973 
974  DEBUG_TRACE ("FAIL");
975  return 0;
976 }
static int operand_also_qualified_p(const struct aarch64_opnd_info *operand, aarch64_opnd_qualifier_t target)
Definition: aarch64-opc.c:585
int aarch64_num_of_operands(const aarch64_opcode *opcode)
Definition: aarch64-opc.c:842
#define DEBUG_TRACE(M,...)
Definition: aarch64.h:1198
#define DEBUG_TRACE_IF(C, M,...)
Definition: aarch64.h:1199
unsigned char aarch64_opnd_qualifier_t
Definition: aarch64.h:652
@ AARCH64_OPND_QLF_NIL
Definition: aarch64.h:380
#define AARCH64_MAX_QLF_SEQ_NUM
Definition: aarch64.h:650
static bfd_boolean empty_qualifier_sequence_p(const aarch64_opnd_qualifier_t *qualifiers)
Definition: aarch64.h:659
#define AARCH64_MAX_OPND_NUM
Definition: aarch64.h:648
lzma_index ** i
Definition: index.h:629
RZ_API const KEY_TYPE bool * found
Definition: ht_inc.h:130
#define TRUE
Definition: mybfd.h:103
aarch64_opnd_info operands[AARCH64_MAX_OPND_NUM]
Definition: aarch64.h:1035
const aarch64_opcode * opcode
Definition: aarch64.h:1029
aarch64_opnd_qualifier_t qualifier
Definition: aarch64.h:921

References AARCH64_MAX_OPND_NUM, AARCH64_MAX_QLF_SEQ_NUM, aarch64_num_of_operands(), AARCH64_OPND_QLF_NIL, DEBUG_TRACE, DEBUG_TRACE_IF, empty_qualifier_sequence_p(), found, i, aarch64_inst::opcode, operand_also_qualified_p(), aarch64_inst::operands, aarch64_opnd_info::qualifier, and TRUE.

Referenced by get_expected_qualifier(), and match_operands_qualifier().

◆ aarch64_get_operand_modifier_from_value()

enum aarch64_modifier_kind aarch64_get_operand_modifier_from_value ( aarch64_insn  value,
bfd_boolean  extend_p 
)

Definition at line 414 of file aarch64-opc.c.

422 {
423  if (extend_p == TRUE)
424  return AARCH64_MOD_UXTB + value;
425  else
426  return AARCH64_MOD_LSL - value;
427 }
@ AARCH64_MOD_LSL
Definition: aarch64.h:883
@ AARCH64_MOD_UXTB
Definition: aarch64.h:884
static int value
Definition: cmd_api.c:93

References aarch64_operand_modifiers, and aarch64_name_value_pair::value.

Referenced by aarch64_ext_addr_regoff(), aarch64_ext_reg_extended(), and aarch64_ext_reg_shifted().

◆ aarch64_get_operand_modifier_value()

aarch64_insn aarch64_get_operand_modifier_value ( enum  aarch64_modifier_kind)

Definition at line 414 of file aarch64-opc.c.

415 {
416  return aarch64_operand_modifiers[kind].value;
417 }
const struct aarch64_name_value_pair aarch64_operand_modifiers[]
Definition: aarch64-opc.c:386
aarch64_insn value
Definition: aarch64.h:834

◆ aarch64_get_qualifier_name()

const char* aarch64_get_qualifier_name ( aarch64_opnd_qualifier_t  qualifier)

Definition at line 758 of file aarch64-opc.c.

759 {
760  return aarch64_opnd_qualifiers[qualifier].desc;
761 }
struct operand_qualifier_data aarch64_opnd_qualifiers[]
Definition: aarch64-opc.c:686

References aarch64_opnd_qualifiers, and operand_qualifier_data::desc.

Referenced by aarch64_print_operand(), decode_sizeq(), match_operands_qualifier(), and print_register_list().

◆ aarch64_get_qualifier_nelem()

unsigned char aarch64_get_qualifier_nelem ( aarch64_opnd_qualifier_t  qualifier)

Definition at line 773 of file aarch64-opc.c.

774 {
775  assert (operand_variant_qualifier_p (qualifier) == TRUE);
776  return aarch64_opnd_qualifiers[qualifier].data1;
777 }
static bfd_boolean operand_variant_qualifier_p(aarch64_opnd_qualifier_t qualifier)
Definition: aarch64-opc.c:744
assert(limit<=UINT32_MAX/2)

References aarch64_opnd_qualifiers, assert(), operand_qualifier_data::data1, operand_variant_qualifier_p(), and TRUE.

Referenced by aarch64_ext_simd_addr_post(), and operand_general_constraint_met_p().

◆ aarch64_get_qualifier_standard_value()

aarch64_insn aarch64_get_qualifier_standard_value ( aarch64_opnd_qualifier_t  qualifier)

◆ aarch64_logical_immediate_p()

bfd_boolean aarch64_logical_immediate_p ( uint64_t  value,
int  esize,
aarch64_insn encoding 
)

Definition at line 1207 of file aarch64-opc.c.

1208 {
1209  simd_imm_encoding imm_enc;
1210  const simd_imm_encoding *imm_encoding;
1211  static bfd_boolean initialized = FALSE;
1212  uint64_t upper;
1213  int i;
1214 
1215  DEBUG_TRACE ("enter with 0x%" PRIx64 "(%" PRIi64 "), esize: %d", value,
1216  value, esize);
1217 
1218  if (!initialized)
1219  {
1221  initialized = TRUE;
1222  }
1223 
1224  /* Allow all zeros or all ones in top bits, so that
1225  constant expressions like ~1 are permitted. */
1226  upper = (uint64_t) -1 << (esize * 4) << (esize * 4);
1227  if ((value & ~upper) != value && (value | upper) != value)
1228  return FALSE;
1229 
1230  /* Replicate to a full 64-bit value. */
1231  value &= ~upper;
1232  for (i = esize * 8; i < 64; i *= 2)
1233  value |= (value << i);
1234 
1235  imm_enc.imm = value;
1236  imm_encoding = (const simd_imm_encoding *)
1237  bsearch(&imm_enc, simd_immediates, TOTAL_IMM_NB,
1239  if (imm_encoding == NULL)
1240  {
1241  DEBUG_TRACE ("exit with FALSE");
1242  return FALSE;
1243  }
1244  if (encoding != NULL)
1245  *encoding = imm_encoding->encoding;
1246  DEBUG_TRACE ("exit with TRUE");
1247  return TRUE;
1248 }
static simd_imm_encoding simd_immediates[TOTAL_IMM_NB]
Definition: aarch64-opc.c:1103
static void build_immediate_table(void)
Definition: aarch64-opc.c:1133
static int simd_imm_encoding_cmp(const void *i1, const void *i2)
Definition: aarch64-opc.c:1106
#define TOTAL_IMM_NB
Definition: aarch64-opc.c:1095
#define NULL
Definition: cris-opc.c:27
int bfd_boolean
Definition: mybfd.h:98
#define FALSE
Definition: mybfd.h:102
unsigned long uint64_t
Definition: sftypes.h:28
aarch64_insn encoding
Definition: aarch64-opc.c:1100
#define PRIx64
Definition: sysdefs.h:94
static int initialized
Definition: tricore-dis.c:96

References build_immediate_table(), DEBUG_TRACE, simd_imm_encoding::encoding, cmd_descs_generate::encoding, FALSE, i, simd_imm_encoding::imm, initialized, NULL, PRIx64, simd_imm_encoding_cmp(), simd_immediates, TOTAL_IMM_NB, TRUE, and value.

Referenced by operand_general_constraint_met_p().

◆ aarch64_match_operands_constraint()

int aarch64_match_operands_constraint ( aarch64_inst inst,
aarch64_operand_error mismatch_detail 
)

Definition at line 2632 of file aarch64-opc.c.

2634 {
2635  int i;
2636 
2637  DEBUG_TRACE ("enter");
2638 
2639  /* Check for cases where a source register needs to be the same as the
2640  destination register. Do this before matching qualifiers since if
2641  an instruction has both invalid tying and invalid qualifiers,
2642  the error about qualifiers would suggest several alternative
2643  instructions that also have invalid tying. */
2644  i = inst->opcode->tied_operand;
2645  if (i > 0 && (inst->operands[0].reg.regno != inst->operands[i].reg.regno))
2646  {
2647  if (mismatch_detail)
2648  {
2649  mismatch_detail->kind = AARCH64_OPDE_UNTIED_OPERAND;
2650  mismatch_detail->index = i;
2651  mismatch_detail->error = NULL;
2652  }
2653  return 0;
2654  }
2655 
2656  /* Match operands' qualifier.
2657  *INST has already had qualifier establish for some, if not all, of
2658  its operands; we need to find out whether these established
2659  qualifiers match one of the qualifier sequence in
2660  INST->OPCODE->QUALIFIERS_LIST. If yes, we will assign each operand
2661  with the corresponding qualifier in such a sequence.
2662  Only basic operand constraint checking is done here; the more thorough
2663  constraint checking will carried out by operand_general_constraint_met_p,
2664  which has be to called after this in order to get all of the operands'
2665  qualifiers established. */
2666  if (match_operands_qualifier (inst, TRUE /* update_p */) == 0)
2667  {
2668  DEBUG_TRACE ("FAIL on operand qualifier matching");
2669  if (mismatch_detail)
2670  {
2671  /* Return an error type to indicate that it is the qualifier
2672  matching failure; we don't care about which operand as there
2673  are enough information in the opcode table to reproduce it. */
2674  mismatch_detail->kind = AARCH64_OPDE_INVALID_VARIANT;
2675  mismatch_detail->index = -1;
2676  mismatch_detail->error = NULL;
2677  }
2678  return 0;
2679  }
2680 
2681  /* Match operands' constraint. */
2682  for (i = 0; i < AARCH64_MAX_OPND_NUM; ++i)
2683  {
2684  enum aarch64_opnd type = inst->opcode->operands[i];
2685  if (type == AARCH64_OPND_NIL)
2686  break;
2687  if (inst->operands[i].skip)
2688  {
2689  DEBUG_TRACE ("skip the incomplete operand %d", i);
2690  continue;
2691  }
2693  inst->opcode, mismatch_detail) == 0)
2694  {
2695  DEBUG_TRACE ("FAIL on operand %d", i);
2696  return 0;
2697  }
2698  }
2699 
2700  DEBUG_TRACE ("PASS");
2701 
2702  return 1;
2703 }
static int match_operands_qualifier(aarch64_inst *inst, bfd_boolean update_p)
Definition: aarch64-opc.c:987
static int operand_general_constraint_met_p(const aarch64_opnd_info *opnds, int idx, enum aarch64_opnd type, const aarch64_opcode *opcode, aarch64_operand_error *mismatch_detail)
Definition: aarch64-opc.c:1415
@ AARCH64_OPDE_INVALID_VARIANT
Definition: aarch64.h:1098
@ AARCH64_OPDE_UNTIED_OPERAND
Definition: aarch64.h:1099
aarch64_opnd
Definition: aarch64.h:145
@ AARCH64_OPND_NIL
Definition: aarch64.h:146
int type
Definition: mipsasm.c:17
unsigned char tied_operand
Definition: aarch64.h:710
enum aarch64_opnd operands[AARCH64_MAX_OPND_NUM]
Definition: aarch64.h:697
enum aarch64_operand_error_kind kind
Definition: aarch64.h:1109
const char * error
Definition: aarch64.h:1111
struct aarch64_opnd_info::@35::@38 reg
unsigned skip
Definition: aarch64.h:999

References AARCH64_MAX_OPND_NUM, AARCH64_OPDE_INVALID_VARIANT, AARCH64_OPDE_UNTIED_OPERAND, AARCH64_OPND_NIL, DEBUG_TRACE, aarch64_operand_error::error, i, aarch64_operand_error::index, aarch64_operand_error::kind, match_operands_qualifier(), NULL, aarch64_inst::opcode, operand_general_constraint_met_p(), aarch64_opcode::operands, aarch64_inst::operands, aarch64_opnd_info::reg, aarch64_opnd_info::skip, aarch64_opcode::tied_operand, TRUE, and type.

Referenced by aarch64_opcode_decode(), and determine_disassembling_preference().

◆ aarch64_select_operand_for_sizeq_field_coding()

int aarch64_select_operand_for_sizeq_field_coding ( const aarch64_opcode opcode)

Definition at line 199 of file aarch64-opc.c.

200 {
201  return
203 }
static const char significant_operand_index[]
Definition: aarch64-opc.c:133
static enum data_pattern get_data_pattern(const aarch64_opnd_qualifier_seq_t qualifiers)
Definition: aarch64-opc.c:148
aarch64_opnd_qualifier_seq_t qualifiers_list[AARCH64_MAX_QLF_SEQ_NUM]
Definition: aarch64.h:703

References get_data_pattern(), aarch64_opcode::qualifiers_list, and significant_operand_index.

Referenced by decode_sizeq().

◆ aarch64_shrink_expanded_imm8()

int aarch64_shrink_expanded_imm8 ( uint64_t  imm)

Definition at line 1255 of file aarch64-opc.c.

1256 {
1257  int i, ret;
1258  uint32_t byte;
1259 
1260  ret = 0;
1261  for (i = 0; i < 8; i++)
1262  {
1263  byte = (imm >> (8 * i)) & 0xff;
1264  if (byte == 0xff)
1265  ret |= 1 << i;
1266  else if (byte != 0x00)
1267  return -1;
1268  }
1269  return ret;
1270 }
#define imm
unsigned int uint32_t
Definition: sftypes.h:29

References i, and imm.

Referenced by operand_general_constraint_met_p().

◆ aarch64_wide_constant_p()

bfd_boolean aarch64_wide_constant_p ( int64_t  value,
int  is32,
unsigned int shift_amount 
)

Definition at line 1033 of file aarch64-opc.c.

1034 {
1035  int amount;
1036 
1037  DEBUG_TRACE ("enter with 0x%" PRIx64 "(%" PRIi64 ")", value, value);
1038 
1039  if (is32)
1040  {
1041  /* Allow all zeros or all ones in top 32-bits, so that
1042  32-bit constant expressions like ~0x80000000 are
1043  permitted. */
1044  uint64_t ext = value;
1045  if (ext >> 32 != 0 && ext >> 32 != (uint64_t) 0xffffffff)
1046  /* Immediate out of range. */
1047  return FALSE;
1048  value &= (int64_t) 0xffffffff;
1049  }
1050 
1051  /* first, try movz then movn */
1052  amount = -1;
1053  if ((value & ((int64_t) 0xffff << 0)) == value)
1054  amount = 0;
1055  else if ((value & ((int64_t) 0xffff << 16)) == value)
1056  amount = 16;
1057  else if (!is32 && (value & ((int64_t) 0xffff << 32)) == value)
1058  amount = 32;
1059  else if (!is32 && (value & ((int64_t) 0xffff << 48)) == value)
1060  amount = 48;
1061 
1062  if (amount == -1)
1063  {
1064  DEBUG_TRACE ("exit FALSE with 0x%" PRIx64 "(%" PRIi64 ")", value, value);
1065  return FALSE;
1066  }
1067 
1068  if (shift_amount != NULL)
1069  *shift_amount = amount;
1070 
1071  DEBUG_TRACE ("exit TRUE with amount %d", amount);
1072 
1073  return TRUE;
1074 }
static const char ext[]
Definition: apprentice.c:1981
long int64_t
Definition: sftypes.h:32

References DEBUG_TRACE, ext, FALSE, NULL, PRIx64, TRUE, and value.

Referenced by convert_movebitmask_to_mov(), convert_movewide_to_mov(), and operand_general_constraint_met_p().

◆ copy_operand_info()

static void copy_operand_info ( aarch64_inst inst,
int  dst,
int  src 
)
inlinestatic

Definition at line 463 of file aarch64-opc.h.

469 {
470  assert (dst >= 0 && src >= 0 && dst < AARCH64_MAX_OPND_NUM
lzma_index * src
Definition: index.h:567
char * dst
Definition: lz4.h:724

Referenced by convert_bfm_to_bfc(), convert_csinc_to_cset(), convert_extr_to_ror(), convert_from_csel(), and convert_movebitmask_to_mov().

◆ extract_field()

static aarch64_insn extract_field ( enum aarch64_field_kind  kind,
aarch64_insn  code,
aarch64_insn  mask 
)
inlinestatic

◆ extract_field_2()

◆ extract_fields()

aarch64_insn extract_fields ( aarch64_insn  code,
aarch64_insn  mask,
  ... 
)

Definition at line 142 of file aarch64-dis.c.

143 {
144  uint32_t num;
145  const aarch64_field *field;
146  enum aarch64_field_kind kind;
147  va_list va;
148 
149  va_start (va, mask);
150  num = va_arg (va, uint32_t);
151  assert (num <= 5);
152  aarch64_insn value = 0x0;
153  while (num--)
154  {
155  kind = va_arg (va, enum aarch64_field_kind);
156  field = &fields[kind];
157  value <<= field->width;
158  value |= extract_field (kind, code, mask);
159  }
160  va_end (va);
161  return value;
162 }
const aarch64_field fields[]
Definition: aarch64-opc.c:205
aarch64_field_kind
Definition: aarch64-opc.h:34
static aarch64_insn extract_field(enum aarch64_field_kind kind, aarch64_insn code, aarch64_insn mask)
Definition: aarch64-opc.h:368
#define mask()
static static fork const void static count static fd const char const char static newpath char char char static envp time_t static t const char static mode static whence const char static dir time_t static t unsigned static seconds const char struct utimbuf static buf static inc static sig const char static mode static oldfd struct tms static buf static getgid static geteuid const char static filename static arg static mask struct ustat static ubuf static getppid static setsid static egid sigset_t static set struct timeval struct timezone static tz fd_set fd_set fd_set struct timeval static timeout const char char static bufsiz const char static swapflags void static offset const char static length static mode static who const char struct statfs static buf unsigned unsigned num
Definition: sflib.h:126
Definition: inftree9.h:24

References assert(), extract_field(), fields, mask, num, value, and aarch64_field::width.

Referenced by aarch64_decode_variant_using_iclass(), aarch64_ext_addr_offset(), aarch64_ext_addr_simm10(), aarch64_ext_advsimd_imm_modified(), aarch64_ext_advsimd_imm_shift(), aarch64_ext_ft(), aarch64_ext_hint(), aarch64_ext_ldst_elemlist(), aarch64_ext_limm(), aarch64_ext_pstatefield(), aarch64_ext_reglane(), aarch64_ext_sve_addr_ri_s9xvl(), aarch64_ext_sve_index(), aarch64_ext_sysins_op(), aarch64_ext_sysreg(), decode_sizeq(), and do_misc_decoding().

◆ gen_mask()

static aarch64_insn gen_mask ( int  width)
inlinestatic

Definition at line 306 of file aarch64-opc.h.

312 {

Referenced by extract_field_2(), and insert_field_2().

◆ gen_sub_field()

static int gen_sub_field ( enum aarch64_field_kind  kind,
int  lsb_rel,
int  width,
aarch64_field ret 
)
inlinestatic

Definition at line 313 of file aarch64-opc.h.

319 {
320  const aarch64_field *field = &fields[kind];
321  if (lsb_rel < 0 || width <= 0 || lsb_rel + width > field->width)
const aarch64_field fields[]
Definition: aarch64-opc.c:205

Referenced by aarch64_ext_advsimd_imm_modified(), aarch64_ext_ldst_elemlist(), decode_asimd_fcvt(), decode_asisd_fcvtxn(), and do_special_decoding().

◆ get_logsz()

static unsigned int get_logsz ( unsigned int  size)
inlinestatic

Definition at line 475 of file aarch64-opc.h.

481 {
482  const unsigned char ls[16] =
483  {0, 1, -1, 2, -1, -1, -1, 3, -1, -1, -1, -1, -1, -1, -1, 4};
484  if (size > 16)
485  {
486  assert (0);
voidpf void uLong size
Definition: ioapi.h:138

Referenced by aarch64_ext_addr_regoff(), aarch64_ext_addr_uimm12(), aarch64_ext_reglane(), and operand_general_constraint_met_p().

◆ get_operand_field_width()

static unsigned get_operand_field_width ( const aarch64_operand operand,
unsigned  n 
)
inlinestatic

Definition at line 257 of file aarch64-opc.h.

263 {

◆ get_operand_fields_width()

static unsigned get_operand_fields_width ( const aarch64_operand operand)
inlinestatic

Definition at line 265 of file aarch64-opc.h.

271 {
272  int i = 0;
273  unsigned width = 0;
int width
Definition: main.c:10

Referenced by aarch64_ext_imm(), and operand_general_constraint_met_p().

◆ get_operand_from_code()

static const aarch64_operand* get_operand_from_code ( enum aarch64_opnd  code)
inlinestatic

Definition at line 276 of file aarch64-opc.h.

282 {

Referenced by operand_general_constraint_met_p().

◆ get_operand_specific_data()

static unsigned int get_operand_specific_data ( const aarch64_operand operand)
inlinestatic

Definition at line 250 of file aarch64-opc.h.

250  : FALSE;
251 }
252 
253 /* Return the value of the operand-specific data field (OPD_F_OD_MASK). */

Referenced by aarch64_ext_sve_addr_reg_imm(), aarch64_ext_sve_addr_reg_mul_vl(), aarch64_ext_sve_addr_rr_lsl(), aarch64_ext_sve_addr_rz_xtw(), aarch64_ext_sve_quad_index(), and operand_general_constraint_met_p().

◆ insert_field()

static void insert_field ( enum aarch64_field_kind  kind,
aarch64_insn code,
aarch64_insn  value,
aarch64_insn  mask 
)
inlinestatic

Definition at line 358 of file aarch64-opc.h.

365 {

References fields, insert_field_2(), mask, and value.

◆ insert_field_2()

static void insert_field_2 ( const aarch64_field field,
aarch64_insn code,
aarch64_insn  value,
aarch64_insn  mask 
)
inlinestatic

Definition at line 327 of file aarch64-opc.h.

334 {
335  assert (field->width < 32 && field->width >= 1 && field->lsb >= 0
336  && field->lsb + field->width <= 32);
337  value &= gen_mask (field->width);
338  value <<= field->lsb;
static aarch64_insn gen_mask(int width)
Definition: aarch64-opc.h:306

References assert(), gen_mask(), aarch64_field::lsb, mask, value, and aarch64_field::width.

Referenced by insert_field().

◆ operand_has_extractor()

static bfd_boolean operand_has_extractor ( const aarch64_operand operand)
inlinestatic

Definition at line 225 of file aarch64-opc.h.

225 {
226  return (operand->flags & OPD_F_HAS_INSERTER) ? TRUE : FALSE;
227 }
228 
#define OPD_F_HAS_INSERTER
Definition: aarch64-opc.h:192
operand
Definition: arc-opc.c:39

References FALSE, OPD_F_HAS_INSERTER, and TRUE.

Referenced by aarch64_opcode_decode().

◆ operand_has_inserter()

static bfd_boolean operand_has_inserter ( const aarch64_operand operand)
inlinestatic

Definition at line 219 of file aarch64-opc.h.

225 {

◆ operand_maybe_stack_pointer()

static bfd_boolean operand_maybe_stack_pointer ( const aarch64_operand operand)
inlinestatic

Definition at line 243 of file aarch64-opc.h.

243 {
244  return (operand->flags & OPD_F_SHIFT_BY_2) ? TRUE : FALSE;
245 }
246 
#define OPD_F_SHIFT_BY_2
Definition: aarch64-opc.h:195

References FALSE, OPD_F_SHIFT_BY_2, and TRUE.

Referenced by aarch64_stack_pointer_p(), aarch64_zero_register_p(), and operand_also_qualified_p().

◆ operand_need_shift_by_two()

static bfd_boolean operand_need_shift_by_two ( const aarch64_operand operand)
inlinestatic

Definition at line 237 of file aarch64-opc.h.

237 {
238  return (operand->flags & OPD_F_SIGN_EXT_T) ? TRUE : FALSE;
239 }
240 
#define OPD_F_SIGN_EXT_T
Definition: aarch64-opc.h:194

References FALSE, OPD_F_SIGN_EXT_T, and TRUE.

Referenced by aarch64_ext_imm(), and operand_general_constraint_met_p().

◆ operand_need_sign_extension()

static bfd_boolean operand_need_sign_extension ( const aarch64_operand operand)
inlinestatic

Definition at line 231 of file aarch64-opc.h.

231 {
232  return (operand->flags & OPD_F_HAS_EXTRACTOR) ? TRUE : FALSE;
233 }
234 
#define OPD_F_HAS_EXTRACTOR
Definition: aarch64-opc.h:193

References FALSE, OPD_F_HAS_EXTRACTOR, and TRUE.

Referenced by aarch64_ext_imm().

◆ reset_operand_qualifier()

static void reset_operand_qualifier ( aarch64_inst inst,
int  idx 
)
inlinestatic

Definition at line 295 of file aarch64-opc.h.

301 {

Referenced by convert_bfm_to_bfc(), convert_bfm_to_bfi(), and convert_bfm_to_bfx().

◆ select_operand_for_fptype_field_coding()

static int select_operand_for_fptype_field_coding ( const aarch64_opcode opcode)
inlinestatic

Definition at line 405 of file aarch64-opc.h.

411 {
412  int idx;
413  if (aarch64_get_operand_class (opcode->operands[1])
415  /* normal case. */
416  idx = 1;
417  else if (aarch64_get_operand_class (opcode->operands[0])
419  /* e.g. float2fix. */
enum aarch64_operand_class aarch64_get_operand_class(enum aarch64_opnd type)
Definition: aarch64-opc.c:328
@ AARCH64_OPND_CLASS_FP_REG
Definition: aarch64.h:128
int idx
Definition: setup.py:197

References aarch64_get_operand_class(), AARCH64_OPND_CLASS_FP_REG, assert(), setup::idx, and aarch64_opcode::operands.

Referenced by do_special_decoding().

◆ select_operand_for_scalar_size_field_coding()

static int select_operand_for_scalar_size_field_coding ( const aarch64_opcode opcode)
inlinestatic

Definition at line 427 of file aarch64-opc.h.

433 {
434  int src_size = 0, dst_size = 0;
435  if (aarch64_get_operand_class (opcode->operands[0])
437  dst_size = aarch64_get_qualifier_esize (opcode->qualifiers_list[0][0]);
438  if (aarch64_get_operand_class (opcode->operands[1])
440  src_size = aarch64_get_qualifier_esize (opcode->qualifiers_list[0][1]);
441  if (src_size == dst_size && src_size == 0)
442  { assert (0); abort (); }
443  /* When the result is not a sisd register or it is a long operantion. */
unsigned char aarch64_get_qualifier_esize(aarch64_opnd_qualifier_t qualifier)
Definition: aarch64-opc.c:766
@ AARCH64_OPND_CLASS_SISD_REG
Definition: aarch64.h:131

References aarch64_get_operand_class(), aarch64_get_qualifier_esize(), AARCH64_OPND_CLASS_SISD_REG, assert(), aarch64_opcode::operands, and aarch64_opcode::qualifiers_list.

Referenced by do_special_decoding().

◆ select_operand_for_sf_field_coding()

static int select_operand_for_sf_field_coding ( const aarch64_opcode opcode)
inlinestatic

Definition at line 384 of file aarch64-opc.h.

390 {
391  int idx = -1;
392  if (aarch64_get_operand_class (opcode->operands[0])
394  /* normal case. */
395  idx = 0;
396  else if (aarch64_get_operand_class (opcode->operands[1])
398  /* e.g. float2fix. */
@ AARCH64_OPND_CLASS_INT_REG
Definition: aarch64.h:126

References aarch64_get_operand_class(), AARCH64_OPND_CLASS_INT_REG, assert(), setup::idx, and aarch64_opcode::operands.

Referenced by do_special_decoding().

Variable Documentation

◆ aarch64_operands

◆ fields