Skip to content

Commit

Permalink
callx0|callx4|callx8|callx12
Browse files Browse the repository at this point in the history
  • Loading branch information
imbillow committed Nov 12, 2024
1 parent d0ee139 commit 04e3832
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
6 changes: 6 additions & 0 deletions librz/arch/isa/xtensa/xtensa_il.c
Original file line number Diff line number Diff line change
Expand Up @@ -378,6 +378,11 @@ static RzAnalysisLiftedILOp op_callx12(XtensaContext *ctx) {
JMP(VARL("next")));
}

// Fixme: statusflags: VI
static RzAnalysisLiftedILOp op_ceil_s(XtensaContext *ctx) {
return SETG(REGN(0), F2INT(32, RZ_FLOAT_RMODE_RNA, FLOATV32(IREG(1))));
}

#include <rz_il/rz_il_opbuilder_end.h>

static const fn_analyze_op_il fn_tbl[] = {
Expand Down Expand Up @@ -437,6 +442,7 @@ static const fn_analyze_op_il fn_tbl[] = {
[XTENSA_INS_CALLX4] = op_callx4,
[XTENSA_INS_CALLX8] = op_callx8,
[XTENSA_INS_CALLX12] = op_callx12,
[XTENSA_INS_CEIL_S] = op_ceil_s,
};

void xtensa_analyze_op_rzil(XtensaContext *ctx, RzAnalysisOp *op) {
Expand Down
1 change: 1 addition & 0 deletions test/db/asm/xtensa
Original file line number Diff line number Diff line change
Expand Up @@ -64,3 +64,4 @@ d "callx12 a1" f00100 0x40000 (seq (set next (var a1)) (set a12 (bv 32 0x6004000
d "callx8 a1" e00100 0x40000 (seq (set next (var a1)) (set a8 (bv 32 0x40040003)) (jmp (var next)))
d "callx4 a1" d00100 0x40000 (seq (set next (var a1)) (set a4 (bv 32 0x20040003)) (jmp (var next)))
d "callx0 a1" c00100 0x40000 (seq (set next (var a1)) (set a0 (bv 32 0x40003)) (jmp (var next)))
d "ceil.s a1, f2, 0xf" f012ba 0x0 (set a1 (fcast_int 32 rna (float 0 (var f2) )))

0 comments on commit 04e3832

Please sign in to comment.