* [PATCH newlib v1 0/4] Add FreeBSD long double functions
@ 2022-08-22 22:50 Joel Sherrill
2022-08-22 22:50 ` [PATCH newlib v1 1/4] Add infrastructure for incorporating FreeBSD long double methods Joel Sherrill
` (4 more replies)
0 siblings, 5 replies; 14+ messages in thread
From: Joel Sherrill @ 2022-08-22 22:50 UTC (permalink / raw)
To: newlib
Hi
To be clear, this is a V1 for review. It actually does **NOT**
add every long double math method from FreeBSD. That would add
unnecessary bulk to this patch set at this point.
The FreeBSD long double code requires there to be an architecture
specific _fpmath.h file. This is only available for a handful of
architestures. Further, LDBL does EQ DBL on many architectures.
The FreeBSD long double code will **NOT** compile if there isn't
an _fpmath.h file. Thus, the overall approach is:
if architecture has _fpmath.h
use FreeBSD long double code in libm/common/ldbl
else
use existing long double code
As each FreeBSD long double function is added, the existing
implementation will be moved from libm/common/FUNC.c to
libm/common/ldbl_eq_dbl/s_FUNC.c.
This is a first round patch which includes only:
+ changes to build infrastructure
+ addition of all architecture specific _fpmath.h
+ addition of FreeBSD s_truncl.c and move of truncl.c
Additionally, the existing libm/common/frexpl.c already had
code for long double and LDBL_EQ_DBL so I went ahead and split
that up.
Every file with LDBL_EQ_DBL conditional left in libm/common
should not have an implementation when there is a real long
double type. These will be easy to mechanically move into
libm/common/ldbl_eq_dbl while adding their mate from FreeBSD.
Feedback appreciated.
Thanks.
--joel
Joel Sherrill (4):
Add infrastructure for incorporating FreeBSD long double methods
Makefile.in and configure: Regenerated
Split libm/common/frexpl.c into LDBL_EQ_DBL and long double versions
Makefile.in: Regenerated
newlib/Makefile.am | 2 +-
newlib/Makefile.in | 256 +++++++++++-------
newlib/configure | 15 +
newlib/libc/acinclude.m4 | 2 +
newlib/libc/include/math.h | 14 -
newlib/libc/include/sys/endian.h | 207 ++++++++++++++
newlib/libc/machine/aarch64/machine/_fpmath.h | 64 +++++
newlib/libc/machine/arm/machine/_fpmath.h | 69 +++++
newlib/libc/machine/i386/machine/_fpmath.h | 56 ++++
newlib/libc/machine/mips/machine/_fpmath.h | 58 ++++
newlib/libc/machine/powerpc/machine/_fpmath.h | 101 +++++++
newlib/libc/machine/riscv/machine/_fpmath.h | 71 +++++
newlib/libc/machine/sparc64/machine/_fpmath.h | 59 ++++
newlib/libc/machine/x86_64/machine/_fpmath.h | 57 ++++
newlib/libm/common/Makefile.inc | 16 +-
newlib/libm/common/ldbl/fpmath.h | 82 ++++++
.../libm/common/{frexpl.c => ldbl/s_frexpl.c} | 9 -
newlib/libm/common/ldbl/s_truncl.c | 68 +++++
newlib/libm/common/ldbl_eq_dbl/s_frexpl.c | 42 +++
.../{truncl.c => ldbl_eq_dbl/s_truncl.c} | 0
20 files changed, 1126 insertions(+), 122 deletions(-)
create mode 100644 newlib/libc/include/sys/endian.h
create mode 100644 newlib/libc/machine/aarch64/machine/_fpmath.h
create mode 100644 newlib/libc/machine/arm/machine/_fpmath.h
create mode 100644 newlib/libc/machine/i386/machine/_fpmath.h
create mode 100644 newlib/libc/machine/mips/machine/_fpmath.h
create mode 100644 newlib/libc/machine/powerpc/machine/_fpmath.h
create mode 100644 newlib/libc/machine/riscv/machine/_fpmath.h
create mode 100644 newlib/libc/machine/sparc64/machine/_fpmath.h
create mode 100644 newlib/libc/machine/x86_64/machine/_fpmath.h
create mode 100644 newlib/libm/common/ldbl/fpmath.h
rename newlib/libm/common/{frexpl.c => ldbl/s_frexpl.c} (94%)
create mode 100644 newlib/libm/common/ldbl/s_truncl.c
create mode 100644 newlib/libm/common/ldbl_eq_dbl/s_frexpl.c
rename newlib/libm/common/{truncl.c => ldbl_eq_dbl/s_truncl.c} (100%)
--
2.24.4
^ permalink raw reply [flat|nested] 14+ messages in thread
* [PATCH newlib v1 1/4] Add infrastructure for incorporating FreeBSD long double methods
2022-08-22 22:50 [PATCH newlib v1 0/4] Add FreeBSD long double functions Joel Sherrill
@ 2022-08-22 22:50 ` Joel Sherrill
2022-08-22 22:50 ` [PATCH newlib v1 2/4] Makefile.in and configure: Regenerated Joel Sherrill
` (3 subsequent siblings)
4 siblings, 0 replies; 14+ messages in thread
From: Joel Sherrill @ 2022-08-22 22:50 UTC (permalink / raw)
To: newlib
Newlib's long double math support is almost entirely for when
sizeof(long double) == sizeof(double). This is true for many newlib
targets but not all. This patch includes the infrastructure for
having true long double code from FreeBSD, long double equal double
implementations, and optimized long double implementations.
---
newlib/libc/acinclude.m4 | 2 +
newlib/libc/include/math.h | 14 --
newlib/libc/include/sys/endian.h | 207 ++++++++++++++++++
newlib/libc/machine/aarch64/machine/_fpmath.h | 64 ++++++
newlib/libc/machine/arm/machine/_fpmath.h | 69 ++++++
newlib/libc/machine/i386/machine/_fpmath.h | 56 +++++
newlib/libc/machine/mips/machine/_fpmath.h | 58 +++++
newlib/libc/machine/powerpc/machine/_fpmath.h | 101 +++++++++
newlib/libc/machine/riscv/machine/_fpmath.h | 71 ++++++
newlib/libc/machine/sparc64/machine/_fpmath.h | 59 +++++
newlib/libc/machine/x86_64/machine/_fpmath.h | 57 +++++
newlib/libm/common/Makefile.inc | 14 +-
newlib/libm/common/ldbl/fpmath.h | 82 +++++++
newlib/libm/common/ldbl/s_truncl.c | 68 ++++++
.../{truncl.c => ldbl_eq_dbl/s_truncl.c} | 0
15 files changed, 906 insertions(+), 16 deletions(-)
create mode 100644 newlib/libc/include/sys/endian.h
create mode 100644 newlib/libc/machine/aarch64/machine/_fpmath.h
create mode 100644 newlib/libc/machine/arm/machine/_fpmath.h
create mode 100644 newlib/libc/machine/i386/machine/_fpmath.h
create mode 100644 newlib/libc/machine/mips/machine/_fpmath.h
create mode 100644 newlib/libc/machine/powerpc/machine/_fpmath.h
create mode 100644 newlib/libc/machine/riscv/machine/_fpmath.h
create mode 100644 newlib/libc/machine/sparc64/machine/_fpmath.h
create mode 100644 newlib/libc/machine/x86_64/machine/_fpmath.h
create mode 100644 newlib/libm/common/ldbl/fpmath.h
create mode 100644 newlib/libm/common/ldbl/s_truncl.c
rename newlib/libm/common/{truncl.c => ldbl_eq_dbl/s_truncl.c} (100%)
diff --git a/newlib/libc/acinclude.m4 b/newlib/libc/acinclude.m4
index 7cba7db39..f7c3a6a78 100644
--- a/newlib/libc/acinclude.m4
+++ b/newlib/libc/acinclude.m4
@@ -62,4 +62,6 @@ 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 54e30ef82..7fc18b6dd 100644
--- a/newlib/libc/include/math.h
+++ b/newlib/libc/include/math.h
@@ -440,14 +440,7 @@ extern float log2f (float);
extern float hypotf (float, float);
#endif /* ! defined (_REENT_ONLY) */
-/* Newlib doesn't fully support long double math functions so far.
- On platforms where long double equals double the long double functions
- 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__)
/* Reentrant ANSI C functions. */
-#ifndef __math_68881
extern long double atanl (long double);
extern long double cosl (long double);
extern long double sinl (long double);
@@ -460,10 +453,7 @@ extern long double fabsl (long double);
extern long double floorl (long double);
extern long double log1pl (long double);
extern long double expm1l (long double);
-#endif /* ! defined (__math_68881) */
/* Non reentrant ANSI C functions. */
-#ifndef _REENT_ONLY
-#ifndef __math_68881
extern long double acosl (long double);
extern long double asinl (long double);
extern long double atan2l (long double, long double);
@@ -477,8 +467,6 @@ extern long double powl (long double, long double);
extern long double sqrtl (long double);
extern long double fmodl (long double, long double);
extern long double hypotl (long double, long double);
-#endif /* ! defined (__math_68881) */
-#endif /* ! defined (_REENT_ONLY) */
extern long double copysignl (long double, long double);
extern long double nanl (const char *);
extern int ilogbl (long double);
@@ -515,7 +503,6 @@ extern long double lgammal (long double);
extern long double erfl (long double);
extern long double erfcl (long double);
#endif /* ! defined (_REENT_ONLY) */
-#else /* !_LDBL_EQ_DBL && !__CYGWIN__ */
extern long double hypotl (long double, long double);
extern long double sqrtl (long double);
extern long double frexpl (long double, int *);
@@ -525,7 +512,6 @@ extern _LONG_DOUBLE rintl (_LONG_DOUBLE);
extern long int lrintl (_LONG_DOUBLE);
extern long long int llrintl (_LONG_DOUBLE);
#endif /* __i386__ */
-#endif /* !_LDBL_EQ_DBL && !__CYGWIN__ */
#endif /* __ISO_C_VISIBLE >= 1999 */
diff --git a/newlib/libc/include/sys/endian.h b/newlib/libc/include/sys/endian.h
new file mode 100644
index 000000000..3cef6130c
--- /dev/null
+++ b/newlib/libc/include/sys/endian.h
@@ -0,0 +1,207 @@
+/*-
+ * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
+ *
+ * Copyright (c) 2002 Thomas Moestl <tmm@FreeBSD.org>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * $FreeBSD$
+ */
+
+#ifndef _SYS_ENDIAN_H_
+#define _SYS_ENDIAN_H_
+
+#include <sys/cdefs.h>
+#include <sys/_types.h>
+#include <machine/endian.h>
+
+#ifndef _UINT8_T_DECLARED
+typedef __uint8_t uint8_t;
+#define _UINT8_T_DECLARED
+#endif
+
+#ifndef _UINT16_T_DECLARED
+typedef __uint16_t uint16_t;
+#define _UINT16_T_DECLARED
+#endif
+
+#ifndef _UINT32_T_DECLARED
+typedef __uint32_t uint32_t;
+#define _UINT32_T_DECLARED
+#endif
+
+#ifndef _UINT64_T_DECLARED
+typedef __uint64_t uint64_t;
+#define _UINT64_T_DECLARED
+#endif
+
+/*
+ * General byte order swapping functions.
+ */
+#define bswap16(x) __bswap16(x)
+#define bswap32(x) __bswap32(x)
+#define bswap64(x) __bswap64(x)
+
+/*
+ * Host to big endian, host to little endian, big endian to host, and little
+ * endian to host byte order functions as detailed in byteorder(9).
+ */
+#if _BYTE_ORDER == _LITTLE_ENDIAN
+#define htobe16(x) bswap16((x))
+#define htobe32(x) bswap32((x))
+#define htobe64(x) bswap64((x))
+#define htole16(x) ((uint16_t)(x))
+#define htole32(x) ((uint32_t)(x))
+#define htole64(x) ((uint64_t)(x))
+
+#define be16toh(x) bswap16((x))
+#define be32toh(x) bswap32((x))
+#define be64toh(x) bswap64((x))
+#define le16toh(x) ((uint16_t)(x))
+#define le32toh(x) ((uint32_t)(x))
+#define le64toh(x) ((uint64_t)(x))
+#else /* _BYTE_ORDER != _LITTLE_ENDIAN */
+#define htobe16(x) ((uint16_t)(x))
+#define htobe32(x) ((uint32_t)(x))
+#define htobe64(x) ((uint64_t)(x))
+#define htole16(x) bswap16((x))
+#define htole32(x) bswap32((x))
+#define htole64(x) bswap64((x))
+
+#define be16toh(x) ((uint16_t)(x))
+#define be32toh(x) ((uint32_t)(x))
+#define be64toh(x) ((uint64_t)(x))
+#define le16toh(x) bswap16((x))
+#define le32toh(x) bswap32((x))
+#define le64toh(x) bswap64((x))
+#endif /* _BYTE_ORDER == _LITTLE_ENDIAN */
+
+/* Alignment-agnostic encode/decode bytestream to/from little/big endian. */
+
+static __inline uint16_t
+be16dec(const void *pp)
+{
+ uint8_t const *p = (uint8_t const *)pp;
+
+ return ((p[0] << 8) | p[1]);
+}
+
+static __inline uint32_t
+be32dec(const void *pp)
+{
+ uint8_t const *p = (uint8_t const *)pp;
+
+ return (((unsigned)p[0] << 24) | (p[1] << 16) | (p[2] << 8) | p[3]);
+}
+
+static __inline uint64_t
+be64dec(const void *pp)
+{
+ uint8_t const *p = (uint8_t const *)pp;
+
+ return (((uint64_t)be32dec(p) << 32) | be32dec(p + 4));
+}
+
+static __inline uint16_t
+le16dec(const void *pp)
+{
+ uint8_t const *p = (uint8_t const *)pp;
+
+ return ((p[1] << 8) | p[0]);
+}
+
+static __inline uint32_t
+le32dec(const void *pp)
+{
+ uint8_t const *p = (uint8_t const *)pp;
+
+ return (((unsigned)p[3] << 24) | (p[2] << 16) | (p[1] << 8) | p[0]);
+}
+
+static __inline uint64_t
+le64dec(const void *pp)
+{
+ uint8_t const *p = (uint8_t const *)pp;
+
+ return (((uint64_t)le32dec(p + 4) << 32) | le32dec(p));
+}
+
+static __inline void
+be16enc(void *pp, uint16_t u)
+{
+ uint8_t *p = (uint8_t *)pp;
+
+ p[0] = (u >> 8) & 0xff;
+ p[1] = u & 0xff;
+}
+
+static __inline void
+be32enc(void *pp, uint32_t u)
+{
+ uint8_t *p = (uint8_t *)pp;
+
+ p[0] = (u >> 24) & 0xff;
+ p[1] = (u >> 16) & 0xff;
+ p[2] = (u >> 8) & 0xff;
+ p[3] = u & 0xff;
+}
+
+static __inline void
+be64enc(void *pp, uint64_t u)
+{
+ uint8_t *p = (uint8_t *)pp;
+
+ be32enc(p, (uint32_t)(u >> 32));
+ be32enc(p + 4, (uint32_t)(u & 0xffffffffU));
+}
+
+static __inline void
+le16enc(void *pp, uint16_t u)
+{
+ uint8_t *p = (uint8_t *)pp;
+
+ p[0] = u & 0xff;
+ p[1] = (u >> 8) & 0xff;
+}
+
+static __inline void
+le32enc(void *pp, uint32_t u)
+{
+ uint8_t *p = (uint8_t *)pp;
+
+ p[0] = u & 0xff;
+ p[1] = (u >> 8) & 0xff;
+ p[2] = (u >> 16) & 0xff;
+ p[3] = (u >> 24) & 0xff;
+}
+
+static __inline void
+le64enc(void *pp, uint64_t u)
+{
+ uint8_t *p = (uint8_t *)pp;
+
+ le32enc(p, (uint32_t)(u & 0xffffffffU));
+ le32enc(p + 4, (uint32_t)(u >> 32));
+}
+
+#endif /* _SYS_ENDIAN_H_ */
diff --git a/newlib/libc/machine/aarch64/machine/_fpmath.h b/newlib/libc/machine/aarch64/machine/_fpmath.h
new file mode 100644
index 000000000..fa62ae81c
--- /dev/null
+++ b/newlib/libc/machine/aarch64/machine/_fpmath.h
@@ -0,0 +1,64 @@
+/*-
+ * Copyright (c) 2002, 2003 David Schultz <das@FreeBSD.ORG>
+ * Copyright (2) 2014 The FreeBSD Foundation
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * $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 {
+ uint64_t manl :64;
+ uint64_t manh :48;
+ uint32_t exp :15;
+ uint32_t sign :1;
+ } bits;
+ /* TODO andrew: Check the packing here */
+ struct {
+ uint64_t manl :64;
+ uint64_t manh :48;
+ uint32_t expsign :16;
+ } xbits;
+};
+
+#define LDBL_NBIT 0
+#define LDBL_IMPLICIT_NBIT
+#define mask_nbit_l(u) ((void)0)
+
+#define LDBL_MANH_SIZE 48
+#define LDBL_MANL_SIZE 64
+
+#define LDBL_TO_ARRAY32(u, a) do { \
+ (a)[0] = (uint32_t)(u).bits.manl; \
+ (a)[1] = (uint32_t)((u).bits.manl >> 32); \
+ (a)[2] = (uint32_t)(u).bits.manh; \
+ (a)[3] = (uint32_t)((u).bits.manh >> 32); \
+} while(0)
diff --git a/newlib/libc/machine/arm/machine/_fpmath.h b/newlib/libc/machine/arm/machine/_fpmath.h
new file mode 100644
index 000000000..f5ae2f95a
--- /dev/null
+++ b/newlib/libc/machine/arm/machine/_fpmath.h
@@ -0,0 +1,69 @@
+/*-
+ * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
+ *
+ * Copyright (c) 2002, 2003 David Schultz <das@FreeBSD.ORG>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * $FreeBSD$
+ */
+
+#if defined(__VFP_FP__) || defined(__ARM_EABI__)
+#define _IEEE_WORD_ORDER _BYTE_ORDER
+#else
+#define _IEEE_WORD_ORDER _BIG_ENDIAN
+#endif
+
+union IEEEl2bits {
+ long double e;
+ struct {
+#if _BYTE_ORDER == _LITTLE_ENDIAN
+#if _IEEE_WORD_ORDER == _LITTLE_ENDIAN
+ unsigned int manl :32;
+#endif
+ unsigned int manh :20;
+ unsigned int exp :11;
+ unsigned int sign :1;
+#if _IEEE_WORD_ORDER == _BIG_ENDIAN
+ unsigned int manl :32;
+#endif
+#else /* _BYTE_ORDER == _LITTLE_ENDIAN */
+ unsigned int sign :1;
+ unsigned int exp :11;
+ unsigned int manh :20;
+ unsigned int manl :32;
+#endif
+ } bits;
+};
+
+#define LDBL_NBIT 0
+#define LDBL_IMPLICIT_NBIT
+#define mask_nbit_l(u) ((void)0)
+
+#define LDBL_MANH_SIZE 20
+#define LDBL_MANL_SIZE 32
+
+#define LDBL_TO_ARRAY32(u, a) do { \
+ (a)[0] = (uint32_t)(u).bits.manl; \
+ (a)[1] = (uint32_t)(u).bits.manh; \
+} while(0)
diff --git a/newlib/libc/machine/i386/machine/_fpmath.h b/newlib/libc/machine/i386/machine/_fpmath.h
new file mode 100644
index 000000000..874439c34
--- /dev/null
+++ b/newlib/libc/machine/i386/machine/_fpmath.h
@@ -0,0 +1,56 @@
+/*-
+ * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
+ *
+ * Copyright (c) 2002, 2003 David Schultz <das@FreeBSD.ORG>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * $FreeBSD$
+ */
+
+union IEEEl2bits {
+ long double e;
+ struct {
+ unsigned int manl :32;
+ unsigned int manh :32;
+ unsigned int exp :15;
+ unsigned int sign :1;
+ unsigned int junk :16;
+ } bits;
+ struct {
+ unsigned long long man :64;
+ unsigned int expsign :16;
+ unsigned int junk :16;
+ } xbits;
+};
+
+#define LDBL_NBIT 0x80000000
+#define mask_nbit_l(u) ((u).bits.manh &= ~LDBL_NBIT)
+
+#define LDBL_MANH_SIZE 32
+#define LDBL_MANL_SIZE 32
+
+#define LDBL_TO_ARRAY32(u, a) do { \
+ (a)[0] = (uint32_t)(u).bits.manl; \
+ (a)[1] = (uint32_t)(u).bits.manh; \
+} while (0)
diff --git a/newlib/libc/machine/mips/machine/_fpmath.h b/newlib/libc/machine/mips/machine/_fpmath.h
new file mode 100644
index 000000000..cece2fa81
--- /dev/null
+++ b/newlib/libc/machine/mips/machine/_fpmath.h
@@ -0,0 +1,58 @@
+/*-
+ * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
+ *
+ * Copyright (c) 2002, 2003 David Schultz <das@FreeBSD.ORG>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * $FreeBSD$
+ */
+
+union IEEEl2bits {
+ long double e;
+ struct {
+#ifndef __MIPSEB__
+ unsigned int manl :32;
+ unsigned int manh :20;
+ unsigned int exp :11;
+ unsigned int sign :1;
+#else
+ unsigned int sign :1;
+ unsigned int exp :11;
+ unsigned int manh :20;
+ unsigned int manl :32;
+#endif
+ } bits;
+};
+
+#define LDBL_NBIT 0
+#define mask_nbit_l(u) ((void)0)
+#define LDBL_IMPLICIT_NBIT
+
+#define LDBL_MANH_SIZE 20
+#define LDBL_MANL_SIZE 32
+
+#define LDBL_TO_ARRAY32(u, a) do { \
+ (a)[0] = (uint32_t)(u).bits.manl; \
+ (a)[1] = (uint32_t)(u).bits.manh; \
+} while(0)
diff --git a/newlib/libc/machine/powerpc/machine/_fpmath.h b/newlib/libc/machine/powerpc/machine/_fpmath.h
new file mode 100644
index 000000000..b19c19777
--- /dev/null
+++ b/newlib/libc/machine/powerpc/machine/_fpmath.h
@@ -0,0 +1,101 @@
+/*-
+ * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
+ *
+ * Copyright (c) 2003 David Schultz <das@FreeBSD.ORG>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * $FreeBSD$
+ */
+
+/*
+ * Newlib's powerpc code can be built multilib for 32 and 64 bit targets.
+ * FreeBSD has separate 32 and 64 bit PowerPC versions of _fpmath.h. This
+ * file is just a merger of the two version with an ifdef added.
+ * --joel (20 Aug 2022)
+ */
+
+#ifdef __PPC64__
+
+union IEEEl2bits {
+ long double e;
+ struct {
+#if _BYTE_ORDER == _LITTLE_ENDIAN
+ unsigned int manl :32;
+ unsigned int manh :20;
+ unsigned int exp :11;
+ unsigned int sign :1;
+#else /* _BYTE_ORDER == _LITTLE_ENDIAN */
+ unsigned int sign :1;
+ unsigned int exp :11;
+ unsigned int manh :20;
+ unsigned int manl :32;
+#endif
+ } bits;
+};
+
+#define mask_nbit_l(u) ((void)0)
+#define LDBL_IMPLICIT_NBIT
+#define LDBL_NBIT 0
+
+#define LDBL_MANH_SIZE 20
+#define LDBL_MANL_SIZE 32
+
+#define LDBL_TO_ARRAY32(u, a) do { \
+ (a)[0] = (uint32_t)(u).bits.manl; \
+ (a)[1] = (uint32_t)(u).bits.manh; \
+} while(0)
+
+#else
+/* PowerPC 32 bit */
+
+union IEEEl2bits {
+ long double e;
+ struct {
+#if _BYTE_ORDER == _LITTLE_ENDIAN
+ unsigned int manl :32;
+ unsigned int manh :20;
+ unsigned int exp :11;
+ unsigned int sign :1;
+#else /* _BYTE_ORDER == _LITTLE_ENDIAN */
+ unsigned int sign :1;
+ unsigned int exp :11;
+ unsigned int manh :20;
+ unsigned int manl :32;
+#endif
+ } bits;
+};
+
+#define mask_nbit_l(u) ((void)0)
+#define LDBL_IMPLICIT_NBIT
+#define LDBL_NBIT 0
+
+#define LDBL_MANH_SIZE 20
+#define LDBL_MANL_SIZE 32
+
+#define LDBL_TO_ARRAY32(u, a) do { \
+ (a)[0] = (uint32_t)(u).bits.manl; \
+ (a)[1] = (uint32_t)(u).bits.manh; \
+} while(0)
+
+#endif /* PowerPC 32/64 bits */
diff --git a/newlib/libc/machine/riscv/machine/_fpmath.h b/newlib/libc/machine/riscv/machine/_fpmath.h
new file mode 100644
index 000000000..5c4077cb9
--- /dev/null
+++ b/newlib/libc/machine/riscv/machine/_fpmath.h
@@ -0,0 +1,71 @@
+/*-
+ * Copyright (c) 2002, 2003 David Schultz <das@FreeBSD.ORG>
+ * Copyright (c) 2014 The FreeBSD Foundation
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * $FreeBSD$
+ */
+
+union IEEEl2bits {
+ long double e;
+ struct {
+ unsigned long manl :64;
+ unsigned long manh :48;
+ unsigned int exp :15;
+ unsigned int sign :1;
+ } bits;
+ struct {
+ unsigned long manl :64;
+ unsigned long manh :48;
+ unsigned int expsign :16;
+ } xbits;
+};
+
+#define LDBL_NBIT 0
+#define LDBL_IMPLICIT_NBIT
+#define mask_nbit_l(u) ((void)0)
+
+#define LDBL_MANH_SIZE 20
+#define LDBL_MANL_SIZE 32
+
+#define LDBL_TO_ARRAY32(u, a) do { \
+ (a)[0] = (uint32_t)(u).bits.manl; \
+ (a)[1] = (uint32_t)(u).bits.manh; \
+} while(0)
+
+/*
+ * TODO: Due to compiler problem we are temporary using
+ * LDBL_PREC == 53. Use code below for LDBL_PREC == 113
+ */
+#if 0
+#define LDBL_MANH_SIZE 48
+#define LDBL_MANL_SIZE 64
+
+#define LDBL_TO_ARRAY32(u, a) do { \
+ (a)[0] = (uint32_t)(u).bits.manl; \
+ (a)[1] = (uint32_t)((u).bits.manl >> 32); \
+ (a)[2] = (uint32_t)(u).bits.manh; \
+ (a)[3] = (uint32_t)((u).bits.manh >> 32); \
+} while(0)
+#endif
diff --git a/newlib/libc/machine/sparc64/machine/_fpmath.h b/newlib/libc/machine/sparc64/machine/_fpmath.h
new file mode 100644
index 000000000..847411572
--- /dev/null
+++ b/newlib/libc/machine/sparc64/machine/_fpmath.h
@@ -0,0 +1,59 @@
+/*-
+ * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
+ *
+ * Copyright (c) 2003 Mike Barcroft <mike@FreeBSD.org>
+ * Copyright (c) 2002, 2003 David Schultz <das@FreeBSD.ORG>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * $FreeBSD$
+ */
+
+union IEEEl2bits {
+ long double e;
+ struct {
+ unsigned int sign :1;
+ unsigned int exp :15;
+ unsigned long manh :48;
+ unsigned long manl :64;
+ } bits;
+ struct {
+ unsigned int expsign :16;
+ unsigned long manh :48;
+ unsigned long manl :64;
+ } xbits;
+};
+
+#define mask_nbit_l(u) ((void)0)
+#define LDBL_IMPLICIT_NBIT
+#define LDBL_NBIT 0
+
+#define LDBL_MANH_SIZE 48
+#define LDBL_MANL_SIZE 64
+
+#define LDBL_TO_ARRAY32(u, a) do { \
+ (a)[0] = (uint32_t)(u).bits.manl; \
+ (a)[1] = (uint32_t)((u).bits.manl >> 32); \
+ (a)[2] = (uint32_t)(u).bits.manh; \
+ (a)[3] = (uint32_t)((u).bits.manh >> 32); \
+} while(0)
diff --git a/newlib/libc/machine/x86_64/machine/_fpmath.h b/newlib/libc/machine/x86_64/machine/_fpmath.h
new file mode 100644
index 000000000..8be7b7dba
--- /dev/null
+++ b/newlib/libc/machine/x86_64/machine/_fpmath.h
@@ -0,0 +1,57 @@
+/*-
+ * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
+ *
+ * Copyright (c) 2002, 2003 David Schultz <das@FreeBSD.ORG>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * $FreeBSD$
+ */
+
+union IEEEl2bits {
+ long double e;
+ struct {
+ unsigned int manl :32;
+ unsigned int manh :32;
+ unsigned int exp :15;
+ unsigned int sign :1;
+ unsigned int junkl :16;
+ unsigned int junkh :32;
+ } bits;
+ struct {
+ unsigned long man :64;
+ unsigned int expsign :16;
+ unsigned long junk :48;
+ } xbits;
+};
+
+#define LDBL_NBIT 0x80000000
+#define mask_nbit_l(u) ((u).bits.manh &= ~LDBL_NBIT)
+
+#define LDBL_MANH_SIZE 32
+#define LDBL_MANL_SIZE 32
+
+#define LDBL_TO_ARRAY32(u, a) do { \
+ (a)[0] = (uint32_t)(u).bits.manl; \
+ (a)[1] = (uint32_t)(u).bits.manh; \
+} while (0)
diff --git a/newlib/libm/common/Makefile.inc b/newlib/libm/common/Makefile.inc
index 8b54acab6..d08b8b21a 100644
--- a/newlib/libm/common/Makefile.inc
+++ b/newlib/libm/common/Makefile.inc
@@ -65,18 +65,28 @@
%D%/expl.c %D%/ldexpl.c %D%/logl.c %D%/log10l.c %D%/powl.c %D%/sqrtl.c %D%/fmodl.c %D%/hypotl.c \
%D%/copysignl.c %D%/nanl.c %D%/ilogbl.c %D%/asinhl.c %D%/cbrtl.c %D%/nextafterl.c %D%/rintl.c \
%D%/scalbnl.c %D%/exp2l.c %D%/scalblnl.c %D%/tgammal.c %D%/nearbyintl.c %D%/lrintl.c %D%/llrintl.c \
- %D%/roundl.c %D%/lroundl.c %D%/llroundl.c %D%/truncl.c %D%/remquol.c %D%/fdiml.c %D%/fmaxl.c %D%/fminl.c \
+ %D%/roundl.c %D%/lroundl.c %D%/llroundl.c %D%/remquol.c %D%/fdiml.c %D%/fmaxl.c %D%/fminl.c \
%D%/fmal.c %D%/acoshl.c %D%/atanhl.c %D%/remainderl.c %D%/lgammal.c %D%/erfl.c %D%/erfcl.c \
%D%/logbl.c %D%/nexttowardf.c %D%/nexttoward.c %D%/nexttowardl.c %D%/log2l.c \
%D%/sl_finite.c
+%C%_ldbl_eq_dbl_src = %D%/ldbl_eq_dbl/s_truncl.c
+
+%C%_ldbl_src = %D%/ldbl/s_truncl.c
+
libm_a_CFLAGS_%C% = -fbuiltin -fno-math-errno
libm_a_SOURCES += $(%C%_src) $(%C%_fsrc)
if HAVE_LONG_DOUBLE
-libm_a_SOURCES += $(%C%_lsrc)
+ libm_a_SOURCES += $(%C%_lsrc)
endif # HAVE_LONG_DOUBLE
+if HAVE_FPMATH_H
+ libm_a_SOURCES += $(%C%_ldbl_src)
+else
+ libm_a_SOURCES += $(%C%_ldbl_eq_dbl_src)
+endif # HAVE_FPMATH_H
+
LIBM_CHEWOUT_FILES += \
%D%/s_cbrt.def %D%/s_copysign.def %D%/s_exp10.def %D%/s_expm1.def %D%/s_ilogb.def \
%D%/s_infinity.def %D%/s_isnan.def %D%/s_log1p.def %D%/s_modf.def \
diff --git a/newlib/libm/common/ldbl/fpmath.h b/newlib/libm/common/ldbl/fpmath.h
new file mode 100644
index 000000000..690f94eaf
--- /dev/null
+++ b/newlib/libm/common/ldbl/fpmath.h
@@ -0,0 +1,82 @@
+/*-
+ * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
+ *
+ * Copyright (c) 2003 Mike Barcroft <mike@FreeBSD.org>
+ * Copyright (c) 2002 David Schultz <das@FreeBSD.ORG>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * $FreeBSD$
+ */
+
+#ifndef _FPMATH_H_
+#define _FPMATH_H_
+
+#include "sys/endian.h"
+#include "machine/_fpmath.h" /* changed to machine for newlib */
+
+#ifndef _IEEE_WORD_ORDER
+#define _IEEE_WORD_ORDER _BYTE_ORDER
+#endif
+
+union IEEEf2bits {
+ float f;
+ struct {
+#if _BYTE_ORDER == _LITTLE_ENDIAN
+ unsigned int man :23;
+ unsigned int exp :8;
+ unsigned int sign :1;
+#else /* _BIG_ENDIAN */
+ unsigned int sign :1;
+ unsigned int exp :8;
+ unsigned int man :23;
+#endif
+ } bits;
+};
+
+#define DBL_MANH_SIZE 20
+#define DBL_MANL_SIZE 32
+
+union IEEEd2bits {
+ double d;
+ struct {
+#if _BYTE_ORDER == _LITTLE_ENDIAN
+#if _IEEE_WORD_ORDER == _LITTLE_ENDIAN
+ unsigned int manl :32;
+#endif
+ unsigned int manh :20;
+ unsigned int exp :11;
+ unsigned int sign :1;
+#if _IEEE_WORD_ORDER == _BIG_ENDIAN
+ unsigned int manl :32;
+#endif
+#else /* _BIG_ENDIAN */
+ unsigned int sign :1;
+ unsigned int exp :11;
+ unsigned int manh :20;
+ unsigned int manl :32;
+#endif
+ } bits;
+};
+
+#endif /* !_FPMATH_H */
diff --git a/newlib/libm/common/ldbl/s_truncl.c b/newlib/libm/common/ldbl/s_truncl.c
new file mode 100644
index 000000000..9e2b51132
--- /dev/null
+++ b/newlib/libm/common/ldbl/s_truncl.c
@@ -0,0 +1,68 @@
+/*
+ * ====================================================
+ * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
+ *
+ * Developed at SunPro, a Sun Microsystems, Inc. business.
+ * Permission to use, copy, modify, and distribute this
+ * software is freely granted, provided that this notice
+ * is preserved.
+ * ====================================================
+ *
+ * From: @(#)s_floor.c 5.1 93/09/24
+ */
+
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
+
+/*
+ * truncl(x)
+ * Return x rounded toward 0 to integral value
+ * Method:
+ * Bit twiddling.
+ * Exception:
+ * Inexact flag raised if x not equal to truncl(x).
+ */
+
+#include <float.h>
+#include <math.h>
+#include <stdint.h>
+
+#include "fpmath.h"
+
+#ifdef LDBL_IMPLICIT_NBIT
+#define MANH_SIZE (LDBL_MANH_SIZE + 1)
+#else
+#define MANH_SIZE LDBL_MANH_SIZE
+#endif
+
+static const long double huge = 1.0e300;
+static const float zero[] = { 0.0, -0.0 };
+
+long double
+truncl(long double x)
+{
+ union IEEEl2bits u = { .e = x };
+ int e = u.bits.exp - LDBL_MAX_EXP + 1;
+
+ if (e < MANH_SIZE - 1) {
+ if (e < 0) { /* raise inexact if x != 0 */
+ if (huge + x > 0.0)
+ u.e = zero[u.bits.sign];
+ } else {
+ uint64_t m = ((1llu << MANH_SIZE) - 1) >> (e + 1);
+ if (((u.bits.manh & m) | u.bits.manl) == 0)
+ return (x); /* x is integral */
+ if (huge + x > 0.0) { /* raise inexact flag */
+ u.bits.manh &= ~m;
+ u.bits.manl = 0;
+ }
+ }
+ } else if (e < LDBL_MANT_DIG - 1) {
+ uint64_t m = (uint64_t)-1 >> (64 - LDBL_MANT_DIG + e + 1);
+ if ((u.bits.manl & m) == 0)
+ return (x); /* x is integral */
+ if (huge + x > 0.0) /* raise inexact flag */
+ u.bits.manl &= ~m;
+ }
+ return (u.e);
+}
diff --git a/newlib/libm/common/truncl.c b/newlib/libm/common/ldbl_eq_dbl/s_truncl.c
similarity index 100%
rename from newlib/libm/common/truncl.c
rename to newlib/libm/common/ldbl_eq_dbl/s_truncl.c
--
2.24.4
^ permalink raw reply [flat|nested] 14+ messages in thread
* [PATCH newlib v1 2/4] Makefile.in and configure: Regenerated
2022-08-22 22:50 [PATCH newlib v1 0/4] Add FreeBSD long double functions Joel Sherrill
2022-08-22 22:50 ` [PATCH newlib v1 1/4] Add infrastructure for incorporating FreeBSD long double methods Joel Sherrill
@ 2022-08-22 22:50 ` Joel Sherrill
2022-08-22 22:50 ` [PATCH newlib v1 3/4] Split libm/common/frexpl.c into LDBL_EQ_DBL and long double versions Joel Sherrill
` (2 subsequent siblings)
4 siblings, 0 replies; 14+ messages in thread
From: Joel Sherrill @ 2022-08-22 22:50 UTC (permalink / raw)
To: newlib
---
newlib/Makefile.in | 196 ++++++++++++++++++++++++++++-----------------
newlib/configure | 15 ++++
2 files changed, 136 insertions(+), 75 deletions(-)
diff --git a/newlib/Makefile.in b/newlib/Makefile.in
index f26d99ae9..5fba39a42 100644
--- a/newlib/Makefile.in
+++ b/newlib/Makefile.in
@@ -910,19 +910,21 @@ check_PROGRAMS =
@NEWLIB_HW_FP_FALSE@am__append_137 = libm/math/math.tex
@HAVE_LONG_DOUBLE_TRUE@am__append_138 = $(libm_common_lsrc)
-@HAVE_LIBM_MACHINE_AARCH64_TRUE@am__append_139 = $(libm_machine_aarch64_src)
-@HAVE_LIBM_MACHINE_ARM_TRUE@am__append_140 = $(libm_machine_arm_src)
-@HAVE_LIBM_MACHINE_I386_TRUE@am__append_141 = $(libm_machine_i386_src)
-@HAVE_LIBM_MACHINE_MIPS_TRUE@am__append_142 = $(libm_machine_mips_src)
-@HAS_NDS32_FPU_SP_TRUE@@HAVE_LIBM_MACHINE_NDS32_TRUE@am__append_143 = libm/machine/nds32/wf_sqrt.S
-@HAS_NDS32_FPU_DP_TRUE@@HAVE_LIBM_MACHINE_NDS32_TRUE@am__append_144 = libm/machine/nds32/w_sqrt.S
-@HAVE_LIBM_MACHINE_NDS32_TRUE@am__append_145 = $(libm_machine_nds32_src)
-@HAVE_LIBM_MACHINE_POWERPC_TRUE@am__append_146 = $(libm_machine_powerpc_src)
-@HAVE_LIBM_MACHINE_PRU_TRUE@am__append_147 = $(libm_machine_pru_src)
-@HAVE_LIBM_MACHINE_SPARC_TRUE@am__append_148 = $(libm_machine_sparc_src)
-@HAVE_LIBM_MACHINE_SPU_TRUE@am__append_149 = $(libm_machine_spu_src)
-@HAVE_LIBM_MACHINE_RISCV_TRUE@am__append_150 = $(libm_machine_riscv_src)
-@HAVE_LIBM_MACHINE_X86_64_TRUE@am__append_151 = $(libm_machine_x86_64_src)
+@HAVE_FPMATH_H_TRUE@am__append_139 = $(libm_common_ldbl_src)
+@HAVE_FPMATH_H_FALSE@am__append_140 = $(libm_common_ldbl_eq_dbl_src)
+@HAVE_LIBM_MACHINE_AARCH64_TRUE@am__append_141 = $(libm_machine_aarch64_src)
+@HAVE_LIBM_MACHINE_ARM_TRUE@am__append_142 = $(libm_machine_arm_src)
+@HAVE_LIBM_MACHINE_I386_TRUE@am__append_143 = $(libm_machine_i386_src)
+@HAVE_LIBM_MACHINE_MIPS_TRUE@am__append_144 = $(libm_machine_mips_src)
+@HAS_NDS32_FPU_SP_TRUE@@HAVE_LIBM_MACHINE_NDS32_TRUE@am__append_145 = libm/machine/nds32/wf_sqrt.S
+@HAS_NDS32_FPU_DP_TRUE@@HAVE_LIBM_MACHINE_NDS32_TRUE@am__append_146 = libm/machine/nds32/w_sqrt.S
+@HAVE_LIBM_MACHINE_NDS32_TRUE@am__append_147 = $(libm_machine_nds32_src)
+@HAVE_LIBM_MACHINE_POWERPC_TRUE@am__append_148 = $(libm_machine_powerpc_src)
+@HAVE_LIBM_MACHINE_PRU_TRUE@am__append_149 = $(libm_machine_pru_src)
+@HAVE_LIBM_MACHINE_SPARC_TRUE@am__append_150 = $(libm_machine_sparc_src)
+@HAVE_LIBM_MACHINE_SPU_TRUE@am__append_151 = $(libm_machine_spu_src)
+@HAVE_LIBM_MACHINE_RISCV_TRUE@am__append_152 = $(libm_machine_riscv_src)
+@HAVE_LIBM_MACHINE_X86_64_TRUE@am__append_153 = $(libm_machine_x86_64_src)
subdir = .
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/../config/depstand.m4 \
@@ -2947,7 +2949,6 @@ am__objects_150 = libm/common/libm_a-atanl.$(OBJEXT) \
libm/common/libm_a-roundl.$(OBJEXT) \
libm/common/libm_a-lroundl.$(OBJEXT) \
libm/common/libm_a-llroundl.$(OBJEXT) \
- libm/common/libm_a-truncl.$(OBJEXT) \
libm/common/libm_a-remquol.$(OBJEXT) \
libm/common/libm_a-fdiml.$(OBJEXT) \
libm/common/libm_a-fmaxl.$(OBJEXT) \
@@ -2966,7 +2967,11 @@ am__objects_150 = libm/common/libm_a-atanl.$(OBJEXT) \
libm/common/libm_a-log2l.$(OBJEXT) \
libm/common/libm_a-sl_finite.$(OBJEXT)
@HAVE_LONG_DOUBLE_TRUE@am__objects_151 = $(am__objects_150)
-am__objects_152 = libm/complex/libm_a-cabs.$(OBJEXT) \
+am__objects_152 = libm/common/ldbl/libm_a-s_truncl.$(OBJEXT)
+@HAVE_FPMATH_H_TRUE@am__objects_153 = $(am__objects_152)
+am__objects_154 = libm/common/ldbl_eq_dbl/libm_a-s_truncl.$(OBJEXT)
+@HAVE_FPMATH_H_FALSE@am__objects_155 = $(am__objects_154)
+am__objects_156 = libm/complex/libm_a-cabs.$(OBJEXT) \
libm/complex/libm_a-cacos.$(OBJEXT) \
libm/complex/libm_a-cacosh.$(OBJEXT) \
libm/complex/libm_a-carg.$(OBJEXT) \
@@ -2990,7 +2995,7 @@ am__objects_152 = libm/complex/libm_a-cabs.$(OBJEXT) \
libm/complex/libm_a-csqrt.$(OBJEXT) \
libm/complex/libm_a-ctan.$(OBJEXT) \
libm/complex/libm_a-ctanh.$(OBJEXT)
-am__objects_153 = libm/complex/libm_a-cabsf.$(OBJEXT) \
+am__objects_157 = libm/complex/libm_a-cabsf.$(OBJEXT) \
libm/complex/libm_a-casinf.$(OBJEXT) \
libm/complex/libm_a-ccosf.$(OBJEXT) \
libm/complex/libm_a-cimagf.$(OBJEXT) \
@@ -3014,7 +3019,7 @@ am__objects_153 = libm/complex/libm_a-cabsf.$(OBJEXT) \
libm/complex/libm_a-cexpf.$(OBJEXT) \
libm/complex/libm_a-cpowf.$(OBJEXT) \
libm/complex/libm_a-csinhf.$(OBJEXT)
-am__objects_154 = libm/complex/libm_a-cabsl.$(OBJEXT) \
+am__objects_158 = libm/complex/libm_a-cabsl.$(OBJEXT) \
libm/complex/libm_a-creall.$(OBJEXT) \
libm/complex/libm_a-cimagl.$(OBJEXT) \
libm/complex/libm_a-ccoshl.$(OBJEXT) \
@@ -3037,7 +3042,7 @@ am__objects_154 = libm/complex/libm_a-cabsl.$(OBJEXT) \
libm/complex/libm_a-csinhl.$(OBJEXT) \
libm/complex/libm_a-csinl.$(OBJEXT) \
libm/complex/libm_a-catanl.$(OBJEXT)
-am__objects_155 = libm/fenv/libm_a-feclearexcept.$(OBJEXT) \
+am__objects_159 = libm/fenv/libm_a-feclearexcept.$(OBJEXT) \
libm/fenv/libm_a-fe_dfl_env.$(OBJEXT) \
libm/fenv/libm_a-fegetenv.$(OBJEXT) \
libm/fenv/libm_a-fegetexceptflag.$(OBJEXT) \
@@ -3049,7 +3054,7 @@ am__objects_155 = libm/fenv/libm_a-feclearexcept.$(OBJEXT) \
libm/fenv/libm_a-fesetround.$(OBJEXT) \
libm/fenv/libm_a-fetestexcept.$(OBJEXT) \
libm/fenv/libm_a-feupdateenv.$(OBJEXT)
-@HAVE_LIBM_MACHINE_AARCH64_TRUE@am__objects_156 = libm/machine/aarch64/libm_a-e_sqrt.$(OBJEXT) \
+@HAVE_LIBM_MACHINE_AARCH64_TRUE@am__objects_160 = libm/machine/aarch64/libm_a-e_sqrt.$(OBJEXT) \
@HAVE_LIBM_MACHINE_AARCH64_TRUE@ libm/machine/aarch64/libm_a-ef_sqrt.$(OBJEXT) \
@HAVE_LIBM_MACHINE_AARCH64_TRUE@ libm/machine/aarch64/libm_a-s_ceil.$(OBJEXT) \
@HAVE_LIBM_MACHINE_AARCH64_TRUE@ libm/machine/aarch64/libm_a-s_fabs.$(OBJEXT) \
@@ -3091,8 +3096,8 @@ am__objects_155 = libm/fenv/libm_a-feclearexcept.$(OBJEXT) \
@HAVE_LIBM_MACHINE_AARCH64_TRUE@ libm/machine/aarch64/libm_a-fesetround.$(OBJEXT) \
@HAVE_LIBM_MACHINE_AARCH64_TRUE@ libm/machine/aarch64/libm_a-fetestexcept.$(OBJEXT) \
@HAVE_LIBM_MACHINE_AARCH64_TRUE@ libm/machine/aarch64/libm_a-feupdateenv.$(OBJEXT)
-@HAVE_LIBM_MACHINE_AARCH64_TRUE@am__objects_157 = $(am__objects_156)
-@HAVE_LIBM_MACHINE_ARM_TRUE@am__objects_158 = libm/machine/arm/libm_a-e_sqrt.$(OBJEXT) \
+@HAVE_LIBM_MACHINE_AARCH64_TRUE@am__objects_161 = $(am__objects_160)
+@HAVE_LIBM_MACHINE_ARM_TRUE@am__objects_162 = libm/machine/arm/libm_a-e_sqrt.$(OBJEXT) \
@HAVE_LIBM_MACHINE_ARM_TRUE@ libm/machine/arm/libm_a-ef_sqrt.$(OBJEXT) \
@HAVE_LIBM_MACHINE_ARM_TRUE@ libm/machine/arm/libm_a-s_ceil.$(OBJEXT) \
@HAVE_LIBM_MACHINE_ARM_TRUE@ libm/machine/arm/libm_a-s_floor.$(OBJEXT) \
@@ -3123,8 +3128,8 @@ am__objects_155 = libm/fenv/libm_a-feclearexcept.$(OBJEXT) \
@HAVE_LIBM_MACHINE_ARM_TRUE@ libm/machine/arm/libm_a-feupdateenv.$(OBJEXT) \
@HAVE_LIBM_MACHINE_ARM_TRUE@ libm/machine/arm/libm_a-feenableexcept.$(OBJEXT) \
@HAVE_LIBM_MACHINE_ARM_TRUE@ libm/machine/arm/libm_a-fedisableexcept.$(OBJEXT)
-@HAVE_LIBM_MACHINE_ARM_TRUE@am__objects_159 = $(am__objects_158)
-@HAVE_LIBM_MACHINE_I386_TRUE@am__objects_160 = libm/machine/i386/libm_a-f_atan2.$(OBJEXT) \
+@HAVE_LIBM_MACHINE_ARM_TRUE@am__objects_163 = $(am__objects_162)
+@HAVE_LIBM_MACHINE_I386_TRUE@am__objects_164 = libm/machine/i386/libm_a-f_atan2.$(OBJEXT) \
@HAVE_LIBM_MACHINE_I386_TRUE@ libm/machine/i386/libm_a-f_atan2f.$(OBJEXT) \
@HAVE_LIBM_MACHINE_I386_TRUE@ libm/machine/i386/libm_a-f_exp.$(OBJEXT) \
@HAVE_LIBM_MACHINE_I386_TRUE@ libm/machine/i386/libm_a-f_expf.$(OBJEXT) \
@@ -3161,8 +3166,8 @@ am__objects_155 = libm/fenv/libm_a-feclearexcept.$(OBJEXT) \
@HAVE_LIBM_MACHINE_I386_TRUE@ libm/machine/i386/libm_a-fesetround.$(OBJEXT) \
@HAVE_LIBM_MACHINE_I386_TRUE@ libm/machine/i386/libm_a-fetestexcept.$(OBJEXT) \
@HAVE_LIBM_MACHINE_I386_TRUE@ libm/machine/i386/libm_a-feupdateenv.$(OBJEXT)
-@HAVE_LIBM_MACHINE_I386_TRUE@am__objects_161 = $(am__objects_160)
-@HAVE_LIBM_MACHINE_MIPS_TRUE@am__objects_162 = libm/machine/mips/libm_a-feclearexcept.$(OBJEXT) \
+@HAVE_LIBM_MACHINE_I386_TRUE@am__objects_165 = $(am__objects_164)
+@HAVE_LIBM_MACHINE_MIPS_TRUE@am__objects_166 = libm/machine/mips/libm_a-feclearexcept.$(OBJEXT) \
@HAVE_LIBM_MACHINE_MIPS_TRUE@ libm/machine/mips/libm_a-fegetenv.$(OBJEXT) \
@HAVE_LIBM_MACHINE_MIPS_TRUE@ libm/machine/mips/libm_a-fegetexceptflag.$(OBJEXT) \
@HAVE_LIBM_MACHINE_MIPS_TRUE@ libm/machine/mips/libm_a-fegetround.$(OBJEXT) \
@@ -3174,13 +3179,13 @@ am__objects_155 = libm/fenv/libm_a-feclearexcept.$(OBJEXT) \
@HAVE_LIBM_MACHINE_MIPS_TRUE@ libm/machine/mips/libm_a-fetestexcept.$(OBJEXT) \
@HAVE_LIBM_MACHINE_MIPS_TRUE@ libm/machine/mips/libm_a-feupdateenv.$(OBJEXT) \
@HAVE_LIBM_MACHINE_MIPS_TRUE@ libm/machine/mips/libm_a-fenv.$(OBJEXT)
-@HAVE_LIBM_MACHINE_MIPS_TRUE@am__objects_163 = $(am__objects_162)
-@HAS_NDS32_FPU_SP_TRUE@@HAVE_LIBM_MACHINE_NDS32_TRUE@am__objects_164 = libm/machine/nds32/libm_a-wf_sqrt.$(OBJEXT)
-@HAS_NDS32_FPU_DP_TRUE@@HAVE_LIBM_MACHINE_NDS32_TRUE@am__objects_165 = libm/machine/nds32/libm_a-w_sqrt.$(OBJEXT)
-@HAVE_LIBM_MACHINE_NDS32_TRUE@am__objects_166 = $(am__objects_164) \
-@HAVE_LIBM_MACHINE_NDS32_TRUE@ $(am__objects_165)
-@HAVE_LIBM_MACHINE_NDS32_TRUE@am__objects_167 = $(am__objects_166)
-@HAVE_LIBM_MACHINE_POWERPC_TRUE@am__objects_168 = libm/machine/powerpc/libm_a-feclearexcept.$(OBJEXT) \
+@HAVE_LIBM_MACHINE_MIPS_TRUE@am__objects_167 = $(am__objects_166)
+@HAS_NDS32_FPU_SP_TRUE@@HAVE_LIBM_MACHINE_NDS32_TRUE@am__objects_168 = libm/machine/nds32/libm_a-wf_sqrt.$(OBJEXT)
+@HAS_NDS32_FPU_DP_TRUE@@HAVE_LIBM_MACHINE_NDS32_TRUE@am__objects_169 = libm/machine/nds32/libm_a-w_sqrt.$(OBJEXT)
+@HAVE_LIBM_MACHINE_NDS32_TRUE@am__objects_170 = $(am__objects_168) \
+@HAVE_LIBM_MACHINE_NDS32_TRUE@ $(am__objects_169)
+@HAVE_LIBM_MACHINE_NDS32_TRUE@am__objects_171 = $(am__objects_170)
+@HAVE_LIBM_MACHINE_POWERPC_TRUE@am__objects_172 = libm/machine/powerpc/libm_a-feclearexcept.$(OBJEXT) \
@HAVE_LIBM_MACHINE_POWERPC_TRUE@ libm/machine/powerpc/libm_a-fegetenv.$(OBJEXT) \
@HAVE_LIBM_MACHINE_POWERPC_TRUE@ libm/machine/powerpc/libm_a-fegetexceptflag.$(OBJEXT) \
@HAVE_LIBM_MACHINE_POWERPC_TRUE@ libm/machine/powerpc/libm_a-fegetround.$(OBJEXT) \
@@ -3192,8 +3197,8 @@ am__objects_155 = libm/fenv/libm_a-feclearexcept.$(OBJEXT) \
@HAVE_LIBM_MACHINE_POWERPC_TRUE@ libm/machine/powerpc/libm_a-fesetround.$(OBJEXT) \
@HAVE_LIBM_MACHINE_POWERPC_TRUE@ libm/machine/powerpc/libm_a-fetestexcept.$(OBJEXT) \
@HAVE_LIBM_MACHINE_POWERPC_TRUE@ libm/machine/powerpc/libm_a-feupdateenv.$(OBJEXT)
-@HAVE_LIBM_MACHINE_POWERPC_TRUE@am__objects_169 = $(am__objects_168)
-@HAVE_LIBM_MACHINE_PRU_TRUE@am__objects_170 = libm/machine/pru/libm_a-fpclassify.$(OBJEXT) \
+@HAVE_LIBM_MACHINE_POWERPC_TRUE@am__objects_173 = $(am__objects_172)
+@HAVE_LIBM_MACHINE_PRU_TRUE@am__objects_174 = libm/machine/pru/libm_a-fpclassify.$(OBJEXT) \
@HAVE_LIBM_MACHINE_PRU_TRUE@ libm/machine/pru/libm_a-fpclassifyf.$(OBJEXT) \
@HAVE_LIBM_MACHINE_PRU_TRUE@ libm/machine/pru/libm_a-isfinite.$(OBJEXT) \
@HAVE_LIBM_MACHINE_PRU_TRUE@ libm/machine/pru/libm_a-isfinitef.$(OBJEXT) \
@@ -3203,8 +3208,8 @@ am__objects_155 = libm/fenv/libm_a-feclearexcept.$(OBJEXT) \
@HAVE_LIBM_MACHINE_PRU_TRUE@ libm/machine/pru/libm_a-isnanf.$(OBJEXT) \
@HAVE_LIBM_MACHINE_PRU_TRUE@ libm/machine/pru/libm_a-isnormal.$(OBJEXT) \
@HAVE_LIBM_MACHINE_PRU_TRUE@ libm/machine/pru/libm_a-isnormalf.$(OBJEXT)
-@HAVE_LIBM_MACHINE_PRU_TRUE@am__objects_171 = $(am__objects_170)
-@HAVE_LIBM_MACHINE_SPARC_TRUE@am__objects_172 = libm/machine/sparc/libm_a-feclearexcept.$(OBJEXT) \
+@HAVE_LIBM_MACHINE_PRU_TRUE@am__objects_175 = $(am__objects_174)
+@HAVE_LIBM_MACHINE_SPARC_TRUE@am__objects_176 = libm/machine/sparc/libm_a-feclearexcept.$(OBJEXT) \
@HAVE_LIBM_MACHINE_SPARC_TRUE@ libm/machine/sparc/libm_a-fegetenv.$(OBJEXT) \
@HAVE_LIBM_MACHINE_SPARC_TRUE@ libm/machine/sparc/libm_a-fegetexceptflag.$(OBJEXT) \
@HAVE_LIBM_MACHINE_SPARC_TRUE@ libm/machine/sparc/libm_a-fegetround.$(OBJEXT) \
@@ -3216,8 +3221,8 @@ am__objects_155 = libm/fenv/libm_a-feclearexcept.$(OBJEXT) \
@HAVE_LIBM_MACHINE_SPARC_TRUE@ libm/machine/sparc/libm_a-fetestexcept.$(OBJEXT) \
@HAVE_LIBM_MACHINE_SPARC_TRUE@ libm/machine/sparc/libm_a-feupdateenv.$(OBJEXT) \
@HAVE_LIBM_MACHINE_SPARC_TRUE@ libm/machine/sparc/libm_a-fenv.$(OBJEXT)
-@HAVE_LIBM_MACHINE_SPARC_TRUE@am__objects_173 = $(am__objects_172)
-@HAVE_LIBM_MACHINE_SPU_TRUE@am__objects_174 = libm/machine/spu/libm_a-feclearexcept.$(OBJEXT) \
+@HAVE_LIBM_MACHINE_SPARC_TRUE@am__objects_177 = $(am__objects_176)
+@HAVE_LIBM_MACHINE_SPU_TRUE@am__objects_178 = libm/machine/spu/libm_a-feclearexcept.$(OBJEXT) \
@HAVE_LIBM_MACHINE_SPU_TRUE@ libm/machine/spu/libm_a-fe_dfl_env.$(OBJEXT) \
@HAVE_LIBM_MACHINE_SPU_TRUE@ libm/machine/spu/libm_a-fegetenv.$(OBJEXT) \
@HAVE_LIBM_MACHINE_SPU_TRUE@ libm/machine/spu/libm_a-fegetexceptflag.$(OBJEXT) \
@@ -3342,8 +3347,8 @@ am__objects_155 = libm/fenv/libm_a-feclearexcept.$(OBJEXT) \
@HAVE_LIBM_MACHINE_SPU_TRUE@ libm/machine/spu/libm_a-w_sinh.$(OBJEXT) \
@HAVE_LIBM_MACHINE_SPU_TRUE@ libm/machine/spu/libm_a-w_sqrt.$(OBJEXT) \
@HAVE_LIBM_MACHINE_SPU_TRUE@ libm/machine/spu/libm_a-w_tgamma.$(OBJEXT)
-@HAVE_LIBM_MACHINE_SPU_TRUE@am__objects_175 = $(am__objects_174)
-@HAVE_LIBM_MACHINE_RISCV_TRUE@am__objects_176 = libm/machine/riscv/libm_a-feclearexcept.$(OBJEXT) \
+@HAVE_LIBM_MACHINE_SPU_TRUE@am__objects_179 = $(am__objects_178)
+@HAVE_LIBM_MACHINE_RISCV_TRUE@am__objects_180 = libm/machine/riscv/libm_a-feclearexcept.$(OBJEXT) \
@HAVE_LIBM_MACHINE_RISCV_TRUE@ libm/machine/riscv/libm_a-fe_dfl_env.$(OBJEXT) \
@HAVE_LIBM_MACHINE_RISCV_TRUE@ libm/machine/riscv/libm_a-fegetenv.$(OBJEXT) \
@HAVE_LIBM_MACHINE_RISCV_TRUE@ libm/machine/riscv/libm_a-fegetexceptflag.$(OBJEXT) \
@@ -3383,8 +3388,8 @@ am__objects_155 = libm/fenv/libm_a-feclearexcept.$(OBJEXT) \
@HAVE_LIBM_MACHINE_RISCV_TRUE@ libm/machine/riscv/libm_a-sf_llrint.$(OBJEXT) \
@HAVE_LIBM_MACHINE_RISCV_TRUE@ libm/machine/riscv/libm_a-s_llround.$(OBJEXT) \
@HAVE_LIBM_MACHINE_RISCV_TRUE@ libm/machine/riscv/libm_a-sf_llround.$(OBJEXT)
-@HAVE_LIBM_MACHINE_RISCV_TRUE@am__objects_177 = $(am__objects_176)
-@HAVE_LIBM_MACHINE_X86_64_TRUE@am__objects_178 = libm/machine/x86_64/libm_a-feclearexcept.$(OBJEXT) \
+@HAVE_LIBM_MACHINE_RISCV_TRUE@am__objects_181 = $(am__objects_180)
+@HAVE_LIBM_MACHINE_X86_64_TRUE@am__objects_182 = libm/machine/x86_64/libm_a-feclearexcept.$(OBJEXT) \
@HAVE_LIBM_MACHINE_X86_64_TRUE@ libm/machine/x86_64/libm_a-fegetenv.$(OBJEXT) \
@HAVE_LIBM_MACHINE_X86_64_TRUE@ libm/machine/x86_64/libm_a-fegetexceptflag.$(OBJEXT) \
@HAVE_LIBM_MACHINE_X86_64_TRUE@ libm/machine/x86_64/libm_a-fegetround.$(OBJEXT) \
@@ -3396,14 +3401,15 @@ am__objects_155 = libm/fenv/libm_a-feclearexcept.$(OBJEXT) \
@HAVE_LIBM_MACHINE_X86_64_TRUE@ libm/machine/x86_64/libm_a-fesetround.$(OBJEXT) \
@HAVE_LIBM_MACHINE_X86_64_TRUE@ libm/machine/x86_64/libm_a-fetestexcept.$(OBJEXT) \
@HAVE_LIBM_MACHINE_X86_64_TRUE@ libm/machine/x86_64/libm_a-feupdateenv.$(OBJEXT)
-@HAVE_LIBM_MACHINE_X86_64_TRUE@am__objects_179 = $(am__objects_178)
+@HAVE_LIBM_MACHINE_X86_64_TRUE@am__objects_183 = $(am__objects_182)
am_libm_a_OBJECTS = $(am__objects_143) $(am__objects_147) \
$(am__objects_148) $(am__objects_149) $(am__objects_151) \
- $(am__objects_152) $(am__objects_153) $(am__objects_154) \
- $(am__objects_155) $(am__objects_157) $(am__objects_159) \
- $(am__objects_161) $(am__objects_163) $(am__objects_167) \
- $(am__objects_169) $(am__objects_171) $(am__objects_173) \
- $(am__objects_175) $(am__objects_177) $(am__objects_179)
+ $(am__objects_153) $(am__objects_155) $(am__objects_156) \
+ $(am__objects_157) $(am__objects_158) $(am__objects_159) \
+ $(am__objects_161) $(am__objects_163) $(am__objects_165) \
+ $(am__objects_167) $(am__objects_171) $(am__objects_173) \
+ $(am__objects_175) $(am__objects_177) $(am__objects_179) \
+ $(am__objects_181) $(am__objects_183)
libm_a_OBJECTS = $(am_libm_a_OBJECTS)
am_libm_test_test_OBJECTS = libm/test/test.$(OBJEXT) \
libm/test/string.$(OBJEXT) libm/test/convert.$(OBJEXT) \
@@ -3950,11 +3956,12 @@ libc_a_CPPFLAGS = $(AM_CPPFLAGS) $(libc_a_CPPFLAGS_$(subst /,_,$(@D))) $(libc_a_
libc_a_DEPENDENCIES = stamp-libc-math-objects
libm_a_SOURCES = $(am__append_132) $(am__append_135) \
$(libm_common_src) $(libm_common_fsrc) $(am__append_138) \
- $(libm_complex_src) $(libm_complex_fsrc) $(libm_complex_lsrc) \
- $(libm_fenv_src) $(am__append_139) $(am__append_140) \
- $(am__append_141) $(am__append_142) $(am__append_145) \
- $(am__append_146) $(am__append_147) $(am__append_148) \
- $(am__append_149) $(am__append_150) $(am__append_151)
+ $(am__append_139) $(am__append_140) $(libm_complex_src) \
+ $(libm_complex_fsrc) $(libm_complex_lsrc) $(libm_fenv_src) \
+ $(am__append_141) $(am__append_142) $(am__append_143) \
+ $(am__append_144) $(am__append_147) $(am__append_148) \
+ $(am__append_149) $(am__append_150) $(am__append_151) \
+ $(am__append_152) $(am__append_153)
libm_a_CFLAGS = $(AM_CFLAGS) $(libm_a_CFLAGS_$(subst /,_,$(@D))) $(libm_a_CFLAGS_$(subst /,_,$(@D)_$(<F)))
libm_a_CCASFLAGS = $(AM_CCASFLAGS) $(libm_a_CCASFLAGS_$(subst /,_,$(@D))) $(libm_a_CCASFLAGS_$(subst /,_,$(@D)_$(<F)))
libm_a_CPPFLAGS = $(AM_CPPFLAGS) -I$(srcdir)/libm/common $(libm_a_CPPFLAGS_$(subst /,_,$(@D))) $(libm_a_CPPFLAGS_$(subst /,_,$(@D)_$(<F)))
@@ -4576,11 +4583,13 @@ libm_common_lsrc = \
libm/common/expl.c libm/common/ldexpl.c libm/common/logl.c libm/common/log10l.c libm/common/powl.c libm/common/sqrtl.c libm/common/fmodl.c libm/common/hypotl.c \
libm/common/copysignl.c libm/common/nanl.c libm/common/ilogbl.c libm/common/asinhl.c libm/common/cbrtl.c libm/common/nextafterl.c libm/common/rintl.c \
libm/common/scalbnl.c libm/common/exp2l.c libm/common/scalblnl.c libm/common/tgammal.c libm/common/nearbyintl.c libm/common/lrintl.c libm/common/llrintl.c \
- libm/common/roundl.c libm/common/lroundl.c libm/common/llroundl.c libm/common/truncl.c libm/common/remquol.c libm/common/fdiml.c libm/common/fmaxl.c libm/common/fminl.c \
+ libm/common/roundl.c libm/common/lroundl.c libm/common/llroundl.c libm/common/remquol.c libm/common/fdiml.c libm/common/fmaxl.c libm/common/fminl.c \
libm/common/fmal.c libm/common/acoshl.c libm/common/atanhl.c libm/common/remainderl.c libm/common/lgammal.c libm/common/erfl.c libm/common/erfcl.c \
libm/common/logbl.c libm/common/nexttowardf.c libm/common/nexttoward.c libm/common/nexttowardl.c libm/common/log2l.c \
libm/common/sl_finite.c
+libm_common_ldbl_eq_dbl_src = libm/common/ldbl_eq_dbl/s_truncl.c
+libm_common_ldbl_src = libm/common/ldbl/s_truncl.c
libm_a_CFLAGS_libm_common = -fbuiltin -fno-math-errno
libm_complex_src = \
libm/complex/cabs.c libm/complex/cacos.c libm/complex/cacosh.c libm/complex/carg.c libm/complex/casin.c libm/complex/casinh.c \
@@ -4787,8 +4796,8 @@ libm_test_test_LDADD = $(CRT0) libm.a libc.a
# fenv.c cannot be compiled as mips16 since it uses the cfc1 instruction.
@HAVE_LIBM_MACHINE_MIPS_TRUE@libm_a_CFLAGS_libm_machine_mips_fenv.c = -mno-mips16
@HAVE_LIBM_MACHINE_NDS32_TRUE@libm_machine_nds32_src = \
-@HAVE_LIBM_MACHINE_NDS32_TRUE@ $(am__append_143) \
-@HAVE_LIBM_MACHINE_NDS32_TRUE@ $(am__append_144)
+@HAVE_LIBM_MACHINE_NDS32_TRUE@ $(am__append_145) \
+@HAVE_LIBM_MACHINE_NDS32_TRUE@ $(am__append_146)
@HAVE_LIBM_MACHINE_POWERPC_TRUE@libm_machine_powerpc_src = \
@HAVE_LIBM_MACHINE_POWERPC_TRUE@ libm/machine/powerpc/feclearexcept.c libm/machine/powerpc/fegetenv.c libm/machine/powerpc/fegetexceptflag.c \
@HAVE_LIBM_MACHINE_POWERPC_TRUE@ libm/machine/powerpc/fegetround.c libm/machine/powerpc/feholdexcept.c libm/machine/powerpc/fenv.c libm/machine/powerpc/feraiseexcept.c libm/machine/powerpc/fesetenv.c \
@@ -10057,8 +10066,6 @@ libm/common/libm_a-lroundl.$(OBJEXT): libm/common/$(am__dirstamp) \
libm/common/$(DEPDIR)/$(am__dirstamp)
libm/common/libm_a-llroundl.$(OBJEXT): libm/common/$(am__dirstamp) \
libm/common/$(DEPDIR)/$(am__dirstamp)
-libm/common/libm_a-truncl.$(OBJEXT): libm/common/$(am__dirstamp) \
- libm/common/$(DEPDIR)/$(am__dirstamp)
libm/common/libm_a-remquol.$(OBJEXT): libm/common/$(am__dirstamp) \
libm/common/$(DEPDIR)/$(am__dirstamp)
libm/common/libm_a-fdiml.$(OBJEXT): libm/common/$(am__dirstamp) \
@@ -10093,6 +10100,24 @@ libm/common/libm_a-log2l.$(OBJEXT): libm/common/$(am__dirstamp) \
libm/common/$(DEPDIR)/$(am__dirstamp)
libm/common/libm_a-sl_finite.$(OBJEXT): libm/common/$(am__dirstamp) \
libm/common/$(DEPDIR)/$(am__dirstamp)
+libm/common/ldbl/$(am__dirstamp):
+ @$(MKDIR_P) libm/common/ldbl
+ @: > libm/common/ldbl/$(am__dirstamp)
+libm/common/ldbl/$(DEPDIR)/$(am__dirstamp):
+ @$(MKDIR_P) libm/common/ldbl/$(DEPDIR)
+ @: > libm/common/ldbl/$(DEPDIR)/$(am__dirstamp)
+libm/common/ldbl/libm_a-s_truncl.$(OBJEXT): \
+ libm/common/ldbl/$(am__dirstamp) \
+ libm/common/ldbl/$(DEPDIR)/$(am__dirstamp)
+libm/common/ldbl_eq_dbl/$(am__dirstamp):
+ @$(MKDIR_P) libm/common/ldbl_eq_dbl
+ @: > libm/common/ldbl_eq_dbl/$(am__dirstamp)
+libm/common/ldbl_eq_dbl/$(DEPDIR)/$(am__dirstamp):
+ @$(MKDIR_P) libm/common/ldbl_eq_dbl/$(DEPDIR)
+ @: > libm/common/ldbl_eq_dbl/$(DEPDIR)/$(am__dirstamp)
+libm/common/ldbl_eq_dbl/libm_a-s_truncl.$(OBJEXT): \
+ libm/common/ldbl_eq_dbl/$(am__dirstamp) \
+ libm/common/ldbl_eq_dbl/$(DEPDIR)/$(am__dirstamp)
libm/complex/$(am__dirstamp):
@$(MKDIR_P) libm/complex
@: > libm/complex/$(am__dirstamp)
@@ -11619,6 +11644,8 @@ mostlyclean-compile:
-rm -f libc/unix/*.$(OBJEXT)
-rm -f libc/xdr/*.$(OBJEXT)
-rm -f libm/common/*.$(OBJEXT)
+ -rm -f libm/common/ldbl/*.$(OBJEXT)
+ -rm -f libm/common/ldbl_eq_dbl/*.$(OBJEXT)
-rm -f libm/complex/*.$(OBJEXT)
-rm -f libm/fenv/*.$(OBJEXT)
-rm -f libm/machine/aarch64/*.$(OBJEXT)
@@ -13272,7 +13299,8 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@libm/common/$(DEPDIR)/libm_a-tanhl.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@libm/common/$(DEPDIR)/libm_a-tanl.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@libm/common/$(DEPDIR)/libm_a-tgammal.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@libm/common/$(DEPDIR)/libm_a-truncl.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@libm/common/ldbl/$(DEPDIR)/libm_a-s_truncl.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@libm/common/ldbl_eq_dbl/$(DEPDIR)/libm_a-s_truncl.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@libm/complex/$(DEPDIR)/libm_a-cabs.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@libm/complex/$(DEPDIR)/libm_a-cabsf.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@libm/complex/$(DEPDIR)/libm_a-cabsl.Po@am__quote@
@@ -40042,20 +40070,6 @@ libm/common/libm_a-llroundl.obj: libm/common/llroundl.c
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libm_a_CPPFLAGS) $(CPPFLAGS) $(libm_a_CFLAGS) $(CFLAGS) -c -o libm/common/libm_a-llroundl.obj `if test -f 'libm/common/llroundl.c'; then $(CYGPATH_W) 'libm/common/llroundl.c'; else $(CYGPATH_W) '$(srcdir)/libm/common/llroundl.c'; fi`
-libm/common/libm_a-truncl.o: libm/common/truncl.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libm_a_CPPFLAGS) $(CPPFLAGS) $(libm_a_CFLAGS) $(CFLAGS) -MT libm/common/libm_a-truncl.o -MD -MP -MF libm/common/$(DEPDIR)/libm_a-truncl.Tpo -c -o libm/common/libm_a-truncl.o `test -f 'libm/common/truncl.c' || echo '$(srcdir)/'`libm/common/truncl.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) libm/common/$(DEPDIR)/libm_a-truncl.Tpo libm/common/$(DEPDIR)/libm_a-truncl.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='libm/common/truncl.c' object='libm/common/libm_a-truncl.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libm_a_CPPFLAGS) $(CPPFLAGS) $(libm_a_CFLAGS) $(CFLAGS) -c -o libm/common/libm_a-truncl.o `test -f 'libm/common/truncl.c' || echo '$(srcdir)/'`libm/common/truncl.c
-
-libm/common/libm_a-truncl.obj: libm/common/truncl.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libm_a_CPPFLAGS) $(CPPFLAGS) $(libm_a_CFLAGS) $(CFLAGS) -MT libm/common/libm_a-truncl.obj -MD -MP -MF libm/common/$(DEPDIR)/libm_a-truncl.Tpo -c -o libm/common/libm_a-truncl.obj `if test -f 'libm/common/truncl.c'; then $(CYGPATH_W) 'libm/common/truncl.c'; else $(CYGPATH_W) '$(srcdir)/libm/common/truncl.c'; fi`
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) libm/common/$(DEPDIR)/libm_a-truncl.Tpo libm/common/$(DEPDIR)/libm_a-truncl.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='libm/common/truncl.c' object='libm/common/libm_a-truncl.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libm_a_CPPFLAGS) $(CPPFLAGS) $(libm_a_CFLAGS) $(CFLAGS) -c -o libm/common/libm_a-truncl.obj `if test -f 'libm/common/truncl.c'; then $(CYGPATH_W) 'libm/common/truncl.c'; else $(CYGPATH_W) '$(srcdir)/libm/common/truncl.c'; fi`
-
libm/common/libm_a-remquol.o: libm/common/remquol.c
@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libm_a_CPPFLAGS) $(CPPFLAGS) $(libm_a_CFLAGS) $(CFLAGS) -MT libm/common/libm_a-remquol.o -MD -MP -MF libm/common/$(DEPDIR)/libm_a-remquol.Tpo -c -o libm/common/libm_a-remquol.o `test -f 'libm/common/remquol.c' || echo '$(srcdir)/'`libm/common/remquol.c
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) libm/common/$(DEPDIR)/libm_a-remquol.Tpo libm/common/$(DEPDIR)/libm_a-remquol.Po
@@ -40294,6 +40308,34 @@ libm/common/libm_a-sl_finite.obj: libm/common/sl_finite.c
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libm_a_CPPFLAGS) $(CPPFLAGS) $(libm_a_CFLAGS) $(CFLAGS) -c -o libm/common/libm_a-sl_finite.obj `if test -f 'libm/common/sl_finite.c'; then $(CYGPATH_W) 'libm/common/sl_finite.c'; else $(CYGPATH_W) '$(srcdir)/libm/common/sl_finite.c'; fi`
+libm/common/ldbl/libm_a-s_truncl.o: libm/common/ldbl/s_truncl.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libm_a_CPPFLAGS) $(CPPFLAGS) $(libm_a_CFLAGS) $(CFLAGS) -MT libm/common/ldbl/libm_a-s_truncl.o -MD -MP -MF libm/common/ldbl/$(DEPDIR)/libm_a-s_truncl.Tpo -c -o libm/common/ldbl/libm_a-s_truncl.o `test -f 'libm/common/ldbl/s_truncl.c' || echo '$(srcdir)/'`libm/common/ldbl/s_truncl.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) libm/common/ldbl/$(DEPDIR)/libm_a-s_truncl.Tpo libm/common/ldbl/$(DEPDIR)/libm_a-s_truncl.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='libm/common/ldbl/s_truncl.c' object='libm/common/ldbl/libm_a-s_truncl.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libm_a_CPPFLAGS) $(CPPFLAGS) $(libm_a_CFLAGS) $(CFLAGS) -c -o libm/common/ldbl/libm_a-s_truncl.o `test -f 'libm/common/ldbl/s_truncl.c' || echo '$(srcdir)/'`libm/common/ldbl/s_truncl.c
+
+libm/common/ldbl/libm_a-s_truncl.obj: libm/common/ldbl/s_truncl.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libm_a_CPPFLAGS) $(CPPFLAGS) $(libm_a_CFLAGS) $(CFLAGS) -MT libm/common/ldbl/libm_a-s_truncl.obj -MD -MP -MF libm/common/ldbl/$(DEPDIR)/libm_a-s_truncl.Tpo -c -o libm/common/ldbl/libm_a-s_truncl.obj `if test -f 'libm/common/ldbl/s_truncl.c'; then $(CYGPATH_W) 'libm/common/ldbl/s_truncl.c'; else $(CYGPATH_W) '$(srcdir)/libm/common/ldbl/s_truncl.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) libm/common/ldbl/$(DEPDIR)/libm_a-s_truncl.Tpo libm/common/ldbl/$(DEPDIR)/libm_a-s_truncl.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='libm/common/ldbl/s_truncl.c' object='libm/common/ldbl/libm_a-s_truncl.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libm_a_CPPFLAGS) $(CPPFLAGS) $(libm_a_CFLAGS) $(CFLAGS) -c -o libm/common/ldbl/libm_a-s_truncl.obj `if test -f 'libm/common/ldbl/s_truncl.c'; then $(CYGPATH_W) 'libm/common/ldbl/s_truncl.c'; else $(CYGPATH_W) '$(srcdir)/libm/common/ldbl/s_truncl.c'; fi`
+
+libm/common/ldbl_eq_dbl/libm_a-s_truncl.o: libm/common/ldbl_eq_dbl/s_truncl.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libm_a_CPPFLAGS) $(CPPFLAGS) $(libm_a_CFLAGS) $(CFLAGS) -MT libm/common/ldbl_eq_dbl/libm_a-s_truncl.o -MD -MP -MF libm/common/ldbl_eq_dbl/$(DEPDIR)/libm_a-s_truncl.Tpo -c -o libm/common/ldbl_eq_dbl/libm_a-s_truncl.o `test -f 'libm/common/ldbl_eq_dbl/s_truncl.c' || echo '$(srcdir)/'`libm/common/ldbl_eq_dbl/s_truncl.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) libm/common/ldbl_eq_dbl/$(DEPDIR)/libm_a-s_truncl.Tpo libm/common/ldbl_eq_dbl/$(DEPDIR)/libm_a-s_truncl.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='libm/common/ldbl_eq_dbl/s_truncl.c' object='libm/common/ldbl_eq_dbl/libm_a-s_truncl.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libm_a_CPPFLAGS) $(CPPFLAGS) $(libm_a_CFLAGS) $(CFLAGS) -c -o libm/common/ldbl_eq_dbl/libm_a-s_truncl.o `test -f 'libm/common/ldbl_eq_dbl/s_truncl.c' || echo '$(srcdir)/'`libm/common/ldbl_eq_dbl/s_truncl.c
+
+libm/common/ldbl_eq_dbl/libm_a-s_truncl.obj: libm/common/ldbl_eq_dbl/s_truncl.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libm_a_CPPFLAGS) $(CPPFLAGS) $(libm_a_CFLAGS) $(CFLAGS) -MT libm/common/ldbl_eq_dbl/libm_a-s_truncl.obj -MD -MP -MF libm/common/ldbl_eq_dbl/$(DEPDIR)/libm_a-s_truncl.Tpo -c -o libm/common/ldbl_eq_dbl/libm_a-s_truncl.obj `if test -f 'libm/common/ldbl_eq_dbl/s_truncl.c'; then $(CYGPATH_W) 'libm/common/ldbl_eq_dbl/s_truncl.c'; else $(CYGPATH_W) '$(srcdir)/libm/common/ldbl_eq_dbl/s_truncl.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) libm/common/ldbl_eq_dbl/$(DEPDIR)/libm_a-s_truncl.Tpo libm/common/ldbl_eq_dbl/$(DEPDIR)/libm_a-s_truncl.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='libm/common/ldbl_eq_dbl/s_truncl.c' object='libm/common/ldbl_eq_dbl/libm_a-s_truncl.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libm_a_CPPFLAGS) $(CPPFLAGS) $(libm_a_CFLAGS) $(CFLAGS) -c -o libm/common/ldbl_eq_dbl/libm_a-s_truncl.obj `if test -f 'libm/common/ldbl_eq_dbl/s_truncl.c'; then $(CYGPATH_W) 'libm/common/ldbl_eq_dbl/s_truncl.c'; else $(CYGPATH_W) '$(srcdir)/libm/common/ldbl_eq_dbl/s_truncl.c'; fi`
+
libm/complex/libm_a-cabs.o: libm/complex/cabs.c
@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libm_a_CPPFLAGS) $(CPPFLAGS) $(libm_a_CFLAGS) $(CFLAGS) -MT libm/complex/libm_a-cabs.o -MD -MP -MF libm/complex/$(DEPDIR)/libm_a-cabs.Tpo -c -o libm/complex/libm_a-cabs.o `test -f 'libm/complex/cabs.c' || echo '$(srcdir)/'`libm/complex/cabs.c
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) libm/complex/$(DEPDIR)/libm_a-cabs.Tpo libm/complex/$(DEPDIR)/libm_a-cabs.Po
@@ -46494,6 +46536,10 @@ distclean-generic:
-rm -f libm/$(am__dirstamp)
-rm -f libm/common/$(DEPDIR)/$(am__dirstamp)
-rm -f libm/common/$(am__dirstamp)
+ -rm -f libm/common/ldbl/$(DEPDIR)/$(am__dirstamp)
+ -rm -f libm/common/ldbl/$(am__dirstamp)
+ -rm -f libm/common/ldbl_eq_dbl/$(DEPDIR)/$(am__dirstamp)
+ -rm -f libm/common/ldbl_eq_dbl/$(am__dirstamp)
-rm -f libm/complex/$(DEPDIR)/$(am__dirstamp)
-rm -f libm/complex/$(am__dirstamp)
-rm -f libm/fenv/$(DEPDIR)/$(am__dirstamp)
@@ -46537,7 +46583,7 @@ clean-am: clean-aminfo clean-checkPROGRAMS clean-generic clean-local \
distclean: distclean-am
-rm -f $(am__CONFIG_DISTCLEAN_FILES)
- -rm -rf libc/argz/$(DEPDIR) libc/ctype/$(DEPDIR) libc/errno/$(DEPDIR) libc/iconv/ccs/$(DEPDIR) libc/iconv/ces/$(DEPDIR) libc/iconv/lib/$(DEPDIR) libc/locale/$(DEPDIR) libc/machine/aarch64/$(DEPDIR) libc/machine/amdgcn/$(DEPDIR) libc/machine/arc/$(DEPDIR) libc/machine/arm/$(DEPDIR) libc/machine/bfin/$(DEPDIR) libc/machine/cr16/$(DEPDIR) libc/machine/cris/$(DEPDIR) libc/machine/crx/$(DEPDIR) libc/machine/csky/$(DEPDIR) libc/machine/d10v/$(DEPDIR) libc/machine/d30v/$(DEPDIR) libc/machine/epiphany/$(DEPDIR) libc/machine/fr30/$(DEPDIR) libc/machine/frv/$(DEPDIR) libc/machine/ft32/$(DEPDIR) libc/machine/h8300/$(DEPDIR) libc/machine/h8500/$(DEPDIR) libc/machine/hppa/$(DEPDIR) libc/machine/i386/$(DEPDIR) libc/machine/i960/$(DEPDIR) libc/machine/iq2000/$(DEPDIR) libc/machine/lm32/$(DEPDIR) libc/machine/m32c/$(DEPDIR) libc/machine/m32r/$(DEPDIR) libc/machine/m68hc11/$(DEPDIR) libc/machine/m68k/$(DEPDIR) libc/machine/m88k/$(DEPDIR) libc/machine/mep/$(DEPDIR) libc/machine/microblaze/$(DEPDIR) libc/machine/mips/$(DEPDIR) libc/machine/mn10200/$(DEPDIR) libc/machine/mn10300/$(DEPDIR) libc/machine/moxie/$(DEPDIR) libc/machine/msp430/$(DEPDIR) libc/machine/mt/$(DEPDIR) libc/machine/nds32/$(DEPDIR) libc/machine/necv70/$(DEPDIR) libc/machine/nvptx/$(DEPDIR) libc/machine/or1k/$(DEPDIR) libc/machine/powerpc/$(DEPDIR) libc/machine/riscv/$(DEPDIR) libc/machine/rl78/$(DEPDIR) libc/machine/rx/$(DEPDIR) libc/machine/sh/$(DEPDIR) libc/machine/sparc/$(DEPDIR) libc/machine/spu/$(DEPDIR) libc/machine/tic4x/$(DEPDIR) libc/machine/tic6x/$(DEPDIR) libc/machine/tic80/$(DEPDIR) libc/machine/v850/$(DEPDIR) libc/machine/visium/$(DEPDIR) libc/machine/w65/$(DEPDIR) libc/machine/x86_64/$(DEPDIR) libc/machine/xc16x/$(DEPDIR) libc/machine/xstormy16/$(DEPDIR) libc/machine/z8k/$(DEPDIR) libc/misc/$(DEPDIR) libc/posix/$(DEPDIR) libc/reent/$(DEPDIR) libc/search/$(DEPDIR) libc/signal/$(DEPDIR) libc/ssp/$(DEPDIR) libc/stdio/$(DEPDIR) libc/stdio64/$(DEPDIR) libc/stdlib/$(DEPDIR) libc/string/$(DEPDIR) libc/sys/a29khif/$(DEPDIR) libc/sys/amdgcn/$(DEPDIR) libc/sys/arm/$(DEPDIR) libc/sys/d10v/$(DEPDIR) libc/sys/epiphany/$(DEPDIR) libc/sys/h8300hms/$(DEPDIR) libc/sys/h8500hms/$(DEPDIR) libc/sys/m88kbug/$(DEPDIR) libc/sys/mmixware/$(DEPDIR) libc/sys/netware/$(DEPDIR) libc/sys/or1k/$(DEPDIR) libc/sys/rdos/$(DEPDIR) libc/sys/rtems/$(DEPDIR) libc/sys/sh/$(DEPDIR) libc/sys/sysmec/$(DEPDIR) libc/sys/sysnec810/$(DEPDIR) libc/sys/sysnecv850/$(DEPDIR) libc/sys/sysvi386/$(DEPDIR) libc/sys/sysvnecv70/$(DEPDIR) libc/sys/tirtos/$(DEPDIR) libc/sys/w65/$(DEPDIR) libc/sys/z8ksim/$(DEPDIR) libc/syscalls/$(DEPDIR) libc/time/$(DEPDIR) libc/unix/$(DEPDIR) libc/xdr/$(DEPDIR) libm/common/$(DEPDIR) libm/complex/$(DEPDIR) libm/fenv/$(DEPDIR) libm/machine/aarch64/$(DEPDIR) libm/machine/arm/$(DEPDIR) libm/machine/i386/$(DEPDIR) libm/machine/mips/$(DEPDIR) libm/machine/nds32/$(DEPDIR) libm/machine/powerpc/$(DEPDIR) libm/machine/pru/$(DEPDIR) libm/machine/riscv/$(DEPDIR) libm/machine/sparc/$(DEPDIR) libm/machine/spu/$(DEPDIR) libm/machine/x86_64/$(DEPDIR) libm/math/$(DEPDIR) libm/mathfp/$(DEPDIR) libm/test/$(DEPDIR)
+ -rm -rf libc/argz/$(DEPDIR) libc/ctype/$(DEPDIR) libc/errno/$(DEPDIR) libc/iconv/ccs/$(DEPDIR) libc/iconv/ces/$(DEPDIR) libc/iconv/lib/$(DEPDIR) libc/locale/$(DEPDIR) libc/machine/aarch64/$(DEPDIR) libc/machine/amdgcn/$(DEPDIR) libc/machine/arc/$(DEPDIR) libc/machine/arm/$(DEPDIR) libc/machine/bfin/$(DEPDIR) libc/machine/cr16/$(DEPDIR) libc/machine/cris/$(DEPDIR) libc/machine/crx/$(DEPDIR) libc/machine/csky/$(DEPDIR) libc/machine/d10v/$(DEPDIR) libc/machine/d30v/$(DEPDIR) libc/machine/epiphany/$(DEPDIR) libc/machine/fr30/$(DEPDIR) libc/machine/frv/$(DEPDIR) libc/machine/ft32/$(DEPDIR) libc/machine/h8300/$(DEPDIR) libc/machine/h8500/$(DEPDIR) libc/machine/hppa/$(DEPDIR) libc/machine/i386/$(DEPDIR) libc/machine/i960/$(DEPDIR) libc/machine/iq2000/$(DEPDIR) libc/machine/lm32/$(DEPDIR) libc/machine/m32c/$(DEPDIR) libc/machine/m32r/$(DEPDIR) libc/machine/m68hc11/$(DEPDIR) libc/machine/m68k/$(DEPDIR) libc/machine/m88k/$(DEPDIR) libc/machine/mep/$(DEPDIR) libc/machine/microblaze/$(DEPDIR) libc/machine/mips/$(DEPDIR) libc/machine/mn10200/$(DEPDIR) libc/machine/mn10300/$(DEPDIR) libc/machine/moxie/$(DEPDIR) libc/machine/msp430/$(DEPDIR) libc/machine/mt/$(DEPDIR) libc/machine/nds32/$(DEPDIR) libc/machine/necv70/$(DEPDIR) libc/machine/nvptx/$(DEPDIR) libc/machine/or1k/$(DEPDIR) libc/machine/powerpc/$(DEPDIR) libc/machine/riscv/$(DEPDIR) libc/machine/rl78/$(DEPDIR) libc/machine/rx/$(DEPDIR) libc/machine/sh/$(DEPDIR) libc/machine/sparc/$(DEPDIR) libc/machine/spu/$(DEPDIR) libc/machine/tic4x/$(DEPDIR) libc/machine/tic6x/$(DEPDIR) libc/machine/tic80/$(DEPDIR) libc/machine/v850/$(DEPDIR) libc/machine/visium/$(DEPDIR) libc/machine/w65/$(DEPDIR) libc/machine/x86_64/$(DEPDIR) libc/machine/xc16x/$(DEPDIR) libc/machine/xstormy16/$(DEPDIR) libc/machine/z8k/$(DEPDIR) libc/misc/$(DEPDIR) libc/posix/$(DEPDIR) libc/reent/$(DEPDIR) libc/search/$(DEPDIR) libc/signal/$(DEPDIR) libc/ssp/$(DEPDIR) libc/stdio/$(DEPDIR) libc/stdio64/$(DEPDIR) libc/stdlib/$(DEPDIR) libc/string/$(DEPDIR) libc/sys/a29khif/$(DEPDIR) libc/sys/amdgcn/$(DEPDIR) libc/sys/arm/$(DEPDIR) libc/sys/d10v/$(DEPDIR) libc/sys/epiphany/$(DEPDIR) libc/sys/h8300hms/$(DEPDIR) libc/sys/h8500hms/$(DEPDIR) libc/sys/m88kbug/$(DEPDIR) libc/sys/mmixware/$(DEPDIR) libc/sys/netware/$(DEPDIR) libc/sys/or1k/$(DEPDIR) libc/sys/rdos/$(DEPDIR) libc/sys/rtems/$(DEPDIR) libc/sys/sh/$(DEPDIR) libc/sys/sysmec/$(DEPDIR) libc/sys/sysnec810/$(DEPDIR) libc/sys/sysnecv850/$(DEPDIR) libc/sys/sysvi386/$(DEPDIR) libc/sys/sysvnecv70/$(DEPDIR) libc/sys/tirtos/$(DEPDIR) libc/sys/w65/$(DEPDIR) libc/sys/z8ksim/$(DEPDIR) libc/syscalls/$(DEPDIR) libc/time/$(DEPDIR) libc/unix/$(DEPDIR) libc/xdr/$(DEPDIR) libm/common/$(DEPDIR) libm/common/ldbl/$(DEPDIR) libm/common/ldbl_eq_dbl/$(DEPDIR) libm/complex/$(DEPDIR) libm/fenv/$(DEPDIR) libm/machine/aarch64/$(DEPDIR) libm/machine/arm/$(DEPDIR) libm/machine/i386/$(DEPDIR) libm/machine/mips/$(DEPDIR) libm/machine/nds32/$(DEPDIR) libm/machine/powerpc/$(DEPDIR) libm/machine/pru/$(DEPDIR) libm/machine/riscv/$(DEPDIR) libm/machine/sparc/$(DEPDIR) libm/machine/spu/$(DEPDIR) libm/machine/x86_64/$(DEPDIR) libm/math/$(DEPDIR) libm/mathfp/$(DEPDIR) libm/test/$(DEPDIR)
-rm -f Makefile
distclean-am: clean-am distclean-DEJAGNU distclean-compile \
distclean-generic distclean-hdr distclean-local distclean-tags
@@ -46675,7 +46721,7 @@ installcheck-am:
maintainer-clean: maintainer-clean-am
-rm -f $(am__CONFIG_DISTCLEAN_FILES)
-rm -rf $(top_srcdir)/autom4te.cache
- -rm -rf libc/argz/$(DEPDIR) libc/ctype/$(DEPDIR) libc/errno/$(DEPDIR) libc/iconv/ccs/$(DEPDIR) libc/iconv/ces/$(DEPDIR) libc/iconv/lib/$(DEPDIR) libc/locale/$(DEPDIR) libc/machine/aarch64/$(DEPDIR) libc/machine/amdgcn/$(DEPDIR) libc/machine/arc/$(DEPDIR) libc/machine/arm/$(DEPDIR) libc/machine/bfin/$(DEPDIR) libc/machine/cr16/$(DEPDIR) libc/machine/cris/$(DEPDIR) libc/machine/crx/$(DEPDIR) libc/machine/csky/$(DEPDIR) libc/machine/d10v/$(DEPDIR) libc/machine/d30v/$(DEPDIR) libc/machine/epiphany/$(DEPDIR) libc/machine/fr30/$(DEPDIR) libc/machine/frv/$(DEPDIR) libc/machine/ft32/$(DEPDIR) libc/machine/h8300/$(DEPDIR) libc/machine/h8500/$(DEPDIR) libc/machine/hppa/$(DEPDIR) libc/machine/i386/$(DEPDIR) libc/machine/i960/$(DEPDIR) libc/machine/iq2000/$(DEPDIR) libc/machine/lm32/$(DEPDIR) libc/machine/m32c/$(DEPDIR) libc/machine/m32r/$(DEPDIR) libc/machine/m68hc11/$(DEPDIR) libc/machine/m68k/$(DEPDIR) libc/machine/m88k/$(DEPDIR) libc/machine/mep/$(DEPDIR) libc/machine/microblaze/$(DEPDIR) libc/machine/mips/$(DEPDIR) libc/machine/mn10200/$(DEPDIR) libc/machine/mn10300/$(DEPDIR) libc/machine/moxie/$(DEPDIR) libc/machine/msp430/$(DEPDIR) libc/machine/mt/$(DEPDIR) libc/machine/nds32/$(DEPDIR) libc/machine/necv70/$(DEPDIR) libc/machine/nvptx/$(DEPDIR) libc/machine/or1k/$(DEPDIR) libc/machine/powerpc/$(DEPDIR) libc/machine/riscv/$(DEPDIR) libc/machine/rl78/$(DEPDIR) libc/machine/rx/$(DEPDIR) libc/machine/sh/$(DEPDIR) libc/machine/sparc/$(DEPDIR) libc/machine/spu/$(DEPDIR) libc/machine/tic4x/$(DEPDIR) libc/machine/tic6x/$(DEPDIR) libc/machine/tic80/$(DEPDIR) libc/machine/v850/$(DEPDIR) libc/machine/visium/$(DEPDIR) libc/machine/w65/$(DEPDIR) libc/machine/x86_64/$(DEPDIR) libc/machine/xc16x/$(DEPDIR) libc/machine/xstormy16/$(DEPDIR) libc/machine/z8k/$(DEPDIR) libc/misc/$(DEPDIR) libc/posix/$(DEPDIR) libc/reent/$(DEPDIR) libc/search/$(DEPDIR) libc/signal/$(DEPDIR) libc/ssp/$(DEPDIR) libc/stdio/$(DEPDIR) libc/stdio64/$(DEPDIR) libc/stdlib/$(DEPDIR) libc/string/$(DEPDIR) libc/sys/a29khif/$(DEPDIR) libc/sys/amdgcn/$(DEPDIR) libc/sys/arm/$(DEPDIR) libc/sys/d10v/$(DEPDIR) libc/sys/epiphany/$(DEPDIR) libc/sys/h8300hms/$(DEPDIR) libc/sys/h8500hms/$(DEPDIR) libc/sys/m88kbug/$(DEPDIR) libc/sys/mmixware/$(DEPDIR) libc/sys/netware/$(DEPDIR) libc/sys/or1k/$(DEPDIR) libc/sys/rdos/$(DEPDIR) libc/sys/rtems/$(DEPDIR) libc/sys/sh/$(DEPDIR) libc/sys/sysmec/$(DEPDIR) libc/sys/sysnec810/$(DEPDIR) libc/sys/sysnecv850/$(DEPDIR) libc/sys/sysvi386/$(DEPDIR) libc/sys/sysvnecv70/$(DEPDIR) libc/sys/tirtos/$(DEPDIR) libc/sys/w65/$(DEPDIR) libc/sys/z8ksim/$(DEPDIR) libc/syscalls/$(DEPDIR) libc/time/$(DEPDIR) libc/unix/$(DEPDIR) libc/xdr/$(DEPDIR) libm/common/$(DEPDIR) libm/complex/$(DEPDIR) libm/fenv/$(DEPDIR) libm/machine/aarch64/$(DEPDIR) libm/machine/arm/$(DEPDIR) libm/machine/i386/$(DEPDIR) libm/machine/mips/$(DEPDIR) libm/machine/nds32/$(DEPDIR) libm/machine/powerpc/$(DEPDIR) libm/machine/pru/$(DEPDIR) libm/machine/riscv/$(DEPDIR) libm/machine/sparc/$(DEPDIR) libm/machine/spu/$(DEPDIR) libm/machine/x86_64/$(DEPDIR) libm/math/$(DEPDIR) libm/mathfp/$(DEPDIR) libm/test/$(DEPDIR)
+ -rm -rf libc/argz/$(DEPDIR) libc/ctype/$(DEPDIR) libc/errno/$(DEPDIR) libc/iconv/ccs/$(DEPDIR) libc/iconv/ces/$(DEPDIR) libc/iconv/lib/$(DEPDIR) libc/locale/$(DEPDIR) libc/machine/aarch64/$(DEPDIR) libc/machine/amdgcn/$(DEPDIR) libc/machine/arc/$(DEPDIR) libc/machine/arm/$(DEPDIR) libc/machine/bfin/$(DEPDIR) libc/machine/cr16/$(DEPDIR) libc/machine/cris/$(DEPDIR) libc/machine/crx/$(DEPDIR) libc/machine/csky/$(DEPDIR) libc/machine/d10v/$(DEPDIR) libc/machine/d30v/$(DEPDIR) libc/machine/epiphany/$(DEPDIR) libc/machine/fr30/$(DEPDIR) libc/machine/frv/$(DEPDIR) libc/machine/ft32/$(DEPDIR) libc/machine/h8300/$(DEPDIR) libc/machine/h8500/$(DEPDIR) libc/machine/hppa/$(DEPDIR) libc/machine/i386/$(DEPDIR) libc/machine/i960/$(DEPDIR) libc/machine/iq2000/$(DEPDIR) libc/machine/lm32/$(DEPDIR) libc/machine/m32c/$(DEPDIR) libc/machine/m32r/$(DEPDIR) libc/machine/m68hc11/$(DEPDIR) libc/machine/m68k/$(DEPDIR) libc/machine/m88k/$(DEPDIR) libc/machine/mep/$(DEPDIR) libc/machine/microblaze/$(DEPDIR) libc/machine/mips/$(DEPDIR) libc/machine/mn10200/$(DEPDIR) libc/machine/mn10300/$(DEPDIR) libc/machine/moxie/$(DEPDIR) libc/machine/msp430/$(DEPDIR) libc/machine/mt/$(DEPDIR) libc/machine/nds32/$(DEPDIR) libc/machine/necv70/$(DEPDIR) libc/machine/nvptx/$(DEPDIR) libc/machine/or1k/$(DEPDIR) libc/machine/powerpc/$(DEPDIR) libc/machine/riscv/$(DEPDIR) libc/machine/rl78/$(DEPDIR) libc/machine/rx/$(DEPDIR) libc/machine/sh/$(DEPDIR) libc/machine/sparc/$(DEPDIR) libc/machine/spu/$(DEPDIR) libc/machine/tic4x/$(DEPDIR) libc/machine/tic6x/$(DEPDIR) libc/machine/tic80/$(DEPDIR) libc/machine/v850/$(DEPDIR) libc/machine/visium/$(DEPDIR) libc/machine/w65/$(DEPDIR) libc/machine/x86_64/$(DEPDIR) libc/machine/xc16x/$(DEPDIR) libc/machine/xstormy16/$(DEPDIR) libc/machine/z8k/$(DEPDIR) libc/misc/$(DEPDIR) libc/posix/$(DEPDIR) libc/reent/$(DEPDIR) libc/search/$(DEPDIR) libc/signal/$(DEPDIR) libc/ssp/$(DEPDIR) libc/stdio/$(DEPDIR) libc/stdio64/$(DEPDIR) libc/stdlib/$(DEPDIR) libc/string/$(DEPDIR) libc/sys/a29khif/$(DEPDIR) libc/sys/amdgcn/$(DEPDIR) libc/sys/arm/$(DEPDIR) libc/sys/d10v/$(DEPDIR) libc/sys/epiphany/$(DEPDIR) libc/sys/h8300hms/$(DEPDIR) libc/sys/h8500hms/$(DEPDIR) libc/sys/m88kbug/$(DEPDIR) libc/sys/mmixware/$(DEPDIR) libc/sys/netware/$(DEPDIR) libc/sys/or1k/$(DEPDIR) libc/sys/rdos/$(DEPDIR) libc/sys/rtems/$(DEPDIR) libc/sys/sh/$(DEPDIR) libc/sys/sysmec/$(DEPDIR) libc/sys/sysnec810/$(DEPDIR) libc/sys/sysnecv850/$(DEPDIR) libc/sys/sysvi386/$(DEPDIR) libc/sys/sysvnecv70/$(DEPDIR) libc/sys/tirtos/$(DEPDIR) libc/sys/w65/$(DEPDIR) libc/sys/z8ksim/$(DEPDIR) libc/syscalls/$(DEPDIR) libc/time/$(DEPDIR) libc/unix/$(DEPDIR) libc/xdr/$(DEPDIR) libm/common/$(DEPDIR) libm/common/ldbl/$(DEPDIR) libm/common/ldbl_eq_dbl/$(DEPDIR) libm/complex/$(DEPDIR) libm/fenv/$(DEPDIR) libm/machine/aarch64/$(DEPDIR) libm/machine/arm/$(DEPDIR) libm/machine/i386/$(DEPDIR) libm/machine/mips/$(DEPDIR) libm/machine/nds32/$(DEPDIR) libm/machine/powerpc/$(DEPDIR) libm/machine/pru/$(DEPDIR) libm/machine/riscv/$(DEPDIR) libm/machine/sparc/$(DEPDIR) libm/machine/spu/$(DEPDIR) libm/machine/x86_64/$(DEPDIR) libm/math/$(DEPDIR) libm/mathfp/$(DEPDIR) libm/test/$(DEPDIR)
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-aminfo \
maintainer-clean-generic maintainer-clean-local
diff --git a/newlib/configure b/newlib/configure
index e493eb293..4dc6685af 100755
--- a/newlib/configure
+++ b/newlib/configure
@@ -631,6 +631,8 @@ HAS_NDS32_FPU_SP_FALSE
HAS_NDS32_FPU_SP_TRUE
MACH_ADD_SETJMP_FALSE
MACH_ADD_SETJMP_TRUE
+HAVE_FPMATH_H_FALSE
+HAVE_FPMATH_H_TRUE
HAVE_LIBC_MACHINE_Z8K_FALSE
HAVE_LIBC_MACHINE_Z8K_TRUE
HAVE_LIBC_MACHINE_XSTORMY16_FALSE
@@ -6121,6 +6123,15 @@ else
fi
+ if test -r "${srcdir}/libc/machine/${machine_dir}/machine/_fpmath.h"; then
+ HAVE_FPMATH_H_TRUE=
+ HAVE_FPMATH_H_FALSE='#'
+else
+ HAVE_FPMATH_H_TRUE='#'
+ HAVE_FPMATH_H_FALSE=
+fi
+
+
if test "x$mach_add_setjmp" = "xtrue"; then
MACH_ADD_SETJMP_TRUE=
MACH_ADD_SETJMP_FALSE='#'
@@ -7846,6 +7857,10 @@ if test -z "${HAVE_LIBC_MACHINE_Z8K_TRUE}" && test -z "${HAVE_LIBC_MACHINE_Z8K_F
as_fn_error $? "conditional \"HAVE_LIBC_MACHINE_Z8K\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi
+if test -z "${HAVE_FPMATH_H_TRUE}" && test -z "${HAVE_FPMATH_H_FALSE}"; then
+ as_fn_error $? "conditional \"HAVE_FPMATH_H\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
if test -z "${MACH_ADD_SETJMP_TRUE}" && test -z "${MACH_ADD_SETJMP_FALSE}"; then
as_fn_error $? "conditional \"MACH_ADD_SETJMP\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
--
2.24.4
^ permalink raw reply [flat|nested] 14+ messages in thread
* [PATCH newlib v1 3/4] Split libm/common/frexpl.c into LDBL_EQ_DBL and long double versions
2022-08-22 22:50 [PATCH newlib v1 0/4] Add FreeBSD long double functions Joel Sherrill
2022-08-22 22:50 ` [PATCH newlib v1 1/4] Add infrastructure for incorporating FreeBSD long double methods Joel Sherrill
2022-08-22 22:50 ` [PATCH newlib v1 2/4] Makefile.in and configure: Regenerated Joel Sherrill
@ 2022-08-22 22:50 ` Joel Sherrill
2022-08-22 22:50 ` [PATCH newlib v1 4/4] Makefile.in: Regenerated Joel Sherrill
2022-08-24 9:26 ` [PATCH newlib v1 0/4] Add FreeBSD long double functions Corinna Vinschen
4 siblings, 0 replies; 14+ messages in thread
From: Joel Sherrill @ 2022-08-22 22:50 UTC (permalink / raw)
To: newlib
This resulted in the contents of libm/common/frexpl.c being split
into libm/common/ldbl/s_frexpl.c and libm/common/ldbl_eq_dbl/s_frexpl.c.
---
newlib/Makefile.am | 2 +-
newlib/libm/common/Makefile.inc | 6 +--
.../libm/common/{frexpl.c => ldbl/s_frexpl.c} | 9 ----
newlib/libm/common/ldbl_eq_dbl/s_frexpl.c | 42 +++++++++++++++++++
4 files changed, 46 insertions(+), 13 deletions(-)
rename newlib/libm/common/{frexpl.c => ldbl/s_frexpl.c} (94%)
create mode 100644 newlib/libm/common/ldbl_eq_dbl/s_frexpl.c
diff --git a/newlib/Makefile.am b/newlib/Makefile.am
index 0108d8576..bd99c7b4f 100644
--- a/newlib/Makefile.am
+++ b/newlib/Makefile.am
@@ -116,7 +116,7 @@ MATHOBJS_IN_LIBC = \
libm_a-s_isnand.o libm_a-sf_isnanf.o \
libm_a-s_nan.o libm_a-sf_nan.o \
libm_a-s_ldexp.o libm_a-sf_ldexp.o \
- libm_a-s_frexp.o libm_a-sf_frexp.o libm_a-frexpl.o \
+ libm_a-s_frexp.o libm_a-sf_frexp.o libm_a-s_frexpl.o \
libm_a-s_modf.o \
libm_a-sf_modf.o libm_a-s_scalbn.o \
libm_a-sf_scalbn.o \
diff --git a/newlib/libm/common/Makefile.inc b/newlib/libm/common/Makefile.inc
index d08b8b21a..9ff1231e9 100644
--- a/newlib/libm/common/Makefile.inc
+++ b/newlib/libm/common/Makefile.inc
@@ -60,7 +60,7 @@
%D%/sinf.c %D%/cosf.c %D%/sincosf.c %D%/sincosf_data.c %D%/math_errf.c
%C%_lsrc = \
- %D%/atanl.c %D%/cosl.c %D%/sinl.c %D%/tanl.c %D%/tanhl.c %D%/frexpl.c %D%/modfl.c %D%/ceill.c %D%/fabsl.c \
+ %D%/atanl.c %D%/cosl.c %D%/sinl.c %D%/tanl.c %D%/tanhl.c %D%/modfl.c %D%/ceill.c %D%/fabsl.c \
%D%/floorl.c %D%/log1pl.c %D%/expm1l.c %D%/acosl.c %D%/asinl.c %D%/atan2l.c %D%/coshl.c %D%/sinhl.c \
%D%/expl.c %D%/ldexpl.c %D%/logl.c %D%/log10l.c %D%/powl.c %D%/sqrtl.c %D%/fmodl.c %D%/hypotl.c \
%D%/copysignl.c %D%/nanl.c %D%/ilogbl.c %D%/asinhl.c %D%/cbrtl.c %D%/nextafterl.c %D%/rintl.c \
@@ -70,9 +70,9 @@
%D%/logbl.c %D%/nexttowardf.c %D%/nexttoward.c %D%/nexttowardl.c %D%/log2l.c \
%D%/sl_finite.c
-%C%_ldbl_eq_dbl_src = %D%/ldbl_eq_dbl/s_truncl.c
+%C%_ldbl_eq_dbl_src = %D%/ldbl_eq_dbl/s_frexpl.c %D%/ldbl_eq_dbl/s_truncl.c
-%C%_ldbl_src = %D%/ldbl/s_truncl.c
+%C%_ldbl_src = %D%/ldbl/s_frexpl.c %D%/ldbl/s_truncl.c
libm_a_CFLAGS_%C% = -fbuiltin -fno-math-errno
diff --git a/newlib/libm/common/frexpl.c b/newlib/libm/common/ldbl/s_frexpl.c
similarity index 94%
rename from newlib/libm/common/frexpl.c
rename to newlib/libm/common/ldbl/s_frexpl.c
index 8da2823ca..63835c105 100644
--- a/newlib/libm/common/frexpl.c
+++ b/newlib/libm/common/ldbl/s_frexpl.c
@@ -32,14 +32,6 @@ POSSIBILITY OF SUCH DAMAGE.
#include <float.h>
#include "local.h"
-/* On platforms where long double is as wide as double. */
-#if defined(_LDBL_EQ_DBL)
-long double
-frexpl (long double x, int *eptr)
-{
- return frexp(x, eptr);
-}
-#else /* !_DBL_EQ_DBL */
# if (LDBL_MANT_DIG == 53) /* 64-bit long double */
static const double scale = 0x1p54;
@@ -149,4 +141,3 @@ frexpl (long double x, int *eptr)
u.u32.exp = LDBL_MAX_EXP - 2; /* -1 */
return u.x;
}
-#endif /* !_LDBL_EQ_DBL */
diff --git a/newlib/libm/common/ldbl_eq_dbl/s_frexpl.c b/newlib/libm/common/ldbl_eq_dbl/s_frexpl.c
new file mode 100644
index 000000000..90ae0153f
--- /dev/null
+++ b/newlib/libm/common/ldbl_eq_dbl/s_frexpl.c
@@ -0,0 +1,42 @@
+/*
+(C) Copyright IBM Corp. 2009
+
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+
+* Redistributions of source code must retain the above copyright notice,
+this list of conditions and the following disclaimer.
+* Redistributions in binary form must reproduce the above copyright
+notice, this list of conditions and the following disclaimer in the
+documentation and/or other materials provided with the distribution.
+* Neither the name of IBM nor the names of its contributors may be
+used to endorse or promote products derived from this software without
+specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#include <math.h>
+#include <float.h>
+#include "local.h"
+
+/* On platforms where long double is as wide as double. */
+#if defined(_LDBL_EQ_DBL)
+long double
+frexpl (long double x, int *eptr)
+{
+ return frexp(x, eptr);
+}
+#endif /* !_LDBL_EQ_DBL */
--
2.24.4
^ permalink raw reply [flat|nested] 14+ messages in thread
* [PATCH newlib v1 4/4] Makefile.in: Regenerated
2022-08-22 22:50 [PATCH newlib v1 0/4] Add FreeBSD long double functions Joel Sherrill
` (2 preceding siblings ...)
2022-08-22 22:50 ` [PATCH newlib v1 3/4] Split libm/common/frexpl.c into LDBL_EQ_DBL and long double versions Joel Sherrill
@ 2022-08-22 22:50 ` Joel Sherrill
2022-08-24 9:26 ` [PATCH newlib v1 0/4] Add FreeBSD long double functions Corinna Vinschen
4 siblings, 0 replies; 14+ messages in thread
From: Joel Sherrill @ 2022-08-22 22:50 UTC (permalink / raw)
To: newlib
---
newlib/Makefile.in | 68 ++++++++++++++++++++++++++++++----------------
1 file changed, 44 insertions(+), 24 deletions(-)
diff --git a/newlib/Makefile.in b/newlib/Makefile.in
index 5fba39a42..00d38e1b7 100644
--- a/newlib/Makefile.in
+++ b/newlib/Makefile.in
@@ -2912,7 +2912,6 @@ am__objects_150 = libm/common/libm_a-atanl.$(OBJEXT) \
libm/common/libm_a-sinl.$(OBJEXT) \
libm/common/libm_a-tanl.$(OBJEXT) \
libm/common/libm_a-tanhl.$(OBJEXT) \
- libm/common/libm_a-frexpl.$(OBJEXT) \
libm/common/libm_a-modfl.$(OBJEXT) \
libm/common/libm_a-ceill.$(OBJEXT) \
libm/common/libm_a-fabsl.$(OBJEXT) \
@@ -2967,9 +2966,11 @@ am__objects_150 = libm/common/libm_a-atanl.$(OBJEXT) \
libm/common/libm_a-log2l.$(OBJEXT) \
libm/common/libm_a-sl_finite.$(OBJEXT)
@HAVE_LONG_DOUBLE_TRUE@am__objects_151 = $(am__objects_150)
-am__objects_152 = libm/common/ldbl/libm_a-s_truncl.$(OBJEXT)
+am__objects_152 = libm/common/ldbl/libm_a-s_frexpl.$(OBJEXT) \
+ libm/common/ldbl/libm_a-s_truncl.$(OBJEXT)
@HAVE_FPMATH_H_TRUE@am__objects_153 = $(am__objects_152)
-am__objects_154 = libm/common/ldbl_eq_dbl/libm_a-s_truncl.$(OBJEXT)
+am__objects_154 = libm/common/ldbl_eq_dbl/libm_a-s_frexpl.$(OBJEXT) \
+ libm/common/ldbl_eq_dbl/libm_a-s_truncl.$(OBJEXT)
@HAVE_FPMATH_H_FALSE@am__objects_155 = $(am__objects_154)
am__objects_156 = libm/complex/libm_a-cabs.$(OBJEXT) \
libm/complex/libm_a-cacos.$(OBJEXT) \
@@ -3790,7 +3791,7 @@ MATHOBJS_IN_LIBC = \
libm_a-s_isnand.o libm_a-sf_isnanf.o \
libm_a-s_nan.o libm_a-sf_nan.o \
libm_a-s_ldexp.o libm_a-sf_ldexp.o \
- libm_a-s_frexp.o libm_a-sf_frexp.o libm_a-frexpl.o \
+ libm_a-s_frexp.o libm_a-sf_frexp.o libm_a-s_frexpl.o \
libm_a-s_modf.o \
libm_a-sf_modf.o libm_a-s_scalbn.o \
libm_a-sf_scalbn.o \
@@ -4578,7 +4579,7 @@ libm_common_fsrc = \
libm/common/sinf.c libm/common/cosf.c libm/common/sincosf.c libm/common/sincosf_data.c libm/common/math_errf.c
libm_common_lsrc = \
- libm/common/atanl.c libm/common/cosl.c libm/common/sinl.c libm/common/tanl.c libm/common/tanhl.c libm/common/frexpl.c libm/common/modfl.c libm/common/ceill.c libm/common/fabsl.c \
+ libm/common/atanl.c libm/common/cosl.c libm/common/sinl.c libm/common/tanl.c libm/common/tanhl.c libm/common/modfl.c libm/common/ceill.c libm/common/fabsl.c \
libm/common/floorl.c libm/common/log1pl.c libm/common/expm1l.c libm/common/acosl.c libm/common/asinl.c libm/common/atan2l.c libm/common/coshl.c libm/common/sinhl.c \
libm/common/expl.c libm/common/ldexpl.c libm/common/logl.c libm/common/log10l.c libm/common/powl.c libm/common/sqrtl.c libm/common/fmodl.c libm/common/hypotl.c \
libm/common/copysignl.c libm/common/nanl.c libm/common/ilogbl.c libm/common/asinhl.c libm/common/cbrtl.c libm/common/nextafterl.c libm/common/rintl.c \
@@ -4588,8 +4589,8 @@ libm_common_lsrc = \
libm/common/logbl.c libm/common/nexttowardf.c libm/common/nexttoward.c libm/common/nexttowardl.c libm/common/log2l.c \
libm/common/sl_finite.c
-libm_common_ldbl_eq_dbl_src = libm/common/ldbl_eq_dbl/s_truncl.c
-libm_common_ldbl_src = libm/common/ldbl/s_truncl.c
+libm_common_ldbl_eq_dbl_src = libm/common/ldbl_eq_dbl/s_frexpl.c libm/common/ldbl_eq_dbl/s_truncl.c
+libm_common_ldbl_src = libm/common/ldbl/s_frexpl.c libm/common/ldbl/s_truncl.c
libm_a_CFLAGS_libm_common = -fbuiltin -fno-math-errno
libm_complex_src = \
libm/complex/cabs.c libm/complex/cacos.c libm/complex/cacosh.c libm/complex/carg.c libm/complex/casin.c libm/complex/casinh.c \
@@ -9992,8 +9993,6 @@ libm/common/libm_a-tanl.$(OBJEXT): libm/common/$(am__dirstamp) \
libm/common/$(DEPDIR)/$(am__dirstamp)
libm/common/libm_a-tanhl.$(OBJEXT): libm/common/$(am__dirstamp) \
libm/common/$(DEPDIR)/$(am__dirstamp)
-libm/common/libm_a-frexpl.$(OBJEXT): libm/common/$(am__dirstamp) \
- libm/common/$(DEPDIR)/$(am__dirstamp)
libm/common/libm_a-modfl.$(OBJEXT): libm/common/$(am__dirstamp) \
libm/common/$(DEPDIR)/$(am__dirstamp)
libm/common/libm_a-ceill.$(OBJEXT): libm/common/$(am__dirstamp) \
@@ -10106,6 +10105,9 @@ libm/common/ldbl/$(am__dirstamp):
libm/common/ldbl/$(DEPDIR)/$(am__dirstamp):
@$(MKDIR_P) libm/common/ldbl/$(DEPDIR)
@: > libm/common/ldbl/$(DEPDIR)/$(am__dirstamp)
+libm/common/ldbl/libm_a-s_frexpl.$(OBJEXT): \
+ libm/common/ldbl/$(am__dirstamp) \
+ libm/common/ldbl/$(DEPDIR)/$(am__dirstamp)
libm/common/ldbl/libm_a-s_truncl.$(OBJEXT): \
libm/common/ldbl/$(am__dirstamp) \
libm/common/ldbl/$(DEPDIR)/$(am__dirstamp)
@@ -10115,6 +10117,9 @@ libm/common/ldbl_eq_dbl/$(am__dirstamp):
libm/common/ldbl_eq_dbl/$(DEPDIR)/$(am__dirstamp):
@$(MKDIR_P) libm/common/ldbl_eq_dbl/$(DEPDIR)
@: > libm/common/ldbl_eq_dbl/$(DEPDIR)/$(am__dirstamp)
+libm/common/ldbl_eq_dbl/libm_a-s_frexpl.$(OBJEXT): \
+ libm/common/ldbl_eq_dbl/$(am__dirstamp) \
+ libm/common/ldbl_eq_dbl/$(DEPDIR)/$(am__dirstamp)
libm/common/ldbl_eq_dbl/libm_a-s_truncl.$(OBJEXT): \
libm/common/ldbl_eq_dbl/$(am__dirstamp) \
libm/common/ldbl_eq_dbl/$(DEPDIR)/$(am__dirstamp)
@@ -13176,7 +13181,6 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@libm/common/$(DEPDIR)/libm_a-fmaxl.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@libm/common/$(DEPDIR)/libm_a-fminl.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@libm/common/$(DEPDIR)/libm_a-fmodl.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@libm/common/$(DEPDIR)/libm_a-frexpl.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@libm/common/$(DEPDIR)/libm_a-hypotl.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@libm/common/$(DEPDIR)/libm_a-ilogbl.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@libm/common/$(DEPDIR)/libm_a-ldexpl.Po@am__quote@
@@ -13299,7 +13303,9 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@libm/common/$(DEPDIR)/libm_a-tanhl.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@libm/common/$(DEPDIR)/libm_a-tanl.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@libm/common/$(DEPDIR)/libm_a-tgammal.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@libm/common/ldbl/$(DEPDIR)/libm_a-s_frexpl.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@libm/common/ldbl/$(DEPDIR)/libm_a-s_truncl.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@libm/common/ldbl_eq_dbl/$(DEPDIR)/libm_a-s_frexpl.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@libm/common/ldbl_eq_dbl/$(DEPDIR)/libm_a-s_truncl.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@libm/complex/$(DEPDIR)/libm_a-cabs.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@libm/complex/$(DEPDIR)/libm_a-cabsf.Po@am__quote@
@@ -39552,20 +39558,6 @@ libm/common/libm_a-tanhl.obj: libm/common/tanhl.c
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libm_a_CPPFLAGS) $(CPPFLAGS) $(libm_a_CFLAGS) $(CFLAGS) -c -o libm/common/libm_a-tanhl.obj `if test -f 'libm/common/tanhl.c'; then $(CYGPATH_W) 'libm/common/tanhl.c'; else $(CYGPATH_W) '$(srcdir)/libm/common/tanhl.c'; fi`
-libm/common/libm_a-frexpl.o: libm/common/frexpl.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libm_a_CPPFLAGS) $(CPPFLAGS) $(libm_a_CFLAGS) $(CFLAGS) -MT libm/common/libm_a-frexpl.o -MD -MP -MF libm/common/$(DEPDIR)/libm_a-frexpl.Tpo -c -o libm/common/libm_a-frexpl.o `test -f 'libm/common/frexpl.c' || echo '$(srcdir)/'`libm/common/frexpl.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) libm/common/$(DEPDIR)/libm_a-frexpl.Tpo libm/common/$(DEPDIR)/libm_a-frexpl.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='libm/common/frexpl.c' object='libm/common/libm_a-frexpl.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libm_a_CPPFLAGS) $(CPPFLAGS) $(libm_a_CFLAGS) $(CFLAGS) -c -o libm/common/libm_a-frexpl.o `test -f 'libm/common/frexpl.c' || echo '$(srcdir)/'`libm/common/frexpl.c
-
-libm/common/libm_a-frexpl.obj: libm/common/frexpl.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libm_a_CPPFLAGS) $(CPPFLAGS) $(libm_a_CFLAGS) $(CFLAGS) -MT libm/common/libm_a-frexpl.obj -MD -MP -MF libm/common/$(DEPDIR)/libm_a-frexpl.Tpo -c -o libm/common/libm_a-frexpl.obj `if test -f 'libm/common/frexpl.c'; then $(CYGPATH_W) 'libm/common/frexpl.c'; else $(CYGPATH_W) '$(srcdir)/libm/common/frexpl.c'; fi`
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) libm/common/$(DEPDIR)/libm_a-frexpl.Tpo libm/common/$(DEPDIR)/libm_a-frexpl.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='libm/common/frexpl.c' object='libm/common/libm_a-frexpl.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libm_a_CPPFLAGS) $(CPPFLAGS) $(libm_a_CFLAGS) $(CFLAGS) -c -o libm/common/libm_a-frexpl.obj `if test -f 'libm/common/frexpl.c'; then $(CYGPATH_W) 'libm/common/frexpl.c'; else $(CYGPATH_W) '$(srcdir)/libm/common/frexpl.c'; fi`
-
libm/common/libm_a-modfl.o: libm/common/modfl.c
@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libm_a_CPPFLAGS) $(CPPFLAGS) $(libm_a_CFLAGS) $(CFLAGS) -MT libm/common/libm_a-modfl.o -MD -MP -MF libm/common/$(DEPDIR)/libm_a-modfl.Tpo -c -o libm/common/libm_a-modfl.o `test -f 'libm/common/modfl.c' || echo '$(srcdir)/'`libm/common/modfl.c
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) libm/common/$(DEPDIR)/libm_a-modfl.Tpo libm/common/$(DEPDIR)/libm_a-modfl.Po
@@ -40308,6 +40300,20 @@ libm/common/libm_a-sl_finite.obj: libm/common/sl_finite.c
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libm_a_CPPFLAGS) $(CPPFLAGS) $(libm_a_CFLAGS) $(CFLAGS) -c -o libm/common/libm_a-sl_finite.obj `if test -f 'libm/common/sl_finite.c'; then $(CYGPATH_W) 'libm/common/sl_finite.c'; else $(CYGPATH_W) '$(srcdir)/libm/common/sl_finite.c'; fi`
+libm/common/ldbl/libm_a-s_frexpl.o: libm/common/ldbl/s_frexpl.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libm_a_CPPFLAGS) $(CPPFLAGS) $(libm_a_CFLAGS) $(CFLAGS) -MT libm/common/ldbl/libm_a-s_frexpl.o -MD -MP -MF libm/common/ldbl/$(DEPDIR)/libm_a-s_frexpl.Tpo -c -o libm/common/ldbl/libm_a-s_frexpl.o `test -f 'libm/common/ldbl/s_frexpl.c' || echo '$(srcdir)/'`libm/common/ldbl/s_frexpl.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) libm/common/ldbl/$(DEPDIR)/libm_a-s_frexpl.Tpo libm/common/ldbl/$(DEPDIR)/libm_a-s_frexpl.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='libm/common/ldbl/s_frexpl.c' object='libm/common/ldbl/libm_a-s_frexpl.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libm_a_CPPFLAGS) $(CPPFLAGS) $(libm_a_CFLAGS) $(CFLAGS) -c -o libm/common/ldbl/libm_a-s_frexpl.o `test -f 'libm/common/ldbl/s_frexpl.c' || echo '$(srcdir)/'`libm/common/ldbl/s_frexpl.c
+
+libm/common/ldbl/libm_a-s_frexpl.obj: libm/common/ldbl/s_frexpl.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libm_a_CPPFLAGS) $(CPPFLAGS) $(libm_a_CFLAGS) $(CFLAGS) -MT libm/common/ldbl/libm_a-s_frexpl.obj -MD -MP -MF libm/common/ldbl/$(DEPDIR)/libm_a-s_frexpl.Tpo -c -o libm/common/ldbl/libm_a-s_frexpl.obj `if test -f 'libm/common/ldbl/s_frexpl.c'; then $(CYGPATH_W) 'libm/common/ldbl/s_frexpl.c'; else $(CYGPATH_W) '$(srcdir)/libm/common/ldbl/s_frexpl.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) libm/common/ldbl/$(DEPDIR)/libm_a-s_frexpl.Tpo libm/common/ldbl/$(DEPDIR)/libm_a-s_frexpl.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='libm/common/ldbl/s_frexpl.c' object='libm/common/ldbl/libm_a-s_frexpl.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libm_a_CPPFLAGS) $(CPPFLAGS) $(libm_a_CFLAGS) $(CFLAGS) -c -o libm/common/ldbl/libm_a-s_frexpl.obj `if test -f 'libm/common/ldbl/s_frexpl.c'; then $(CYGPATH_W) 'libm/common/ldbl/s_frexpl.c'; else $(CYGPATH_W) '$(srcdir)/libm/common/ldbl/s_frexpl.c'; fi`
+
libm/common/ldbl/libm_a-s_truncl.o: libm/common/ldbl/s_truncl.c
@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libm_a_CPPFLAGS) $(CPPFLAGS) $(libm_a_CFLAGS) $(CFLAGS) -MT libm/common/ldbl/libm_a-s_truncl.o -MD -MP -MF libm/common/ldbl/$(DEPDIR)/libm_a-s_truncl.Tpo -c -o libm/common/ldbl/libm_a-s_truncl.o `test -f 'libm/common/ldbl/s_truncl.c' || echo '$(srcdir)/'`libm/common/ldbl/s_truncl.c
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) libm/common/ldbl/$(DEPDIR)/libm_a-s_truncl.Tpo libm/common/ldbl/$(DEPDIR)/libm_a-s_truncl.Po
@@ -40322,6 +40328,20 @@ libm/common/ldbl/libm_a-s_truncl.obj: libm/common/ldbl/s_truncl.c
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libm_a_CPPFLAGS) $(CPPFLAGS) $(libm_a_CFLAGS) $(CFLAGS) -c -o libm/common/ldbl/libm_a-s_truncl.obj `if test -f 'libm/common/ldbl/s_truncl.c'; then $(CYGPATH_W) 'libm/common/ldbl/s_truncl.c'; else $(CYGPATH_W) '$(srcdir)/libm/common/ldbl/s_truncl.c'; fi`
+libm/common/ldbl_eq_dbl/libm_a-s_frexpl.o: libm/common/ldbl_eq_dbl/s_frexpl.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libm_a_CPPFLAGS) $(CPPFLAGS) $(libm_a_CFLAGS) $(CFLAGS) -MT libm/common/ldbl_eq_dbl/libm_a-s_frexpl.o -MD -MP -MF libm/common/ldbl_eq_dbl/$(DEPDIR)/libm_a-s_frexpl.Tpo -c -o libm/common/ldbl_eq_dbl/libm_a-s_frexpl.o `test -f 'libm/common/ldbl_eq_dbl/s_frexpl.c' || echo '$(srcdir)/'`libm/common/ldbl_eq_dbl/s_frexpl.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) libm/common/ldbl_eq_dbl/$(DEPDIR)/libm_a-s_frexpl.Tpo libm/common/ldbl_eq_dbl/$(DEPDIR)/libm_a-s_frexpl.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='libm/common/ldbl_eq_dbl/s_frexpl.c' object='libm/common/ldbl_eq_dbl/libm_a-s_frexpl.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libm_a_CPPFLAGS) $(CPPFLAGS) $(libm_a_CFLAGS) $(CFLAGS) -c -o libm/common/ldbl_eq_dbl/libm_a-s_frexpl.o `test -f 'libm/common/ldbl_eq_dbl/s_frexpl.c' || echo '$(srcdir)/'`libm/common/ldbl_eq_dbl/s_frexpl.c
+
+libm/common/ldbl_eq_dbl/libm_a-s_frexpl.obj: libm/common/ldbl_eq_dbl/s_frexpl.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libm_a_CPPFLAGS) $(CPPFLAGS) $(libm_a_CFLAGS) $(CFLAGS) -MT libm/common/ldbl_eq_dbl/libm_a-s_frexpl.obj -MD -MP -MF libm/common/ldbl_eq_dbl/$(DEPDIR)/libm_a-s_frexpl.Tpo -c -o libm/common/ldbl_eq_dbl/libm_a-s_frexpl.obj `if test -f 'libm/common/ldbl_eq_dbl/s_frexpl.c'; then $(CYGPATH_W) 'libm/common/ldbl_eq_dbl/s_frexpl.c'; else $(CYGPATH_W) '$(srcdir)/libm/common/ldbl_eq_dbl/s_frexpl.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) libm/common/ldbl_eq_dbl/$(DEPDIR)/libm_a-s_frexpl.Tpo libm/common/ldbl_eq_dbl/$(DEPDIR)/libm_a-s_frexpl.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='libm/common/ldbl_eq_dbl/s_frexpl.c' object='libm/common/ldbl_eq_dbl/libm_a-s_frexpl.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libm_a_CPPFLAGS) $(CPPFLAGS) $(libm_a_CFLAGS) $(CFLAGS) -c -o libm/common/ldbl_eq_dbl/libm_a-s_frexpl.obj `if test -f 'libm/common/ldbl_eq_dbl/s_frexpl.c'; then $(CYGPATH_W) 'libm/common/ldbl_eq_dbl/s_frexpl.c'; else $(CYGPATH_W) '$(srcdir)/libm/common/ldbl_eq_dbl/s_frexpl.c'; fi`
+
libm/common/ldbl_eq_dbl/libm_a-s_truncl.o: libm/common/ldbl_eq_dbl/s_truncl.c
@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libm_a_CPPFLAGS) $(CPPFLAGS) $(libm_a_CFLAGS) $(CFLAGS) -MT libm/common/ldbl_eq_dbl/libm_a-s_truncl.o -MD -MP -MF libm/common/ldbl_eq_dbl/$(DEPDIR)/libm_a-s_truncl.Tpo -c -o libm/common/ldbl_eq_dbl/libm_a-s_truncl.o `test -f 'libm/common/ldbl_eq_dbl/s_truncl.c' || echo '$(srcdir)/'`libm/common/ldbl_eq_dbl/s_truncl.c
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) libm/common/ldbl_eq_dbl/$(DEPDIR)/libm_a-s_truncl.Tpo libm/common/ldbl_eq_dbl/$(DEPDIR)/libm_a-s_truncl.Po
--
2.24.4
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH newlib v1 0/4] Add FreeBSD long double functions
2022-08-22 22:50 [PATCH newlib v1 0/4] Add FreeBSD long double functions Joel Sherrill
` (3 preceding siblings ...)
2022-08-22 22:50 ` [PATCH newlib v1 4/4] Makefile.in: Regenerated Joel Sherrill
@ 2022-08-24 9:26 ` Corinna Vinschen
2022-08-24 13:40 ` Joel Sherrill
4 siblings, 1 reply; 14+ messages in thread
From: Corinna Vinschen @ 2022-08-24 9:26 UTC (permalink / raw)
To: newlib
On Aug 22 17:50, Joel Sherrill wrote:
> Hi
>
> To be clear, this is a V1 for review. It actually does **NOT**
> add every long double math method from FreeBSD. That would add
> unnecessary bulk to this patch set at this point.
>
> The FreeBSD long double code requires there to be an architecture
> specific _fpmath.h file. This is only available for a handful of
> architestures. Further, LDBL does EQ DBL on many architectures.
> The FreeBSD long double code will **NOT** compile if there isn't
> an _fpmath.h file. Thus, the overall approach is:
>
> if architecture has _fpmath.h
> use FreeBSD long double code in libm/common/ldbl
> else
> use existing long double code
Erm... Did you actually read my last reply? We should really not add YA
code path. Merging the FreeBSD long double functions should work for
basically all supported arches. We only have to create our own
_fpmath.h supporting all arches based on LDBL_MANT_DIG, isn't it?
Corinna
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH newlib v1 0/4] Add FreeBSD long double functions
2022-08-24 9:26 ` [PATCH newlib v1 0/4] Add FreeBSD long double functions Corinna Vinschen
@ 2022-08-24 13:40 ` Joel Sherrill
2022-08-24 13:40 ` Joel Sherrill
2022-08-26 15:05 ` Corinna Vinschen
0 siblings, 2 replies; 14+ messages in thread
From: Joel Sherrill @ 2022-08-24 13:40 UTC (permalink / raw)
To: Newlib
On Wed, Aug 24, 2022 at 4:26 AM Corinna Vinschen <vinschen@redhat.com>
wrote:
> On Aug 22 17:50, Joel Sherrill wrote:
> > Hi
> >
> > To be clear, this is a V1 for review. It actually does **NOT**
> > add every long double math method from FreeBSD. That would add
> > unnecessary bulk to this patch set at this point.
> >
> > The FreeBSD long double code requires there to be an architecture
> > specific _fpmath.h file. This is only available for a handful of
> > architestures. Further, LDBL does EQ DBL on many architectures.
> > The FreeBSD long double code will **NOT** compile if there isn't
> > an _fpmath.h file. Thus, the overall approach is:
> >
> > if architecture has _fpmath.h
> > use FreeBSD long double code in libm/common/ldbl
> > else
> > use existing long double code
>
> Erm... Did you actually read my last reply?
Yes. If we do that, we end up with long double support on 8
architectures and lose it immediately on all others. On the
18 RTEMS target architectures,
+ Current: long double support on 12
+ Proposed: long double support on all
+ Delete ldbl=dbl implementation: 8 would have long double
We should really not add YA
> code path. Merging the FreeBSD long double functions should work for
> basically all supported arches. We only have to create our own
> _fpmath.h supporting all arches based on LDBL_MANT_DIG, isn't it?
>
It should if someone creates all the _fpmath.h headers. There are 61
directories under libc/machine. That leaves 53 _fpmath.h headers to
complete and most are likely ldbl==dbl. That is up to 53 target
architectures
which would lose the long double math APIs in libm.a.
Honestly, I don't mind long term planning to delete them but I was
thinking this approach improves the current situation a lot since it will
support the targets which really have long double support. It leaves
in place support for where ldbl==dbl with no change in available APIs.
It is a net win for users.
If there is a target with long double which doesn't have a FreeBSD
_fpmath.h file, then there is value in creating it. Honestly, unless
someone
can script writing the missing 50+ _fpmath.h files, I am not comfortable
or eager to dive in. Ignoring the lack of time to so.
This approach works and doesn't abandon the targets which the
ldbl==dbl method works for.
--joel
>
>
> Corinna
>
>
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH newlib v1 0/4] Add FreeBSD long double functions
2022-08-24 13:40 ` Joel Sherrill
@ 2022-08-24 13:40 ` Joel Sherrill
2022-08-26 15:05 ` Corinna Vinschen
1 sibling, 0 replies; 14+ messages in thread
From: Joel Sherrill @ 2022-08-24 13:40 UTC (permalink / raw)
To: Newlib
[-- Attachment #1: Type: text/plain, Size: 2346 bytes --]
On Wed, Aug 24, 2022 at 4:26 AM Corinna Vinschen <vinschen@redhat.com>
wrote:
> On Aug 22 17:50, Joel Sherrill wrote:
> > Hi
> >
> > To be clear, this is a V1 for review. It actually does **NOT**
> > add every long double math method from FreeBSD. That would add
> > unnecessary bulk to this patch set at this point.
> >
> > The FreeBSD long double code requires there to be an architecture
> > specific _fpmath.h file. This is only available for a handful of
> > architestures. Further, LDBL does EQ DBL on many architectures.
> > The FreeBSD long double code will **NOT** compile if there isn't
> > an _fpmath.h file. Thus, the overall approach is:
> >
> > if architecture has _fpmath.h
> > use FreeBSD long double code in libm/common/ldbl
> > else
> > use existing long double code
>
> Erm... Did you actually read my last reply?
Yes. If we do that, we end up with long double support on 8
architectures and lose it immediately on all others. On the
18 RTEMS target architectures,
+ Current: long double support on 12
+ Proposed: long double support on all
+ Delete ldbl=dbl implementation: 8 would have long double
We should really not add YA
> code path. Merging the FreeBSD long double functions should work for
> basically all supported arches. We only have to create our own
> _fpmath.h supporting all arches based on LDBL_MANT_DIG, isn't it?
>
It should if someone creates all the _fpmath.h headers. There are 61
directories under libc/machine. That leaves 53 _fpmath.h headers to
complete and most are likely ldbl==dbl. That is up to 53 target
architectures
which would lose the long double math APIs in libm.a.
Honestly, I don't mind long term planning to delete them but I was
thinking this approach improves the current situation a lot since it will
support the targets which really have long double support. It leaves
in place support for where ldbl==dbl with no change in available APIs.
It is a net win for users.
If there is a target with long double which doesn't have a FreeBSD
_fpmath.h file, then there is value in creating it. Honestly, unless
someone
can script writing the missing 50+ _fpmath.h files, I am not comfortable
or eager to dive in. Ignoring the lack of time to so.
This approach works and doesn't abandon the targets which the
ldbl==dbl method works for.
--joel
>
>
> Corinna
>
>
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH newlib v1 0/4] Add FreeBSD long double functions
2022-08-24 13:40 ` Joel Sherrill
2022-08-24 13:40 ` Joel Sherrill
@ 2022-08-26 15:05 ` Corinna Vinschen
2022-08-26 15:45 ` Joel Sherrill
1 sibling, 1 reply; 14+ messages in thread
From: Corinna Vinschen @ 2022-08-26 15:05 UTC (permalink / raw)
To: Joel Sherrill, Jeff Johnston; +Cc: newlib
On Aug 24 08:40, Joel Sherrill wrote:
> On Wed, Aug 24, 2022 at 4:26 AM Corinna Vinschen <vinschen@redhat.com>
> wrote:
> > > [...]
> > > if architecture has _fpmath.h
> > > use FreeBSD long double code in libm/common/ldbl
> > > else
> > > use existing long double code
> >
> > Erm... Did you actually read my last reply?
>
>
> Yes. If we do that, we end up with long double support on 8
> architectures and lose it immediately on all others. On the
> 18 RTEMS target architectures,
>
> + Current: long double support on 12
> + Proposed: long double support on all
> + Delete ldbl=dbl implementation: 8 would have long double
>
>
> We should really not add YA
> > code path. Merging the FreeBSD long double functions should work for
> > basically all supported arches. We only have to create our own
> > _fpmath.h supporting all arches based on LDBL_MANT_DIG, isn't it?
> >
>
> It should if someone creates all the _fpmath.h headers.
No, I wrote, create a *single* _fpmath.h file with the massive amount
of definitions (*all* seven) based on LDBL_MANT_DIG.
There are very few special targets, like x86/x86_64 which need a tweak
in the macros, most of the time the macros should be the same.
Instead of having 61 files, only have one. In theory there should be
only two definitions for targets with LDBL_MANT_DIG == DBL_MANT_DIG
to support little and big endian, more shouldn't be required.
For all others, we already have *ieee*.h files with matching definitions
which can be used as role models for the various (but few) definitions of
union IEEEl2bits. See, for instance, newlib/libc/include/machine/ieee.h.
> There are 61
> directories under libc/machine. That leaves 53 _fpmath.h headers to
> complete and most are likely ldbl==dbl. That is up to 53 target
> architectures
> which would lose the long double math APIs in libm.a.
>
> Honestly, I don't mind long term planning to delete them but I was
> thinking this approach improves the current situation a lot since it will
> support the targets which really have long double support. It leaves
> in place support for where ldbl==dbl with no change in available APIs.
> It is a net win for users.
>
> If there is a target with long double which doesn't have a FreeBSD
> _fpmath.h file, then there is value in creating it. Honestly, unless
> someone
> can script writing the missing 50+ _fpmath.h files, I am not comfortable
> or eager to dive in. Ignoring the lack of time to so.
>
> This approach works and doesn't abandon the targets which the
> ldbl==dbl method works for.
I never said to abandon these targets, but fwiw, I think you're
overestimating the complexity to generate a single _fpmath.h
file with matching definitions for these targes as well. The
information is basically already present in newlib.
Jeff, ping? Your POV would be much appreciated here.
Thanks,
Corinna
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH newlib v1 0/4] Add FreeBSD long double functions
2022-08-26 15:05 ` Corinna Vinschen
@ 2022-08-26 15:45 ` Joel Sherrill
2022-08-26 15:45 ` Joel Sherrill
2022-08-26 17:45 ` Corinna Vinschen
0 siblings, 2 replies; 14+ messages in thread
From: Joel Sherrill @ 2022-08-26 15:45 UTC (permalink / raw)
To: Newlib, Joel Sherrill, Jeff Johnston
On Fri, Aug 26, 2022 at 10:05 AM Corinna Vinschen <vinschen@redhat.com>
wrote:
> On Aug 24 08:40, Joel Sherrill wrote:
> > On Wed, Aug 24, 2022 at 4:26 AM Corinna Vinschen <vinschen@redhat.com>
> > wrote:
> > > > [...]
> > > > if architecture has _fpmath.h
> > > > use FreeBSD long double code in libm/common/ldbl
> > > > else
> > > > use existing long double code
> > >
> > > Erm... Did you actually read my last reply?
> >
> >
> > Yes. If we do that, we end up with long double support on 8
> > architectures and lose it immediately on all others. On the
> > 18 RTEMS target architectures,
> >
> > + Current: long double support on 12
> > + Proposed: long double support on all
> > + Delete ldbl=dbl implementation: 8 would have long double
> >
> >
> > We should really not add YA
> > > code path. Merging the FreeBSD long double functions should work for
> > > basically all supported arches. We only have to create our own
> > > _fpmath.h supporting all arches based on LDBL_MANT_DIG, isn't it?
> > >
> >
> > It should if someone creates all the _fpmath.h headers.
>
> No, I wrote, create a *single* _fpmath.h file with the massive amount
> of definitions (*all* seven) based on LDBL_MANT_DIG.
>
> There are very few special targets, like x86/x86_64 which need a tweak
> in the macros, most of the time the macros should be the same.
>
> Instead of having 61 files, only have one. In theory there should be
> only two definitions for targets with LDBL_MANT_DIG == DBL_MANT_DIG
> to support little and big endian, more shouldn't be required.
>
> For all others, we already have *ieee*.h files with matching definitions
> which can be used as role models for the various (but few) definitions of
> union IEEEl2bits. See, for instance, newlib/libc/include/machine/ieee.h.
>
> > There are 61
> > directories under libc/machine. That leaves 53 _fpmath.h headers to
> > complete and most are likely ldbl==dbl. That is up to 53 target
> > architectures
> > which would lose the long double math APIs in libm.a.
> >
> > Honestly, I don't mind long term planning to delete them but I was
> > thinking this approach improves the current situation a lot since it will
> > support the targets which really have long double support. It leaves
> > in place support for where ldbl==dbl with no change in available APIs.
> > It is a net win for users.
> >
> > If there is a target with long double which doesn't have a FreeBSD
> > _fpmath.h file, then there is value in creating it. Honestly, unless
> > someone
> > can script writing the missing 50+ _fpmath.h files, I am not comfortable
> > or eager to dive in. Ignoring the lack of time to so.
> >
> > This approach works and doesn't abandon the targets which the
> > ldbl==dbl method works for.
>
> I never said to abandon these targets, but fwiw, I think you're
> overestimating the complexity to generate a single _fpmath.h
> file with matching definitions for these targes as well. The
> information is basically already present in newlib.
>
So don't preserve the FreeBSD files as close to a direct copy
as possible?
Maybe I am overestimating it. I just don't see the single _fpmath.h
to rule them all with confidence like you do. I am not seeing the
set of parameters in my head which makes this generic with
some macros.
I'd appreciate help on this.
>
> Jeff, ping? Your POV would be much appreciated here.
>
+1
I also have come across there needs to be a way to pick between ld80
and ld128 headers and implementation files. FreeBSD has them in
separate directories. Apparently their build system builds common
plus an architecture specific _fpmath.h and a choice of ld80/ld128
which adds at least two other header files
--joel
>
>
> Thanks,
> Corinna
>
>
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH newlib v1 0/4] Add FreeBSD long double functions
2022-08-26 15:45 ` Joel Sherrill
@ 2022-08-26 15:45 ` Joel Sherrill
2022-08-26 17:45 ` Corinna Vinschen
1 sibling, 0 replies; 14+ messages in thread
From: Joel Sherrill @ 2022-08-26 15:45 UTC (permalink / raw)
To: Newlib, Joel Sherrill, Jeff Johnston
[-- Attachment #1: Type: text/plain, Size: 3734 bytes --]
On Fri, Aug 26, 2022 at 10:05 AM Corinna Vinschen <vinschen@redhat.com>
wrote:
> On Aug 24 08:40, Joel Sherrill wrote:
> > On Wed, Aug 24, 2022 at 4:26 AM Corinna Vinschen <vinschen@redhat.com>
> > wrote:
> > > > [...]
> > > > if architecture has _fpmath.h
> > > > use FreeBSD long double code in libm/common/ldbl
> > > > else
> > > > use existing long double code
> > >
> > > Erm... Did you actually read my last reply?
> >
> >
> > Yes. If we do that, we end up with long double support on 8
> > architectures and lose it immediately on all others. On the
> > 18 RTEMS target architectures,
> >
> > + Current: long double support on 12
> > + Proposed: long double support on all
> > + Delete ldbl=dbl implementation: 8 would have long double
> >
> >
> > We should really not add YA
> > > code path. Merging the FreeBSD long double functions should work for
> > > basically all supported arches. We only have to create our own
> > > _fpmath.h supporting all arches based on LDBL_MANT_DIG, isn't it?
> > >
> >
> > It should if someone creates all the _fpmath.h headers.
>
> No, I wrote, create a *single* _fpmath.h file with the massive amount
> of definitions (*all* seven) based on LDBL_MANT_DIG.
>
> There are very few special targets, like x86/x86_64 which need a tweak
> in the macros, most of the time the macros should be the same.
>
> Instead of having 61 files, only have one. In theory there should be
> only two definitions for targets with LDBL_MANT_DIG == DBL_MANT_DIG
> to support little and big endian, more shouldn't be required.
>
> For all others, we already have *ieee*.h files with matching definitions
> which can be used as role models for the various (but few) definitions of
> union IEEEl2bits. See, for instance, newlib/libc/include/machine/ieee.h.
>
> > There are 61
> > directories under libc/machine. That leaves 53 _fpmath.h headers to
> > complete and most are likely ldbl==dbl. That is up to 53 target
> > architectures
> > which would lose the long double math APIs in libm.a.
> >
> > Honestly, I don't mind long term planning to delete them but I was
> > thinking this approach improves the current situation a lot since it will
> > support the targets which really have long double support. It leaves
> > in place support for where ldbl==dbl with no change in available APIs.
> > It is a net win for users.
> >
> > If there is a target with long double which doesn't have a FreeBSD
> > _fpmath.h file, then there is value in creating it. Honestly, unless
> > someone
> > can script writing the missing 50+ _fpmath.h files, I am not comfortable
> > or eager to dive in. Ignoring the lack of time to so.
> >
> > This approach works and doesn't abandon the targets which the
> > ldbl==dbl method works for.
>
> I never said to abandon these targets, but fwiw, I think you're
> overestimating the complexity to generate a single _fpmath.h
> file with matching definitions for these targes as well. The
> information is basically already present in newlib.
>
So don't preserve the FreeBSD files as close to a direct copy
as possible?
Maybe I am overestimating it. I just don't see the single _fpmath.h
to rule them all with confidence like you do. I am not seeing the
set of parameters in my head which makes this generic with
some macros.
I'd appreciate help on this.
>
> Jeff, ping? Your POV would be much appreciated here.
>
+1
I also have come across there needs to be a way to pick between ld80
and ld128 headers and implementation files. FreeBSD has them in
separate directories. Apparently their build system builds common
plus an architecture specific _fpmath.h and a choice of ld80/ld128
which adds at least two other header files
--joel
>
>
> Thanks,
> Corinna
>
>
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH newlib v1 0/4] Add FreeBSD long double functions
2022-08-26 15:45 ` Joel Sherrill
2022-08-26 15:45 ` Joel Sherrill
@ 2022-08-26 17:45 ` Corinna Vinschen
2022-08-26 20:45 ` Jeff Johnston
1 sibling, 1 reply; 14+ messages in thread
From: Corinna Vinschen @ 2022-08-26 17:45 UTC (permalink / raw)
To: newlib
On Aug 26 10:45, Joel Sherrill wrote:
> On Fri, Aug 26, 2022 at 10:05 AM Corinna Vinschen <vinschen@redhat.com>
> wrote:
> > No, I wrote, create a *single* _fpmath.h file with the massive amount
> > of definitions (*all* seven) based on LDBL_MANT_DIG.
> >
> > There are very few special targets, like x86/x86_64 which need a tweak
> > in the macros, most of the time the macros should be the same.
> >
> > Instead of having 61 files, only have one. In theory there should be
> > only two definitions for targets with LDBL_MANT_DIG == DBL_MANT_DIG
> > to support little and big endian, more shouldn't be required.
> >
> > For all others, we already have *ieee*.h files with matching definitions
> > which can be used as role models for the various (but few) definitions of
> > union IEEEl2bits. See, for instance, newlib/libc/include/machine/ieee.h.
> >
> > > This approach works and doesn't abandon the targets which the
> > > ldbl==dbl method works for.
> >
> > I never said to abandon these targets, but fwiw, I think you're
> > overestimating the complexity to generate a single _fpmath.h
> > file with matching definitions for these targes as well. The
> > information is basically already present in newlib.
> >
> So don't preserve the FreeBSD files as close to a direct copy
> as possible?
We're only talking about the _fpmath.h files, not all the other
files.
If you like, copy over the handful of target-dependent _fpmath.h
files, but *also* add a generic _fpmath.h file for all other
targets, IMHO.
> Maybe I am overestimating it. I just don't see the single _fpmath.h
> to rule them all with confidence like you do. I am not seeing the
> set of parameters in my head which makes this generic with
> some macros.
>
> I'd appreciate help on this.
newlib/libc/include/machine/ieee.h does not help?
Kind of like this:
#if LDBL_MANT_DIG == 24
union IEEEl2bits {
long double e;
# ifdef __IEEE_LITTLE_ENDIAN
struct {
__uint32_t manl :16;
__uint32_t manh :7;
__uint32_t exp :8;
__uint32_t sign :1;
} bits;
struct {
__uint32_t manl :16;
__uint32_t manh :7;
__uint32_t expsign :9;
} xbits;
# else
struct {
__uint32_t sign :1;
__uint32_t exp :8;
__uint32_t manh :7;
__uint32_t manl :16;
} bits;
struct {
__uint32_t expsign :9;
__uint32_t manh :7;
__uint32_t manl :16;
} xbits;
# endif
};
# define LDBL_NBIT 0
# define LDBL_IMPLICIT_NBIT
# define mask_nbit_l(u) ((void)0)
# define LDBL_MANH_SIZE 7
# define LDBL_MANL_SIZE 16
# define LDBL_TO_ARRAY32(u, a) do { \
(a)[0] = (uint32_t)(u).bits.manl \
| ((uint32_t)(u).bits.manh << LDBL_MANL_SIZE) \
(a)[1] = 0; \
} while(0)
#elif LDBL_MANT_DIG == 53
union IEEEl2bits {
long double e;
# ifdef __IEEE_LITTLE_ENDIAN
struct {
__uint64_t manl :32;
__uint64_t manh :20;
__uint64_t exp :11;
__uint64_t sign :1;
} bits;
struct {
__uint64_t manl :32;
__uint64_t manh :20;
__uint64_t expsign :12;
} xbits;
# else
struct {
__uint64_t sign :1;
__uint64_t exp :11;
__uint64_t manh :20;
__uint64_t manl :32;
} bits;
struct {
__uint64_t expsign :12;
__uint64_t manh :20;
__uint64_t manl :32;
} xbits;
# endif
};
# define LDBL_NBIT 0
# define LDBL_IMPLICIT_NBIT
# define mask_nbit_l(u) ((void)0)
# define LDBL_MANH_SIZE 20
# define LDBL_MANL_SIZE 32
# define LDBL_TO_ARRAY32(u, a) do { \
(a)[0] = (uint32_t)(u).bits.manl; \
(a)[1] = (uint32_t)(u).bits.manh; \
} while(0)
#elif LDBL_MANT_DIG == 64
union IEEEl2bits {
long double e;
# ifdef __IEEE_LITTLE_ENDIAN
struct {
__uint64_t manl :32;
__uint64_t manh :32;
__uint64_t exp :15;
__uint64_t sign :1;
__uint64_t junk :16
} bits;
struct {
__uint64_t man :64;
__uint64_t expsign :16;
__uint64_t junk :16
} xbits;
# else
struct {
__uint64_t junk :16
__uint64_t sign :1;
__uint64_t exp :15;
__uint64_t manh :32;
__uint64_t manl :32;
} bits;
struct {
__uint64_t junk :16
__uint64_t expsign :16;
__uint64_t man :64;
} xbits;
# endif
};
# define LDBL_NBIT 0x80000000
# define mask_nbit_l(u) ((u).bits.manh &= ~LDBL_NBIT)
# define LDBL_MANH_SIZE 32
# define LDBL_MANL_SIZE 32
# define LDBL_TO_ARRAY32(u, a) do { \
(a)[0] = (uint32_t)(u).bits.manl; \
(a)[1] = (uint32_t)(u).bits.manh; \
} while(0)
#elif LDBL_MANT_DIG == 113
union IEEEl2bits {
long double e;
# ifdef __IEEE_LITTLE_ENDIAN
struct {
__uint64_t manl :64;
__uint64_t manh :48;
__uint64_t exp :15;
__uint64_t sign :1;
} bits;
struct {
__uint64_t manl :64;
__uint64_t manh :48;
__uint64_t expsign :16;
} xbits;
# else
struct {
__uint64_t sign :1;
__uint64_t exp :15;
__uint64_t manh :48;
__uint64_t manl :64;
} bits;
struct {
__uint64_t expsign :16;
__uint64_t manh :48;
__uint64_t manl :64;
} xbits;
# endif
};
# define LDBL_NBIT 0
# define LDBL_IMPLICIT_NBIT
# define mask_nbit_l(u) ((void)0)
# define LDBL_MANH_SIZE 48
# define LDBL_MANL_SIZE 64
# define LDBL_TO_ARRAY32(u, a) do { \
(a)[0] = (uint32_t)(u).bits.manl; \
(a)[1] = (uint32_t)((u).bits.manl >> 32); \
(a)[2] = (uint32_t)(u).bits.manh; \
(a)[3] = (uint32_t)((u).bits.manh >> 32); \
} while(0)
#endif
There's also a ___IEEE_BYTES_LITTLE_ENDIAN definition which I ignored
for now. Also, the LDBL_MANT_DIG == 64 is defined for x86-only and the
manl/manh fields for LDBL_MANT_DIG == 23 are faked on a 16 bit border
just to have a manl and a manh definition.
I don't claim that it works OOTB with the above, but apart from
the LDBL_NBIT/mask_nbit_l values which differ for x86/x86_64 CPUs,
it should be a good start, I think.
> > Jeff, ping? Your POV would be much appreciated here.
> >
>
> +1
>
> I also have come across there needs to be a way to pick between ld80
> and ld128 headers and implementation files. FreeBSD has them in
> separate directories. Apparently their build system builds common
> plus an architecture specific _fpmath.h and a choice of ld80/ld128
> which adds at least two other header files
But then again, FreeBSD supports ARM and PowerPC, both of which come
with 64 bit long double. So, besides ld80/ld128, there's apparently a
generic implementation, too, to support non-ld80 and non-ld128 long
double, right?
Corinna
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH newlib v1 0/4] Add FreeBSD long double functions
2022-08-26 17:45 ` Corinna Vinschen
@ 2022-08-26 20:45 ` Jeff Johnston
2022-08-26 20:45 ` Jeff Johnston
0 siblings, 1 reply; 14+ messages in thread
From: Jeff Johnston @ 2022-08-26 20:45 UTC (permalink / raw)
To: Newlib
On Fri, Aug 26, 2022 at 1:45 PM Corinna Vinschen <vinschen@redhat.com>
wrote:
> On Aug 26 10:45, Joel Sherrill wrote:
> > On Fri, Aug 26, 2022 at 10:05 AM Corinna Vinschen <vinschen@redhat.com>
> > wrote:
> > > No, I wrote, create a *single* _fpmath.h file with the massive amount
> > > of definitions (*all* seven) based on LDBL_MANT_DIG.
> > >
> > > There are very few special targets, like x86/x86_64 which need a tweak
> > > in the macros, most of the time the macros should be the same.
> > >
> > > Instead of having 61 files, only have one. In theory there should be
> > > only two definitions for targets with LDBL_MANT_DIG == DBL_MANT_DIG
> > > to support little and big endian, more shouldn't be required.
> > >
> > > For all others, we already have *ieee*.h files with matching
> definitions
> > > which can be used as role models for the various (but few) definitions
> of
> > > union IEEEl2bits. See, for instance,
> newlib/libc/include/machine/ieee.h.
> > >
> > > > This approach works and doesn't abandon the targets which the
> > > > ldbl==dbl method works for.
> > >
> > > I never said to abandon these targets, but fwiw, I think you're
> > > overestimating the complexity to generate a single _fpmath.h
> > > file with matching definitions for these targes as well. The
> > > information is basically already present in newlib.
> > >
> > So don't preserve the FreeBSD files as close to a direct copy
> > as possible?
>
> We're only talking about the _fpmath.h files, not all the other
> files.
>
> If you like, copy over the handful of target-dependent _fpmath.h
> files, but *also* add a generic _fpmath.h file for all other
> targets, IMHO.
>
> > Maybe I am overestimating it. I just don't see the single _fpmath.h
> > to rule them all with confidence like you do. I am not seeing the
> > set of parameters in my head which makes this generic with
> > some macros.
> >
> > I'd appreciate help on this.
>
> newlib/libc/include/machine/ieee.h does not help?
>
> Kind of like this:
>
> #if LDBL_MANT_DIG == 24
> union IEEEl2bits {
> long double e;
> # ifdef __IEEE_LITTLE_ENDIAN
> struct {
> __uint32_t manl :16;
> __uint32_t manh :7;
> __uint32_t exp :8;
> __uint32_t sign :1;
> } bits;
> struct {
> __uint32_t manl :16;
> __uint32_t manh :7;
> __uint32_t expsign :9;
> } xbits;
> # else
> struct {
> __uint32_t sign :1;
> __uint32_t exp :8;
> __uint32_t manh :7;
> __uint32_t manl :16;
> } bits;
> struct {
> __uint32_t expsign :9;
> __uint32_t manh :7;
> __uint32_t manl :16;
> } xbits;
> # endif
> };
> # define LDBL_NBIT 0
> # define LDBL_IMPLICIT_NBIT
> # define mask_nbit_l(u) ((void)0)
>
> # define LDBL_MANH_SIZE 7
> # define LDBL_MANL_SIZE 16
>
> # define LDBL_TO_ARRAY32(u, a) do { \
> (a)[0] = (uint32_t)(u).bits.manl \
> | ((uint32_t)(u).bits.manh << LDBL_MANL_SIZE) \
> (a)[1] = 0; \
> } while(0)
> #elif LDBL_MANT_DIG == 53
> union IEEEl2bits {
> long double e;
> # ifdef __IEEE_LITTLE_ENDIAN
> struct {
> __uint64_t manl :32;
> __uint64_t manh :20;
> __uint64_t exp :11;
> __uint64_t sign :1;
> } bits;
> struct {
> __uint64_t manl :32;
> __uint64_t manh :20;
> __uint64_t expsign :12;
> } xbits;
> # else
> struct {
> __uint64_t sign :1;
> __uint64_t exp :11;
> __uint64_t manh :20;
> __uint64_t manl :32;
> } bits;
> struct {
> __uint64_t expsign :12;
> __uint64_t manh :20;
> __uint64_t manl :32;
> } xbits;
> # endif
> };
> # define LDBL_NBIT 0
> # define LDBL_IMPLICIT_NBIT
> # define mask_nbit_l(u) ((void)0)
>
> # define LDBL_MANH_SIZE 20
> # define LDBL_MANL_SIZE 32
>
> # define LDBL_TO_ARRAY32(u, a) do { \
> (a)[0] = (uint32_t)(u).bits.manl; \
> (a)[1] = (uint32_t)(u).bits.manh; \
> } while(0)
> #elif LDBL_MANT_DIG == 64
> union IEEEl2bits {
> long double e;
> # ifdef __IEEE_LITTLE_ENDIAN
> struct {
> __uint64_t manl :32;
> __uint64_t manh :32;
> __uint64_t exp :15;
> __uint64_t sign :1;
> __uint64_t junk :16
> } bits;
> struct {
> __uint64_t man :64;
> __uint64_t expsign :16;
> __uint64_t junk :16
> } xbits;
> # else
> struct {
> __uint64_t junk :16
> __uint64_t sign :1;
> __uint64_t exp :15;
> __uint64_t manh :32;
> __uint64_t manl :32;
> } bits;
> struct {
> __uint64_t junk :16
> __uint64_t expsign :16;
> __uint64_t man :64;
> } xbits;
> # endif
> };
>
> # define LDBL_NBIT 0x80000000
> # define mask_nbit_l(u) ((u).bits.manh &= ~LDBL_NBIT)
>
> # define LDBL_MANH_SIZE 32
> # define LDBL_MANL_SIZE 32
>
> # define LDBL_TO_ARRAY32(u, a) do { \
> (a)[0] = (uint32_t)(u).bits.manl; \
> (a)[1] = (uint32_t)(u).bits.manh; \
> } while(0)
> #elif LDBL_MANT_DIG == 113
> union IEEEl2bits {
> long double e;
> # ifdef __IEEE_LITTLE_ENDIAN
> struct {
> __uint64_t manl :64;
> __uint64_t manh :48;
> __uint64_t exp :15;
> __uint64_t sign :1;
> } bits;
> struct {
> __uint64_t manl :64;
> __uint64_t manh :48;
> __uint64_t expsign :16;
> } xbits;
> # else
> struct {
> __uint64_t sign :1;
> __uint64_t exp :15;
> __uint64_t manh :48;
> __uint64_t manl :64;
> } bits;
> struct {
> __uint64_t expsign :16;
> __uint64_t manh :48;
> __uint64_t manl :64;
> } xbits;
> # endif
> };
>
> # define LDBL_NBIT 0
> # define LDBL_IMPLICIT_NBIT
> # define mask_nbit_l(u) ((void)0)
>
> # define LDBL_MANH_SIZE 48
> # define LDBL_MANL_SIZE 64
>
> # define LDBL_TO_ARRAY32(u, a) do { \
> (a)[0] = (uint32_t)(u).bits.manl; \
> (a)[1] = (uint32_t)((u).bits.manl >> 32); \
> (a)[2] = (uint32_t)(u).bits.manh; \
> (a)[3] = (uint32_t)((u).bits.manh >> 32); \
> } while(0)
> #endif
>
> There's also a ___IEEE_BYTES_LITTLE_ENDIAN definition which I ignored
> for now. Also, the LDBL_MANT_DIG == 64 is defined for x86-only and the
> manl/manh fields for LDBL_MANT_DIG == 23 are faked on a 16 bit border
> just to have a manl and a manh definition.
>
> I don't claim that it works OOTB with the above, but apart from
> the LDBL_NBIT/mask_nbit_l values which differ for x86/x86_64 CPUs,
> it should be a good start, I think.
>
> > > Jeff, ping? Your POV would be much appreciated here.
> > >
>
Sorry for the late reply. I agree with your proposal Corinna.
>
> > +1
> >
> > I also have come across there needs to be a way to pick between ld80
> > and ld128 headers and implementation files. FreeBSD has them in
> > separate directories. Apparently their build system builds common
> > plus an architecture specific _fpmath.h and a choice of ld80/ld128
> > which adds at least two other header files
>
> But then again, FreeBSD supports ARM and PowerPC, both of which come
> with 64 bit long double. So, besides ld80/ld128, there's apparently a
> generic implementation, too, to support non-ld80 and non-ld128 long
> double, right?
>
>
> Corinna
>
>
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH newlib v1 0/4] Add FreeBSD long double functions
2022-08-26 20:45 ` Jeff Johnston
@ 2022-08-26 20:45 ` Jeff Johnston
0 siblings, 0 replies; 14+ messages in thread
From: Jeff Johnston @ 2022-08-26 20:45 UTC (permalink / raw)
To: Newlib
[-- Attachment #1: Type: text/plain, Size: 8791 bytes --]
On Fri, Aug 26, 2022 at 1:45 PM Corinna Vinschen <vinschen@redhat.com>
wrote:
> On Aug 26 10:45, Joel Sherrill wrote:
> > On Fri, Aug 26, 2022 at 10:05 AM Corinna Vinschen <vinschen@redhat.com>
> > wrote:
> > > No, I wrote, create a *single* _fpmath.h file with the massive amount
> > > of definitions (*all* seven) based on LDBL_MANT_DIG.
> > >
> > > There are very few special targets, like x86/x86_64 which need a tweak
> > > in the macros, most of the time the macros should be the same.
> > >
> > > Instead of having 61 files, only have one. In theory there should be
> > > only two definitions for targets with LDBL_MANT_DIG == DBL_MANT_DIG
> > > to support little and big endian, more shouldn't be required.
> > >
> > > For all others, we already have *ieee*.h files with matching
> definitions
> > > which can be used as role models for the various (but few) definitions
> of
> > > union IEEEl2bits. See, for instance,
> newlib/libc/include/machine/ieee.h.
> > >
> > > > This approach works and doesn't abandon the targets which the
> > > > ldbl==dbl method works for.
> > >
> > > I never said to abandon these targets, but fwiw, I think you're
> > > overestimating the complexity to generate a single _fpmath.h
> > > file with matching definitions for these targes as well. The
> > > information is basically already present in newlib.
> > >
> > So don't preserve the FreeBSD files as close to a direct copy
> > as possible?
>
> We're only talking about the _fpmath.h files, not all the other
> files.
>
> If you like, copy over the handful of target-dependent _fpmath.h
> files, but *also* add a generic _fpmath.h file for all other
> targets, IMHO.
>
> > Maybe I am overestimating it. I just don't see the single _fpmath.h
> > to rule them all with confidence like you do. I am not seeing the
> > set of parameters in my head which makes this generic with
> > some macros.
> >
> > I'd appreciate help on this.
>
> newlib/libc/include/machine/ieee.h does not help?
>
> Kind of like this:
>
> #if LDBL_MANT_DIG == 24
> union IEEEl2bits {
> long double e;
> # ifdef __IEEE_LITTLE_ENDIAN
> struct {
> __uint32_t manl :16;
> __uint32_t manh :7;
> __uint32_t exp :8;
> __uint32_t sign :1;
> } bits;
> struct {
> __uint32_t manl :16;
> __uint32_t manh :7;
> __uint32_t expsign :9;
> } xbits;
> # else
> struct {
> __uint32_t sign :1;
> __uint32_t exp :8;
> __uint32_t manh :7;
> __uint32_t manl :16;
> } bits;
> struct {
> __uint32_t expsign :9;
> __uint32_t manh :7;
> __uint32_t manl :16;
> } xbits;
> # endif
> };
> # define LDBL_NBIT 0
> # define LDBL_IMPLICIT_NBIT
> # define mask_nbit_l(u) ((void)0)
>
> # define LDBL_MANH_SIZE 7
> # define LDBL_MANL_SIZE 16
>
> # define LDBL_TO_ARRAY32(u, a) do { \
> (a)[0] = (uint32_t)(u).bits.manl \
> | ((uint32_t)(u).bits.manh << LDBL_MANL_SIZE) \
> (a)[1] = 0; \
> } while(0)
> #elif LDBL_MANT_DIG == 53
> union IEEEl2bits {
> long double e;
> # ifdef __IEEE_LITTLE_ENDIAN
> struct {
> __uint64_t manl :32;
> __uint64_t manh :20;
> __uint64_t exp :11;
> __uint64_t sign :1;
> } bits;
> struct {
> __uint64_t manl :32;
> __uint64_t manh :20;
> __uint64_t expsign :12;
> } xbits;
> # else
> struct {
> __uint64_t sign :1;
> __uint64_t exp :11;
> __uint64_t manh :20;
> __uint64_t manl :32;
> } bits;
> struct {
> __uint64_t expsign :12;
> __uint64_t manh :20;
> __uint64_t manl :32;
> } xbits;
> # endif
> };
> # define LDBL_NBIT 0
> # define LDBL_IMPLICIT_NBIT
> # define mask_nbit_l(u) ((void)0)
>
> # define LDBL_MANH_SIZE 20
> # define LDBL_MANL_SIZE 32
>
> # define LDBL_TO_ARRAY32(u, a) do { \
> (a)[0] = (uint32_t)(u).bits.manl; \
> (a)[1] = (uint32_t)(u).bits.manh; \
> } while(0)
> #elif LDBL_MANT_DIG == 64
> union IEEEl2bits {
> long double e;
> # ifdef __IEEE_LITTLE_ENDIAN
> struct {
> __uint64_t manl :32;
> __uint64_t manh :32;
> __uint64_t exp :15;
> __uint64_t sign :1;
> __uint64_t junk :16
> } bits;
> struct {
> __uint64_t man :64;
> __uint64_t expsign :16;
> __uint64_t junk :16
> } xbits;
> # else
> struct {
> __uint64_t junk :16
> __uint64_t sign :1;
> __uint64_t exp :15;
> __uint64_t manh :32;
> __uint64_t manl :32;
> } bits;
> struct {
> __uint64_t junk :16
> __uint64_t expsign :16;
> __uint64_t man :64;
> } xbits;
> # endif
> };
>
> # define LDBL_NBIT 0x80000000
> # define mask_nbit_l(u) ((u).bits.manh &= ~LDBL_NBIT)
>
> # define LDBL_MANH_SIZE 32
> # define LDBL_MANL_SIZE 32
>
> # define LDBL_TO_ARRAY32(u, a) do { \
> (a)[0] = (uint32_t)(u).bits.manl; \
> (a)[1] = (uint32_t)(u).bits.manh; \
> } while(0)
> #elif LDBL_MANT_DIG == 113
> union IEEEl2bits {
> long double e;
> # ifdef __IEEE_LITTLE_ENDIAN
> struct {
> __uint64_t manl :64;
> __uint64_t manh :48;
> __uint64_t exp :15;
> __uint64_t sign :1;
> } bits;
> struct {
> __uint64_t manl :64;
> __uint64_t manh :48;
> __uint64_t expsign :16;
> } xbits;
> # else
> struct {
> __uint64_t sign :1;
> __uint64_t exp :15;
> __uint64_t manh :48;
> __uint64_t manl :64;
> } bits;
> struct {
> __uint64_t expsign :16;
> __uint64_t manh :48;
> __uint64_t manl :64;
> } xbits;
> # endif
> };
>
> # define LDBL_NBIT 0
> # define LDBL_IMPLICIT_NBIT
> # define mask_nbit_l(u) ((void)0)
>
> # define LDBL_MANH_SIZE 48
> # define LDBL_MANL_SIZE 64
>
> # define LDBL_TO_ARRAY32(u, a) do { \
> (a)[0] = (uint32_t)(u).bits.manl; \
> (a)[1] = (uint32_t)((u).bits.manl >> 32); \
> (a)[2] = (uint32_t)(u).bits.manh; \
> (a)[3] = (uint32_t)((u).bits.manh >> 32); \
> } while(0)
> #endif
>
> There's also a ___IEEE_BYTES_LITTLE_ENDIAN definition which I ignored
> for now. Also, the LDBL_MANT_DIG == 64 is defined for x86-only and the
> manl/manh fields for LDBL_MANT_DIG == 23 are faked on a 16 bit border
> just to have a manl and a manh definition.
>
> I don't claim that it works OOTB with the above, but apart from
> the LDBL_NBIT/mask_nbit_l values which differ for x86/x86_64 CPUs,
> it should be a good start, I think.
>
> > > Jeff, ping? Your POV would be much appreciated here.
> > >
>
Sorry for the late reply. I agree with your proposal Corinna.
>
> > +1
> >
> > I also have come across there needs to be a way to pick between ld80
> > and ld128 headers and implementation files. FreeBSD has them in
> > separate directories. Apparently their build system builds common
> > plus an architecture specific _fpmath.h and a choice of ld80/ld128
> > which adds at least two other header files
>
> But then again, FreeBSD supports ARM and PowerPC, both of which come
> with 64 bit long double. So, besides ld80/ld128, there's apparently a
> generic implementation, too, to support non-ld80 and non-ld128 long
> double, right?
>
>
> Corinna
>
>
^ permalink raw reply [flat|nested] 14+ messages in thread
end of thread, other threads:[~2022-08-26 20:45 UTC | newest]
Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-22 22:50 [PATCH newlib v1 0/4] Add FreeBSD long double functions Joel Sherrill
2022-08-22 22:50 ` [PATCH newlib v1 1/4] Add infrastructure for incorporating FreeBSD long double methods Joel Sherrill
2022-08-22 22:50 ` [PATCH newlib v1 2/4] Makefile.in and configure: Regenerated Joel Sherrill
2022-08-22 22:50 ` [PATCH newlib v1 3/4] Split libm/common/frexpl.c into LDBL_EQ_DBL and long double versions Joel Sherrill
2022-08-22 22:50 ` [PATCH newlib v1 4/4] Makefile.in: Regenerated Joel Sherrill
2022-08-24 9:26 ` [PATCH newlib v1 0/4] Add FreeBSD long double functions Corinna Vinschen
2022-08-24 13:40 ` Joel Sherrill
2022-08-24 13:40 ` Joel Sherrill
2022-08-26 15:05 ` Corinna Vinschen
2022-08-26 15:45 ` Joel Sherrill
2022-08-26 15:45 ` Joel Sherrill
2022-08-26 17:45 ` Corinna Vinschen
2022-08-26 20:45 ` Jeff Johnston
2022-08-26 20:45 ` Jeff Johnston
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).