diff options
author | Jennifer Averett <jennifer.averett@oarcorp.com> | 2023-05-05 21:39:17 +0300 |
---|---|---|
committer | Joel Sherrill <joel@rtems.org> | 2023-05-16 17:05:36 +0300 |
commit | 048ebea9819b67daefc1ab3cda2add6ebe6f27a0 (patch) | |
tree | e208ce66bedbfd432df77cf73dbfcaaaf5e528e5 /newlib/libm/ld80 | |
parent | c630a6a837fd581d741fb94602aed6a4a5ed9bf4 (diff) |
newlib: Add non LDBL_EQ_DBL math support for aarch64, i386, and x86_64
Rename s_nearbyint.c, s_fdim.c and s_scalbln.c to remove conflicts
Remove functions that are not needed from above files
Modify include paths
Add includes missing in cygwin build
Add missing types
Create Makefiles
Create header files to resolve dependencies between directories
Modify some instances of unsigned long to uint64_t for 32 bit platforms
Add HAVE_FPMATH_H
Diffstat (limited to 'newlib/libm/ld80')
-rw-r--r-- | newlib/libm/ld80/Makefile.inc | 15 | ||||
-rw-r--r-- | newlib/libm/ld80/b_expl.c | 4 | ||||
-rw-r--r-- | newlib/libm/ld80/b_tgammal.c | 7 | ||||
-rw-r--r-- | newlib/libm/ld80/e_lgammal_r.c | 4 | ||||
-rw-r--r-- | newlib/libm/ld80/e_powl.c | 4 | ||||
-rw-r--r-- | newlib/libm/ld80/e_rem_pio2l.h | 2 | ||||
-rw-r--r-- | newlib/libm/ld80/invtrig.h | 2 | ||||
-rw-r--r-- | newlib/libm/ld80/k_cosl.c | 4 | ||||
-rw-r--r-- | newlib/libm/ld80/k_sinl.c | 4 | ||||
-rw-r--r-- | newlib/libm/ld80/s_cospil.c | 4 | ||||
-rw-r--r-- | newlib/libm/ld80/s_erfl.c | 4 | ||||
-rw-r--r-- | newlib/libm/ld80/s_exp2l.c | 4 | ||||
-rw-r--r-- | newlib/libm/ld80/s_expl.c | 4 | ||||
-rw-r--r-- | newlib/libm/ld80/s_logl.c | 4 | ||||
-rw-r--r-- | newlib/libm/ld80/s_sinpil.c | 4 |
15 files changed, 44 insertions, 26 deletions
diff --git a/newlib/libm/ld80/Makefile.inc b/newlib/libm/ld80/Makefile.inc new file mode 100644 index 000000000..97fbacdda --- /dev/null +++ b/newlib/libm/ld80/Makefile.inc @@ -0,0 +1,15 @@ +%C%_lsrc = \ + %D%/b_tgammal.c %D%/e_powl.c %D%/s_erfl.c %D%/s_exp2l.c \ + %D%/s_expl.c %D%/s_logl.c %D%/s_sinpil.c %D%/s_cospil.c \ + %D%/invtrig.c %D%/e_lgammal_r.c %D%/k_cosl.c %D%/k_sinl.c + + +libm_a_CFLAGS_%C% = -fbuiltin -fno-math-errno + +if HAVE_LONG_DOUBLE +libm_a_SOURCES += $(%C%_lsrc) +endif # HAVE_LONG_DOUBLE + +LIBM_CHEWOUT_FILES += + +LIBM_CHAPTERS += diff --git a/newlib/libm/ld80/b_expl.c b/newlib/libm/ld80/b_expl.c index c18a55451..26c95fb7b 100644 --- a/newlib/libm/ld80/b_expl.c +++ b/newlib/libm/ld80/b_expl.c @@ -35,8 +35,8 @@ * bsdrc/b_exp.c converted to long double by Steven G. Kargl. */ -#include "fpmath.h" -#include "math_private.h" +#include "../ld/fpmath.h" +#include "../ld/math_private.h" static const union IEEEl2bits p0u = LD80C(0xaaaaaaaaaaaaaaab, -3, 1.66666666666666666671e-01L), diff --git a/newlib/libm/ld80/b_tgammal.c b/newlib/libm/ld80/b_tgammal.c index 2b955d658..efc0e2434 100644 --- a/newlib/libm/ld80/b_tgammal.c +++ b/newlib/libm/ld80/b_tgammal.c @@ -55,9 +55,12 @@ #include <ieeefp.h> #endif -#include "fpmath.h" +#include "../ld/fpmath.h" #include "math.h" -#include "math_private.h" +#include "../ld/math_private.h" + +long double sinpil(long double x); +long double cospil(long double x); /* Used in b_log.c and below. */ struct Double { diff --git a/newlib/libm/ld80/e_lgammal_r.c b/newlib/libm/ld80/e_lgammal_r.c index 7d3697bb9..840c7ccbe 100644 --- a/newlib/libm/ld80/e_lgammal_r.c +++ b/newlib/libm/ld80/e_lgammal_r.c @@ -23,9 +23,9 @@ __FBSDID("$FreeBSD$"); #include <ieeefp.h> #endif -#include "fpmath.h" +#include "../ld/fpmath.h" #include "math.h" -#include "math_private.h" +#include "../ld/math_private.h" static const volatile double vzero = 0; diff --git a/newlib/libm/ld80/e_powl.c b/newlib/libm/ld80/e_powl.c index ea25354c2..6c11c73d0 100644 --- a/newlib/libm/ld80/e_powl.c +++ b/newlib/libm/ld80/e_powl.c @@ -19,7 +19,7 @@ __FBSDID("$FreeBSD$"); #include <math.h> -#include "math_private.h" +#include "../ld/math_private.h" /* * Polynomial evaluator: @@ -122,7 +122,7 @@ __FBSDID("$FreeBSD$"); #include <float.h> #include <math.h> -#include "math_private.h" +#include "../ld/math_private.h" /* Table size */ #define NXT 32 diff --git a/newlib/libm/ld80/e_rem_pio2l.h b/newlib/libm/ld80/e_rem_pio2l.h index 4d849de41..496a07744 100644 --- a/newlib/libm/ld80/e_rem_pio2l.h +++ b/newlib/libm/ld80/e_rem_pio2l.h @@ -25,7 +25,7 @@ __FBSDID("$FreeBSD$"); #include <float.h> #include "math.h" -#include "math_private.h" +#include "../ld/math_private.h" #include "../ld/fpmath.h" #define BIAS (LDBL_MAX_EXP - 1) diff --git a/newlib/libm/ld80/invtrig.h b/newlib/libm/ld80/invtrig.h index be06a044b..4a2469ed6 100644 --- a/newlib/libm/ld80/invtrig.h +++ b/newlib/libm/ld80/invtrig.h @@ -30,7 +30,7 @@ #include <float.h> -#include "fpmath.h" +#include "../ld/fpmath.h" #define BIAS (LDBL_MAX_EXP - 1) #define MANH_SIZE LDBL_MANH_SIZE diff --git a/newlib/libm/ld80/k_cosl.c b/newlib/libm/ld80/k_cosl.c index 354bf1d0e..f7ba7cf3d 100644 --- a/newlib/libm/ld80/k_cosl.c +++ b/newlib/libm/ld80/k_cosl.c @@ -17,8 +17,8 @@ __FBSDID("$FreeBSD$"); /* * ld80 version of k_cos.c. See ../src/k_cos.c for most comments. */ - -#include "math_private.h" +#include <math.h> +#include "../ld/math_private.h" /* * Domain [-0.7854, 0.7854], range ~[-2.43e-23, 2.425e-23]: diff --git a/newlib/libm/ld80/k_sinl.c b/newlib/libm/ld80/k_sinl.c index 171549057..7d6e9717d 100644 --- a/newlib/libm/ld80/k_sinl.c +++ b/newlib/libm/ld80/k_sinl.c @@ -17,8 +17,8 @@ __FBSDID("$FreeBSD$"); /* * ld80 version of k_sin.c. See ../src/k_sin.c for most comments. */ - -#include "math_private.h" +#include <math.h> +#include "../ld/math_private.h" static const double half = 0.5; diff --git a/newlib/libm/ld80/s_cospil.c b/newlib/libm/ld80/s_cospil.c index 199479e9e..75ec27d0c 100644 --- a/newlib/libm/ld80/s_cospil.c +++ b/newlib/libm/ld80/s_cospil.c @@ -33,9 +33,9 @@ #endif #include <stdint.h> -#include "fpmath.h" +#include "../ld/fpmath.h" #include "math.h" -#include "math_private.h" +#include "../ld/math_private.h" static const double pi_hi = 3.1415926814079285e+00, /* 0x400921fb 0x58000000 */ diff --git a/newlib/libm/ld80/s_erfl.c b/newlib/libm/ld80/s_erfl.c index 1d54838f5..da04cd8ea 100644 --- a/newlib/libm/ld80/s_erfl.c +++ b/newlib/libm/ld80/s_erfl.c @@ -23,9 +23,9 @@ __FBSDID("$FreeBSD$"); #include <ieeefp.h> #endif -#include "fpmath.h" +#include "../ld/fpmath.h" #include "math.h" -#include "math_private.h" +#include "../ld/math_private.h" /* XXX Prevent compilers from erroneously constant folding: */ static const volatile long double tiny = 0x1p-10000L; diff --git a/newlib/libm/ld80/s_exp2l.c b/newlib/libm/ld80/s_exp2l.c index 421d6e2e0..552956b8b 100644 --- a/newlib/libm/ld80/s_exp2l.c +++ b/newlib/libm/ld80/s_exp2l.c @@ -36,9 +36,9 @@ __FBSDID("$FreeBSD$"); #include <ieeefp.h> #endif -#include "fpmath.h" +#include "../ld/fpmath.h" #include "math.h" -#include "math_private.h" +#include "../ld/math_private.h" #define TBLBITS 7 #define TBLSIZE (1 << TBLBITS) diff --git a/newlib/libm/ld80/s_expl.c b/newlib/libm/ld80/s_expl.c index e46e73f0c..81469e00f 100644 --- a/newlib/libm/ld80/s_expl.c +++ b/newlib/libm/ld80/s_expl.c @@ -47,9 +47,9 @@ __FBSDID("$FreeBSD$"); #include <ieeefp.h> #endif -#include "fpmath.h" +#include "../ld/fpmath.h" #include "math.h" -#include "math_private.h" +#include "../ld/math_private.h" #include "k_expl.h" /* XXX Prevent compilers from erroneously constant folding these: */ diff --git a/newlib/libm/ld80/s_logl.c b/newlib/libm/ld80/s_logl.c index c74519caf..01e541b49 100644 --- a/newlib/libm/ld80/s_logl.c +++ b/newlib/libm/ld80/s_logl.c @@ -85,13 +85,13 @@ __FBSDID("$FreeBSD$"); #include <ieeefp.h> #endif -#include "fpmath.h" +#include "../ld/fpmath.h" #include "math.h" #define i386_SSE_GOOD #ifndef NO_STRUCT_RETURN #define STRUCT_RETURN #endif -#include "math_private.h" +#include "../ld/math_private.h" #if !defined(NO_UTAB) && !defined(NO_UTABL) #define USE_UTAB diff --git a/newlib/libm/ld80/s_sinpil.c b/newlib/libm/ld80/s_sinpil.c index e8a3824d9..3390d4d05 100644 --- a/newlib/libm/ld80/s_sinpil.c +++ b/newlib/libm/ld80/s_sinpil.c @@ -33,9 +33,9 @@ #endif #include <stdint.h> -#include "fpmath.h" +#include "../ld/fpmath.h" #include "math.h" -#include "math_private.h" +#include "../ld/math_private.h" static const union IEEEl2bits pi_hi_u = LD80C(0xc90fdaa200000000, 1, 3.14159265346825122833e+00L), |