4 static char *hack_handle_dp_imm(
ut32 insn) {
7 const ut8 op0 = (insn >> 23) & 0
x7;
11 const bool sf = (insn >> 31) & 0
x1;
12 const bool op = (insn >> 30) & 0
x1;
13 const bool S = (insn >> 29) & 0
x1;
14 const bool o2 = (insn >> 22) & 0
x1;
15 if (sf && !
S && !
o2) {
23 const ut8 uimm6 = ((insn >> 16) & 0x3f) << 4;
24 const ut8 uimm4 = (insn >> 10) & 0xf;
25 const ut8 Xn = (insn >> 5) & 0x1f;
26 const ut8 Xd = (insn >> 0) & 0x1f;
36 static char *hack_handle_br_exc_sys(
ut32 insn) {
39 const ut8 op0 = (insn >> 29) & 0
x7;
40 const ut16 op1 = (insn >> 12) & 0x3fff;
41 ut8 op2 = insn & 0x1f;
44 if (op0 == 6 && op1 == 4146 && op2 == 31) {
45 const ut8 CRm = (insn >> 8) & 0xf;
46 op2 = (insn >> 5) & 0
x7;
47 if (CRm == 4 && (op2 & 1) == 0) {
67 static char *hack_handle_dp_reg(
ut32 insn) {
70 const bool op0 = (insn >> 30) & 0
x1;
71 const bool op1 = (insn >> 28) & 0
x1;
72 const ut8 op2 = (insn >> 21) & 0xf;
75 if (!op0 && op1 && op2 == 6) {
76 const bool sf = (insn >> 31) & 0
x1;
77 const bool S = (insn >> 29) & 0
x1;
78 const ut8 opcode = (insn >> 10) & 0x1f;
83 }
else if (opcode == 0) {
85 }
else if (opcode == 5) {
88 }
else if (
S && opcode == 0) {
93 const ut8 Xm = (insn >> 16) & 0x1f;
94 const ut8 Xn = (insn >> 5) & 0x1f;
95 const ut8 Xd = (insn >> 0) & 0x1f;
96 if (Xm == 31 && !strcmp(
mnemonic,
"irg")) {
99 }
else if (!strcmp(
mnemonic,
"subps") &&
S == 1 && Xd == 0x1f) {
112 static char *hack_handle_ldst(
ut32 insn) {
113 char *buf_asm =
NULL;
115 bool ignore_imm9 =
false;
116 const ut8 op0 = (insn >> 28) & 0xf;
117 const bool op1 = (insn >> 26) & 0
x1;
118 ut8 op2 = (insn >> 23) & 0
x3;
119 const bool op3 = (insn >> 21) & 0
x1;
122 if (op0 == 13 && !op1 && (op2 == 2 || op2 == 3) && op3) {
124 const ut16 imm9 = ((insn >> 12) & 0x1ff) << 4;
125 op2 = (insn >> 10) & 0
x3;
126 const ut8 Xn = (insn >> 5) & 0x1f;
127 const ut8 Xt = (insn >> 0) & 0x1f;
161 }
else if (op2 == 0) {
190 }
else if ((op0 & 0
x3) == 2) {
192 const bool V = (insn >> 26) & 0
x1;
193 const bool L = (insn >> 22) & 0
x1;
195 if (
opc == 1 && !
V && !
L) {
196 const ut8 imm7 = ((insn >> 15) & 0x7f) << 4;
197 const ut8 Xt2 = (insn >> 10) & 0x1f;
198 const ut8 Xn = (insn >> 5) & 0x1f;
199 const ut8 Xt = (insn >> 0) & 0x1f;
202 buf_asm =
rz_str_newf(
"stgp x%d, x%d, [x%d], #0x%x",
206 buf_asm =
rz_str_newf(
"stgp x%d, x%d, [x%d, #0x%x]",
210 buf_asm =
rz_str_newf(
"stgp x%d, x%d, [x%d, #0x%x]!",
224 char *buf_asm =
NULL;
226 if (
a->bits == 64 &&
len >= 4) {
228 int insn_class = (insn >> 25) & 0xf;
229 switch (insn_class) {
234 buf_asm = hack_handle_dp_reg(insn);
240 buf_asm = hack_handle_dp_imm(insn);
246 buf_asm = hack_handle_br_exc_sys(insn);
254 buf_asm = hack_handle_ldst(insn);
RZ_API void Ht_() free(HtName_(Ht) *ht)
static ut32 rz_read_ble32(const void *src, bool big_endian)
RZ_API char * rz_str_newf(const char *fmt,...) RZ_PRINTF_CHECK(1
RZ_API char * rz_str_replace(char *str, const char *key, const char *val, int g)
RZ_API int rz_str_replace_char(char *s, int a, int b)
RZ_API const char * rz_strbuf_set(RzStrBuf *sb, const char *s)
#define V(handle, symbol)