aboutsummaryrefslogtreecommitdiff
path: root/newlib/libc
diff options
context:
space:
mode:
Diffstat (limited to 'newlib/libc')
-rw-r--r--newlib/libc/acinclude.m43
-rw-r--r--newlib/libc/include/math.h3
-rw-r--r--newlib/libc/machine/aarch64/machine/_fpmath.h20
3 files changed, 18 insertions, 8 deletions
diff --git a/newlib/libc/acinclude.m4 b/newlib/libc/acinclude.m4
index 7cba7db..4266266 100644
--- a/newlib/libc/acinclude.m4
+++ b/newlib/libc/acinclude.m4
@@ -62,4 +62,7 @@ m4_foreach_w([MACHINE], [
z8k
], [AM_CONDITIONAL([HAVE_LIBC_MACHINE_]m4_toupper(MACHINE), test "${machine_dir}" = MACHINE)])
+AM_CONDITIONAL(HAVE_FPMATH_H, test -r "${srcdir}/libc/machine/${machine_dir}/machine/_fpmath.h")
+
+
AM_CONDITIONAL(MACH_ADD_SETJMP, test "x$mach_add_setjmp" = "xtrue")
diff --git a/newlib/libc/include/math.h b/newlib/libc/include/math.h
index 54e30ef..87f5133 100644
--- a/newlib/libc/include/math.h
+++ b/newlib/libc/include/math.h
@@ -445,7 +445,8 @@ extern float hypotf (float, float);
simply call the double functions. On Cygwin the long double functions
are implemented independently from newlib to be able to use optimized
assembler functions despite using the Microsoft x86_64 ABI. */
-#if defined (_LDBL_EQ_DBL) || defined (__CYGWIN__)
+#if defined (_LDBL_EQ_DBL) || defined (__CYGWIN__) || \
+ defined(__aarch64__) || defined(__i386__) || defined(__x86_64__)
/* Reentrant ANSI C functions. */
#ifndef __math_68881
extern long double atanl (long double);
diff --git a/newlib/libc/machine/aarch64/machine/_fpmath.h b/newlib/libc/machine/aarch64/machine/_fpmath.h
index 71d0a71..fa62ae8 100644
--- a/newlib/libc/machine/aarch64/machine/_fpmath.h
+++ b/newlib/libc/machine/aarch64/machine/_fpmath.h
@@ -27,19 +27,25 @@
* $FreeBSD$
*/
+/*
+ * Change unsigned int/long used by FreeBSD to fixed width types because
+ * ilp32 has a different size for unsigned long. --joel (20 Aug 2022)
+ */
+#include <stdint.h>
+
union IEEEl2bits {
long double e;
struct {
- unsigned long manl :64;
- unsigned long manh :48;
- unsigned int exp :15;
- unsigned int sign :1;
+ uint64_t manl :64;
+ uint64_t manh :48;
+ uint32_t exp :15;
+ uint32_t sign :1;
} bits;
/* TODO andrew: Check the packing here */
struct {
- unsigned long manl :64;
- unsigned long manh :48;
- unsigned int expsign :16;
+ uint64_t manl :64;
+ uint64_t manh :48;
+ uint32_t expsign :16;
} xbits;
};