The implementations of the long double versions use a few hardcoded
constants that assume that long double is 80 bit.

Signed-off-by: Martin Storsjö <[email protected]>
---
 mingw-w64-crt/math/coshl.c | 10 ++++++++++
 mingw-w64-crt/math/sinhl.c | 11 ++++++++++-
 mingw-w64-crt/math/tanhl.c | 11 ++++++++++-
 3 files changed, 30 insertions(+), 2 deletions(-)

diff --git a/mingw-w64-crt/math/coshl.c b/mingw-w64-crt/math/coshl.c
index d7eb4b7cb..4aaaf6e21 100644
--- a/mingw-w64-crt/math/coshl.c
+++ b/mingw-w64-crt/math/coshl.c
@@ -5,6 +5,15 @@
  */
 #include "cephes_mconf.h"
 
+#if defined(_ARM_) || defined(__arm__) || defined(_ARM64_) || 
defined(__aarch64__)
+#include <math.h>
+
+long double coshl(long double x)
+{
+  return cosh(x);
+}
+#else
+
 #ifndef _SET_ERRNO
 #define _SET_ERRNO(x)
 #endif
@@ -43,3 +52,4 @@ long double coshl(long double x)
   y = 0.5L * (y + 1.0L / y);
   return y;
 }
+#endif
diff --git a/mingw-w64-crt/math/sinhl.c b/mingw-w64-crt/math/sinhl.c
index 4db0e51ff..aa6f0a9c3 100644
--- a/mingw-w64-crt/math/sinhl.c
+++ b/mingw-w64-crt/math/sinhl.c
@@ -6,6 +6,15 @@
 #include "cephes_mconf.h"
 #include <errno.h>
 
+#if defined(_ARM_) || defined(__arm__) || defined(_ARM64_) || 
defined(__aarch64__)
+#include <math.h>
+
+long double sinhl(long double x)
+{
+  return sinh(x);
+}
+#else
+
 #ifdef UNK
 static uLD P[] = {
   { { 1.7550769032975377032681E-6L } },
@@ -97,4 +106,4 @@ long double sinhl(long double x)
   a *= a;
   return (x + x * a * (polevll(a,P,3)/polevll(a,Q,4)));
 }
-
+#endif
diff --git a/mingw-w64-crt/math/tanhl.c b/mingw-w64-crt/math/tanhl.c
index 2c48a6aab..da3fc5e25 100644
--- a/mingw-w64-crt/math/tanhl.c
+++ b/mingw-w64-crt/math/tanhl.c
@@ -8,6 +8,15 @@
 #define _SET_ERRNO(x)
 #endif
 
+#if defined(_ARM_) || defined(__arm__) || defined(_ARM64_) || 
defined(__aarch64__)
+#include <math.h>
+
+long double tanhl(long double x)
+{
+  return tanh(x);
+}
+#else
+
 #ifdef UNK
 static uLD P[] = {
   { { -6.8473739392677100872869E-5L } },
@@ -89,4 +98,4 @@ long double tanhl(long double x)
   }
   return (z);
 }
-
+#endif
-- 
2.17.1



_______________________________________________
Mingw-w64-public mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to