Skip to content

Commit

Permalink
Match fdlibm; re-organize flags.json (#276)
Browse files Browse the repository at this point in the history
* MSL_C float.c

* MSL_C bool_def.h

* Re-organize flag lists

* Bring in fdlibm sources
Not fully matching, some modifications need to be made

* Pick off most fdlibm matches

* Finish fdlibm
  • Loading branch information
TheNathannator authored Jul 1, 2024
1 parent 4e24244 commit bfdb9ce
Show file tree
Hide file tree
Showing 44 changed files with 3,866 additions and 309 deletions.
109 changes: 49 additions & 60 deletions config/SZBE69_B8/flags.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,29 +28,6 @@
"-d MILO_DEBUG"
]
},
"runtime": {
"base": "base",
"flags": [
"-str reuse,pool,readonly",
"-pragma \"merge_float_consts on\"",

"-use_lmw_stmw on",
"-common off",

"-lang=c99",
"-O4,p",
"-inline auto",
"-func_align 4"
]
},
"rvl_sdk": {
"base": "base",
"flags": [
"-func_align 16",
"-O4,p",
"-Isrc/sdk/PowerPC_EABI_Support/MSL"
]
},
"main": {
"base": "base",
"flags": [
Expand Down Expand Up @@ -82,15 +59,11 @@
"-ipa file"
]
},
"system": {
"base": "band3",
"flags": []
},
"network": {
"base": "band3",
"flags": []
},
"json_c": {
"network/json_c": {
"base": "base",
"flags": [
"-sdata 2",
Expand All @@ -106,7 +79,7 @@
"-ipa file"
]
},
"quazal": {
"network/Platform": {
"base": "base",
"flags": [
"-sdata 2",
Expand All @@ -120,73 +93,89 @@
"-inline auto"
]
},
"zlib": {
"system": {
"base": "band3",
"flags": []
},
"system/flex": {
"base": "system/zlib",
"flags": []
},
"system/speex": {
"base": "system/zlib",
"flags": [
"-fp_contract on"
]
},
"system/soundtouch": {
"base": "base",
"flags": [
"-sdata 2",
"-sdata2 2",

"-pool on",
"-str reuse,pool",
"-pragma \"merge_float_consts on\"",
"-fp_contract on",

"-lang=c99",
"-O4,p",
"-lang=c++",
"-inline auto"
]
},
"zlib/zutil": {
"system/tomcrypt": {
"base": "system/zlib",
"flags": [
"-inline off"
]
},
"system/vorbis": {
"base": "system/zlib",
"flags": [
"-fp_contract on"
]
},
"system/zlib": {
"base": "base",
"flags": [
"-sdata 2",
"-sdata2 2",

"-pool on",
"-str nopool",
"-str reuse,pool",
"-pragma \"merge_float_consts on\"",

"-lang=c99",
"-O4,p",
"-inline auto"
]
},
"soundtouch": {
"sdk/MSL": {
"base": "base",
"flags": [
"-sdata 2",
"-sdata2 2",
"-str reuse,pool",
"-pragma \"merge_float_consts on\"",
"-fp_contract on",
"-str reuse,pool,readonly",

"-use_lmw_stmw on",
"-common off",

"-lang=c99",
"-O4,p",
"-lang=c++",
"-inline auto"
]
},
"libtomcrypt": {
"base": "zlib",
"flags": [
"-inline off"
"-inline auto",
"-func_align 4"
]
},
"speex": {
"base": "zlib",
"sdk/MSL/fdlibm": {
"base": "sdk/MSL",
"flags": [
"-fp_contract on"
"-d _IEEE_LIBM"
]
},
"flex": {
"base": "zlib",
"flags": []
},
"vorbis": {
"base": "zlib",
"sdk/RVL_SDK": {
"base": "base",
"flags": [
"-fp_contract on"
"-func_align 16",
"-O4,p"
]
},
"bt": {
"sdk/RVL_SDK/bte": {
"base": "base",
"flags": [
"-sdata 2",
Expand Down
67 changes: 49 additions & 18 deletions config/SZBE69_B8/objects.json
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@
},
"network/json_c": {
"mw_version": "Wii/1.3",
"cflags": "json_c",
"cflags": "network/json_c",
"objects": {
"network/net/json-c/arraylist.c": "Matching",
"network/net/json-c/debug.c": "Matching",
Expand All @@ -95,7 +95,7 @@
},
"network/Platform": {
"mw_version": "Wii/1.3",
"cflags": "quazal",
"cflags": "network/Platform",
"objects": {
"network/Platform/CriticalSection.cpp": "Matching",
"network/Platform/DateTime.cpp": "NonMatching",
Expand Down Expand Up @@ -562,14 +562,14 @@
},
"system/flex": {
"mw_version": "Wii/1.3",
"cflags": "flex",
"cflags": "system/flex",
"objects": {
"system/obj/DataFlex.c": "NonMatching"
}
},
"system/speex": {
"mw_version": "Wii/1.3",
"cflags": "speex",
"cflags": "system/speex",
"objects": {
"system/speex/libspeex/bits.c": "NonMatching",
"system/speex/libspeex/cb_search.c": "Matching",
Expand Down Expand Up @@ -598,7 +598,7 @@
},
"system/soundtouch": {
"mw_version": "Wii/1.3",
"cflags": "soundtouch",
"cflags": "system/soundtouch",
"objects": {
"system/synthwii/soundtouch/source/SoundTouch/AAFilter.cpp": "NonMatching",
"system/synthwii/soundtouch/source/SoundTouch/FIFOSampleBuffer.cpp": "NonMatching",
Expand All @@ -610,7 +610,7 @@
},
"system/tomcrypt": {
"mw_version": "Wii/1.3",
"cflags": "libtomcrypt",
"cflags": "system/tomcrypt",
"objects": {
"system/synth/tomcrypt/aes.c": "Matching",
"system/synth/tomcrypt/crypt.c": "Matching",
Expand All @@ -619,7 +619,7 @@
},
"system/vorbis": {
"mw_version": "Wii/1.3",
"cflags": "vorbis",
"cflags": "system/vorbis",
"objects": {
"system/oggvorbis/analysis.c": "NonMatching",
"system/oggvorbis/bitrate.c": "Matching",
Expand All @@ -645,7 +645,7 @@
},
"system/zlib": {
"mw_version": "Wii/1.3",
"cflags": "zlib",
"cflags": "system/zlib",
"objects": {
"system/zlib/adler32.c": "Matching",
"system/zlib/crc32.c": "Matching",
Expand All @@ -654,7 +654,7 @@
"system/zlib/inflate.c": "Matching",
"system/zlib/inftrees.c": "Matching",
"system/zlib/inffast.c": "Matching",
"system/zlib/zutil.c": { "status": "Matching", "cflags": "zlib/zutil" }
"system/zlib/zutil.c": { "status": "Matching", "extra_cflags": ["-str nopool"] }
}
},
"lib/binkwii": {
Expand All @@ -666,50 +666,81 @@
},
"sdk/MSL_C": {
"mw_version": "Wii/1.3",
"cflags": "runtime",
"cflags": "sdk/MSL",
"objects": {
"sdk/PowerPC_EABI_Support/MSL/MSL_C/MSL_Common/alloc.c": "NonMatching",
"sdk/PowerPC_EABI_Support/MSL/MSL_C/MSL_Common/arith.c": "Matching",
"sdk/PowerPC_EABI_Support/MSL/MSL_C/MSL_Common/buffer_io.c": "NonMatching",
"sdk/PowerPC_EABI_Support/MSL/MSL_C/MSL_Common/errno.c": "Matching",
"sdk/PowerPC_EABI_Support/MSL/MSL_C/MSL_Common/float.c": "Matching",
"sdk/PowerPC_EABI_Support/MSL/MSL_C/MSL_Common/rand.c": "Matching",

"sdk/PowerPC_EABI_Support/MSL/MSL_C/PPC_EABI/time.dolphin.c": "Matching",
"sdk/PowerPC_EABI_Support/MSL/MSL_C/PPC_EABI/math_ppc.c": "Matching"
}
},
"sdk/MSL_C/fdlibm": {
"mw_version": "Wii/1.3",
"cflags": "sdk/MSL/fdlibm",
"objects": {
"sdk/PowerPC_EABI_Support/MSL/MSL_C/MSL_Common_Embedded/Math/Double_precision/e_acos.c": "Matching",
"sdk/PowerPC_EABI_Support/MSL/MSL_C/MSL_Common_Embedded/Math/Double_precision/e_asin.c": "Matching",
"sdk/PowerPC_EABI_Support/MSL/MSL_C/MSL_Common_Embedded/Math/Double_precision/e_atan2.c": "Matching",
"sdk/PowerPC_EABI_Support/MSL/MSL_C/MSL_Common_Embedded/Math/Double_precision/e_exp.c": "Matching",
"sdk/PowerPC_EABI_Support/MSL/MSL_C/MSL_Common_Embedded/Math/Double_precision/e_fmod.c": "Matching",
"sdk/PowerPC_EABI_Support/MSL/MSL_C/MSL_Common_Embedded/Math/Double_precision/e_log.c": "Matching",
"sdk/PowerPC_EABI_Support/MSL/MSL_C/MSL_Common_Embedded/Math/Double_precision/e_log10.c": "Matching",
"sdk/PowerPC_EABI_Support/MSL/MSL_C/MSL_Common_Embedded/Math/Double_precision/e_pow.c": "Matching",
"sdk/PowerPC_EABI_Support/MSL/MSL_C/MSL_Common_Embedded/Math/Double_precision/e_rem_pio2.c": "Matching",
"sdk/PowerPC_EABI_Support/MSL/MSL_C/MSL_Common_Embedded/Math/Double_precision/k_cos.c": "Matching",
"sdk/PowerPC_EABI_Support/MSL/MSL_C/MSL_Common_Embedded/Math/Double_precision/k_rem_pio2.c": "Matching",
"sdk/PowerPC_EABI_Support/MSL/MSL_C/MSL_Common_Embedded/Math/Double_precision/k_sin.c": "Matching",
"sdk/PowerPC_EABI_Support/MSL/MSL_C/MSL_Common_Embedded/Math/Double_precision/k_tan.c": "Matching",
"sdk/PowerPC_EABI_Support/MSL/MSL_C/MSL_Common_Embedded/Math/Double_precision/s_atan.c": "Matching",
"sdk/PowerPC_EABI_Support/MSL/MSL_C/MSL_Common_Embedded/Math/Double_precision/s_ceil.c": "Matching",
"sdk/PowerPC_EABI_Support/MSL/MSL_C/MSL_Common_Embedded/Math/Double_precision/s_copysign.c": "Matching",
"sdk/PowerPC_EABI_Support/MSL/MSL_C/MSL_Common_Embedded/Math/Double_precision/s_cos.c": "Matching",
"sdk/PowerPC_EABI_Support/MSL/MSL_C/MSL_Common_Embedded/Math/Double_precision/s_floor.c": "Matching",
"sdk/PowerPC_EABI_Support/MSL/MSL_C/MSL_Common_Embedded/Math/Double_precision/s_frexp.c": "Matching",
"sdk/PowerPC_EABI_Support/MSL/MSL_C/MSL_Common_Embedded/Math/Double_precision/s_ldexp.c": "Matching",
"sdk/PowerPC_EABI_Support/MSL/MSL_C/MSL_Common_Embedded/Math/Double_precision/s_modf.c": "Matching",
"sdk/PowerPC_EABI_Support/MSL/MSL_C/MSL_Common_Embedded/Math/Double_precision/s_rint.c": "Matching",
"sdk/PowerPC_EABI_Support/MSL/MSL_C/MSL_Common_Embedded/Math/Double_precision/s_sin.c": "Matching",
"sdk/PowerPC_EABI_Support/MSL/MSL_C/MSL_Common_Embedded/Math/Double_precision/s_tan.c": "Matching",
"sdk/PowerPC_EABI_Support/MSL/MSL_C/MSL_Common_Embedded/Math/Double_precision/w_acos.c": "Matching",
"sdk/PowerPC_EABI_Support/MSL/MSL_C/MSL_Common_Embedded/Math/Double_precision/w_asin.c": "Matching",
"sdk/PowerPC_EABI_Support/MSL/MSL_C/MSL_Common_Embedded/Math/Double_precision/w_atan2.c": "Matching",
"sdk/PowerPC_EABI_Support/MSL/MSL_C/MSL_Common_Embedded/Math/Double_precision/w_exp.c": "Matching",
"sdk/PowerPC_EABI_Support/MSL/MSL_C/MSL_Common_Embedded/Math/Double_precision/w_fmod.c": "Matching",
"sdk/PowerPC_EABI_Support/MSL/MSL_C/MSL_Common_Embedded/Math/Double_precision/w_log.c": "Matching",
"sdk/PowerPC_EABI_Support/MSL/MSL_C/MSL_Common_Embedded/Math/Double_precision/w_log10.c": "Matching",
"sdk/PowerPC_EABI_Support/MSL/MSL_C/MSL_Common_Embedded/Math/Double_precision/w_pow.c": "Matching",

"sdk/PowerPC_EABI_Support/MSL/MSL_C/PPC_EABI/time.dolphin.c": "Matching",
"sdk/PowerPC_EABI_Support/MSL/MSL_C/PPC_EABI/math_ppc.c": "Matching"
"sdk/PowerPC_EABI_Support/MSL/MSL_C/MSL_Common_Embedded/Math/Double_precision/w_pow.c": "Matching"
}
},
"sdk/MSL_C++": {
"mw_version": "Wii/1.3",
"cflags": "runtime",
"cflags": "sdk/MSL",
"objects": {

}
},
"sdk/Runtime": {
"mw_version": "Wii/1.3",
"cflags": "runtime",
"cflags": "sdk/MSL",
"objects": {
"sdk/PowerPC_EABI_Support/Runtime/Gecko_setjmp.cpp": "Matching"
}
},
"sdk/MetroTRK": {
"mw_version": "Wii/1.3",
"cflags": "runtime",
"cflags": "sdk/MSL",
"objects": {

}
},
"sdk/RVL_SDK": {
"mw_version": "Wii/1.3",
"cflags": "rvl_sdk",
"cflags": "sdk/RVL_SDK",
"objects": {
"sdk/RVL_SDK/revolution/gx/GXBump.c": "NonMatching",
"sdk/RVL_SDK/revolution/gx/GXDisplayList.c": "Matching",
Expand Down
13 changes: 13 additions & 0 deletions src/sdk/PowerPC_EABI_Support/MSL/MSL_C/MSL_Common/bool_def.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#ifndef _MSL_BOOL_DEF_H_
#define _MSL_BOOL_DEF_H_

#ifndef __cplusplus

typedef unsigned char bool;

#define false 0
#define true 1

#endif

#endif
7 changes: 7 additions & 0 deletions src/sdk/PowerPC_EABI_Support/MSL/MSL_C/MSL_Common/float.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
// Seems they forgot the include, these are stored in .sdata here
// but elsewhere they're are read as if they're in .data
// #include "MSL_Common/float.h"

int __float_nan = 0x7FFFFFFF;
float __float_huge = 0x1.0P128F;
double __double_huge = 0x1.0P1024;
20 changes: 20 additions & 0 deletions src/sdk/PowerPC_EABI_Support/MSL/MSL_C/MSL_Common/float.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#ifndef MSL_COMMON_FLOAT_H
#define MSL_COMMON_FLOAT_H

#ifdef __cplusplus
extern "C" {
#endif

__declspec(section ".data") extern int __float_nan;
__declspec(section ".data") extern float __float_huge;
__declspec(section ".data") extern double __double_huge;

#define INFINITY (__float_huge)
#define NAN (*(float *)&__float_nan)
#define HUGE_VAL (__double_huge)

#ifdef __cplusplus
}
#endif

#endif
Loading

0 comments on commit bfdb9ce

Please sign in to comment.