Skip to content

Commit

Permalink
tricore : fix
Browse files Browse the repository at this point in the history
  • Loading branch information
imbillow committed Jun 2, 2024
1 parent 71479eb commit 958b241
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 7 deletions.
7 changes: 6 additions & 1 deletion librz/arch/isa/tricore/tricore_il_fp.inc
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
// SPDX-FileCopyrightText: 2024 billow <[email protected]>
// SPDX-License-Identifier: LGPL-3.0-only

/// The maximum of IEEE-754-2008 16-bit half precision floating point
static const ut32 HP_MAX_VALUE = 65504;
/// The minimum positive normalized number of IEEE-754-2008 16-bit half precision floating point
static const ut32 HP_MIN_NORMAL = 1024 * 16;

/// This represents all positive numbers that are too big to be represented accurately as a normalized number.
static const ut32 HP_NEG_INFINITY = 0xfc00;
/// This represents all negative numbers with an absolute value that is too big to be represented accurately as a normalized number.
static const ut32 HP_POS_INFINITY = 0x7c00;

#define F2SINT32(x, m) F2SINT(32, m, x)
Expand Down Expand Up @@ -92,7 +95,9 @@ static RzILOpPure *minmax(const char *k, st64 min, st64 max, RzILOpPure *x) {
x)));
}

// The maximum of the Q31 format value
#define Q31_MAX q_real(0x7FFFFFFF)
// The minimum of the Q31 format value
#define Q31_MIN F32(-1.f)

static RzILOpPure *minmax_q31(const char *k, RzILOpPure *x) {
Expand Down
10 changes: 5 additions & 5 deletions librz/arch/p/analysis/analysis_tricore_cs.c
Original file line number Diff line number Diff line change
Expand Up @@ -240,11 +240,11 @@ static char *tricore_reg_profile(RzAnalysis *_) {
"drx FPU_TRAP_SRC1 .32 816 0\n"
"drx FPU_TRAP_SRC2 .32 820 0\n"
"drx FPU_TRAP_SRC3 .32 824 0\n"
"drx set_FI .1 900 0\n"
"drx set_FV .1 901 0\n"
"drx set_FZ .1 902 0\n"
"drx set_FU .1 903 0\n"
"drx set_FX .1 904 0\n";
"drx set_FI .1 900 0\n"
"drx set_FV .1 901 0\n"
"drx set_FZ .1 902 0\n"
"drx set_FU .1 903 0\n"
"drx set_FX .1 904 0\n";
return strdup(p);
}

Expand Down
2 changes: 1 addition & 1 deletion librz/include/rz_il/rz_il_opbuilder_end.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
#undef FMOD
#undef FPOW
#undef FMAD
#undef FNEQ
#undef FEQ
#undef FEQ
#undef FLT
#undef FLE
Expand Down

0 comments on commit 958b241

Please sign in to comment.