From 745729cdc27cf18e18f365676683937ebaabac63 Mon Sep 17 00:00:00 2001 From: Ryan Houdek Date: Mon, 18 Sep 2023 17:15:15 -0700 Subject: [PATCH] SoftFloat-3e: Adds preserve_all attribute to all functions used This will let FEX's JIT be more optimal --- FEXCore/Source/CMakeLists.txt | 9 ++++++++ .../Source/Common/SoftFloat-3e/extF80_add.c | 1 + .../Source/Common/SoftFloat-3e/extF80_div.c | 1 + .../Source/Common/SoftFloat-3e/extF80_eq.c | 1 + .../Source/Common/SoftFloat-3e/extF80_lt.c | 1 + .../Source/Common/SoftFloat-3e/extF80_mul.c | 1 + .../Source/Common/SoftFloat-3e/extF80_rem.c | 1 + .../Common/SoftFloat-3e/extF80_roundToInt.c | 1 + .../Source/Common/SoftFloat-3e/extF80_sqrt.c | 1 + .../Source/Common/SoftFloat-3e/extF80_sub.c | 1 + .../Common/SoftFloat-3e/extF80_to_f128.c | 1 + .../Common/SoftFloat-3e/extF80_to_f32.c | 1 + .../Common/SoftFloat-3e/extF80_to_f64.c | 1 + .../Common/SoftFloat-3e/extF80_to_i32.c | 1 + .../Common/SoftFloat-3e/extF80_to_i64.c | 1 + .../Common/SoftFloat-3e/extF80_to_ui64.c | 1 + .../Common/SoftFloat-3e/f128_to_extF80.c | 1 + .../Common/SoftFloat-3e/f32_to_extF80.c | 1 + .../Common/SoftFloat-3e/f64_to_extF80.c | 1 + .../Common/SoftFloat-3e/i32_to_extF80.c | 1 + .../Source/Common/SoftFloat-3e/internals.h | 10 +++++++++ .../Source/Common/SoftFloat-3e/primitives.h | 16 ++++++++++++++ FEXCore/Source/Common/SoftFloat-3e/s_add128.c | 1 + .../Common/SoftFloat-3e/s_approxRecip32_1.c | 1 + .../SoftFloat-3e/s_approxRecipSqrt32_1.c | 1 + .../SoftFloat-3e/s_commonNaNToExtF80UI.c | 1 + .../Common/SoftFloat-3e/s_commonNaNToF128UI.c | 1 + .../Common/SoftFloat-3e/s_commonNaNToF32UI.c | 1 + .../Common/SoftFloat-3e/s_commonNaNToF64UI.c | 1 + .../SoftFloat-3e/s_countLeadingZeros32.c | 1 + .../SoftFloat-3e/s_countLeadingZeros64.c | 1 + .../SoftFloat-3e/s_extF80UIToCommonNaN.c | 1 + .../Common/SoftFloat-3e/s_f128UIToCommonNaN.c | 1 + .../Common/SoftFloat-3e/s_f32UIToCommonNaN.c | 1 + .../Common/SoftFloat-3e/s_f64UIToCommonNaN.c | 1 + FEXCore/Source/Common/SoftFloat-3e/s_le128.c | 1 + FEXCore/Source/Common/SoftFloat-3e/s_lt128.c | 1 + .../SoftFloat-3e/s_mul64ByShifted32To128.c | 1 + .../Source/Common/SoftFloat-3e/s_mul64To128.c | 1 + .../SoftFloat-3e/s_normRoundPackToExtF80.c | 1 + .../SoftFloat-3e/s_normSubnormalExtF80Sig.c | 1 + .../SoftFloat-3e/s_normSubnormalF128Sig.c | 1 + .../SoftFloat-3e/s_normSubnormalF32Sig.c | 1 + .../SoftFloat-3e/s_normSubnormalF64Sig.c | 1 + .../SoftFloat-3e/s_propagateNaNExtF80UI.c | 1 + .../Common/SoftFloat-3e/s_roundPackToExtF80.c | 1 + .../Common/SoftFloat-3e/s_roundPackToF32.c | 1 + .../Common/SoftFloat-3e/s_roundPackToF64.c | 1 + .../Source/Common/SoftFloat-3e/s_roundToI32.c | 1 + .../Source/Common/SoftFloat-3e/s_roundToI64.c | 1 + .../Common/SoftFloat-3e/s_shiftRightJam32.c | 1 + .../Common/SoftFloat-3e/s_shiftRightJam64.c | 1 + .../SoftFloat-3e/s_shiftRightJam64Extra.c | 1 + .../Common/SoftFloat-3e/s_shortShiftLeft128.c | 1 + .../SoftFloat-3e/s_shortShiftRight128.c | 1 + .../SoftFloat-3e/s_shortShiftRightJam64.c | 1 + FEXCore/Source/Common/SoftFloat-3e/s_sub128.c | 1 + .../Source/Common/SoftFloat-3e/softfloat.h | 21 +++++++++++++++++++ .../SoftFloat-3e/softfloat_raiseFlags.c | 1 + .../Source/Common/SoftFloat-3e/specialize.h | 9 ++++++++ .../Common/SoftFloat-3e/ui64_to_extF80.c | 1 + 61 files changed, 121 insertions(+) diff --git a/FEXCore/Source/CMakeLists.txt b/FEXCore/Source/CMakeLists.txt index 3e2e4b232..1d915a207 100644 --- a/FEXCore/Source/CMakeLists.txt +++ b/FEXCore/Source/CMakeLists.txt @@ -231,6 +231,15 @@ if (ENABLE_JIT_ARM64) ) endif() +if (_M_ARM_64 AND HAS_CLANG_PRESERVE_ALL) + list(APPEND DEFINES "-DFEXCORE_PRESERVE_ALL_ATTR=__attribute__((preserve_all));-DFEXCORE_HAS_PRESERVE_ALL_ATTR=1") +else() + list(APPEND DEFINES "-DFEXCORE_PRESERVE_ALL_ATTR=;-DFEXCORE_HAS_PRESERVE_ALL_ATTR=0") +endif() + +# Some defines for the softfloat library +list(APPEND DEFINES "-DSOFTFLOAT_BUILTIN_CLZ") + set (LIBS fmt::fmt vixl xxhash FEXHeaderUtils) if (NOT MINGW_BUILD) diff --git a/FEXCore/Source/Common/SoftFloat-3e/extF80_add.c b/FEXCore/Source/Common/SoftFloat-3e/extF80_add.c index e331d01e9..476921c88 100644 --- a/FEXCore/Source/Common/SoftFloat-3e/extF80_add.c +++ b/FEXCore/Source/Common/SoftFloat-3e/extF80_add.c @@ -40,6 +40,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "internals.h" #include "softfloat.h" +FEXCORE_PRESERVE_ALL_ATTR extFloat80_t extF80_add( extFloat80_t a, extFloat80_t b ) { union { struct extFloat80M s; extFloat80_t f; } uA; diff --git a/FEXCore/Source/Common/SoftFloat-3e/extF80_div.c b/FEXCore/Source/Common/SoftFloat-3e/extF80_div.c index 28dfb13de..f84c17d7a 100644 --- a/FEXCore/Source/Common/SoftFloat-3e/extF80_div.c +++ b/FEXCore/Source/Common/SoftFloat-3e/extF80_div.c @@ -41,6 +41,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "specialize.h" #include "softfloat.h" +FEXCORE_PRESERVE_ALL_ATTR extFloat80_t extF80_div( extFloat80_t a, extFloat80_t b ) { union { struct extFloat80M s; extFloat80_t f; } uA; diff --git a/FEXCore/Source/Common/SoftFloat-3e/extF80_eq.c b/FEXCore/Source/Common/SoftFloat-3e/extF80_eq.c index efcbc3714..c2e6f85b5 100644 --- a/FEXCore/Source/Common/SoftFloat-3e/extF80_eq.c +++ b/FEXCore/Source/Common/SoftFloat-3e/extF80_eq.c @@ -41,6 +41,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "specialize.h" #include "softfloat.h" +FEXCORE_PRESERVE_ALL_ATTR bool extF80_eq( extFloat80_t a, extFloat80_t b ) { union { struct extFloat80M s; extFloat80_t f; } uA; diff --git a/FEXCore/Source/Common/SoftFloat-3e/extF80_lt.c b/FEXCore/Source/Common/SoftFloat-3e/extF80_lt.c index a4ac69fa6..937bbbbf5 100644 --- a/FEXCore/Source/Common/SoftFloat-3e/extF80_lt.c +++ b/FEXCore/Source/Common/SoftFloat-3e/extF80_lt.c @@ -41,6 +41,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "specialize.h" #include "softfloat.h" +FEXCORE_PRESERVE_ALL_ATTR bool extF80_lt( extFloat80_t a, extFloat80_t b ) { union { struct extFloat80M s; extFloat80_t f; } uA; diff --git a/FEXCore/Source/Common/SoftFloat-3e/extF80_mul.c b/FEXCore/Source/Common/SoftFloat-3e/extF80_mul.c index 39ce4012c..205dfaa89 100644 --- a/FEXCore/Source/Common/SoftFloat-3e/extF80_mul.c +++ b/FEXCore/Source/Common/SoftFloat-3e/extF80_mul.c @@ -41,6 +41,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "specialize.h" #include "softfloat.h" +FEXCORE_PRESERVE_ALL_ATTR extFloat80_t extF80_mul( extFloat80_t a, extFloat80_t b ) { union { struct extFloat80M s; extFloat80_t f; } uA; diff --git a/FEXCore/Source/Common/SoftFloat-3e/extF80_rem.c b/FEXCore/Source/Common/SoftFloat-3e/extF80_rem.c index 5ad977526..333443cbf 100644 --- a/FEXCore/Source/Common/SoftFloat-3e/extF80_rem.c +++ b/FEXCore/Source/Common/SoftFloat-3e/extF80_rem.c @@ -41,6 +41,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "specialize.h" #include "softfloat.h" +FEXCORE_PRESERVE_ALL_ATTR extFloat80_t extF80_rem( extFloat80_t a, extFloat80_t b ) { union { struct extFloat80M s; extFloat80_t f; } uA; diff --git a/FEXCore/Source/Common/SoftFloat-3e/extF80_roundToInt.c b/FEXCore/Source/Common/SoftFloat-3e/extF80_roundToInt.c index 10b6d5dd8..79213ee00 100644 --- a/FEXCore/Source/Common/SoftFloat-3e/extF80_roundToInt.c +++ b/FEXCore/Source/Common/SoftFloat-3e/extF80_roundToInt.c @@ -41,6 +41,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "specialize.h" #include "softfloat.h" +FEXCORE_PRESERVE_ALL_ATTR extFloat80_t extF80_roundToInt( extFloat80_t a, uint_fast8_t roundingMode, bool exact ) { diff --git a/FEXCore/Source/Common/SoftFloat-3e/extF80_sqrt.c b/FEXCore/Source/Common/SoftFloat-3e/extF80_sqrt.c index af8c496e1..e94e20ff4 100644 --- a/FEXCore/Source/Common/SoftFloat-3e/extF80_sqrt.c +++ b/FEXCore/Source/Common/SoftFloat-3e/extF80_sqrt.c @@ -41,6 +41,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "specialize.h" #include "softfloat.h" +FEXCORE_PRESERVE_ALL_ATTR extFloat80_t extF80_sqrt( extFloat80_t a ) { union { struct extFloat80M s; extFloat80_t f; } uA; diff --git a/FEXCore/Source/Common/SoftFloat-3e/extF80_sub.c b/FEXCore/Source/Common/SoftFloat-3e/extF80_sub.c index 770c7563a..077937af9 100644 --- a/FEXCore/Source/Common/SoftFloat-3e/extF80_sub.c +++ b/FEXCore/Source/Common/SoftFloat-3e/extF80_sub.c @@ -40,6 +40,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "internals.h" #include "softfloat.h" +FEXCORE_PRESERVE_ALL_ATTR extFloat80_t extF80_sub( extFloat80_t a, extFloat80_t b ) { union { struct extFloat80M s; extFloat80_t f; } uA; diff --git a/FEXCore/Source/Common/SoftFloat-3e/extF80_to_f128.c b/FEXCore/Source/Common/SoftFloat-3e/extF80_to_f128.c index 4de90ae31..b1e0c4a6d 100644 --- a/FEXCore/Source/Common/SoftFloat-3e/extF80_to_f128.c +++ b/FEXCore/Source/Common/SoftFloat-3e/extF80_to_f128.c @@ -41,6 +41,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "specialize.h" #include "softfloat.h" +FEXCORE_PRESERVE_ALL_ATTR float128_t extF80_to_f128( extFloat80_t a ) { union { struct extFloat80M s; extFloat80_t f; } uA; diff --git a/FEXCore/Source/Common/SoftFloat-3e/extF80_to_f32.c b/FEXCore/Source/Common/SoftFloat-3e/extF80_to_f32.c index 77fcfdc11..413c3f353 100644 --- a/FEXCore/Source/Common/SoftFloat-3e/extF80_to_f32.c +++ b/FEXCore/Source/Common/SoftFloat-3e/extF80_to_f32.c @@ -41,6 +41,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "specialize.h" #include "softfloat.h" +FEXCORE_PRESERVE_ALL_ATTR float32_t extF80_to_f32( extFloat80_t a ) { union { struct extFloat80M s; extFloat80_t f; } uA; diff --git a/FEXCore/Source/Common/SoftFloat-3e/extF80_to_f64.c b/FEXCore/Source/Common/SoftFloat-3e/extF80_to_f64.c index 410d6622c..531552483 100644 --- a/FEXCore/Source/Common/SoftFloat-3e/extF80_to_f64.c +++ b/FEXCore/Source/Common/SoftFloat-3e/extF80_to_f64.c @@ -41,6 +41,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "specialize.h" #include "softfloat.h" +FEXCORE_PRESERVE_ALL_ATTR float64_t extF80_to_f64( extFloat80_t a ) { union { struct extFloat80M s; extFloat80_t f; } uA; diff --git a/FEXCore/Source/Common/SoftFloat-3e/extF80_to_i32.c b/FEXCore/Source/Common/SoftFloat-3e/extF80_to_i32.c index 9acdc3c9b..c3fb69651 100644 --- a/FEXCore/Source/Common/SoftFloat-3e/extF80_to_i32.c +++ b/FEXCore/Source/Common/SoftFloat-3e/extF80_to_i32.c @@ -41,6 +41,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "specialize.h" #include "softfloat.h" +FEXCORE_PRESERVE_ALL_ATTR int_fast32_t extF80_to_i32( extFloat80_t a, uint_fast8_t roundingMode, bool exact ) { diff --git a/FEXCore/Source/Common/SoftFloat-3e/extF80_to_i64.c b/FEXCore/Source/Common/SoftFloat-3e/extF80_to_i64.c index ba307a61c..6faa51603 100644 --- a/FEXCore/Source/Common/SoftFloat-3e/extF80_to_i64.c +++ b/FEXCore/Source/Common/SoftFloat-3e/extF80_to_i64.c @@ -41,6 +41,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "specialize.h" #include "softfloat.h" +FEXCORE_PRESERVE_ALL_ATTR int_fast64_t extF80_to_i64( extFloat80_t a, uint_fast8_t roundingMode, bool exact ) { diff --git a/FEXCore/Source/Common/SoftFloat-3e/extF80_to_ui64.c b/FEXCore/Source/Common/SoftFloat-3e/extF80_to_ui64.c index 490b26aaf..c2dd8e238 100644 --- a/FEXCore/Source/Common/SoftFloat-3e/extF80_to_ui64.c +++ b/FEXCore/Source/Common/SoftFloat-3e/extF80_to_ui64.c @@ -41,6 +41,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "specialize.h" #include "softfloat.h" +FEXCORE_PRESERVE_ALL_ATTR uint_fast64_t extF80_to_ui64( extFloat80_t a, uint_fast8_t roundingMode, bool exact ) { diff --git a/FEXCore/Source/Common/SoftFloat-3e/f128_to_extF80.c b/FEXCore/Source/Common/SoftFloat-3e/f128_to_extF80.c index ec169c0ff..845f68a1f 100644 --- a/FEXCore/Source/Common/SoftFloat-3e/f128_to_extF80.c +++ b/FEXCore/Source/Common/SoftFloat-3e/f128_to_extF80.c @@ -41,6 +41,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "specialize.h" #include "softfloat.h" +FEXCORE_PRESERVE_ALL_ATTR extFloat80_t f128_to_extF80( float128_t a ) { union ui128_f128 uA; diff --git a/FEXCore/Source/Common/SoftFloat-3e/f32_to_extF80.c b/FEXCore/Source/Common/SoftFloat-3e/f32_to_extF80.c index 742ed649c..fe73de85b 100644 --- a/FEXCore/Source/Common/SoftFloat-3e/f32_to_extF80.c +++ b/FEXCore/Source/Common/SoftFloat-3e/f32_to_extF80.c @@ -41,6 +41,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "specialize.h" #include "softfloat.h" +FEXCORE_PRESERVE_ALL_ATTR extFloat80_t f32_to_extF80( float32_t a ) { union ui32_f32 uA; diff --git a/FEXCore/Source/Common/SoftFloat-3e/f64_to_extF80.c b/FEXCore/Source/Common/SoftFloat-3e/f64_to_extF80.c index 2799d9b07..1b04abc2f 100644 --- a/FEXCore/Source/Common/SoftFloat-3e/f64_to_extF80.c +++ b/FEXCore/Source/Common/SoftFloat-3e/f64_to_extF80.c @@ -41,6 +41,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "specialize.h" #include "softfloat.h" +FEXCORE_PRESERVE_ALL_ATTR extFloat80_t f64_to_extF80( float64_t a ) { union ui64_f64 uA; diff --git a/FEXCore/Source/Common/SoftFloat-3e/i32_to_extF80.c b/FEXCore/Source/Common/SoftFloat-3e/i32_to_extF80.c index 8036fa9f1..3e36bac6d 100644 --- a/FEXCore/Source/Common/SoftFloat-3e/i32_to_extF80.c +++ b/FEXCore/Source/Common/SoftFloat-3e/i32_to_extF80.c @@ -40,6 +40,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "internals.h" #include "softfloat.h" +FEXCORE_PRESERVE_ALL_ATTR extFloat80_t i32_to_extF80( int32_t a ) { uint_fast16_t uiZ64; diff --git a/FEXCore/Source/Common/SoftFloat-3e/internals.h b/FEXCore/Source/Common/SoftFloat-3e/internals.h index 020b3402f..271e08e46 100644 --- a/FEXCore/Source/Common/SoftFloat-3e/internals.h +++ b/FEXCore/Source/Common/SoftFloat-3e/internals.h @@ -68,9 +68,11 @@ uint_fast64_t uint_fast64_t softfloat_roundMToUI64( bool, uint32_t *, uint_fast8_t, bool ); #endif +FEXCORE_PRESERVE_ALL_ATTR int_fast32_t softfloat_roundToI32( bool, uint_fast64_t, uint_fast8_t, bool ); #ifdef SOFTFLOAT_FAST_INT64 +FEXCORE_PRESERVE_ALL_ATTR int_fast64_t softfloat_roundToI64( bool, uint_fast64_t, uint_fast64_t, uint_fast8_t, bool ); @@ -109,8 +111,10 @@ float16_t #define isNaNF32UI( a ) (((~(a) & 0x7F800000) == 0) && ((a) & 0x007FFFFF)) struct exp16_sig32 { int_fast16_t exp; uint_fast32_t sig; }; +FEXCORE_PRESERVE_ALL_ATTR struct exp16_sig32 softfloat_normSubnormalF32Sig( uint_fast32_t ); +FEXCORE_PRESERVE_ALL_ATTR float32_t softfloat_roundPackToF32( bool, int_fast16_t, uint_fast32_t ); float32_t softfloat_normRoundPackToF32( bool, int_fast16_t, uint_fast32_t ); @@ -130,8 +134,10 @@ float32_t #define isNaNF64UI( a ) (((~(a) & UINT64_C( 0x7FF0000000000000 )) == 0) && ((a) & UINT64_C( 0x000FFFFFFFFFFFFF ))) struct exp16_sig64 { int_fast16_t exp; uint_fast64_t sig; }; +FEXCORE_PRESERVE_ALL_ATTR struct exp16_sig64 softfloat_normSubnormalF64Sig( uint_fast64_t ); +FEXCORE_PRESERVE_ALL_ATTR float64_t softfloat_roundPackToF64( bool, int_fast16_t, uint_fast64_t ); float64_t softfloat_normRoundPackToF64( bool, int_fast16_t, uint_fast64_t ); @@ -155,11 +161,14 @@ float64_t *----------------------------------------------------------------------------*/ struct exp32_sig64 { int_fast32_t exp; uint64_t sig; }; +FEXCORE_PRESERVE_ALL_ATTR struct exp32_sig64 softfloat_normSubnormalExtF80Sig( uint_fast64_t ); +FEXCORE_PRESERVE_ALL_ATTR extFloat80_t softfloat_roundPackToExtF80( bool, int_fast32_t, uint_fast64_t, uint_fast64_t, uint_fast8_t ); +FEXCORE_PRESERVE_ALL_ATTR extFloat80_t softfloat_normRoundPackToExtF80( bool, int_fast32_t, uint_fast64_t, uint_fast64_t, uint_fast8_t ); @@ -181,6 +190,7 @@ extFloat80_t #define isNaNF128UI( a64, a0 ) (((~(a64) & UINT64_C( 0x7FFF000000000000 )) == 0) && (a0 || ((a64) & UINT64_C( 0x0000FFFFFFFFFFFF )))) struct exp32_sig128 { int_fast32_t exp; struct uint128 sig; }; +FEXCORE_PRESERVE_ALL_ATTR struct exp32_sig128 softfloat_normSubnormalF128Sig( uint_fast64_t, uint_fast64_t ); diff --git a/FEXCore/Source/Common/SoftFloat-3e/primitives.h b/FEXCore/Source/Common/SoftFloat-3e/primitives.h index 863ab45b5..3d7dac3b5 100644 --- a/FEXCore/Source/Common/SoftFloat-3e/primitives.h +++ b/FEXCore/Source/Common/SoftFloat-3e/primitives.h @@ -53,6 +53,7 @@ INLINE uint64_t softfloat_shortShiftRightJam64( uint64_t a, uint_fast8_t dist ) { return a>>dist | ((a & (((uint_fast64_t) 1<>dist | ((uint32_t) (a<<(-dist & 31)) != 0) : (a != 0); } #else +FEXCORE_PRESERVE_ALL_ATTR uint32_t softfloat_shiftRightJam32( uint32_t a, uint_fast16_t dist ); #endif #endif @@ -95,6 +97,7 @@ INLINE uint64_t softfloat_shiftRightJam64( uint64_t a, uint_fast32_t dist ) (dist < 63) ? a>>dist | ((uint64_t) (a<<(-dist & 63)) != 0) : (a != 0); } #else +FEXCORE_PRESERVE_ALL_ATTR uint64_t softfloat_shiftRightJam64( uint64_t a, uint_fast32_t dist ); #endif #endif @@ -148,6 +151,7 @@ INLINE uint_fast8_t softfloat_countLeadingZeros32( uint32_t a ) return count; } #else +FEXCORE_PRESERVE_ALL_ATTR uint_fast8_t softfloat_countLeadingZeros32( uint32_t a ); #endif #endif @@ -157,6 +161,7 @@ uint_fast8_t softfloat_countLeadingZeros32( uint32_t a ); | Returns the number of leading 0 bits before the most-significant 1 bit of | 'a'. If 'a' is zero, 64 is returned. *----------------------------------------------------------------------------*/ +FEXCORE_PRESERVE_ALL_ATTR uint_fast8_t softfloat_countLeadingZeros64( uint64_t a ); #endif @@ -178,6 +183,7 @@ extern const uint16_t softfloat_approxRecip_1k1s[16]; #ifdef SOFTFLOAT_FAST_DIV64TO32 #define softfloat_approxRecip32_1( a ) ((uint32_t) (UINT64_C( 0x7FFFFFFFFFFFFFFF ) / (uint32_t) (a))) #else +FEXCORE_PRESERVE_ALL_ATTR uint32_t softfloat_approxRecip32_1( uint32_t a ); #endif #endif @@ -204,6 +210,7 @@ extern const uint16_t softfloat_approxRecipSqrt_1k1s[16]; | returned is also always within the range 0.5 to 1; thus, the most- | significant bit of the result is always set. *----------------------------------------------------------------------------*/ +FEXCORE_PRESERVE_ALL_ATTR uint32_t softfloat_approxRecipSqrt32_1( unsigned int oddExpA, uint32_t a ); #endif @@ -240,6 +247,7 @@ INLINE bool softfloat_le128( uint64_t a64, uint64_t a0, uint64_t b64, uint64_t b0 ) { return (a64 < b64) || ((a64 == b64) && (a0 <= b0)); } #else +FEXCORE_PRESERVE_ALL_ATTR bool softfloat_le128( uint64_t a64, uint64_t a0, uint64_t b64, uint64_t b0 ); #endif #endif @@ -255,6 +263,7 @@ INLINE bool softfloat_lt128( uint64_t a64, uint64_t a0, uint64_t b64, uint64_t b0 ) { return (a64 < b64) || ((a64 == b64) && (a0 < b0)); } #else +FEXCORE_PRESERVE_ALL_ATTR bool softfloat_lt128( uint64_t a64, uint64_t a0, uint64_t b64, uint64_t b0 ); #endif #endif @@ -275,6 +284,7 @@ struct uint128 return z; } #else +FEXCORE_PRESERVE_ALL_ATTR struct uint128 softfloat_shortShiftLeft128( uint64_t a64, uint64_t a0, uint_fast8_t dist ); #endif @@ -296,6 +306,7 @@ struct uint128 return z; } #else +FEXCORE_PRESERVE_ALL_ATTR struct uint128 softfloat_shortShiftRight128( uint64_t a64, uint64_t a0, uint_fast8_t dist ); #endif @@ -413,6 +424,7 @@ struct uint64_extra return z; } #else +FEXCORE_PRESERVE_ALL_ATTR struct uint64_extra softfloat_shiftRightJam64Extra( uint64_t a, uint64_t extra, uint_fast32_t dist ); @@ -492,6 +504,7 @@ struct uint128 return z; } #else +FEXCORE_PRESERVE_ALL_ATTR struct uint128 softfloat_add128( uint64_t a64, uint64_t a0, uint64_t b64, uint64_t b0 ); #endif @@ -528,6 +541,7 @@ struct uint128 return z; } #else +FEXCORE_PRESERVE_ALL_ATTR struct uint128 softfloat_sub128( uint64_t a64, uint64_t a0, uint64_t b64, uint64_t b0 ); #endif @@ -562,6 +576,7 @@ INLINE struct uint128 softfloat_mul64ByShifted32To128( uint64_t a, uint32_t b ) return z; } #else +FEXCORE_PRESERVE_ALL_ATTR struct uint128 softfloat_mul64ByShifted32To128( uint64_t a, uint32_t b ); #endif #endif @@ -570,6 +585,7 @@ struct uint128 softfloat_mul64ByShifted32To128( uint64_t a, uint32_t b ); /*---------------------------------------------------------------------------- | Returns the 128-bit product of 'a' and 'b'. *----------------------------------------------------------------------------*/ +FEXCORE_PRESERVE_ALL_ATTR struct uint128 softfloat_mul64To128( uint64_t a, uint64_t b ); #endif diff --git a/FEXCore/Source/Common/SoftFloat-3e/s_add128.c b/FEXCore/Source/Common/SoftFloat-3e/s_add128.c index 5a9d5082a..af999a46d 100644 --- a/FEXCore/Source/Common/SoftFloat-3e/s_add128.c +++ b/FEXCore/Source/Common/SoftFloat-3e/s_add128.c @@ -40,6 +40,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #ifndef softfloat_add128 +FEXCORE_PRESERVE_ALL_ATTR struct uint128 softfloat_add128( uint64_t a64, uint64_t a0, uint64_t b64, uint64_t b0 ) { diff --git a/FEXCore/Source/Common/SoftFloat-3e/s_approxRecip32_1.c b/FEXCore/Source/Common/SoftFloat-3e/s_approxRecip32_1.c index 4a326a438..612c2bc11 100644 --- a/FEXCore/Source/Common/SoftFloat-3e/s_approxRecip32_1.c +++ b/FEXCore/Source/Common/SoftFloat-3e/s_approxRecip32_1.c @@ -42,6 +42,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. extern const uint16_t softfloat_approxRecip_1k0s[16]; extern const uint16_t softfloat_approxRecip_1k1s[16]; +FEXCORE_PRESERVE_ALL_ATTR uint32_t softfloat_approxRecip32_1( uint32_t a ) { int index; diff --git a/FEXCore/Source/Common/SoftFloat-3e/s_approxRecipSqrt32_1.c b/FEXCore/Source/Common/SoftFloat-3e/s_approxRecipSqrt32_1.c index b3fdeba68..ea8747dca 100644 --- a/FEXCore/Source/Common/SoftFloat-3e/s_approxRecipSqrt32_1.c +++ b/FEXCore/Source/Common/SoftFloat-3e/s_approxRecipSqrt32_1.c @@ -42,6 +42,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. extern const uint16_t softfloat_approxRecipSqrt_1k0s[]; extern const uint16_t softfloat_approxRecipSqrt_1k1s[]; +FEXCORE_PRESERVE_ALL_ATTR uint32_t softfloat_approxRecipSqrt32_1( unsigned int oddExpA, uint32_t a ) { int index; diff --git a/FEXCore/Source/Common/SoftFloat-3e/s_commonNaNToExtF80UI.c b/FEXCore/Source/Common/SoftFloat-3e/s_commonNaNToExtF80UI.c index cb7424f43..b0d4a50ca 100644 --- a/FEXCore/Source/Common/SoftFloat-3e/s_commonNaNToExtF80UI.c +++ b/FEXCore/Source/Common/SoftFloat-3e/s_commonNaNToExtF80UI.c @@ -44,6 +44,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | floating-point NaN, and returns the bit pattern of this value as an unsigned | integer. *----------------------------------------------------------------------------*/ +FEXCORE_PRESERVE_ALL_ATTR struct uint128 softfloat_commonNaNToExtF80UI( const struct commonNaN *aPtr ) { struct uint128 uiZ; diff --git a/FEXCore/Source/Common/SoftFloat-3e/s_commonNaNToF128UI.c b/FEXCore/Source/Common/SoftFloat-3e/s_commonNaNToF128UI.c index 7a9423bea..d4dff12fe 100644 --- a/FEXCore/Source/Common/SoftFloat-3e/s_commonNaNToF128UI.c +++ b/FEXCore/Source/Common/SoftFloat-3e/s_commonNaNToF128UI.c @@ -43,6 +43,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | Converts the common NaN pointed to by `aPtr' into a 128-bit floating-point | NaN, and returns the bit pattern of this value as an unsigned integer. *----------------------------------------------------------------------------*/ +FEXCORE_PRESERVE_ALL_ATTR struct uint128 softfloat_commonNaNToF128UI( const struct commonNaN *aPtr ) { struct uint128 uiZ; diff --git a/FEXCore/Source/Common/SoftFloat-3e/s_commonNaNToF32UI.c b/FEXCore/Source/Common/SoftFloat-3e/s_commonNaNToF32UI.c index ed6c2268f..f6165e451 100644 --- a/FEXCore/Source/Common/SoftFloat-3e/s_commonNaNToF32UI.c +++ b/FEXCore/Source/Common/SoftFloat-3e/s_commonNaNToF32UI.c @@ -42,6 +42,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | Converts the common NaN pointed to by `aPtr' into a 32-bit floating-point | NaN, and returns the bit pattern of this value as an unsigned integer. *----------------------------------------------------------------------------*/ +FEXCORE_PRESERVE_ALL_ATTR uint_fast32_t softfloat_commonNaNToF32UI( const struct commonNaN *aPtr ) { diff --git a/FEXCore/Source/Common/SoftFloat-3e/s_commonNaNToF64UI.c b/FEXCore/Source/Common/SoftFloat-3e/s_commonNaNToF64UI.c index 1182be3c9..86bbc92e0 100644 --- a/FEXCore/Source/Common/SoftFloat-3e/s_commonNaNToF64UI.c +++ b/FEXCore/Source/Common/SoftFloat-3e/s_commonNaNToF64UI.c @@ -42,6 +42,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | Converts the common NaN pointed to by `aPtr' into a 64-bit floating-point | NaN, and returns the bit pattern of this value as an unsigned integer. *----------------------------------------------------------------------------*/ +FEXCORE_PRESERVE_ALL_ATTR uint_fast64_t softfloat_commonNaNToF64UI( const struct commonNaN *aPtr ) { diff --git a/FEXCore/Source/Common/SoftFloat-3e/s_countLeadingZeros32.c b/FEXCore/Source/Common/SoftFloat-3e/s_countLeadingZeros32.c index 53ab22824..9de8341e3 100644 --- a/FEXCore/Source/Common/SoftFloat-3e/s_countLeadingZeros32.c +++ b/FEXCore/Source/Common/SoftFloat-3e/s_countLeadingZeros32.c @@ -42,6 +42,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #define softfloat_countLeadingZeros32 softfloat_countLeadingZeros32 #include "primitives.h" +FEXCORE_PRESERVE_ALL_ATTR uint_fast8_t softfloat_countLeadingZeros32( uint32_t a ) { uint_fast8_t count; diff --git a/FEXCore/Source/Common/SoftFloat-3e/s_countLeadingZeros64.c b/FEXCore/Source/Common/SoftFloat-3e/s_countLeadingZeros64.c index 13a222463..bbc8ab0ab 100644 --- a/FEXCore/Source/Common/SoftFloat-3e/s_countLeadingZeros64.c +++ b/FEXCore/Source/Common/SoftFloat-3e/s_countLeadingZeros64.c @@ -42,6 +42,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #define softfloat_countLeadingZeros64 softfloat_countLeadingZeros64 #include "primitives.h" +FEXCORE_PRESERVE_ALL_ATTR uint_fast8_t softfloat_countLeadingZeros64( uint64_t a ) { uint_fast8_t count; diff --git a/FEXCore/Source/Common/SoftFloat-3e/s_extF80UIToCommonNaN.c b/FEXCore/Source/Common/SoftFloat-3e/s_extF80UIToCommonNaN.c index ab6311ef2..840e019e0 100644 --- a/FEXCore/Source/Common/SoftFloat-3e/s_extF80UIToCommonNaN.c +++ b/FEXCore/Source/Common/SoftFloat-3e/s_extF80UIToCommonNaN.c @@ -46,6 +46,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | location pointed to by `zPtr'. If the NaN is a signaling NaN, the invalid | exception is raised. *----------------------------------------------------------------------------*/ +FEXCORE_PRESERVE_ALL_ATTR void softfloat_extF80UIToCommonNaN( uint_fast16_t uiA64, uint_fast64_t uiA0, struct commonNaN *zPtr ) diff --git a/FEXCore/Source/Common/SoftFloat-3e/s_f128UIToCommonNaN.c b/FEXCore/Source/Common/SoftFloat-3e/s_f128UIToCommonNaN.c index f838f02aa..4de7cb926 100644 --- a/FEXCore/Source/Common/SoftFloat-3e/s_f128UIToCommonNaN.c +++ b/FEXCore/Source/Common/SoftFloat-3e/s_f128UIToCommonNaN.c @@ -47,6 +47,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | pointed to by `zPtr'. If the NaN is a signaling NaN, the invalid exception | is raised. *----------------------------------------------------------------------------*/ +FEXCORE_PRESERVE_ALL_ATTR void softfloat_f128UIToCommonNaN( uint_fast64_t uiA64, uint_fast64_t uiA0, struct commonNaN *zPtr ) diff --git a/FEXCore/Source/Common/SoftFloat-3e/s_f32UIToCommonNaN.c b/FEXCore/Source/Common/SoftFloat-3e/s_f32UIToCommonNaN.c index b21ba6603..67cfc30f6 100644 --- a/FEXCore/Source/Common/SoftFloat-3e/s_f32UIToCommonNaN.c +++ b/FEXCore/Source/Common/SoftFloat-3e/s_f32UIToCommonNaN.c @@ -45,6 +45,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | location pointed to by `zPtr'. If the NaN is a signaling NaN, the invalid | exception is raised. *----------------------------------------------------------------------------*/ +FEXCORE_PRESERVE_ALL_ATTR void softfloat_f32UIToCommonNaN( uint_fast32_t uiA, struct commonNaN *zPtr ) { diff --git a/FEXCore/Source/Common/SoftFloat-3e/s_f64UIToCommonNaN.c b/FEXCore/Source/Common/SoftFloat-3e/s_f64UIToCommonNaN.c index 6529d2ee5..c02f920ab 100644 --- a/FEXCore/Source/Common/SoftFloat-3e/s_f64UIToCommonNaN.c +++ b/FEXCore/Source/Common/SoftFloat-3e/s_f64UIToCommonNaN.c @@ -45,6 +45,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | location pointed to by `zPtr'. If the NaN is a signaling NaN, the invalid | exception is raised. *----------------------------------------------------------------------------*/ +FEXCORE_PRESERVE_ALL_ATTR void softfloat_f64UIToCommonNaN( uint_fast64_t uiA, struct commonNaN *zPtr ) { diff --git a/FEXCore/Source/Common/SoftFloat-3e/s_le128.c b/FEXCore/Source/Common/SoftFloat-3e/s_le128.c index 1fce7af98..15ca6f58c 100644 --- a/FEXCore/Source/Common/SoftFloat-3e/s_le128.c +++ b/FEXCore/Source/Common/SoftFloat-3e/s_le128.c @@ -40,6 +40,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #ifndef softfloat_le128 +FEXCORE_PRESERVE_ALL_ATTR bool softfloat_le128( uint64_t a64, uint64_t a0, uint64_t b64, uint64_t b0 ) { diff --git a/FEXCore/Source/Common/SoftFloat-3e/s_lt128.c b/FEXCore/Source/Common/SoftFloat-3e/s_lt128.c index d7ce3b997..d9a11c672 100644 --- a/FEXCore/Source/Common/SoftFloat-3e/s_lt128.c +++ b/FEXCore/Source/Common/SoftFloat-3e/s_lt128.c @@ -40,6 +40,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #ifndef softfloat_lt128 +FEXCORE_PRESERVE_ALL_ATTR bool softfloat_lt128( uint64_t a64, uint64_t a0, uint64_t b64, uint64_t b0 ) { diff --git a/FEXCore/Source/Common/SoftFloat-3e/s_mul64ByShifted32To128.c b/FEXCore/Source/Common/SoftFloat-3e/s_mul64ByShifted32To128.c index 57e528888..c84a0fe62 100644 --- a/FEXCore/Source/Common/SoftFloat-3e/s_mul64ByShifted32To128.c +++ b/FEXCore/Source/Common/SoftFloat-3e/s_mul64ByShifted32To128.c @@ -40,6 +40,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #ifndef softfloat_mul64ByShifted32To128 +FEXCORE_PRESERVE_ALL_ATTR struct uint128 softfloat_mul64ByShifted32To128( uint64_t a, uint32_t b ) { uint_fast64_t mid; diff --git a/FEXCore/Source/Common/SoftFloat-3e/s_mul64To128.c b/FEXCore/Source/Common/SoftFloat-3e/s_mul64To128.c index 5d360aa4b..2ab3c77c7 100644 --- a/FEXCore/Source/Common/SoftFloat-3e/s_mul64To128.c +++ b/FEXCore/Source/Common/SoftFloat-3e/s_mul64To128.c @@ -40,6 +40,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #ifndef softfloat_mul64To128 +FEXCORE_PRESERVE_ALL_ATTR struct uint128 softfloat_mul64To128( uint64_t a, uint64_t b ) { uint32_t a32, a0, b32, b0; diff --git a/FEXCore/Source/Common/SoftFloat-3e/s_normRoundPackToExtF80.c b/FEXCore/Source/Common/SoftFloat-3e/s_normRoundPackToExtF80.c index 76e791d91..e958105c4 100644 --- a/FEXCore/Source/Common/SoftFloat-3e/s_normRoundPackToExtF80.c +++ b/FEXCore/Source/Common/SoftFloat-3e/s_normRoundPackToExtF80.c @@ -39,6 +39,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "platform.h" #include "internals.h" +FEXCORE_PRESERVE_ALL_ATTR extFloat80_t softfloat_normRoundPackToExtF80( bool sign, diff --git a/FEXCore/Source/Common/SoftFloat-3e/s_normSubnormalExtF80Sig.c b/FEXCore/Source/Common/SoftFloat-3e/s_normSubnormalExtF80Sig.c index c1d7788b1..df0d9eaa5 100644 --- a/FEXCore/Source/Common/SoftFloat-3e/s_normSubnormalExtF80Sig.c +++ b/FEXCore/Source/Common/SoftFloat-3e/s_normSubnormalExtF80Sig.c @@ -38,6 +38,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "platform.h" #include "internals.h" +FEXCORE_PRESERVE_ALL_ATTR struct exp32_sig64 softfloat_normSubnormalExtF80Sig( uint_fast64_t sig ) { int_fast8_t shiftDist; diff --git a/FEXCore/Source/Common/SoftFloat-3e/s_normSubnormalF128Sig.c b/FEXCore/Source/Common/SoftFloat-3e/s_normSubnormalF128Sig.c index 597d558cc..74c99d859 100644 --- a/FEXCore/Source/Common/SoftFloat-3e/s_normSubnormalF128Sig.c +++ b/FEXCore/Source/Common/SoftFloat-3e/s_normSubnormalF128Sig.c @@ -38,6 +38,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "platform.h" #include "internals.h" +FEXCORE_PRESERVE_ALL_ATTR struct exp32_sig128 softfloat_normSubnormalF128Sig( uint_fast64_t sig64, uint_fast64_t sig0 ) { diff --git a/FEXCore/Source/Common/SoftFloat-3e/s_normSubnormalF32Sig.c b/FEXCore/Source/Common/SoftFloat-3e/s_normSubnormalF32Sig.c index d4bff9b41..b84572a9d 100644 --- a/FEXCore/Source/Common/SoftFloat-3e/s_normSubnormalF32Sig.c +++ b/FEXCore/Source/Common/SoftFloat-3e/s_normSubnormalF32Sig.c @@ -38,6 +38,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "platform.h" #include "internals.h" +FEXCORE_PRESERVE_ALL_ATTR struct exp16_sig32 softfloat_normSubnormalF32Sig( uint_fast32_t sig ) { int_fast8_t shiftDist; diff --git a/FEXCore/Source/Common/SoftFloat-3e/s_normSubnormalF64Sig.c b/FEXCore/Source/Common/SoftFloat-3e/s_normSubnormalF64Sig.c index 0c63b97d5..33544e7fb 100644 --- a/FEXCore/Source/Common/SoftFloat-3e/s_normSubnormalF64Sig.c +++ b/FEXCore/Source/Common/SoftFloat-3e/s_normSubnormalF64Sig.c @@ -38,6 +38,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "platform.h" #include "internals.h" +FEXCORE_PRESERVE_ALL_ATTR struct exp16_sig64 softfloat_normSubnormalF64Sig( uint_fast64_t sig ) { int_fast8_t shiftDist; diff --git a/FEXCore/Source/Common/SoftFloat-3e/s_propagateNaNExtF80UI.c b/FEXCore/Source/Common/SoftFloat-3e/s_propagateNaNExtF80UI.c index cc3f0f42c..4a2b6a8db 100644 --- a/FEXCore/Source/Common/SoftFloat-3e/s_propagateNaNExtF80UI.c +++ b/FEXCore/Source/Common/SoftFloat-3e/s_propagateNaNExtF80UI.c @@ -50,6 +50,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | result. If either original floating-point value is a signaling NaN, the | invalid exception is raised. *----------------------------------------------------------------------------*/ +FEXCORE_PRESERVE_ALL_ATTR struct uint128 softfloat_propagateNaNExtF80UI( uint_fast16_t uiA64, diff --git a/FEXCore/Source/Common/SoftFloat-3e/s_roundPackToExtF80.c b/FEXCore/Source/Common/SoftFloat-3e/s_roundPackToExtF80.c index 0cc7af985..1c8adcc04 100644 --- a/FEXCore/Source/Common/SoftFloat-3e/s_roundPackToExtF80.c +++ b/FEXCore/Source/Common/SoftFloat-3e/s_roundPackToExtF80.c @@ -40,6 +40,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "internals.h" #include "softfloat.h" +FEXCORE_PRESERVE_ALL_ATTR extFloat80_t softfloat_roundPackToExtF80( bool sign, diff --git a/FEXCore/Source/Common/SoftFloat-3e/s_roundPackToF32.c b/FEXCore/Source/Common/SoftFloat-3e/s_roundPackToF32.c index d1975e845..2a2c2296c 100644 --- a/FEXCore/Source/Common/SoftFloat-3e/s_roundPackToF32.c +++ b/FEXCore/Source/Common/SoftFloat-3e/s_roundPackToF32.c @@ -40,6 +40,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "internals.h" #include "softfloat.h" +FEXCORE_PRESERVE_ALL_ATTR float32_t softfloat_roundPackToF32( bool sign, int_fast16_t exp, uint_fast32_t sig ) { diff --git a/FEXCore/Source/Common/SoftFloat-3e/s_roundPackToF64.c b/FEXCore/Source/Common/SoftFloat-3e/s_roundPackToF64.c index 0345529cf..4ec560874 100644 --- a/FEXCore/Source/Common/SoftFloat-3e/s_roundPackToF64.c +++ b/FEXCore/Source/Common/SoftFloat-3e/s_roundPackToF64.c @@ -40,6 +40,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "internals.h" #include "softfloat.h" +FEXCORE_PRESERVE_ALL_ATTR float64_t softfloat_roundPackToF64( bool sign, int_fast16_t exp, uint_fast64_t sig ) { diff --git a/FEXCore/Source/Common/SoftFloat-3e/s_roundToI32.c b/FEXCore/Source/Common/SoftFloat-3e/s_roundToI32.c index a3e727dc7..23977ce27 100644 --- a/FEXCore/Source/Common/SoftFloat-3e/s_roundToI32.c +++ b/FEXCore/Source/Common/SoftFloat-3e/s_roundToI32.c @@ -41,6 +41,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "specialize.h" #include "softfloat.h" +FEXCORE_PRESERVE_ALL_ATTR int_fast32_t softfloat_roundToI32( bool sign, uint_fast64_t sig, uint_fast8_t roundingMode, bool exact ) diff --git a/FEXCore/Source/Common/SoftFloat-3e/s_roundToI64.c b/FEXCore/Source/Common/SoftFloat-3e/s_roundToI64.c index 773c82cfc..ff6d93f56 100644 --- a/FEXCore/Source/Common/SoftFloat-3e/s_roundToI64.c +++ b/FEXCore/Source/Common/SoftFloat-3e/s_roundToI64.c @@ -41,6 +41,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "specialize.h" #include "softfloat.h" +FEXCORE_PRESERVE_ALL_ATTR int_fast64_t softfloat_roundToI64( bool sign, diff --git a/FEXCore/Source/Common/SoftFloat-3e/s_shiftRightJam32.c b/FEXCore/Source/Common/SoftFloat-3e/s_shiftRightJam32.c index 2533fcd95..2ecdda079 100644 --- a/FEXCore/Source/Common/SoftFloat-3e/s_shiftRightJam32.c +++ b/FEXCore/Source/Common/SoftFloat-3e/s_shiftRightJam32.c @@ -39,6 +39,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #ifndef softfloat_shiftRightJam32 +FEXCORE_PRESERVE_ALL_ATTR uint32_t softfloat_shiftRightJam32( uint32_t a, uint_fast16_t dist ) { diff --git a/FEXCore/Source/Common/SoftFloat-3e/s_shiftRightJam64.c b/FEXCore/Source/Common/SoftFloat-3e/s_shiftRightJam64.c index 4b40e3de6..c24bcdcd0 100644 --- a/FEXCore/Source/Common/SoftFloat-3e/s_shiftRightJam64.c +++ b/FEXCore/Source/Common/SoftFloat-3e/s_shiftRightJam64.c @@ -39,6 +39,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #ifndef softfloat_shiftRightJam64 +FEXCORE_PRESERVE_ALL_ATTR uint64_t softfloat_shiftRightJam64( uint64_t a, uint_fast32_t dist ) { diff --git a/FEXCore/Source/Common/SoftFloat-3e/s_shiftRightJam64Extra.c b/FEXCore/Source/Common/SoftFloat-3e/s_shiftRightJam64Extra.c index b93fad39c..833183247 100644 --- a/FEXCore/Source/Common/SoftFloat-3e/s_shiftRightJam64Extra.c +++ b/FEXCore/Source/Common/SoftFloat-3e/s_shiftRightJam64Extra.c @@ -40,6 +40,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #ifndef softfloat_shiftRightJam64Extra +FEXCORE_PRESERVE_ALL_ATTR struct uint64_extra softfloat_shiftRightJam64Extra( uint64_t a, uint64_t extra, uint_fast32_t dist ) diff --git a/FEXCore/Source/Common/SoftFloat-3e/s_shortShiftLeft128.c b/FEXCore/Source/Common/SoftFloat-3e/s_shortShiftLeft128.c index 7513bc627..94654fbde 100644 --- a/FEXCore/Source/Common/SoftFloat-3e/s_shortShiftLeft128.c +++ b/FEXCore/Source/Common/SoftFloat-3e/s_shortShiftLeft128.c @@ -40,6 +40,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #ifndef softfloat_shortShiftLeft128 +FEXCORE_PRESERVE_ALL_ATTR struct uint128 softfloat_shortShiftLeft128( uint64_t a64, uint64_t a0, uint_fast8_t dist ) { diff --git a/FEXCore/Source/Common/SoftFloat-3e/s_shortShiftRight128.c b/FEXCore/Source/Common/SoftFloat-3e/s_shortShiftRight128.c index 8f5c650b2..83f083013 100644 --- a/FEXCore/Source/Common/SoftFloat-3e/s_shortShiftRight128.c +++ b/FEXCore/Source/Common/SoftFloat-3e/s_shortShiftRight128.c @@ -40,6 +40,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #ifndef softfloat_shortShiftRight128 +FEXCORE_PRESERVE_ALL_ATTR struct uint128 softfloat_shortShiftRight128( uint64_t a64, uint64_t a0, uint_fast8_t dist ) { diff --git a/FEXCore/Source/Common/SoftFloat-3e/s_shortShiftRightJam64.c b/FEXCore/Source/Common/SoftFloat-3e/s_shortShiftRightJam64.c index d3044c853..ebbb5577d 100644 --- a/FEXCore/Source/Common/SoftFloat-3e/s_shortShiftRightJam64.c +++ b/FEXCore/Source/Common/SoftFloat-3e/s_shortShiftRightJam64.c @@ -39,6 +39,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #ifndef softfloat_shortShiftRightJam64 +FEXCORE_PRESERVE_ALL_ATTR uint64_t softfloat_shortShiftRightJam64( uint64_t a, uint_fast8_t dist ) { diff --git a/FEXCore/Source/Common/SoftFloat-3e/s_sub128.c b/FEXCore/Source/Common/SoftFloat-3e/s_sub128.c index 9bf346391..239ca6d33 100644 --- a/FEXCore/Source/Common/SoftFloat-3e/s_sub128.c +++ b/FEXCore/Source/Common/SoftFloat-3e/s_sub128.c @@ -40,6 +40,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #ifndef softfloat_sub128 +FEXCORE_PRESERVE_ALL_ATTR struct uint128 softfloat_sub128( uint64_t a64, uint64_t a0, uint64_t b64, uint64_t b0 ) { diff --git a/FEXCore/Source/Common/SoftFloat-3e/softfloat.h b/FEXCore/Source/Common/SoftFloat-3e/softfloat.h index b33374cd6..a36aa0771 100644 --- a/FEXCore/Source/Common/SoftFloat-3e/softfloat.h +++ b/FEXCore/Source/Common/SoftFloat-3e/softfloat.h @@ -92,6 +92,7 @@ enum { /*---------------------------------------------------------------------------- | Routine to raise any or all of the software floating-point exception flags. *----------------------------------------------------------------------------*/ +FEXCORE_PRESERVE_ALL_ATTR void softfloat_raiseFlags( uint_fast8_t ); /*---------------------------------------------------------------------------- @@ -110,6 +111,7 @@ float16_t ui64_to_f16( uint64_t ); float32_t ui64_to_f32( uint64_t ); float64_t ui64_to_f64( uint64_t ); #ifdef SOFTFLOAT_FAST_INT64 +FEXCORE_PRESERVE_ALL_ATTR extFloat80_t ui64_to_extF80( uint64_t ); float128_t ui64_to_f128( uint64_t ); #endif @@ -119,6 +121,7 @@ float16_t i32_to_f16( int32_t ); float32_t i32_to_f32( int32_t ); float64_t i32_to_f64( int32_t ); #ifdef SOFTFLOAT_FAST_INT64 +FEXCORE_PRESERVE_ALL_ATTR extFloat80_t i32_to_extF80( int32_t ); float128_t i32_to_f128( int32_t ); #endif @@ -183,6 +186,7 @@ int_fast64_t f32_to_i64_r_minMag( float32_t, bool ); float16_t f32_to_f16( float32_t ); float64_t f32_to_f64( float32_t ); #ifdef SOFTFLOAT_FAST_INT64 +FEXCORE_PRESERVE_ALL_ATTR extFloat80_t f32_to_extF80( float32_t ); float128_t f32_to_f128( float32_t ); #endif @@ -218,6 +222,7 @@ int_fast64_t f64_to_i64_r_minMag( float64_t, bool ); float16_t f64_to_f16( float64_t ); float32_t f64_to_f32( float64_t ); #ifdef SOFTFLOAT_FAST_INT64 +FEXCORE_PRESERVE_ALL_ATTR extFloat80_t f64_to_extF80( float64_t ); float128_t f64_to_f128( float64_t ); #endif @@ -250,26 +255,41 @@ extern THREAD_LOCAL uint_fast8_t extF80_roundingPrecision; *----------------------------------------------------------------------------*/ #ifdef SOFTFLOAT_FAST_INT64 uint_fast32_t extF80_to_ui32( extFloat80_t, uint_fast8_t, bool ); +FEXCORE_PRESERVE_ALL_ATTR uint_fast64_t extF80_to_ui64( extFloat80_t, uint_fast8_t, bool ); +FEXCORE_PRESERVE_ALL_ATTR int_fast32_t extF80_to_i32( extFloat80_t, uint_fast8_t, bool ); +FEXCORE_PRESERVE_ALL_ATTR int_fast64_t extF80_to_i64( extFloat80_t, uint_fast8_t, bool ); uint_fast32_t extF80_to_ui32_r_minMag( extFloat80_t, bool ); uint_fast64_t extF80_to_ui64_r_minMag( extFloat80_t, bool ); int_fast32_t extF80_to_i32_r_minMag( extFloat80_t, bool ); int_fast64_t extF80_to_i64_r_minMag( extFloat80_t, bool ); float16_t extF80_to_f16( extFloat80_t ); +FEXCORE_PRESERVE_ALL_ATTR float32_t extF80_to_f32( extFloat80_t ); +FEXCORE_PRESERVE_ALL_ATTR float64_t extF80_to_f64( extFloat80_t ); +FEXCORE_PRESERVE_ALL_ATTR float128_t extF80_to_f128( extFloat80_t ); +FEXCORE_PRESERVE_ALL_ATTR extFloat80_t extF80_roundToInt( extFloat80_t, uint_fast8_t, bool ); +FEXCORE_PRESERVE_ALL_ATTR extFloat80_t extF80_add( extFloat80_t, extFloat80_t ); +FEXCORE_PRESERVE_ALL_ATTR extFloat80_t extF80_sub( extFloat80_t, extFloat80_t ); +FEXCORE_PRESERVE_ALL_ATTR extFloat80_t extF80_mul( extFloat80_t, extFloat80_t ); +FEXCORE_PRESERVE_ALL_ATTR extFloat80_t extF80_div( extFloat80_t, extFloat80_t ); +FEXCORE_PRESERVE_ALL_ATTR extFloat80_t extF80_rem( extFloat80_t, extFloat80_t ); +FEXCORE_PRESERVE_ALL_ATTR extFloat80_t extF80_sqrt( extFloat80_t ); +FEXCORE_PRESERVE_ALL_ATTR bool extF80_eq( extFloat80_t, extFloat80_t ); bool extF80_le( extFloat80_t, extFloat80_t ); +FEXCORE_PRESERVE_ALL_ATTR bool extF80_lt( extFloat80_t, extFloat80_t ); bool extF80_eq_signaling( extFloat80_t, extFloat80_t ); bool extF80_le_quiet( extFloat80_t, extFloat80_t ); @@ -320,6 +340,7 @@ int_fast64_t f128_to_i64_r_minMag( float128_t, bool ); float16_t f128_to_f16( float128_t ); float32_t f128_to_f32( float128_t ); float64_t f128_to_f64( float128_t ); +FEXCORE_PRESERVE_ALL_ATTR extFloat80_t f128_to_extF80( float128_t ); float128_t f128_roundToInt( float128_t, uint_fast8_t, bool ); float128_t f128_add( float128_t, float128_t ); diff --git a/FEXCore/Source/Common/SoftFloat-3e/softfloat_raiseFlags.c b/FEXCore/Source/Common/SoftFloat-3e/softfloat_raiseFlags.c index 3115306be..0ba2871ea 100644 --- a/FEXCore/Source/Common/SoftFloat-3e/softfloat_raiseFlags.c +++ b/FEXCore/Source/Common/SoftFloat-3e/softfloat_raiseFlags.c @@ -43,6 +43,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | to substitute a result value. If traps are not implemented, this routine | should be simply `softfloat_exceptionFlags |= flags;'. *----------------------------------------------------------------------------*/ +FEXCORE_PRESERVE_ALL_ATTR void softfloat_raiseFlags( uint_fast8_t flags ) { diff --git a/FEXCore/Source/Common/SoftFloat-3e/specialize.h b/FEXCore/Source/Common/SoftFloat-3e/specialize.h index 5fe119a1e..8db0b2725 100644 --- a/FEXCore/Source/Common/SoftFloat-3e/specialize.h +++ b/FEXCore/Source/Common/SoftFloat-3e/specialize.h @@ -135,12 +135,14 @@ uint_fast16_t | location pointed to by 'zPtr'. If the NaN is a signaling NaN, the invalid | exception is raised. *----------------------------------------------------------------------------*/ +FEXCORE_PRESERVE_ALL_ATTR void softfloat_f32UIToCommonNaN( uint_fast32_t uiA, struct commonNaN *zPtr ); /*---------------------------------------------------------------------------- | Converts the common NaN pointed to by 'aPtr' into a 32-bit floating-point | NaN, and returns the bit pattern of this value as an unsigned integer. *----------------------------------------------------------------------------*/ +FEXCORE_PRESERVE_ALL_ATTR uint_fast32_t softfloat_commonNaNToF32UI( const struct commonNaN *aPtr ); /*---------------------------------------------------------------------------- @@ -170,12 +172,14 @@ uint_fast32_t | location pointed to by 'zPtr'. If the NaN is a signaling NaN, the invalid | exception is raised. *----------------------------------------------------------------------------*/ +FEXCORE_PRESERVE_ALL_ATTR void softfloat_f64UIToCommonNaN( uint_fast64_t uiA, struct commonNaN *zPtr ); /*---------------------------------------------------------------------------- | Converts the common NaN pointed to by 'aPtr' into a 64-bit floating-point | NaN, and returns the bit pattern of this value as an unsigned integer. *----------------------------------------------------------------------------*/ +FEXCORE_PRESERVE_ALL_ATTR uint_fast64_t softfloat_commonNaNToF64UI( const struct commonNaN *aPtr ); /*---------------------------------------------------------------------------- @@ -215,6 +219,7 @@ uint_fast64_t | location pointed to by 'zPtr'. If the NaN is a signaling NaN, the invalid | exception is raised. *----------------------------------------------------------------------------*/ +FEXCORE_PRESERVE_ALL_ATTR void softfloat_extF80UIToCommonNaN( uint_fast16_t uiA64, uint_fast64_t uiA0, struct commonNaN *zPtr ); @@ -224,6 +229,7 @@ void | floating-point NaN, and returns the bit pattern of this value as an unsigned | integer. *----------------------------------------------------------------------------*/ +FEXCORE_PRESERVE_ALL_ATTR struct uint128 softfloat_commonNaNToExtF80UI( const struct commonNaN *aPtr ); /*---------------------------------------------------------------------------- @@ -235,6 +241,7 @@ struct uint128 softfloat_commonNaNToExtF80UI( const struct commonNaN *aPtr ); | result. If either original floating-point value is a signaling NaN, the | invalid exception is raised. *----------------------------------------------------------------------------*/ +FEXCORE_PRESERVE_ALL_ATTR struct uint128 softfloat_propagateNaNExtF80UI( uint_fast16_t uiA64, @@ -264,6 +271,7 @@ struct uint128 | pointed to by 'zPtr'. If the NaN is a signaling NaN, the invalid exception | is raised. *----------------------------------------------------------------------------*/ +FEXCORE_PRESERVE_ALL_ATTR void softfloat_f128UIToCommonNaN( uint_fast64_t uiA64, uint_fast64_t uiA0, struct commonNaN *zPtr ); @@ -272,6 +280,7 @@ void | Converts the common NaN pointed to by 'aPtr' into a 128-bit floating-point | NaN, and returns the bit pattern of this value as an unsigned integer. *----------------------------------------------------------------------------*/ +FEXCORE_PRESERVE_ALL_ATTR struct uint128 softfloat_commonNaNToF128UI( const struct commonNaN * ); /*---------------------------------------------------------------------------- diff --git a/FEXCore/Source/Common/SoftFloat-3e/ui64_to_extF80.c b/FEXCore/Source/Common/SoftFloat-3e/ui64_to_extF80.c index b0e932fed..fc976bb30 100644 --- a/FEXCore/Source/Common/SoftFloat-3e/ui64_to_extF80.c +++ b/FEXCore/Source/Common/SoftFloat-3e/ui64_to_extF80.c @@ -39,6 +39,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "internals.h" #include "softfloat.h" +FEXCORE_PRESERVE_ALL_ATTR extFloat80_t ui64_to_extF80( uint64_t a ) { uint_fast16_t uiZ64;