public inbox for newlib@sourceware.org
 help / color / mirror / Atom feed
* [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

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).