Skip to content

Commit

Permalink
tricore : add fp emulateme test
Browse files Browse the repository at this point in the history
  • Loading branch information
imbillow committed Jun 2, 2024
1 parent 73fe859 commit 71479eb
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 1 deletion.
2 changes: 1 addition & 1 deletion librz/arch/isa/tricore/tricore_il_fp.inc
Original file line number Diff line number Diff line change
Expand Up @@ -497,7 +497,7 @@ static RzAnalysisLiftedILOp div_f(RzAsmTriCoreContext *ctx) {
SETL("_fb", _32F64(VARG(R(2)))),
SETL("_arg_a", denorm_to_zere64(VARL("_fa"))),
SETL("_arg_b", denorm_to_zere64(VARL("_fb"))),
SETL("_precise_result", FDIV(0, _32F64(VARL("_arg_a")), _32F64(VARL("_arg_b")))),
SETL("_precise_result", FDIV(0, VARL("_arg_a"), VARL("_arg_b"))),
SETL("_normal_result", denorm_to_zere64(VARL("_precise_result"))),
SETL("_rounded_result", FCAST32(FCONVERT, RZ_FLOAT_IEEE754_BIN_32, VARL("_normal_result"), PSW_RM())),
SETL("_result",
Expand Down
30 changes: 30 additions & 0 deletions test/db/rzil/tricore
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,33 @@ FCX = 0x1
Hello from RzIL!
EOF
RUN

NAME=Testing the decryption in emulateme
FILE=bins/tricore/emulateme-fp.tricore.elf
TIMEOUT=30
CMDS=<<EOF
e io.cache=1
aezi
aezsu 0x80000450 # add.f
ar d2
aezsu 0x80000460 # sub.f
ar d2
aezsu 0x80000470 # mul.f
ar d2
aezsu 0x80000480 # div.f
ar d2
aezsu 0x80000498 # madd.f
ar d2
aezsu 0x800004b0 # msub.f
ar d2
EOF
EXPECT=<<EOF
d2 = 0x47157f3b
d2 = 0x47157f3b
d2 = 0x47157f3b
d2 = 0x47157f3b
d2 = 0x47e03ed8
d2 = 0x489d1884
EOF
RUN

0 comments on commit 71479eb

Please sign in to comment.