diff options
| author | Jasper St. Pierre <jstpierre@mecheye.net> | 2023-12-30 15:03:23 -0800 |
|---|---|---|
| committer | Jasper St. Pierre <jstpierre@mecheye.net> | 2023-12-30 15:03:23 -0800 |
| commit | 0aa03af22b7f334c07acf69e1109920efd55c1a9 (patch) | |
| tree | e72dfe330e7a7502b889cfe3d3efe37393adcad8 /src | |
| parent | 99e49b708d7db3d5c2cf4c158c363e5055045dbc (diff) | |
JUTException showFloatSub
Diffstat (limited to 'src')
| -rw-r--r-- | src/JSystem/JUtility/JUTException.cpp | 6 | ||||
| -rw-r--r-- | src/PowerPC_EABI_Support/MSL/MSL_C/MSL_Common/Include/float.h | 2 |
2 files changed, 5 insertions, 3 deletions
diff --git a/src/JSystem/JUtility/JUTException.cpp b/src/JSystem/JUtility/JUTException.cpp index 6151c117..dbde7bac 100644 --- a/src/JSystem/JUtility/JUTException.cpp +++ b/src/JSystem/JUtility/JUTException.cpp @@ -222,10 +222,10 @@ void JUTException::setFPException(u32 fpscr_enable_bits) { /* 802C50CC-802C525C .text showFloatSub__12JUTExceptionFif */ void JUTException::showFloatSub(int index, f32 value) { - if (fpclassify(value) == FP_NAN) { + if (isnan(value)) { sConsole->print_f("F%02d: Nan ", index); - } else if (fpclassify(value) == FP_INFINITE) { - if (signbit(value)) { + } else if (isinf(value)) { + if (*((u8*)&value) & 0x80) { sConsole->print_f("F%02d:+Inf ", index); } else { sConsole->print_f("F%02d:-Inf ", index); diff --git a/src/PowerPC_EABI_Support/MSL/MSL_C/MSL_Common/Include/float.h b/src/PowerPC_EABI_Support/MSL/MSL_C/MSL_Common/Include/float.h index 10fab57c..4e957f8f 100644 --- a/src/PowerPC_EABI_Support/MSL/MSL_C/MSL_Common/Include/float.h +++ b/src/PowerPC_EABI_Support/MSL/MSL_C/MSL_Common/Include/float.h @@ -15,6 +15,8 @@ #define fpclassify(x) ((sizeof(x) == sizeof(float)) ? __fpclassifyf(x) : __fpclassifyd(x)) #define signbit(x) ((sizeof(x) == sizeof(float)) ? __signbitf(x) : __signbitd(x)) #define isfinite(x) ((fpclassify(x) > 2)) +#define isnan(x) ((fpclassify(x) == FP_NAN)) +#define isinf(x) ((fpclassify(x) == FP_INFINITE)) #define __signbitf(x) ((int)(__HI(x) & 0x80000000)) |
