Since long double just is normal double on arm and arm64, just
call the normal ldexp function.

Signed-off-by: Martin Storsjö <mar...@martin.st>
---
 mingw-w64-crt/Makefile.am         |  3 ++-
 mingw-w64-crt/math/arm/ldexpl.c   | 16 ++++++++++++++++
 mingw-w64-crt/math/arm64/ldexpl.c | 16 ++++++++++++++++
 3 files changed, 34 insertions(+), 1 deletion(-)
 create mode 100644 mingw-w64-crt/math/arm/ldexpl.c
 create mode 100644 mingw-w64-crt/math/arm64/ldexpl.c

diff --git a/mingw-w64-crt/Makefile.am b/mingw-w64-crt/Makefile.am
index 6812a5e..7d6c395 100644
--- a/mingw-w64-crt/Makefile.am
+++ b/mingw-w64-crt/Makefile.am
@@ -390,13 +390,14 @@ src_libmingwexarm32+=\
   math/softmath/sinf.c      math/softmath/sinl.c      math/softmath/tanf.c     
 math/softmath/tanl.c
 else
 src_libmingwexarm32+=\
-  math/arm/exp2.c           math/arm/log2.c           math/arm/scalbn.c        
 math/arm/sincos.c
+  math/arm/exp2.c           math/arm/ldexpl.c         math/arm/log2.c          
 math/arm/scalbn.c         math/arm/sincos.c
 endif
 
 # these only go into the ARM64 version:
 src_libmingwexarm64=\
   math/arm64/_chgsignl.S    math/arm64/ceil.S         math/arm64/ceilf.S       
 math/arm64/ceill.S        math/arm64/copysignl.c    \
   math/arm64/exp2.S         math/arm64/exp2f.S        math/arm64/floor.S       
 math/arm64/floorf.S       math/arm64/floorl.S       \
+  math/arm64/ldexpl.c \
   math/arm64/log2.c         math/arm64/nearbyint.S    math/arm64/nearbyintf.S  
 math/arm64/nearbyintl.S   math/arm64/scalbn.c       \
   math/arm64/sincos.c       math/arm64/trunc.S        math/arm64/truncf.S
 
diff --git a/mingw-w64-crt/math/arm/ldexpl.c b/mingw-w64-crt/math/arm/ldexpl.c
new file mode 100644
index 0000000..cdccb7f
--- /dev/null
+++ b/mingw-w64-crt/math/arm/ldexpl.c
@@ -0,0 +1,16 @@
+/**
+ * This file has no copyright assigned and is placed in the Public Domain.
+ * This file is part of the mingw-w64 runtime package.
+ * No warranty is given; refer to the file DISCLAIMER.PD within this package.
+ */
+
+#include <math.h>
+
+long double ldexpl(long double x, int n)
+{
+#if defined(__arm__) || defined(_ARM_)
+    return ldexp(x, exp);
+#else
+#error Not supported on your platform yet
+#endif
+}
diff --git a/mingw-w64-crt/math/arm64/ldexpl.c 
b/mingw-w64-crt/math/arm64/ldexpl.c
new file mode 100644
index 0000000..8f37d8e
--- /dev/null
+++ b/mingw-w64-crt/math/arm64/ldexpl.c
@@ -0,0 +1,16 @@
+/**
+ * This file has no copyright assigned and is placed in the Public Domain.
+ * This file is part of the mingw-w64 runtime package.
+ * No warranty is given; refer to the file DISCLAIMER.PD within this package.
+ */
+
+#include <math.h>
+
+long double ldexpl(long double x, int n)
+{
+#if defined(__aarch64__) || defined(_ARM64_)
+    return ldexp(x, exp);
+#else
+#error Not supported on your platform yet
+#endif
+}
-- 
2.7.4


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to