On Tue, 19 Dec 2017, Liu Hao wrote:
On 2017/12/18 3:43, Martin Storsjö wrote:
Since long double just is normal double on arm and arm64, just
call the normal ldexp function.
Signed-off-by: Martin Storsjö <[email protected]>
---
Fixed the parameters in the C wrappers.
---
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..7d3bffc
--- /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, n);
+#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..bfa3287
--- /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, n);
+#else
+#error Not supported on your platform yet
+#endif
+}
It looks good this time.
Thanks, pushed
// Martin
------------------------------------------------------------------------------
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
[email protected]
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public