From: Jennifer Averett <jennifer.averett@oarcorp.com>
To: newlib@sourceware.org
Cc: Jennifer Averett <jennifer.averett@oarcorp.com>
Subject: [PATCH 0/3]: Add math support for non LDBL_EQ_DBL architecture
Date: Mon, 3 Apr 2023 15:58:34 -0500 [thread overview]
Message-ID: <20230403205837.1595602-1-jennifer.averett@oarcorp.com> (raw)
The attached set of patches add long double support for i386, aarch64 and
x86_64. The riscv and powerpc are supported by FreeBSD but will need more
work to be supported by newlib. FreeBSD has separate 64 and 32 bit powerpc
support which would have to be integrated for newlib. FreeBSD riscv support
is 64 and there are issues with fenv.h that would have to be addressed.
The first patch is FreeBSD source. Most of the source resides in three
directories ld, ld128, and ld80. These contain the long double methods.
The ld128 and ld80 are enabled based on the architecture. I also added
the FreeBSD sys/endian.h file which was required to build. Finally, an
architecture machine/_fpmath.h file was copied from FreeBSD for each
architecture the methods are to be built with. The existence of this file
is used to trigger the FreeBSD long double math methods to build. If the
architecture does not have _fpmath.h the LDBL_EQ_DBL files are built instead.
The second patch contains the modifications necessary to build in newlib.
In FreeBSD some header files from any of the three directories are visible to
all the source files. The include statements were modified so the header
file was pulled from the required directory (e.g, “file.h” was changed to
“ld/file.h”). The files invtrig.h and k_expl.h were created in the ld
directory and conditionally include either the ld128 or the ld80 version of
that header file. If the configure/makefile magic were changed it might be
possible to adjust the include arguments to the compiler rather than the include statements.
Also in the second patch, some of the _fpmath.h and a couple of the source files
unsigned long and unsigned int were changed to fixed width types so different
sized unsigned long could be accommodated. The FreeBSD file s_nearbyint.c
contained the methods nearbyint, nearbyintf, and nearbyintl. This file name
was changed to s_nearbyintl.c and the methods nearbyint and nearbyintf were
removed from the compile to resolve conflicts.
Finally, since long double support shouldn’t be considered rare anymore
prototypes in math.h are no longer conditional.
Jennifer Averett (3):
newlib: Add FreeBSD files for non LDBL_EQ_DBL support
newlib: Add non LDBL_EQ_DBL math support for aarch64, i386, and x86_64
newlib: Regenerated source for adding non LDBL_EQ_DBL math methods.
newlib/Makefile.in | 1312 ++++++++++++++++-
newlib/configure | 16 +
newlib/libc/acinclude.m4 | 3 +
newlib/libc/include/math.h | 14 -
newlib/libc/include/sys/endian.h | 207 +++
newlib/libc/machine/aarch64/machine/_fpmath.h | 64 +
newlib/libc/machine/i386/machine/_fpmath.h | 56 +
newlib/libc/machine/x86_64/machine/_fpmath.h | 57 +
newlib/libm/Makefile.inc | 8 +
newlib/libm/ld/Makefile.inc | 56 +
newlib/libm/ld/e_acoshl.c | 89 ++
newlib/libm/ld/e_acosl.c | 87 ++
newlib/libm/ld/e_asinl.c | 77 +
newlib/libm/ld/e_atan2l.c | 120 ++
newlib/libm/ld/e_atanhl.c | 74 +
newlib/libm/ld/e_coshl.c | 132 ++
newlib/libm/ld/e_fmodl.c | 149 ++
newlib/libm/ld/e_lgammal.c | 27 +
newlib/libm/ld/e_remainderl.c | 40 +
newlib/libm/ld/e_sinhl.c | 134 ++
newlib/libm/ld/fpmath.h | 82 ++
newlib/libm/ld/invtrig.h | 34 +
newlib/libm/ld/k_expl.h | 33 +
newlib/libm/ld/math_private.h | 941 ++++++++++++
newlib/libm/ld/s_asinhl.c | 91 ++
newlib/libm/ld/s_atanl.c | 85 ++
newlib/libm/ld/s_cbrtl.c | 143 ++
newlib/libm/ld/s_ceill.c | 101 ++
newlib/libm/ld/s_copysignl.c | 44 +
newlib/libm/ld/s_cosl.c | 102 ++
newlib/libm/ld/s_fabsl.c | 45 +
newlib/libm/ld/s_fdim.c | 48 +
newlib/libm/ld/s_floorl.c | 101 ++
newlib/libm/ld/s_fmal.c | 274 ++++
newlib/libm/ld/s_fmaxl.c | 57 +
newlib/libm/ld/s_fminl.c | 57 +
newlib/libm/ld/s_frexpl.c | 64 +
newlib/libm/ld/s_ilogbl.c | 53 +
newlib/libm/ld/s_llrintl.c | 9 +
newlib/libm/ld/s_llroundl.c | 11 +
newlib/libm/ld/s_logbl.c | 54 +
newlib/libm/ld/s_lrint.c | 60 +
newlib/libm/ld/s_lrintl.c | 9 +
newlib/libm/ld/s_lround.c | 70 +
newlib/libm/ld/s_lroundl.c | 11 +
newlib/libm/ld/s_modfl.c | 103 ++
newlib/libm/ld/s_nearbyintl.c | 68 +
newlib/libm/ld/s_nextafterl.c | 80 +
newlib/libm/ld/s_nexttoward.c | 72 +
newlib/libm/ld/s_nexttowardf.c | 59 +
newlib/libm/ld/s_remquol.c | 173 +++
newlib/libm/ld/s_rintl.c | 92 ++
newlib/libm/ld/s_roundl.c | 64 +
newlib/libm/ld/s_scalbln.c | 56 +
newlib/libm/ld/s_scalbnl.c | 49 +
newlib/libm/ld/s_sinl.c | 95 ++
newlib/libm/ld/s_tanhl.c | 174 +++
newlib/libm/ld/s_tanl.c | 97 ++
newlib/libm/ld/s_truncl.c | 68 +
newlib/libm/ld128/Makefile.inc | 13 +
newlib/libm/ld128/b_tgammal.c | 57 +
newlib/libm/ld128/e_powl.c | 443 ++++++
newlib/libm/ld128/e_rem_pio2l.h | 135 ++
newlib/libm/ld128/invtrig.h | 115 ++
newlib/libm/ld128/k_expl.h | 324 ++++
newlib/libm/ld128/s_erfl.c | 329 +++++
newlib/libm/ld128/s_exp2l.c | 429 ++++++
newlib/libm/ld128/s_expl.c | 326 ++++
newlib/libm/ld128/s_logl.c | 740 ++++++++++
newlib/libm/ld80/Makefile.inc | 14 +
newlib/libm/ld80/b_expl.c | 113 ++
newlib/libm/ld80/b_logl.c | 375 +++++
newlib/libm/ld80/b_tgammal.c | 422 ++++++
newlib/libm/ld80/e_powl.c | 662 +++++++++
newlib/libm/ld80/e_rem_pio2l.h | 143 ++
newlib/libm/ld80/invtrig.h | 116 ++
newlib/libm/ld80/k_cospil.h | 42 +
newlib/libm/ld80/k_expl.h | 301 ++++
newlib/libm/ld80/k_sinpil.h | 42 +
newlib/libm/ld80/s_cospil.c | 129 ++
newlib/libm/ld80/s_erfl.c | 337 +++++
newlib/libm/ld80/s_exp2l.c | 290 ++++
newlib/libm/ld80/s_expl.c | 279 ++++
newlib/libm/ld80/s_logl.c | 722 +++++++++
newlib/libm/ld80/s_sinpil.c | 140 ++
newlib/newlib.hin | 12 +
86 files changed, 13522 insertions(+), 79 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/i386/machine/_fpmath.h
create mode 100644 newlib/libc/machine/x86_64/machine/_fpmath.h
create mode 100644 newlib/libm/ld/Makefile.inc
create mode 100644 newlib/libm/ld/e_acoshl.c
create mode 100644 newlib/libm/ld/e_acosl.c
create mode 100644 newlib/libm/ld/e_asinl.c
create mode 100644 newlib/libm/ld/e_atan2l.c
create mode 100644 newlib/libm/ld/e_atanhl.c
create mode 100644 newlib/libm/ld/e_coshl.c
create mode 100644 newlib/libm/ld/e_fmodl.c
create mode 100644 newlib/libm/ld/e_lgammal.c
create mode 100644 newlib/libm/ld/e_remainderl.c
create mode 100644 newlib/libm/ld/e_sinhl.c
create mode 100644 newlib/libm/ld/fpmath.h
create mode 100644 newlib/libm/ld/invtrig.h
create mode 100644 newlib/libm/ld/k_expl.h
create mode 100644 newlib/libm/ld/math_private.h
create mode 100644 newlib/libm/ld/s_asinhl.c
create mode 100644 newlib/libm/ld/s_atanl.c
create mode 100644 newlib/libm/ld/s_cbrtl.c
create mode 100644 newlib/libm/ld/s_ceill.c
create mode 100644 newlib/libm/ld/s_copysignl.c
create mode 100644 newlib/libm/ld/s_cosl.c
create mode 100644 newlib/libm/ld/s_fabsl.c
create mode 100644 newlib/libm/ld/s_fdim.c
create mode 100644 newlib/libm/ld/s_floorl.c
create mode 100644 newlib/libm/ld/s_fmal.c
create mode 100644 newlib/libm/ld/s_fmaxl.c
create mode 100644 newlib/libm/ld/s_fminl.c
create mode 100644 newlib/libm/ld/s_frexpl.c
create mode 100644 newlib/libm/ld/s_ilogbl.c
create mode 100644 newlib/libm/ld/s_llrintl.c
create mode 100644 newlib/libm/ld/s_llroundl.c
create mode 100644 newlib/libm/ld/s_logbl.c
create mode 100644 newlib/libm/ld/s_lrint.c
create mode 100644 newlib/libm/ld/s_lrintl.c
create mode 100644 newlib/libm/ld/s_lround.c
create mode 100644 newlib/libm/ld/s_lroundl.c
create mode 100644 newlib/libm/ld/s_modfl.c
create mode 100644 newlib/libm/ld/s_nearbyintl.c
create mode 100644 newlib/libm/ld/s_nextafterl.c
create mode 100644 newlib/libm/ld/s_nexttoward.c
create mode 100644 newlib/libm/ld/s_nexttowardf.c
create mode 100644 newlib/libm/ld/s_remquol.c
create mode 100644 newlib/libm/ld/s_rintl.c
create mode 100644 newlib/libm/ld/s_roundl.c
create mode 100644 newlib/libm/ld/s_scalbln.c
create mode 100644 newlib/libm/ld/s_scalbnl.c
create mode 100644 newlib/libm/ld/s_sinl.c
create mode 100644 newlib/libm/ld/s_tanhl.c
create mode 100644 newlib/libm/ld/s_tanl.c
create mode 100644 newlib/libm/ld/s_truncl.c
create mode 100644 newlib/libm/ld128/Makefile.inc
create mode 100644 newlib/libm/ld128/b_tgammal.c
create mode 100644 newlib/libm/ld128/e_powl.c
create mode 100644 newlib/libm/ld128/e_rem_pio2l.h
create mode 100644 newlib/libm/ld128/invtrig.h
create mode 100644 newlib/libm/ld128/k_expl.h
create mode 100644 newlib/libm/ld128/s_erfl.c
create mode 100644 newlib/libm/ld128/s_exp2l.c
create mode 100644 newlib/libm/ld128/s_expl.c
create mode 100644 newlib/libm/ld128/s_logl.c
create mode 100644 newlib/libm/ld80/Makefile.inc
create mode 100644 newlib/libm/ld80/b_expl.c
create mode 100644 newlib/libm/ld80/b_logl.c
create mode 100644 newlib/libm/ld80/b_tgammal.c
create mode 100644 newlib/libm/ld80/e_powl.c
create mode 100644 newlib/libm/ld80/e_rem_pio2l.h
create mode 100644 newlib/libm/ld80/invtrig.h
create mode 100644 newlib/libm/ld80/k_cospil.h
create mode 100644 newlib/libm/ld80/k_expl.h
create mode 100644 newlib/libm/ld80/k_sinpil.h
create mode 100644 newlib/libm/ld80/s_cospil.c
create mode 100644 newlib/libm/ld80/s_erfl.c
create mode 100644 newlib/libm/ld80/s_exp2l.c
create mode 100644 newlib/libm/ld80/s_expl.c
create mode 100644 newlib/libm/ld80/s_logl.c
create mode 100644 newlib/libm/ld80/s_sinpil.c
--
2.31.1
next reply other threads:[~2023-04-03 20:59 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-04-03 20:58 Jennifer Averett [this message]
2023-04-03 20:58 ` [PATCH 1/3] newlib: Add FreeBSD files for non LDBL_EQ_DBL support Jennifer Averett
2023-04-03 20:58 ` [PATCH 2/3] newlib: Add non LDBL_EQ_DBL math support for aarch64, i386, and x86_64 Jennifer Averett
2023-04-03 20:58 ` [PATCH 3/3] newlib: Regenerated source for adding non LDBL_EQ_DBL math methods Jennifer Averett
2023-04-05 9:23 ` [PATCH 0/3]: Add math support for non LDBL_EQ_DBL architecture Corinna Vinschen
2023-04-05 15:44 ` Joel Sherrill
2023-04-06 9:00 ` Corinna Vinschen
2023-04-06 14:06 ` Joel Sherrill
2023-04-06 16:23 ` Corinna Vinschen
2023-04-05 20:12 ` Jeff Johnston
2023-04-05 21:34 ` Joel Sherrill
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230403205837.1595602-1-jennifer.averett@oarcorp.com \
--to=jennifer.averett@oarcorp.com \
--cc=newlib@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).