JUTException showFloatSub

This commit is contained in:
Jasper St. Pierre
2023-12-30 15:03:23 -08:00
parent 99e49b708d
commit 0aa03af22b
3 changed files with 6 additions and 4 deletions
+3 -3
View File
@@ -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))
+1 -1
View File
@@ -50,7 +50,7 @@ def import_c_file(in_file) -> str:
out_text = ''
try:
with open(in_file, encoding="shift-jis") as file:
with open(in_file, encoding="utf8") as file:
out_text += process_file(in_file, list(file))
except Exception:
with open(in_file) as file: