mirror of
https://github.com/zeldaret/tww.git
synced 2026-08-14 12:24:16 -04:00
JUTException showFloatSub
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user