Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

xtensa RzIL #4712

Draft
wants to merge 102 commits into
base: dev
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
102 commits
Select commit Hold shift + click to select a range
89ab8ee
xtensa: add rzil support
imbillow Sep 28, 2024
9bd2042
revert
imbillow Nov 11, 2024
5024b87
all4|all8
imbillow Nov 12, 2024
79401aa
and|andb|andbc
imbillow Nov 12, 2024
ba3115c
any4|any8
imbillow Nov 12, 2024
b4dbfdf
fix
imbillow Nov 12, 2024
3b8a6a3
ball
imbillow Nov 12, 2024
4eb9f5f
ball|bany
imbillow Nov 12, 2024
48f466a
bbc|bbs|bbci|bbsi
imbillow Nov 12, 2024
cfb59fe
beq|bne
imbillow Nov 12, 2024
c8744ff
beqi|bnei
imbillow Nov 12, 2024
524a782
beqz|bnez
imbillow Nov 12, 2024
af3eb2d
bf|bt
imbillow Nov 12, 2024
208bccd
bge|blt|bgei|blti|bgeu|bltu
imbillow Nov 12, 2024
ee789fd
bgeui|bltui|bgez|bltz
imbillow Nov 12, 2024
fe68326
bnall|bnone
imbillow Nov 12, 2024
5951df8
break|break.n
imbillow Nov 12, 2024
8d8a580
call0|call4|call8|call12
imbillow Nov 12, 2024
1b75fa4
callx0|callx4|callx8|callx12
imbillow Nov 12, 2024
7686a37
callx0|callx4|callx8|callx12
imbillow Nov 12, 2024
8c50b6b
clamps
imbillow Nov 18, 2024
ff7312d
const_s
imbillow Nov 18, 2024
a20e976
div0.s divn.s
imbillow Nov 18, 2024
5d308ee
dsync
imbillow Nov 18, 2024
e8414c5
entry|esync
imbillow Nov 21, 2024
0b3f74d
excw
imbillow Nov 21, 2024
c8a3606
extui
imbillow Nov 21, 2024
38a5807
extw
imbillow Nov 21, 2024
6804c62
float.s
imbillow Nov 21, 2024
9dc7342
floor.s
imbillow Nov 21, 2024
0b6e853
isync
imbillow Nov 21, 2024
1561fa8
j|jx
imbillow Nov 21, 2024
ef804de
l8ui
imbillow Nov 21, 2024
5c4f2ab
l16si|l16ui
imbillow Nov 21, 2024
02e4158
l32(e|i|i.n|r)
imbillow Nov 21, 2024
61ab8fc
ld(inc|dec)
imbillow Nov 22, 2024
f94d1ec
loop
imbillow Nov 22, 2024
5c1d01d
loop(gez|nez)
imbillow Nov 22, 2024
cbcf100
ls(i|ip|x|xp)
imbillow Nov 22, 2024
b694d44
madd.s|maddn.s
imbillow Nov 22, 2024
76a99d6
max|maxu
imbillow Nov 22, 2024
69fbbf0
min|minu|memw
imbillow Nov 22, 2024
08ddd37
todo: mksadj.ss|mkdadj.s
imbillow Nov 22, 2024
bd44ace
moveqz|moveqz.s
imbillow Nov 22, 2024
9c4cbb7
movf|movf.s
imbillow Nov 23, 2024
b9ae1d7
movgez|movegez.s
imbillow Nov 23, 2024
15bf172
movi|movi.n
imbillow Nov 23, 2024
7853e74
movltz|movltz.s
imbillow Nov 23, 2024
fb5be8c
movnez|movnez.s
imbillow Nov 23, 2024
6120896
movsp|movt|movt.s
imbillow Nov 23, 2024
89c7e23
msub.s
imbillow Nov 23, 2024
e691e79
mul.aa.*
imbillow Nov 23, 2024
4567dc1
Update capstone and fix arch arm for build
imbillow Nov 23, 2024
2b879e8
mul.ad.*
imbillow Nov 23, 2024
13a8369
mul.dd.*
imbillow Nov 23, 2024
e947f49
mul.s|mul16u|mul16s
imbillow Nov 23, 2024
56988b7
mula.aa.*
imbillow Nov 23, 2024
52cc386
mula.(ad|da|dd).*
imbillow Nov 23, 2024
fd11a8f
mula.da.*.(lddec|ldinc)
imbillow Nov 23, 2024
87747a7
mula.dd.*.(lddec|ldinc)
imbillow Nov 23, 2024
f97186e
mull
imbillow Nov 23, 2024
648bbe7
muls.*.*
imbillow Nov 24, 2024
b2a4e90
mulsh
imbillow Nov 24, 2024
c100a73
muluh
imbillow Nov 24, 2024
4f00b9f
neg|neg.s
imbillow Nov 24, 2024
42071fe
nexp01.s|nop
imbillow Nov 24, 2024
a237617
nsa
imbillow Nov 24, 2024
6cd01d3
nsau
imbillow Nov 24, 2024
320a529
oeq.s|ole.s|olt.s
imbillow Nov 25, 2024
2158f4f
or*
imbillow Nov 25, 2024
65a60db
quo*
imbillow Nov 25, 2024
7e2e937
rem*
imbillow Nov 25, 2024
918e87d
rer
imbillow Nov 25, 2024
9f51f7a
ret*
imbillow Nov 25, 2024
e2406ca
rf*
imbillow Nov 25, 2024
0989088
rotw|round.s|rsil|rsqrt0.s|rsr|rsync
imbillow Nov 25, 2024
bb5c755
test for rotw|round.s|rsil|rsqrt0.s|rsync
imbillow Nov 25, 2024
ccb83c7
fix rsr test and rm `fsr_tbl` because the fsr register is already dec…
imbillow Nov 25, 2024
007ea3e
rur.*
imbillow Nov 27, 2024
7684a7a
st*
imbillow Nov 27, 2024
dbf0bb4
sext
imbillow Nov 27, 2024
50ff495
simcall (256)
imbillow Nov 27, 2024
641a689
sll*
imbillow Nov 27, 2024
aab7687
sqrt0.s TODO
imbillow Nov 27, 2024
77dd72a
sra*
imbillow Nov 27, 2024
569f401
src
imbillow Nov 27, 2024
1eb9552
srl*
imbillow Nov 27, 2024
1180630
ssa*
imbillow Nov 27, 2024
723a533
ssi*
imbillow Nov 27, 2024
871fd5a
ss*
imbillow Nov 27, 2024
e48efff
fix esil xtensa
imbillow Nov 28, 2024
fe0c98b
try rot127's patch
imbillow Nov 28, 2024
ecca705
fix ae* register name
imbillow Nov 28, 2024
cdf389d
sub*
imbillow Nov 28, 2024
7f9b237
syscall
imbillow Nov 28, 2024
2baf4db
(trunc|ueq|ufloat|ule|ult).s
imbillow Nov 28, 2024
8343e23
un.s|utrunc.s|umul.aa.*
imbillow Nov 28, 2024
2d0b79e
w*
imbillow Nov 28, 2024
862fe9d
witlb|wsr
imbillow Nov 28, 2024
f0581c5
wur*
imbillow Nov 28, 2024
0ba350c
xor*|xsr
imbillow Nov 28, 2024
7dbc5e2
alias?
imbillow Nov 28, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions librz/arch/isa/arm/arm_il32.c
Original file line number Diff line number Diff line change
Expand Up @@ -3623,12 +3623,12 @@ RZ_IPI bool rz_arm_cs_is_float_insn(const cs_insn *insn) {
switch (group_it) {
default:
break;
case ARM_FEATURE_HasNEON:
case ARM_FEATURE_HasVFP2:
case ARM_FEATURE_HasVFP3:
case ARM_FEATURE_HasVFP4:
case ARM_FEATURE_HasDPVFP:
case ARM_FEATURE_HasMVEFloat:
case ARM_FEATURE_HASNEON:
case ARM_FEATURE_HASVFP2:
case ARM_FEATURE_HASVFP3:
case ARM_FEATURE_HASVFP4:
case ARM_FEATURE_HASDPVFP:
case ARM_FEATURE_HASMVEFLOAT:
return true;
}
group_it = insn->detail->groups[++i];
Expand All @@ -3653,7 +3653,7 @@ static RzILOpEffect *try_as_int_cvt(cs_insn *insn, bool is_thumb, bool *success)
ut32 fl_sz = rz_float_get_format_info(is_f2i ? from_fmt : to_fmt, RZ_FLOAT_INFO_TOTAL_LEN);

#if CS_NEXT_VERSION >= 6
if (!rz_arm_cs_is_group_member(insn, ARM_FEATURE_HasNEON)) {
if (!rz_arm_cs_is_group_member(insn, ARM_FEATURE_HASNEON)) {
#else
if (!rz_arm_cs_is_group_member(insn, ARM_GRP_NEON)) {
#endif
Expand Down Expand Up @@ -3890,7 +3890,7 @@ static RzILOpEffect *vadd(cs_insn *insn, bool is_thumb) {
bool is_float_vec = fmt == RZ_FLOAT_UNK ? false : true;

#if CS_NEXT_VERSION >= 6
if (!rz_arm_cs_is_group_member(insn, ARM_FEATURE_HasNEON)) {
if (!rz_arm_cs_is_group_member(insn, ARM_FEATURE_HASNEON)) {
#else
if (!rz_arm_cs_is_group_member(insn, ARM_GRP_NEON)) {
#endif
Expand Down Expand Up @@ -3941,7 +3941,7 @@ static RzILOpEffect *vsub(cs_insn *insn, bool is_thumb) {
bool is_float_vec = fmt == RZ_FLOAT_UNK ? false : true;

#if CS_NEXT_VERSION >= 6
if (!rz_arm_cs_is_group_member(insn, ARM_FEATURE_HasNEON)) {
if (!rz_arm_cs_is_group_member(insn, ARM_FEATURE_HASNEON)) {
#else
if (!rz_arm_cs_is_group_member(insn, ARM_GRP_NEON)) {
#endif
Expand Down Expand Up @@ -3990,7 +3990,7 @@ static RzILOpEffect *vmul(cs_insn *insn, bool is_thumb) {
RzFloatFormat fmt = dt2fmt(dt);

#if CS_NEXT_VERSION >= 6
if (!rz_arm_cs_is_group_member(insn, ARM_FEATURE_HasNEON)) {
if (!rz_arm_cs_is_group_member(insn, ARM_FEATURE_HASNEON)) {
#else
if (!rz_arm_cs_is_group_member(insn, ARM_GRP_NEON)) {
#endif
Expand Down
16 changes: 9 additions & 7 deletions librz/arch/isa/xtensa/xtensa.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ bool xtensa_open(XtensaContext *ctx, const char *cpu, bool big_endian);
bool xtensa_disassemble(XtensaContext *self, const ut8 *buf, int len, ut64 addr);
void xtensa_disassemble_fini(XtensaContext *self);
void xtensa_analyze_op_esil(XtensaContext *ctx, RzAnalysisOp *op);
void xtensa_analyze_op_rzil(XtensaContext *ctx, RzAnalysisOp *op);

static inline cs_xtensa_op_mem *xtensa_op_mem(cs_insn *insn, unsigned int index) {
cs_xtensa_op *op = &insn->detail->xtensa.operands[index];
Expand All @@ -56,12 +57,13 @@ static inline int32_t xtensa_op_l32r(cs_insn *insn, unsigned int index) {
return op->imm;
}

#define XOP(I) (ctx->insn->detail->xtensa.operands + I)
#define MEM(I) xtensa_op_mem(ctx->insn, I)
#define REGI(I) xtensa_op_reg(ctx->insn, I)
#define REGN(I) cs_reg_name(ctx->handle, (xtensa_op_reg(ctx->insn, I)))
#define IMM(I) xtensa_op_imm(ctx->insn, I)
#define L32R(I) xtensa_op_l32r(ctx->insn, I)
#define INSN_SIZE (ctx->insn->size)
#define XOP(I) (ctx->insn->detail->xtensa.operands + I)
#define MEM(I) xtensa_op_mem(ctx->insn, I)
#define REGI(I) xtensa_op_reg(ctx->insn, I)
#define REGNAME(I) cs_reg_name(ctx->handle, (I))
#define REGN(I) REGNAME(REGI((I)))
#define IMM(I) xtensa_op_imm(ctx->insn, I)
#define L32R(I) xtensa_op_l32r(ctx->insn, I)
#define INSN_SIZE (ctx->insn->size)

#endif // RZ_XTENSA_H
Loading
Loading