--- This includes functions needed for ARM64EC support that are not covered by Martin's WIP long-double-64 branch.
mingw-w64-crt/math/cephes_mconf.h | 4 ++-- mingw-w64-crt/math/fmal.c | 2 +- mingw-w64-crt/math/fpclassifyl.c | 6 +++--- mingw-w64-crt/math/frexpl.c | 2 +- mingw-w64-crt/math/lrintl.c | 6 +++--- mingw-w64-crt/math/rintl.c | 6 +++--- mingw-w64-crt/math/signbit.c | 2 +- 7 files changed, 14 insertions(+), 14 deletions(-) diff --git a/mingw-w64-crt/math/cephes_mconf.h b/mingw-w64-crt/math/cephes_mconf.h index f502f187b..4941dc64f 100644 --- a/mingw-w64-crt/math/cephes_mconf.h +++ b/mingw-w64-crt/math/cephes_mconf.h @@ -66,7 +66,7 @@ extern double __QNAN; #endif /*long double*/ -#if defined(__arm__) || defined(_ARM_) || defined(__aarch64__) || defined(_ARM64_) +#if __SIZEOF_LONG_DOUBLE__ == __SIZEOF_DOUBLE__ #define MAXNUML 1.7976931348623158E308 #define MAXLOGL 7.09782712893383996843E2 #define MINLOGL -7.08396418532264106224E2 @@ -84,7 +84,7 @@ extern double __QNAN; #define PIL 3.1415926535897932384626L #define PIO2L 1.5707963267948966192313L #define PIO4L 7.8539816339744830961566E-1L -#endif /* defined(__arm__) || defined(_ARM_) || defined(__aarch64__) || defined(_ARM64_) */ +#endif /* __SIZEOF_LONG_DOUBLE__ == __SIZEOF_DOUBLE__ */ #define isfinitel isfinite #define isinfl isinf diff --git a/mingw-w64-crt/math/fmal.c b/mingw-w64-crt/math/fmal.c index 67e5c503a..3db856e7c 100644 --- a/mingw-w64-crt/math/fmal.c +++ b/mingw-w64-crt/math/fmal.c @@ -5,7 +5,7 @@ */ long double fmal(long double x, long double y, long double z); -#if defined(_ARM_) || defined(__arm__) || defined(_ARM64_) || defined(__aarch64__) +#if __SIZEOF_LONG_DOUBLE__ == __SIZEOF_DOUBLE__ double fma(double x, double y, double z); diff --git a/mingw-w64-crt/math/fpclassifyl.c b/mingw-w64-crt/math/fpclassifyl.c index 3ee487e13..0c057bd1c 100644 --- a/mingw-w64-crt/math/fpclassifyl.c +++ b/mingw-w64-crt/math/fpclassifyl.c @@ -6,7 +6,9 @@ #include <math.h> int __fpclassifyl (long double _x){ -#if defined(__x86_64__) || defined(_AMD64_) +#if __SIZEOF_LONG_DOUBLE__ == __SIZEOF_DOUBLE__ + return __fpclassify(_x); +#elif defined(_AMD64_) || defined(__x86_64__) __mingw_ldbl_type_t hlp; unsigned int e; hlp.x = _x; @@ -23,8 +25,6 @@ int __fpclassifyl (long double _x){ return (((hlp.lh.high & 0x7fffffff) | hlp.lh.low) == 0 ? FP_INFINITE : FP_NAN); return FP_NORMAL; -#elif defined(__arm__) || defined(_ARM_) || defined(__aarch64__) || defined(_ARM64_) - return __fpclassify(_x); #elif defined(__i386__) || defined(_X86_) unsigned short sw; __asm__ __volatile__ ( diff --git a/mingw-w64-crt/math/frexpl.c b/mingw-w64-crt/math/frexpl.c index f686a7463..f60b68bcd 100644 --- a/mingw-w64-crt/math/frexpl.c +++ b/mingw-w64-crt/math/frexpl.c @@ -5,7 +5,7 @@ */ long double frexpl(long double value, int* exp); -#if defined(_ARM_) || defined(__arm__) || defined(_ARM64_) || defined(__aarch64__) +#if __SIZEOF_LONG_DOUBLE__ == __SIZEOF_DOUBLE__ double frexp(double value, int* exp); diff --git a/mingw-w64-crt/math/lrintl.c b/mingw-w64-crt/math/lrintl.c index d710fac05..0bdd5784f 100644 --- a/mingw-w64-crt/math/lrintl.c +++ b/mingw-w64-crt/math/lrintl.c @@ -8,10 +8,10 @@ long lrintl (long double x) { long retval = 0l; -#if defined(_AMD64_) || defined(__x86_64__) || defined(_X86_) || defined(__i386__) - __asm__ __volatile__ ("fistpl %0" : "=m" (retval) : "t" (x) : "st"); -#elif defined(__arm__) || defined(_ARM_) || defined(__aarch64__) || defined(_ARM64_) +#if __SIZEOF_LONG_DOUBLE__ == __SIZEOF_DOUBLE__ retval = lrint(x); +#elif defined(_AMD64_) || defined(__x86_64__) || defined(_X86_) || defined(__i386__) + __asm__ __volatile__ ("fistpl %0" : "=m" (retval) : "t" (x) : "st"); #endif return retval; } diff --git a/mingw-w64-crt/math/rintl.c b/mingw-w64-crt/math/rintl.c index 1c3780330..da30c7aa2 100644 --- a/mingw-w64-crt/math/rintl.c +++ b/mingw-w64-crt/math/rintl.c @@ -7,10 +7,10 @@ long double rintl (long double x) { long double retval = 0.0L; -#if defined(_AMD64_) || defined(__x86_64__) || defined(_X86_) || defined(__i386__) - __asm__ __volatile__ ("frndint;": "=t" (retval) : "0" (x)); -#elif defined(__arm__) || defined(_ARM_) || defined(__aarch64__) || defined(_ARM64_) +#if __SIZEOF_LONG_DOUBLE__ == __SIZEOF_DOUBLE__ retval = rint(x); +#elif defined(_AMD64_) || defined(__x86_64__) || defined(_X86_) || defined(__i386__) + __asm__ __volatile__ ("frndint;": "=t" (retval) : "0" (x)); #endif return retval; } diff --git a/mingw-w64-crt/math/signbit.c b/mingw-w64-crt/math/signbit.c index a97d8b9e9..b123b51cf 100644 --- a/mingw-w64-crt/math/signbit.c +++ b/mingw-w64-crt/math/signbit.c @@ -16,7 +16,7 @@ typedef union __mingw_dbl_type_t { int __signbit (double x) { -#if defined(__x86_64__) || defined(_AMD64_) || defined(__arm__) || defined(_ARM_) || defined(__aarch64__) || defined(_ARM64_) +#if __SIZEOF_LONG_DOUBLE__ == __SIZEOF_DOUBLE__ __mingw_dbl_type_t hlp; hlp.x = x; -- 2.48.1 _______________________________________________ Mingw-w64-public mailing list Mingw-w64-public@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mingw-w64-public