Backed out 3 changesets (bug 1595259) for causing build bustages. CLOSED TREE

Backed out changeset b9f69ae62997 (bug 1595259)
Backed out changeset 313d7588e499 (bug 1595259)
Backed out changeset 3de1cc55fdbb (bug 1595259)
This commit is contained in:
Sandor Molnar 2022-08-09 20:51:28 +03:00
Родитель 996eb87d1d
Коммит 519b18befe
29 изменённых файлов: 703 добавлений и 609 удалений

Просмотреть файл

@ -13,7 +13,7 @@ or
sh update.sh <sha-commit>
from within the modules/fdlibm directory.
Current version: [commit 369ea0520a3061c07400d7cd32172efb6af39815 (2022-08-04T17:33:34Z)].
Current version: [commit cf4707bb2f78ecf56ba350bdc24e3135b4339622 (2019-09-25T18:50:57Z)].
patches 01-18 fixes files to be usable within mozilla-central tree.
See https://bugzilla.mozilla.org/show_bug.cgi?id=933257

Просмотреть файл

@ -1,7 +1,7 @@
diff --git a/modules/fdlibm/src/fdlibm.h b/modules/fdlibm/src/fdlibm.h
--- a/modules/fdlibm/src/fdlibm.h
+++ b/modules/fdlibm/src/fdlibm.h
@@ -12,504 +12,51 @@
@@ -12,499 +12,49 @@
/*
* from: @(#)fdlibm.h 5.1 93/09/24
* $FreeBSD$
@ -27,11 +27,11 @@ diff --git a/modules/fdlibm/src/fdlibm.h b/modules/fdlibm/src/fdlibm.h
- float __uf;
-} __nan;
-
-#if __GNUC_PREREQ__(3, 3)
-#if __GNUC_PREREQ__(3, 3) || (defined(__INTEL_COMPILER) && __INTEL_COMPILER >= 800)
-#define __MATH_BUILTIN_CONSTANTS
-#endif
-
-#if __GNUC_PREREQ__(3, 0)
-#if __GNUC_PREREQ__(3, 0) && !defined(__INTEL_COMPILER)
-#define __MATH_BUILTIN_RELOPS
-#endif
-
@ -70,11 +70,21 @@ diff --git a/modules/fdlibm/src/fdlibm.h b/modules/fdlibm/src/fdlibm.h
-#define FP_SUBNORMAL 0x08
-#define FP_ZERO 0x10
-
-#if __STDC_VERSION__ >= 201112L || __has_extension(c_generic_selections)
-#define __fp_type_select(x, f, d, ld) __extension__ _Generic((x), \
-#if (__STDC_VERSION__ >= 201112L && defined(__clang__)) || \
- __has_extension(c_generic_selections)
-#define __fp_type_select(x, f, d, ld) _Generic((x), \
- float: f(x), \
- double: d(x), \
- long double: ld(x))
- long double: ld(x), \
- volatile float: f(x), \
- volatile double: d(x), \
- volatile long double: ld(x), \
- volatile const float: f(x), \
- volatile const double: d(x), \
- volatile const long double: ld(x), \
- const float: f(x), \
- const double: d(x), \
- const long double: ld(x))
-#elif __GNUC_PREREQ__(3, 1) && !defined(__cplusplus)
-#define __fp_type_select(x, f, d, ld) __builtin_choose_expr( \
- __builtin_types_compatible_p(__typeof(x), long double), ld(x), \
@ -198,12 +208,6 @@ diff --git a/modules/fdlibm/src/fdlibm.h b/modules/fdlibm/src/fdlibm.h
-}
-
-/*
- * Define the following aliases, for compatibility with glibc and CUDA.
- */
-#define __isnan __inline_isnan
-#define __isnanf __inline_isnanf
-
-/*
- * Version 2 of the Single UNIX Specification (UNIX98) defined isnan() and
- * isinf() as functions taking double. C99, and the subsequent POSIX revisions
- * (SUSv3, POSIX.1-2001, define it as a macro that accepts any real floating
@ -222,9 +226,9 @@ diff --git a/modules/fdlibm/src/fdlibm.h b/modules/fdlibm/src/fdlibm.h
double asin(double);
double atan(double);
double atan2(double, double);
double cos(double);
double sin(double);
double tan(double);
-double cos(double);
-double sin(double);
-double tan(double);
double cosh(double);
double sinh(double);
@ -239,12 +243,14 @@ diff --git a/modules/fdlibm/src/fdlibm.h b/modules/fdlibm/src/fdlibm.h
double pow(double, double);
-double sqrt(double);
double ceil(double);
-double fabs(double) __pure2;
+double fabs(double);
-double ceil(double);
-double fabs(double) __pure2;
double floor(double);
-double fmod(double, double);
+double trunc(double);
+double ceil(double);
-/*
- * These functions are not in C90.
@ -304,7 +310,7 @@ diff --git a/modules/fdlibm/src/fdlibm.h b/modules/fdlibm/src/fdlibm.h
-double scalbln(double, long);
double scalbn(double, int);
-double tgamma(double);
double trunc(double);
-double trunc(double);
-#endif
-
-/*
@ -368,7 +374,7 @@ diff --git a/modules/fdlibm/src/fdlibm.h b/modules/fdlibm/src/fdlibm.h
-float hypotf(float, float);
-float lgammaf(float);
-float tgammaf(float);
-
-float acoshf(float);
-float asinhf(float);
-float atanhf(float);
@ -494,15 +500,6 @@ diff --git a/modules/fdlibm/src/fdlibm.h b/modules/fdlibm/src/fdlibm.h
-void sincos(double, double *, double *);
-void sincosf(float, float *, float *);
-void sincosl(long double, long double *, long double *);
-double cospi(double);
-float cospif(float);
-long double cospil(long double);
-double sinpi(double);
-float sinpif(float);
-long double sinpil(long double);
-double tanpi(double);
-float tanpif(float);
-long double tanpil(long double);
-#endif
-
-__END_DECLS

Просмотреть файл

@ -19,14 +19,14 @@ diff --git a/modules/fdlibm/src/fdlibm.h b/modules/fdlibm/src/fdlibm.h
double asin(double);
double atan(double);
double atan2(double, double);
double cos(double);
double sin(double);
double tan(double);
@@ -54,9 +54,9 @@ double scalbn(double, int);
double trunc(double);
double cosh(double);
double sinh(double);
@@ -52,9 +52,9 @@ double scalbn(double, int);
float ceilf(float);
float floorf(float);
float nearbyintf(float);
float rintf(float);
float truncf(float);

Просмотреть файл

@ -16,15 +16,15 @@ diff --git a/modules/fdlibm/src/fdlibm.h b/modules/fdlibm/src/fdlibm.h
double asin(double);
double atan(double);
double atan2(double, double);
double cos(double);
double sin(double);
double tan(double);
@@ -54,9 +56,11 @@ double scalbn(double, int);
double trunc(double);
double cosh(double);
double sinh(double);
double tanh(double);
@@ -52,9 +54,11 @@ double scalbn(double, int);
float ceilf(float);
float floorf(float);
float nearbyintf(float);
float rintf(float);
float truncf(float);

Просмотреть файл

@ -1,7 +1,7 @@
diff --git a/modules/fdlibm/src/e_acos.cpp b/modules/fdlibm/src/e_acos.cpp
--- a/modules/fdlibm/src/e_acos.cpp
+++ b/modules/fdlibm/src/e_acos.cpp
@@ -35,17 +35,16 @@ __FBSDID("$FreeBSD$");
@@ -35,17 +35,16 @@
* if x is NaN, return x itself;
* if |x|>1, return NaN with invalid signal.
*
@ -22,7 +22,7 @@ diff --git a/modules/fdlibm/src/e_acos.cpp b/modules/fdlibm/src/e_acos.cpp
diff --git a/modules/fdlibm/src/e_acosh.cpp b/modules/fdlibm/src/e_acosh.cpp
--- a/modules/fdlibm/src/e_acosh.cpp
+++ b/modules/fdlibm/src/e_acosh.cpp
@@ -26,17 +26,16 @@ __FBSDID("$FreeBSD$");
@@ -26,17 +26,16 @@
*
* Special cases:
* acosh(x) is NaN with signal if x<1.
@ -43,7 +43,7 @@ diff --git a/modules/fdlibm/src/e_acosh.cpp b/modules/fdlibm/src/e_acosh.cpp
diff --git a/modules/fdlibm/src/e_asin.cpp b/modules/fdlibm/src/e_asin.cpp
--- a/modules/fdlibm/src/e_asin.cpp
+++ b/modules/fdlibm/src/e_asin.cpp
@@ -41,17 +41,16 @@ __FBSDID("$FreeBSD$");
@@ -41,17 +41,16 @@
* Special cases:
* if x is NaN, return x itself;
* if |x|>1, return NaN with invalid signal.
@ -64,7 +64,7 @@ diff --git a/modules/fdlibm/src/e_asin.cpp b/modules/fdlibm/src/e_asin.cpp
diff --git a/modules/fdlibm/src/e_atan2.cpp b/modules/fdlibm/src/e_atan2.cpp
--- a/modules/fdlibm/src/e_atan2.cpp
+++ b/modules/fdlibm/src/e_atan2.cpp
@@ -39,17 +39,16 @@ __FBSDID("$FreeBSD$");
@@ -39,17 +39,16 @@
* The hexadecimal values are the intended ones for the following
* constants. The decimal values may be used, provided that the
* compiler will convert from decimal to binary accurately enough
@ -85,7 +85,7 @@ diff --git a/modules/fdlibm/src/e_atan2.cpp b/modules/fdlibm/src/e_atan2.cpp
diff --git a/modules/fdlibm/src/e_atanh.cpp b/modules/fdlibm/src/e_atanh.cpp
--- a/modules/fdlibm/src/e_atanh.cpp
+++ b/modules/fdlibm/src/e_atanh.cpp
@@ -30,17 +30,16 @@ __FBSDID("$FreeBSD$");
@@ -30,17 +30,16 @@
* atanh(x) is NaN if |x| > 1 with signal;
* atanh(NaN) is that NaN with no signal;
* atanh(+-1) is +-INF with signal.
@ -106,7 +106,7 @@ diff --git a/modules/fdlibm/src/e_atanh.cpp b/modules/fdlibm/src/e_atanh.cpp
diff --git a/modules/fdlibm/src/e_cosh.cpp b/modules/fdlibm/src/e_cosh.cpp
--- a/modules/fdlibm/src/e_cosh.cpp
+++ b/modules/fdlibm/src/e_cosh.cpp
@@ -32,17 +32,16 @@ __FBSDID("$FreeBSD$");
@@ -32,17 +32,16 @@
*
* Special cases:
* cosh(x) is |x| if x is +INF, -INF, or NaN.
@ -127,7 +127,7 @@ diff --git a/modules/fdlibm/src/e_cosh.cpp b/modules/fdlibm/src/e_cosh.cpp
diff --git a/modules/fdlibm/src/e_exp.cpp b/modules/fdlibm/src/e_exp.cpp
--- a/modules/fdlibm/src/e_exp.cpp
+++ b/modules/fdlibm/src/e_exp.cpp
@@ -73,17 +73,16 @@ __FBSDID("$FreeBSD$");
@@ -73,17 +73,16 @@
* The hexadecimal values are the intended ones for the following
* constants. The decimal values may be used, provided that the
* compiler will convert from decimal to binary accurately enough
@ -148,7 +148,7 @@ diff --git a/modules/fdlibm/src/e_exp.cpp b/modules/fdlibm/src/e_exp.cpp
diff --git a/modules/fdlibm/src/e_hypot.cpp b/modules/fdlibm/src/e_hypot.cpp
--- a/modules/fdlibm/src/e_hypot.cpp
+++ b/modules/fdlibm/src/e_hypot.cpp
@@ -43,17 +43,16 @@ __FBSDID("$FreeBSD$");
@@ -43,17 +43,16 @@
*
* Accuracy:
* hypot(x,y) returns sqrt(x^2+y^2) with error less
@ -169,7 +169,7 @@ diff --git a/modules/fdlibm/src/e_hypot.cpp b/modules/fdlibm/src/e_hypot.cpp
diff --git a/modules/fdlibm/src/e_log.cpp b/modules/fdlibm/src/e_log.cpp
--- a/modules/fdlibm/src/e_log.cpp
+++ b/modules/fdlibm/src/e_log.cpp
@@ -62,17 +62,16 @@ __FBSDID("$FreeBSD$");
@@ -62,17 +62,16 @@
* The hexadecimal values are the intended ones for the following
* constants. The decimal values may be used, provided that the
* compiler will convert from decimal to binary accurately enough
@ -190,7 +190,7 @@ diff --git a/modules/fdlibm/src/e_log.cpp b/modules/fdlibm/src/e_log.cpp
diff --git a/modules/fdlibm/src/e_log10.cpp b/modules/fdlibm/src/e_log10.cpp
--- a/modules/fdlibm/src/e_log10.cpp
+++ b/modules/fdlibm/src/e_log10.cpp
@@ -19,17 +19,16 @@ __FBSDID("$FreeBSD$");
@@ -19,17 +19,16 @@
* comments.
*
* log10(x) = (f - 0.5*f*f + k_log1p(f)) / ln10 + k * log10(2)
@ -211,7 +211,7 @@ diff --git a/modules/fdlibm/src/e_log10.cpp b/modules/fdlibm/src/e_log10.cpp
diff --git a/modules/fdlibm/src/e_log2.cpp b/modules/fdlibm/src/e_log2.cpp
--- a/modules/fdlibm/src/e_log2.cpp
+++ b/modules/fdlibm/src/e_log2.cpp
@@ -21,17 +21,16 @@ __FBSDID("$FreeBSD$");
@@ -21,17 +21,16 @@
* This reduces x to {k, 1+f} exactly as in e_log.c, then calls the kernel,
* then does the combining and scaling steps
* log2(x) = (f - 0.5*f*f + k_log1p(f)) / ln2 + k
@ -232,7 +232,7 @@ diff --git a/modules/fdlibm/src/e_log2.cpp b/modules/fdlibm/src/e_log2.cpp
diff --git a/modules/fdlibm/src/e_pow.cpp b/modules/fdlibm/src/e_pow.cpp
--- a/modules/fdlibm/src/e_pow.cpp
+++ b/modules/fdlibm/src/e_pow.cpp
@@ -53,17 +53,16 @@ __FBSDID("$FreeBSD$");
@@ -53,17 +53,16 @@
* Constants :
* The hexadecimal values are the intended ones for the following
* constants. The decimal values may be used, provided that the
@ -250,31 +250,10 @@ diff --git a/modules/fdlibm/src/e_pow.cpp b/modules/fdlibm/src/e_pow.cpp
dp_l[] = { 0.0, 1.35003920212974897128e-08,}, /* 0x3E4CFDEB, 0x43CFD006 */
zero = 0.0,
half = 0.5,
diff --git a/modules/fdlibm/src/e_rem_pio2.cpp b/modules/fdlibm/src/e_rem_pio2.cpp
--- a/modules/fdlibm/src/e_rem_pio2.cpp
+++ b/modules/fdlibm/src/e_rem_pio2.cpp
@@ -19,17 +19,16 @@ __FBSDID("$FreeBSD$");
/* __ieee754_rem_pio2(x,y)
*
* return the remainder of x rem pi/2 in y[0]+y[1]
* use __kernel_rem_pio2()
*/
#include <float.h>
-#include "math.h"
#include "math_private.h"
/*
* invpio2: 53 bits of 2/pi
* pio2_1: first 33 bit of pi/2
* pio2_1t: pi/2 - pio2_1
* pio2_2: second 33 bit of pi/2
* pio2_2t: pi/2 - (pio2_1+pio2_2)
diff --git a/modules/fdlibm/src/e_sinh.cpp b/modules/fdlibm/src/e_sinh.cpp
--- a/modules/fdlibm/src/e_sinh.cpp
+++ b/modules/fdlibm/src/e_sinh.cpp
@@ -29,17 +29,16 @@ __FBSDID("$FreeBSD$");
@@ -29,17 +29,16 @@
*
* Special cases:
* sinh(x) is |x| if x is +INF, -INF, or NaN.
@ -292,27 +271,6 @@ diff --git a/modules/fdlibm/src/e_sinh.cpp b/modules/fdlibm/src/e_sinh.cpp
__ieee754_sinh(double x)
{
double t,h;
diff --git a/modules/fdlibm/src/k_cos.cpp b/modules/fdlibm/src/k_cos.cpp
--- a/modules/fdlibm/src/k_cos.cpp
+++ b/modules/fdlibm/src/k_cos.cpp
@@ -48,17 +48,16 @@ __FBSDID("$FreeBSD$");
* and tmp having the same precision as x. If they have extra
* precision due to compiler bugs, then the extra precision is
* only good provided it is retained in all terms of the final
* expression for cos(). Retention happens in all cases tested
* under FreeBSD, so don't pessimize things by forcibly clipping
* any extra precision in w.
*/
-#include "math.h"
#include "math_private.h"
static const double
one = 1.00000000000000000000e+00, /* 0x3FF00000, 0x00000000 */
C1 = 4.16666666666666019037e-02, /* 0x3FA55555, 0x5555554C */
C2 = -1.38888888888741095749e-03, /* 0xBF56C16C, 0x16C15177 */
C3 = 2.48015872894767294178e-05, /* 0x3EFA01A0, 0x19CB1590 */
C4 = -2.75573143513906633035e-07, /* 0xBE927E4F, 0x809C52AD */
diff --git a/modules/fdlibm/src/k_exp.cpp b/modules/fdlibm/src/k_exp.cpp
--- a/modules/fdlibm/src/k_exp.cpp
+++ b/modules/fdlibm/src/k_exp.cpp
@ -334,69 +292,6 @@ diff --git a/modules/fdlibm/src/k_exp.cpp b/modules/fdlibm/src/k_exp.cpp
/*
* Compute exp(x), scaled to avoid spurious overflow. An exponent is
* returned separately in 'expt'.
diff --git a/modules/fdlibm/src/k_rem_pio2.cpp b/modules/fdlibm/src/k_rem_pio2.cpp
--- a/modules/fdlibm/src/k_rem_pio2.cpp
+++ b/modules/fdlibm/src/k_rem_pio2.cpp
@@ -126,17 +126,16 @@ __FBSDID("$FreeBSD$");
* The hexadecimal values are the intended ones for the following
* constants. The decimal values may be used, provided that the
* compiler will convert from decimal to binary accurately enough
* to produce the hexadecimal values shown.
*/
#include <float.h>
-#include "math.h"
#include "math_private.h"
static const int init_jk[] = {3,4,4,6}; /* initial value for jk */
/*
* Table of constants for 2/pi, 396 Hex digits (476 decimal) of 2/pi
*
* integer array, contains the (24*i)-th to (24*i+23)-th
diff --git a/modules/fdlibm/src/k_sin.cpp b/modules/fdlibm/src/k_sin.cpp
--- a/modules/fdlibm/src/k_sin.cpp
+++ b/modules/fdlibm/src/k_sin.cpp
@@ -39,17 +39,16 @@ __FBSDID("$FreeBSD$");
* ~ sin(x) + (1-x*x/2)*y
* For better accuracy, let
* 3 2 2 2 2
* r = x *(S2+x *(S3+x *(S4+x *(S5+x *S6))))
* then 3 2
* sin(x) = x + (S1*x + (x *(r-y/2)+y))
*/
-#include "math.h"
#include "math_private.h"
static const double
half = 5.00000000000000000000e-01, /* 0x3FE00000, 0x00000000 */
S1 = -1.66666666666666324348e-01, /* 0xBFC55555, 0x55555549 */
S2 = 8.33333333332248946124e-03, /* 0x3F811111, 0x1110F8A6 */
S3 = -1.98412698298579493134e-04, /* 0xBF2A01A0, 0x19C161D5 */
S4 = 2.75573137070700676789e-06, /* 0x3EC71DE3, 0x57B1FE7D */
diff --git a/modules/fdlibm/src/k_tan.cpp b/modules/fdlibm/src/k_tan.cpp
--- a/modules/fdlibm/src/k_tan.cpp
+++ b/modules/fdlibm/src/k_tan.cpp
@@ -44,17 +44,16 @@ __FBSDID("$FreeBSD$");
* 3 2
* tan(x+y) = x + (T1*x + (x *(r+y)+y))
*
* 4. For x in [0.67434,pi/4], let y = pi/4 - x, then
* tan(x) = tan(pi/4-y) = (1-tan(y))/(1+tan(y))
* = 1 - 2*(tan(y) - (tan(y)^2)/(1+tan(y)))
*/
-#include "math.h"
#include "math_private.h"
static const double xxx[] = {
3.33333333333334091986e-01, /* 3FD55555, 55555563 */
1.33333333333201242699e-01, /* 3FC11111, 1110FE7A */
5.39682539762260521377e-02, /* 3FABA1BA, 1BB341FE */
2.18694882948595424599e-02, /* 3F9664F4, 8406D637 */
8.86323982359930005737e-03, /* 3F8226E3, E96E8493 */
3.59207910759131235356e-03, /* 3F6D6D22, C9560328 */
diff --git a/modules/fdlibm/src/math_private.h b/modules/fdlibm/src/math_private.h
--- a/modules/fdlibm/src/math_private.h
+++ b/modules/fdlibm/src/math_private.h
@ -422,7 +317,7 @@ diff --git a/modules/fdlibm/src/math_private.h b/modules/fdlibm/src/math_private
diff --git a/modules/fdlibm/src/s_asinh.cpp b/modules/fdlibm/src/s_asinh.cpp
--- a/modules/fdlibm/src/s_asinh.cpp
+++ b/modules/fdlibm/src/s_asinh.cpp
@@ -21,17 +21,16 @@ __FBSDID("$FreeBSD$");
@@ -21,17 +21,16 @@
* asinh(x) := x if 1+x*x=1,
* := sign(x)*(log(x)+ln2)) for large |x|, else
* := sign(x)*log(2|x|+1/(|x|+sqrt(x*x+1))) if|x|>2, else
@ -443,7 +338,7 @@ diff --git a/modules/fdlibm/src/s_asinh.cpp b/modules/fdlibm/src/s_asinh.cpp
diff --git a/modules/fdlibm/src/s_atan.cpp b/modules/fdlibm/src/s_atan.cpp
--- a/modules/fdlibm/src/s_atan.cpp
+++ b/modules/fdlibm/src/s_atan.cpp
@@ -30,17 +30,16 @@ __FBSDID("$FreeBSD$");
@@ -30,17 +30,16 @@
* The hexadecimal values are the intended ones for the following
* constants. The decimal values may be used, provided that the
* compiler will convert from decimal to binary accurately enough
@ -485,7 +380,7 @@ diff --git a/modules/fdlibm/src/s_cbrt.cpp b/modules/fdlibm/src/s_cbrt.cpp
diff --git a/modules/fdlibm/src/s_ceil.cpp b/modules/fdlibm/src/s_ceil.cpp
--- a/modules/fdlibm/src/s_ceil.cpp
+++ b/modules/fdlibm/src/s_ceil.cpp
@@ -19,17 +19,16 @@ __FBSDID("$FreeBSD$");
@@ -19,17 +19,16 @@
* Method:
* Bit twiddling.
* Exception:
@ -545,31 +440,10 @@ diff --git a/modules/fdlibm/src/s_copysign.cpp b/modules/fdlibm/src/s_copysign.c
u_int32_t hx,hy;
GET_HIGH_WORD(hx,x);
GET_HIGH_WORD(hy,y);
diff --git a/modules/fdlibm/src/s_cos.cpp b/modules/fdlibm/src/s_cos.cpp
--- a/modules/fdlibm/src/s_cos.cpp
+++ b/modules/fdlibm/src/s_cos.cpp
@@ -41,17 +41,16 @@ __FBSDID("$FreeBSD$");
* trig(NaN) is that NaN;
*
* Accuracy:
* TRIG(x) returns trig(x) nearly rounded
*/
#include <float.h>
-#include "math.h"
#define INLINE_REM_PIO2
#include "math_private.h"
#include "e_rem_pio2.c"
double
cos(double x)
{
double y[2],z=0.0;
diff --git a/modules/fdlibm/src/s_expm1.cpp b/modules/fdlibm/src/s_expm1.cpp
--- a/modules/fdlibm/src/s_expm1.cpp
+++ b/modules/fdlibm/src/s_expm1.cpp
@@ -105,17 +105,16 @@ __FBSDID("$FreeBSD$");
@@ -105,17 +105,16 @@
* The hexadecimal values are the intended ones for the following
* constants. The decimal values may be used, provided that the
* compiler will convert from decimal to binary accurately enough
@ -611,7 +485,7 @@ diff --git a/modules/fdlibm/src/s_fabs.cpp b/modules/fdlibm/src/s_fabs.cpp
diff --git a/modules/fdlibm/src/s_floor.cpp b/modules/fdlibm/src/s_floor.cpp
--- a/modules/fdlibm/src/s_floor.cpp
+++ b/modules/fdlibm/src/s_floor.cpp
@@ -19,17 +19,16 @@ __FBSDID("$FreeBSD$");
@@ -19,17 +19,16 @@
* Method:
* Bit twiddling.
* Exception:
@ -632,7 +506,7 @@ diff --git a/modules/fdlibm/src/s_floor.cpp b/modules/fdlibm/src/s_floor.cpp
diff --git a/modules/fdlibm/src/s_floorf.cpp b/modules/fdlibm/src/s_floorf.cpp
--- a/modules/fdlibm/src/s_floorf.cpp
+++ b/modules/fdlibm/src/s_floorf.cpp
@@ -20,17 +20,16 @@ __FBSDID("$FreeBSD$");
@@ -20,17 +20,16 @@
* floorf(x)
* Return x rounded toward -inf to integral value
* Method:
@ -653,7 +527,7 @@ diff --git a/modules/fdlibm/src/s_floorf.cpp b/modules/fdlibm/src/s_floorf.cpp
diff --git a/modules/fdlibm/src/s_log1p.cpp b/modules/fdlibm/src/s_log1p.cpp
--- a/modules/fdlibm/src/s_log1p.cpp
+++ b/modules/fdlibm/src/s_log1p.cpp
@@ -75,17 +75,16 @@ __FBSDID("$FreeBSD$");
@@ -75,17 +75,16 @@
* if(u==1.0) return x ; else
* return log(u)*(x/(u-1.0));
*
@ -674,7 +548,7 @@ diff --git a/modules/fdlibm/src/s_log1p.cpp b/modules/fdlibm/src/s_log1p.cpp
diff --git a/modules/fdlibm/src/s_nearbyint.cpp b/modules/fdlibm/src/s_nearbyint.cpp
--- a/modules/fdlibm/src/s_nearbyint.cpp
+++ b/modules/fdlibm/src/s_nearbyint.cpp
@@ -25,17 +25,18 @@
@@ -25,17 +25,17 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
@ -684,7 +558,6 @@ diff --git a/modules/fdlibm/src/s_nearbyint.cpp b/modules/fdlibm/src/s_nearbyint
#include <fenv.h>
-#include <math.h>
+
+#include "math_private.h"
/*
@ -697,7 +570,7 @@ diff --git a/modules/fdlibm/src/s_nearbyint.cpp b/modules/fdlibm/src/s_nearbyint
diff --git a/modules/fdlibm/src/s_rint.cpp b/modules/fdlibm/src/s_rint.cpp
--- a/modules/fdlibm/src/s_rint.cpp
+++ b/modules/fdlibm/src/s_rint.cpp
@@ -20,17 +20,16 @@ __FBSDID("$FreeBSD$");
@@ -20,17 +20,16 @@
* Method:
* Using floating addition.
* Exception:
@ -739,74 +612,28 @@ diff --git a/modules/fdlibm/src/s_rintf.cpp b/modules/fdlibm/src/s_rintf.cpp
diff --git a/modules/fdlibm/src/s_scalbn.cpp b/modules/fdlibm/src/s_scalbn.cpp
--- a/modules/fdlibm/src/s_scalbn.cpp
+++ b/modules/fdlibm/src/s_scalbn.cpp
@@ -2,19 +2,20 @@
* Copyright (c) 2005-2020 Rich Felker, et al.
*
* SPDX-License-Identifier: MIT
*
* Please see https://git.musl-libc.org/cgit/musl/tree/COPYRIGHT
* for all contributors to musl.
*/
#include <float.h>
-#include <math.h>
#include <stdint.h>
+#include "math_private.h"
+
double scalbn(double x, int n)
{
union {double f; uint64_t i;} u;
double_t y = x;
if (n > 1023) {
y *= 0x1p1023;
n -= 1023;
diff --git a/modules/fdlibm/src/s_sin.cpp b/modules/fdlibm/src/s_sin.cpp
--- a/modules/fdlibm/src/s_sin.cpp
+++ b/modules/fdlibm/src/s_sin.cpp
@@ -41,17 +41,16 @@ __FBSDID("$FreeBSD$");
* trig(NaN) is that NaN;
*
* Accuracy:
* TRIG(x) returns trig(x) nearly rounded
@@ -17,17 +17,16 @@
* scalbn (double x, int n)
* scalbn(x,n) returns x* 2**n computed by exponent
* manipulation rather than by actually performing an
* exponentiation or a multiplication.
*/
#include <float.h>
-#include "math.h"
#define INLINE_REM_PIO2
#include "math_private.h"
#include "e_rem_pio2.c"
double
sin(double x)
{
double y[2],z=0.0;
diff --git a/modules/fdlibm/src/s_tan.cpp b/modules/fdlibm/src/s_tan.cpp
--- a/modules/fdlibm/src/s_tan.cpp
+++ b/modules/fdlibm/src/s_tan.cpp
@@ -40,17 +40,16 @@ __FBSDID("$FreeBSD$");
* trig(NaN) is that NaN;
*
* Accuracy:
* TRIG(x) returns trig(x) nearly rounded
*/
static const double
two54 = 1.80143985094819840000e+16, /* 0x43500000, 0x00000000 */
twom54 = 5.55111512312578270212e-17, /* 0x3C900000, 0x00000000 */
huge = 1.0e+300,
tiny = 1.0e-300;
#include <float.h>
-#include "math.h"
#define INLINE_REM_PIO2
#include "math_private.h"
#include "e_rem_pio2.c"
double
tan(double x)
{
double y[2],z=0.0;
diff --git a/modules/fdlibm/src/s_tanh.cpp b/modules/fdlibm/src/s_tanh.cpp
--- a/modules/fdlibm/src/s_tanh.cpp
+++ b/modules/fdlibm/src/s_tanh.cpp
@@ -34,17 +34,16 @@ __FBSDID("$FreeBSD$");
@@ -34,17 +34,16 @@
*
* Special cases:
* tanh(NaN) is NaN;
@ -827,7 +654,7 @@ diff --git a/modules/fdlibm/src/s_tanh.cpp b/modules/fdlibm/src/s_tanh.cpp
diff --git a/modules/fdlibm/src/s_trunc.cpp b/modules/fdlibm/src/s_trunc.cpp
--- a/modules/fdlibm/src/s_trunc.cpp
+++ b/modules/fdlibm/src/s_trunc.cpp
@@ -19,17 +19,16 @@ __FBSDID("$FreeBSD$");
@@ -19,17 +19,16 @@
* Method:
* Bit twiddling.
* Exception:
@ -848,7 +675,7 @@ diff --git a/modules/fdlibm/src/s_trunc.cpp b/modules/fdlibm/src/s_trunc.cpp
diff --git a/modules/fdlibm/src/s_truncf.cpp b/modules/fdlibm/src/s_truncf.cpp
--- a/modules/fdlibm/src/s_truncf.cpp
+++ b/modules/fdlibm/src/s_truncf.cpp
@@ -17,17 +17,16 @@ __FBSDID("$FreeBSD$");
@@ -17,17 +17,16 @@
* truncf(x)
* Return x rounded toward 0 to integral value
* Method:
@ -866,3 +693,172 @@ diff --git a/modules/fdlibm/src/s_truncf.cpp b/modules/fdlibm/src/s_truncf.cpp
truncf(float x)
{
int32_t i0,j0;
diff --git a/modules/fdlibm/src/e_rem_pio2.cpp b/modules/fdlibm/src/e_rem_pio2.cpp
--- a/modules/fdlibm/src/e_rem_pio2.cpp
+++ b/modules/fdlibm/src/e_rem_pio2.cpp
@@ -19,17 +19,16 @@
/* __ieee754_rem_pio2(x,y)
*
* return the remainder of x rem pi/2 in y[0]+y[1]
* use __kernel_rem_pio2()
*/
#include <float.h>
-#include "math.h"
#include "math_private.h"
/*
* invpio2: 53 bits of 2/pi
* pio2_1: first 33 bit of pi/2
* pio2_1t: pi/2 - pio2_1
* pio2_2: second 33 bit of pi/2
* pio2_2t: pi/2 - (pio2_1+pio2_2)
diff --git a/modules/fdlibm/src/k_cos.cpp b/modules/fdlibm/src/k_cos.cpp
--- a/modules/fdlibm/src/k_cos.cpp
+++ b/modules/fdlibm/src/k_cos.cpp
@@ -48,17 +48,16 @@
* and tmp having the same precision as x. If they have extra
* precision due to compiler bugs, then the extra precision is
* only good provided it is retained in all terms of the final
* expression for cos(). Retention happens in all cases tested
* under FreeBSD, so don't pessimize things by forcibly clipping
* any extra precision in w.
*/
-#include "math.h"
#include "math_private.h"
static const double
one = 1.00000000000000000000e+00, /* 0x3FF00000, 0x00000000 */
C1 = 4.16666666666666019037e-02, /* 0x3FA55555, 0x5555554C */
C2 = -1.38888888888741095749e-03, /* 0xBF56C16C, 0x16C15177 */
C3 = 2.48015872894767294178e-05, /* 0x3EFA01A0, 0x19CB1590 */
C4 = -2.75573143513906633035e-07, /* 0xBE927E4F, 0x809C52AD */
diff --git a/modules/fdlibm/src/k_rem_pio2.cpp b/modules/fdlibm/src/k_rem_pio2.cpp
--- a/modules/fdlibm/src/k_rem_pio2.cpp
+++ b/modules/fdlibm/src/k_rem_pio2.cpp
@@ -126,17 +126,16 @@
* The hexadecimal values are the intended ones for the following
* constants. The decimal values may be used, provided that the
* compiler will convert from decimal to binary accurately enough
* to produce the hexadecimal values shown.
*/
#include <float.h>
-#include "math.h"
#include "math_private.h"
static const int init_jk[] = {3,4,4,6}; /* initial value for jk */
/*
* Table of constants for 2/pi, 396 Hex digits (476 decimal) of 2/pi
*
* integer array, contains the (24*i)-th to (24*i+23)-th
diff --git a/modules/fdlibm/src/k_sin.cpp b/modules/fdlibm/src/k_sin.cpp
--- a/modules/fdlibm/src/k_sin.cpp
+++ b/modules/fdlibm/src/k_sin.cpp
@@ -39,17 +39,16 @@
* ~ sin(x) + (1-x*x/2)*y
* For better accuracy, let
* 3 2 2 2 2
* r = x *(S2+x *(S3+x *(S4+x *(S5+x *S6))))
* then 3 2
* sin(x) = x + (S1*x + (x *(r-y/2)+y))
*/
-#include "math.h"
#include "math_private.h"
static const double
half = 5.00000000000000000000e-01, /* 0x3FE00000, 0x00000000 */
S1 = -1.66666666666666324348e-01, /* 0xBFC55555, 0x55555549 */
S2 = 8.33333333332248946124e-03, /* 0x3F811111, 0x1110F8A6 */
S3 = -1.98412698298579493134e-04, /* 0xBF2A01A0, 0x19C161D5 */
S4 = 2.75573137070700676789e-06, /* 0x3EC71DE3, 0x57B1FE7D */
diff --git a/modules/fdlibm/src/k_tan.cpp b/modules/fdlibm/src/k_tan.cpp
--- a/modules/fdlibm/src/k_tan.cpp
+++ b/modules/fdlibm/src/k_tan.cpp
@@ -44,17 +44,16 @@
* 3 2
* tan(x+y) = x + (T1*x + (x *(r+y)+y))
*
* 4. For x in [0.67434,pi/4], let y = pi/4 - x, then
* tan(x) = tan(pi/4-y) = (1-tan(y))/(1+tan(y))
* = 1 - 2*(tan(y) - (tan(y)^2)/(1+tan(y)))
*/
-#include "math.h"
#include "math_private.h"
static const double xxx[] = {
3.33333333333334091986e-01, /* 3FD55555, 55555563 */
1.33333333333201242699e-01, /* 3FC11111, 1110FE7A */
5.39682539762260521377e-02, /* 3FABA1BA, 1BB341FE */
2.18694882948595424599e-02, /* 3F9664F4, 8406D637 */
8.86323982359930005737e-03, /* 3F8226E3, E96E8493 */
3.59207910759131235356e-03, /* 3F6D6D22, C9560328 */
diff --git a/modules/fdlibm/src/s_cos.cpp b/modules/fdlibm/src/s_cos.cpp
--- a/modules/fdlibm/src/s_cos.cpp
+++ b/modules/fdlibm/src/s_cos.cpp
@@ -41,17 +41,16 @@
* trig(NaN) is that NaN;
*
* Accuracy:
* TRIG(x) returns trig(x) nearly rounded
*/
#include <float.h>
-#include "math.h"
#define INLINE_REM_PIO2
#include "math_private.h"
#include "e_rem_pio2.c"
double
cos(double x)
{
double y[2],z=0.0;
diff --git a/modules/fdlibm/src/s_sin.cpp b/modules/fdlibm/src/s_sin.cpp
--- a/modules/fdlibm/src/s_sin.cpp
+++ b/modules/fdlibm/src/s_sin.cpp
@@ -41,17 +41,16 @@
* trig(NaN) is that NaN;
*
* Accuracy:
* TRIG(x) returns trig(x) nearly rounded
*/
#include <float.h>
-#include "math.h"
#define INLINE_REM_PIO2
#include "math_private.h"
#include "e_rem_pio2.c"
double
sin(double x)
{
double y[2],z=0.0;
diff --git a/modules/fdlibm/src/s_tan.cpp b/modules/fdlibm/src/s_tan.cpp
--- a/modules/fdlibm/src/s_tan.cpp
+++ b/modules/fdlibm/src/s_tan.cpp
@@ -40,17 +40,16 @@
* trig(NaN) is that NaN;
*
* Accuracy:
* TRIG(x) returns trig(x) nearly rounded
*/
#include <float.h>
-#include "math.h"
#define INLINE_REM_PIO2
#include "math_private.h"
#include "e_rem_pio2.c"
double
tan(double x)
{
double y[2],z=0.0;

Просмотреть файл

@ -11,11 +11,11 @@ diff --git a/modules/fdlibm/src/math_private.h b/modules/fdlibm/src/math_private
#include <stdint.h>
#include <sys/types.h>
-#include <machine/endian.h>
+
+#include "mozilla/EndianUtils.h"
#include "fdlibm.h"
+#include "mozilla/EndianUtils.h"
+
/*
* The original fdlibm code used statements like:
* n0 = ((*(int*)&one)>>29)^1; * index of high word *
@ -76,7 +76,7 @@ diff --git a/modules/fdlibm/src/math_private.h b/modules/fdlibm/src/math_private
u_int32_t lswlo;
u_int32_t lswhi;
u_int32_t mswlo;
@@ -87,17 +73,17 @@ typedef union
@@ -87,17 +73,22 @@ typedef union
struct {
u_int64_t lsw;
u_int64_t msw;
@ -86,6 +86,11 @@ diff --git a/modules/fdlibm/src/math_private.h b/modules/fdlibm/src/math_private
#endif
-#if IEEE_WORD_ORDER == BIG_ENDIAN
+/*
+ * A union which permits us to convert between a double and two 32 bit
+ * ints.
+ */
+
+#if MOZ_BIG_ENDIAN()
typedef union
@ -95,7 +100,7 @@ diff --git a/modules/fdlibm/src/math_private.h b/modules/fdlibm/src/math_private
{
u_int32_t msw;
u_int32_t lsw;
@@ -105,17 +91,17 @@ typedef union
@@ -105,17 +96,17 @@ typedef union
struct
{
u_int64_t w;

Просмотреть файл

@ -1,7 +1,7 @@
diff --git a/modules/fdlibm/src/math_private.h b/modules/fdlibm/src/math_private.h
--- a/modules/fdlibm/src/math_private.h
+++ b/modules/fdlibm/src/math_private.h
@@ -867,16 +867,53 @@ irintl(long double x)
@@ -872,16 +872,50 @@ irintl(long double x)
#define __ieee754_j1f j1f
#define __ieee754_y0f y0f
#define __ieee754_y1f y1f
@ -14,9 +14,6 @@ diff --git a/modules/fdlibm/src/math_private.h b/modules/fdlibm/src/math_private
+#define asin fdlibm::asin
+#define atan fdlibm::atan
+#define atan2 fdlibm::atan2
+#define cos fdlibm::cos
+#define sin fdlibm::sin
+#define tan fdlibm::tan
+#define cosh fdlibm::cosh
+#define sinh fdlibm::sinh
+#define tanh fdlibm::tanh

Просмотреть файл

@ -1,7 +1,7 @@
diff --git a/modules/fdlibm/src/e_acos.cpp b/modules/fdlibm/src/e_acos.cpp
--- a/modules/fdlibm/src/e_acos.cpp
+++ b/modules/fdlibm/src/e_acos.cpp
@@ -99,12 +99,8 @@ __ieee754_acos(double x)
@@ -99,12 +99,8 @@ double
c = (z-df*df)/(s+df);
p = z*(pS0+z*(pS1+z*(pS2+z*(pS3+z*(pS4+z*pS5)))));
q = one+z*(qS1+z*(qS2+z*(qS3+z*qS4)));
@ -17,7 +17,7 @@ diff --git a/modules/fdlibm/src/e_acos.cpp b/modules/fdlibm/src/e_acos.cpp
diff --git a/modules/fdlibm/src/e_acosh.cpp b/modules/fdlibm/src/e_acosh.cpp
--- a/modules/fdlibm/src/e_acosh.cpp
+++ b/modules/fdlibm/src/e_acosh.cpp
@@ -56,12 +56,8 @@ __ieee754_acosh(double x)
@@ -56,12 +56,8 @@ double
} else if (hx > 0x40000000) { /* 2**28 > x > 2 */
t=x*x;
return __ieee754_log(2.0*x-one/(x+sqrt(t-one)));
@ -33,7 +33,7 @@ diff --git a/modules/fdlibm/src/e_acosh.cpp b/modules/fdlibm/src/e_acosh.cpp
diff --git a/modules/fdlibm/src/e_asin.cpp b/modules/fdlibm/src/e_asin.cpp
--- a/modules/fdlibm/src/e_asin.cpp
+++ b/modules/fdlibm/src/e_asin.cpp
@@ -105,12 +105,8 @@ __ieee754_asin(double x)
@@ -105,12 +105,8 @@ double
c = (t-w*w)/(s+w);
r = p/q;
p = 2.0*s*r-(pio2_lo-2.0*c);
@ -49,7 +49,7 @@ diff --git a/modules/fdlibm/src/e_asin.cpp b/modules/fdlibm/src/e_asin.cpp
diff --git a/modules/fdlibm/src/e_atan2.cpp b/modules/fdlibm/src/e_atan2.cpp
--- a/modules/fdlibm/src/e_atan2.cpp
+++ b/modules/fdlibm/src/e_atan2.cpp
@@ -117,12 +117,8 @@ __ieee754_atan2(double y, double x)
@@ -117,12 +117,8 @@ double
switch (m) {
case 0: return z ; /* atan(+,+) */
case 1: return -z ; /* atan(-,+) */
@ -65,7 +65,7 @@ diff --git a/modules/fdlibm/src/e_atan2.cpp b/modules/fdlibm/src/e_atan2.cpp
diff --git a/modules/fdlibm/src/e_atanh.cpp b/modules/fdlibm/src/e_atanh.cpp
--- a/modules/fdlibm/src/e_atanh.cpp
+++ b/modules/fdlibm/src/e_atanh.cpp
@@ -56,12 +56,8 @@ __ieee754_atanh(double x)
@@ -56,12 +56,8 @@ double
SET_HIGH_WORD(x,ix);
if(ix<0x3fe00000) { /* x < 0.5 */
t = x+x;
@ -81,7 +81,7 @@ diff --git a/modules/fdlibm/src/e_atanh.cpp b/modules/fdlibm/src/e_atanh.cpp
diff --git a/modules/fdlibm/src/e_cosh.cpp b/modules/fdlibm/src/e_cosh.cpp
--- a/modules/fdlibm/src/e_cosh.cpp
+++ b/modules/fdlibm/src/e_cosh.cpp
@@ -73,12 +73,8 @@ __ieee754_cosh(double x)
@@ -73,12 +73,8 @@ double
/* |x| in [log(maxdouble), overflowthresold] */
if (ix<=0x408633CE)
@ -97,7 +97,7 @@ diff --git a/modules/fdlibm/src/e_cosh.cpp b/modules/fdlibm/src/e_cosh.cpp
diff --git a/modules/fdlibm/src/e_exp.cpp b/modules/fdlibm/src/e_exp.cpp
--- a/modules/fdlibm/src/e_exp.cpp
+++ b/modules/fdlibm/src/e_exp.cpp
@@ -152,12 +152,8 @@ __ieee754_exp(double x) /* default IEEE double exp */
@@ -152,12 +152,8 @@ double
else y = one-((lo-(x*c)/(2.0-c))-hi);
if(k >= -1021) {
if (k==1024) return y*2.0*0x1p1023;
@ -113,12 +113,12 @@ diff --git a/modules/fdlibm/src/e_exp.cpp b/modules/fdlibm/src/e_exp.cpp
diff --git a/modules/fdlibm/src/e_hypot.cpp b/modules/fdlibm/src/e_hypot.cpp
--- a/modules/fdlibm/src/e_hypot.cpp
+++ b/modules/fdlibm/src/e_hypot.cpp
@@ -117,12 +117,8 @@ __ieee754_hypot(double x, double y)
w = sqrt(t1*y1-(w*(-w)-(t1*y2+t2*b)));
}
@@ -119,12 +119,8 @@ double
if(k!=0) {
t1 = 0.0;
SET_HIGH_WORD(t1,(1023+k)<<20);
u_int32_t high;
t1 = 1.0;
GET_HIGH_WORD(high,t1);
SET_HIGH_WORD(t1,high+(k<<20));
return t1*w;
} else return w;
}
@ -129,7 +129,7 @@ diff --git a/modules/fdlibm/src/e_hypot.cpp b/modules/fdlibm/src/e_hypot.cpp
diff --git a/modules/fdlibm/src/e_log.cpp b/modules/fdlibm/src/e_log.cpp
--- a/modules/fdlibm/src/e_log.cpp
+++ b/modules/fdlibm/src/e_log.cpp
@@ -135,12 +135,8 @@ __ieee754_log(double x)
@@ -135,12 +135,8 @@ double
hfsq=0.5*f*f;
if(k==0) return f-(hfsq-s*(hfsq+R)); else
return dk*ln2_hi-((hfsq-(s*(hfsq+R)+dk*ln2_lo))-f);
@ -145,7 +145,7 @@ diff --git a/modules/fdlibm/src/e_log.cpp b/modules/fdlibm/src/e_log.cpp
diff --git a/modules/fdlibm/src/e_log10.cpp b/modules/fdlibm/src/e_log10.cpp
--- a/modules/fdlibm/src/e_log10.cpp
+++ b/modules/fdlibm/src/e_log10.cpp
@@ -82,12 +82,8 @@ __ieee754_log10(double x)
@@ -82,12 +82,8 @@ double
* with some parallelism and it reduces the error for many args.
*/
w = y2 + val_hi;
@ -161,7 +161,7 @@ diff --git a/modules/fdlibm/src/e_log10.cpp b/modules/fdlibm/src/e_log10.cpp
diff --git a/modules/fdlibm/src/e_log2.cpp b/modules/fdlibm/src/e_log2.cpp
--- a/modules/fdlibm/src/e_log2.cpp
+++ b/modules/fdlibm/src/e_log2.cpp
@@ -105,12 +105,8 @@ __ieee754_log2(double x)
@@ -105,12 +105,8 @@ double
/* spadd(val_hi, val_lo, y), except for not using double_t: */
w = y + val_hi;
@ -177,7 +177,7 @@ diff --git a/modules/fdlibm/src/e_log2.cpp b/modules/fdlibm/src/e_log2.cpp
diff --git a/modules/fdlibm/src/e_pow.cpp b/modules/fdlibm/src/e_pow.cpp
--- a/modules/fdlibm/src/e_pow.cpp
+++ b/modules/fdlibm/src/e_pow.cpp
@@ -302,12 +302,8 @@ __ieee754_pow(double x, double y)
@@ -302,12 +302,8 @@ double
r = (z*t1)/(t1-two)-(w+z*w);
z = one-(r-z);
GET_HIGH_WORD(j,z);
@ -193,7 +193,7 @@ diff --git a/modules/fdlibm/src/e_pow.cpp b/modules/fdlibm/src/e_pow.cpp
diff --git a/modules/fdlibm/src/e_sinh.cpp b/modules/fdlibm/src/e_sinh.cpp
--- a/modules/fdlibm/src/e_sinh.cpp
+++ b/modules/fdlibm/src/e_sinh.cpp
@@ -67,12 +67,8 @@ __ieee754_sinh(double x)
@@ -67,12 +67,8 @@ double
/* |x| in [log(maxdouble), overflowthresold] */
if (ix<=0x408633CE)
@ -246,7 +246,7 @@ diff --git a/modules/fdlibm/src/s_cbrt.cpp b/modules/fdlibm/src/s_cbrt.cpp
r=x/s; /* error <= 0.5 ulps; |r| < |t| */
w=t+t; /* t+t is exact */
r=(r-t)/(w+r); /* r-t is exact; w+r ~= 3*t */
t=t+t*r; /* error <= (0.5 + 0.5/3) * ulp */
t=t+t*r; /* error <= 0.5 + 0.5/3 + epsilon */
return(t);
}
@ -270,22 +270,6 @@ diff --git a/modules/fdlibm/src/s_ceil.cpp b/modules/fdlibm/src/s_ceil.cpp
-#if LDBL_MANT_DIG == 53
-__weak_reference(ceil, ceill);
-#endif
diff --git a/modules/fdlibm/src/s_cos.cpp b/modules/fdlibm/src/s_cos.cpp
--- a/modules/fdlibm/src/s_cos.cpp
+++ b/modules/fdlibm/src/s_cos.cpp
@@ -77,12 +77,8 @@ cos(double x)
case 0: return __kernel_cos(y[0],y[1]);
case 1: return -__kernel_sin(y[0],y[1],1);
case 2: return -__kernel_cos(y[0],y[1]);
default:
return __kernel_sin(y[0],y[1],1);
}
}
}
-
-#if (LDBL_MANT_DIG == 53)
-__weak_reference(cos, cosl);
-#endif
diff --git a/modules/fdlibm/src/s_expm1.cpp b/modules/fdlibm/src/s_expm1.cpp
--- a/modules/fdlibm/src/s_expm1.cpp
+++ b/modules/fdlibm/src/s_expm1.cpp
@ -353,52 +337,20 @@ diff --git a/modules/fdlibm/src/s_rint.cpp b/modules/fdlibm/src/s_rint.cpp
diff --git a/modules/fdlibm/src/s_scalbn.cpp b/modules/fdlibm/src/s_scalbn.cpp
--- a/modules/fdlibm/src/s_scalbn.cpp
+++ b/modules/fdlibm/src/s_scalbn.cpp
@@ -36,13 +36,8 @@ double scalbn(double x, int n)
if (n < -1022)
n = -1022;
}
@@ -53,13 +53,8 @@ scalbn (double x, int n)
return huge*copysign(huge,x); /*overflow*/
else
return tiny*copysign(tiny,x); /*underflow*/
}
u.i = (uint64_t)(0x3ff+n)<<52;
x = y * u.f;
return x;
k += 54; /* subnormal result */
SET_HIGH_WORD(x,(hx&0x800fffff)|(k<<20));
return x*twom54;
}
-
-#if (LDBL_MANT_DIG == 53) && !defined(scalbn)
-#if (LDBL_MANT_DIG == 53)
-__weak_reference(scalbn, ldexpl);
-__weak_reference(scalbn, scalbnl);
-#endif
diff --git a/modules/fdlibm/src/s_sin.cpp b/modules/fdlibm/src/s_sin.cpp
--- a/modules/fdlibm/src/s_sin.cpp
+++ b/modules/fdlibm/src/s_sin.cpp
@@ -77,12 +77,8 @@ sin(double x)
case 0: return __kernel_sin(y[0],y[1],1);
case 1: return __kernel_cos(y[0],y[1]);
case 2: return -__kernel_sin(y[0],y[1],1);
default:
return -__kernel_cos(y[0],y[1]);
}
}
}
-
-#if (LDBL_MANT_DIG == 53)
-__weak_reference(sin, sinl);
-#endif
diff --git a/modules/fdlibm/src/s_tan.cpp b/modules/fdlibm/src/s_tan.cpp
--- a/modules/fdlibm/src/s_tan.cpp
+++ b/modules/fdlibm/src/s_tan.cpp
@@ -71,12 +71,8 @@ tan(double x)
/* argument reduction needed */
else {
n = __ieee754_rem_pio2(x,y);
return __kernel_tan(y[0],y[1],1-((n&1)<<1)); /* 1 -- n even
-1 -- n odd */
}
}
-
-#if (LDBL_MANT_DIG == 53)
-__weak_reference(tan, tanl);
-#endif
diff --git a/modules/fdlibm/src/s_tanh.cpp b/modules/fdlibm/src/s_tanh.cpp
--- a/modules/fdlibm/src/s_tanh.cpp
+++ b/modules/fdlibm/src/s_tanh.cpp
@ -431,3 +383,51 @@ diff --git a/modules/fdlibm/src/s_trunc.cpp b/modules/fdlibm/src/s_trunc.cpp
-#if LDBL_MANT_DIG == 53
-__weak_reference(trunc, truncl);
-#endif
diff --git a/modules/fdlibm/src/s_cos.cpp b/modules/fdlibm/src/s_cos.cpp
--- a/modules/fdlibm/src/s_cos.cpp
+++ b/modules/fdlibm/src/s_cos.cpp
@@ -78,12 +78,8 @@ cos(double x)
case 0: return __kernel_cos(y[0],y[1]);
case 1: return -__kernel_sin(y[0],y[1],1);
case 2: return -__kernel_cos(y[0],y[1]);
default:
return __kernel_sin(y[0],y[1],1);
}
}
}
-
-#if (LDBL_MANT_DIG == 53)
-__weak_reference(cos, cosl);
-#endif
diff --git a/modules/fdlibm/src/s_sin.cpp b/modules/fdlibm/src/s_sin.cpp
--- a/modules/fdlibm/src/s_sin.cpp
+++ b/modules/fdlibm/src/s_sin.cpp
@@ -78,12 +78,8 @@ sin(double x)
case 0: return __kernel_sin(y[0],y[1],1);
case 1: return __kernel_cos(y[0],y[1]);
case 2: return -__kernel_sin(y[0],y[1],1);
default:
return -__kernel_cos(y[0],y[1]);
}
}
}
-
-#if (LDBL_MANT_DIG == 53)
-__weak_reference(sin, sinl);
-#endif
diff --git a/modules/fdlibm/src/s_tan.cpp b/modules/fdlibm/src/s_tan.cpp
--- a/modules/fdlibm/src/s_tan.cpp
+++ b/modules/fdlibm/src/s_tan.cpp
@@ -72,12 +72,8 @@ tan(double x)
/* argument reduction needed */
else {
n = __ieee754_rem_pio2(x,y);
return __kernel_tan(y[0],y[1],1-((n&1)<<1)); /* 1 -- n even
-1 -- n odd */
}
}
-
-#if (LDBL_MANT_DIG == 53)
-__weak_reference(tan, tanl);
-#endif

Просмотреть файл

@ -301,30 +301,6 @@ diff --git a/modules/fdlibm/src/e_pow.cpp b/modules/fdlibm/src/e_pow.cpp
* 1. Compute and return log2(x) in two pieces:
* log2(x) = w1 + w2,
* where w1 has 53-24 = 29 bit trailing zeros.
diff --git a/modules/fdlibm/src/e_rem_pio2.cpp b/modules/fdlibm/src/e_rem_pio2.cpp
--- a/modules/fdlibm/src/e_rem_pio2.cpp
+++ b/modules/fdlibm/src/e_rem_pio2.cpp
@@ -8,18 +8,18 @@
* Permission to use, copy, modify, and distribute this
* software is freely granted, provided that this notice
* is preserved.
* ====================================================
*
* Optimized by Bruce D. Evans.
*/
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
+//#include <sys/cdefs.h>
+//__FBSDID("$FreeBSD$");
/* __ieee754_rem_pio2(x,y)
*
* return the remainder of x rem pi/2 in y[0]+y[1]
* use __kernel_rem_pio2()
*/
#include <float.h>
diff --git a/modules/fdlibm/src/e_sinh.cpp b/modules/fdlibm/src/e_sinh.cpp
--- a/modules/fdlibm/src/e_sinh.cpp
+++ b/modules/fdlibm/src/e_sinh.cpp
@ -349,30 +325,6 @@ diff --git a/modules/fdlibm/src/e_sinh.cpp b/modules/fdlibm/src/e_sinh.cpp
* 2.
* E + E/(E+1)
* 0 <= x <= 22 : sinh(x) := --------------, E=expm1(x)
diff --git a/modules/fdlibm/src/k_cos.cpp b/modules/fdlibm/src/k_cos.cpp
--- a/modules/fdlibm/src/k_cos.cpp
+++ b/modules/fdlibm/src/k_cos.cpp
@@ -6,18 +6,18 @@
*
* Developed at SunSoft, a Sun Microsystems, Inc. business.
* Permission to use, copy, modify, and distribute this
* software is freely granted, provided that this notice
* is preserved.
* ====================================================
*/
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
+//#include <sys/cdefs.h>
+//__FBSDID("$FreeBSD$");
/*
* __kernel_cos( x, y )
* kernel cos function on [-pi/4, pi/4], pi/4 ~ 0.785398164
* Input x is assumed to be bounded by ~pi/4 in magnitude.
* Input y is the tail of x.
*
* Algorithm
diff --git a/modules/fdlibm/src/k_exp.cpp b/modules/fdlibm/src/k_exp.cpp
--- a/modules/fdlibm/src/k_exp.cpp
+++ b/modules/fdlibm/src/k_exp.cpp
@ -426,78 +378,6 @@ diff --git a/modules/fdlibm/src/k_log.h b/modules/fdlibm/src/k_log.h
* The following describes the overall strategy for computing
* logarithms in base e. The argument reduction and adding the final
* term of the polynomial are done by the caller for increased accuracy
diff --git a/modules/fdlibm/src/k_rem_pio2.cpp b/modules/fdlibm/src/k_rem_pio2.cpp
--- a/modules/fdlibm/src/k_rem_pio2.cpp
+++ b/modules/fdlibm/src/k_rem_pio2.cpp
@@ -6,18 +6,18 @@
*
* Developed at SunSoft, a Sun Microsystems, Inc. business.
* Permission to use, copy, modify, and distribute this
* software is freely granted, provided that this notice
* is preserved.
* ====================================================
*/
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
+//#include <sys/cdefs.h>
+//__FBSDID("$FreeBSD$");
/*
* __kernel_rem_pio2(x,y,e0,nx,prec)
* double x[],y[]; int e0,nx,prec;
*
* __kernel_rem_pio2 return the last three digits of N with
* y = x - N*pi/2
* so that |y| < pi/2.
diff --git a/modules/fdlibm/src/k_sin.cpp b/modules/fdlibm/src/k_sin.cpp
--- a/modules/fdlibm/src/k_sin.cpp
+++ b/modules/fdlibm/src/k_sin.cpp
@@ -6,18 +6,18 @@
*
* Developed at SunSoft, a Sun Microsystems, Inc. business.
* Permission to use, copy, modify, and distribute this
* software is freely granted, provided that this notice
* is preserved.
* ====================================================
*/
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
+//#include <sys/cdefs.h>
+//__FBSDID("$FreeBSD$");
/* __kernel_sin( x, y, iy)
* kernel sin function on ~[-pi/4, pi/4] (except on -0), pi/4 ~ 0.7854
* Input x is assumed to be bounded by ~pi/4 in magnitude.
* Input y is the tail of x.
* Input iy indicates whether y is 0. (if iy=0, y assume to be 0).
*
* Algorithm
diff --git a/modules/fdlibm/src/k_tan.cpp b/modules/fdlibm/src/k_tan.cpp
--- a/modules/fdlibm/src/k_tan.cpp
+++ b/modules/fdlibm/src/k_tan.cpp
@@ -6,18 +6,18 @@
*
* Permission to use, copy, modify, and distribute this
* software is freely granted, provided that this notice
* is preserved.
* ====================================================
*/
/* INDENT OFF */
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
+//#include <sys/cdefs.h>
+//__FBSDID("$FreeBSD$");
/* __kernel_tan( x, y, k )
* kernel tan function on ~[-pi/4, pi/4] (except on -0), pi/4 ~ 0.7854
* Input x is assumed to be bounded by ~pi/4 in magnitude.
* Input y is the tail of x.
* Input k indicates whether tan (if k = 1) or -1/tan (if k = -1) is returned.
*
* Algorithm
diff --git a/modules/fdlibm/src/s_asinh.cpp b/modules/fdlibm/src/s_asinh.cpp
--- a/modules/fdlibm/src/s_asinh.cpp
+++ b/modules/fdlibm/src/s_asinh.cpp
@ -642,30 +522,6 @@ diff --git a/modules/fdlibm/src/s_copysign.cpp b/modules/fdlibm/src/s_copysign.c
*/
#include "math_private.h"
diff --git a/modules/fdlibm/src/s_cos.cpp b/modules/fdlibm/src/s_cos.cpp
--- a/modules/fdlibm/src/s_cos.cpp
+++ b/modules/fdlibm/src/s_cos.cpp
@@ -5,18 +5,18 @@
*
* 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.
* ====================================================
*/
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
+//#include <sys/cdefs.h>
+//__FBSDID("$FreeBSD$");
/* cos(x)
* Return cosine function of x.
*
* kernel function:
* __kernel_sin ... sine function on [-pi/4,pi/4]
* __kernel_cos ... cosine function on [-pi/4,pi/4]
* __ieee754_rem_pio2 ... argument reduction routine
diff --git a/modules/fdlibm/src/s_expm1.cpp b/modules/fdlibm/src/s_expm1.cpp
--- a/modules/fdlibm/src/s_expm1.cpp
+++ b/modules/fdlibm/src/s_expm1.cpp
@ -804,12 +660,12 @@ diff --git a/modules/fdlibm/src/s_nearbyint.cpp b/modules/fdlibm/src/s_nearbyint
+//__FBSDID("$FreeBSD$");
#include <fenv.h>
#include "math_private.h"
/*
* We save and restore the floating-point environment to avoid raising
* an inexact exception. We can get away with using fesetenv()
* instead of feclearexcept()/feupdateenv() to restore the environment
diff --git a/modules/fdlibm/src/s_rint.cpp b/modules/fdlibm/src/s_rint.cpp
--- a/modules/fdlibm/src/s_rint.cpp
+++ b/modules/fdlibm/src/s_rint.cpp
@ -858,9 +714,9 @@ diff --git a/modules/fdlibm/src/s_rintf.cpp b/modules/fdlibm/src/s_rintf.cpp
static const float
TWO23[2]={
diff --git a/modules/fdlibm/src/s_sin.cpp b/modules/fdlibm/src/s_sin.cpp
--- a/modules/fdlibm/src/s_sin.cpp
+++ b/modules/fdlibm/src/s_sin.cpp
diff --git a/modules/fdlibm/src/s_scalbn.cpp b/modules/fdlibm/src/s_scalbn.cpp
--- a/modules/fdlibm/src/s_scalbn.cpp
+++ b/modules/fdlibm/src/s_scalbn.cpp
@@ -5,18 +5,18 @@
*
* Developed at SunPro, a Sun Microsystems, Inc. business.
@ -875,37 +731,13 @@ diff --git a/modules/fdlibm/src/s_sin.cpp b/modules/fdlibm/src/s_sin.cpp
+//#include <sys/cdefs.h>
+//__FBSDID("$FreeBSD$");
/* sin(x)
* Return sine function of x.
*
* kernel function:
* __kernel_sin ... sine function on [-pi/4,pi/4]
* __kernel_cos ... cose function on [-pi/4,pi/4]
* __ieee754_rem_pio2 ... argument reduction routine
diff --git a/modules/fdlibm/src/s_tan.cpp b/modules/fdlibm/src/s_tan.cpp
--- a/modules/fdlibm/src/s_tan.cpp
+++ b/modules/fdlibm/src/s_tan.cpp
@@ -5,18 +5,18 @@
*
* 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.
* ====================================================
/*
* scalbn (double x, int n)
* scalbn(x,n) returns x* 2**n computed by exponent
* manipulation rather than by actually performing an
* exponentiation or a multiplication.
*/
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
+//#include <sys/cdefs.h>
+//__FBSDID("$FreeBSD$");
/* tan(x)
* Return tangent function of x.
*
* kernel function:
* __kernel_tan ... tangent function on [-pi/4,pi/4]
* __ieee754_rem_pio2 ... argument reduction routine
*
diff --git a/modules/fdlibm/src/s_tanh.cpp b/modules/fdlibm/src/s_tanh.cpp
--- a/modules/fdlibm/src/s_tanh.cpp
+++ b/modules/fdlibm/src/s_tanh.cpp
@ -978,3 +810,196 @@ diff --git a/modules/fdlibm/src/s_truncf.cpp b/modules/fdlibm/src/s_truncf.cpp
* Bit twiddling.
* Exception:
* Inexact flag raised if x not equal to truncf(x).
diff --git a/modules/fdlibm/src/e_rem_pio2.cpp b/modules/fdlibm/src/e_rem_pio2.cpp
--- a/modules/fdlibm/src/e_rem_pio2.cpp
+++ b/modules/fdlibm/src/e_rem_pio2.cpp
@@ -8,18 +8,18 @@
* Permission to use, copy, modify, and distribute this
* software is freely granted, provided that this notice
* is preserved.
* ====================================================
*
* Optimized by Bruce D. Evans.
*/
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
+//#include <sys/cdefs.h>
+//__FBSDID("$FreeBSD$");
/* __ieee754_rem_pio2(x,y)
*
* return the remainder of x rem pi/2 in y[0]+y[1]
* use __kernel_rem_pio2()
*/
#include <float.h>
diff --git a/modules/fdlibm/src/k_cos.cpp b/modules/fdlibm/src/k_cos.cpp
--- a/modules/fdlibm/src/k_cos.cpp
+++ b/modules/fdlibm/src/k_cos.cpp
@@ -6,18 +6,18 @@
*
* Developed at SunSoft, a Sun Microsystems, Inc. business.
* Permission to use, copy, modify, and distribute this
* software is freely granted, provided that this notice
* is preserved.
* ====================================================
*/
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
+//#include <sys/cdefs.h>
+//__FBSDID("$FreeBSD$");
/*
* __kernel_cos( x, y )
* kernel cos function on [-pi/4, pi/4], pi/4 ~ 0.785398164
* Input x is assumed to be bounded by ~pi/4 in magnitude.
* Input y is the tail of x.
*
* Algorithm
diff --git a/modules/fdlibm/src/k_rem_pio2.cpp b/modules/fdlibm/src/k_rem_pio2.cpp
--- a/modules/fdlibm/src/k_rem_pio2.cpp
+++ b/modules/fdlibm/src/k_rem_pio2.cpp
@@ -6,18 +6,18 @@
*
* Developed at SunSoft, a Sun Microsystems, Inc. business.
* Permission to use, copy, modify, and distribute this
* software is freely granted, provided that this notice
* is preserved.
* ====================================================
*/
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
+//#include <sys/cdefs.h>
+//__FBSDID("$FreeBSD$");
/*
* __kernel_rem_pio2(x,y,e0,nx,prec)
* double x[],y[]; int e0,nx,prec;
*
* __kernel_rem_pio2 return the last three digits of N with
* y = x - N*pi/2
* so that |y| < pi/2.
diff --git a/modules/fdlibm/src/k_sin.cpp b/modules/fdlibm/src/k_sin.cpp
--- a/modules/fdlibm/src/k_sin.cpp
+++ b/modules/fdlibm/src/k_sin.cpp
@@ -6,18 +6,18 @@
*
* Developed at SunSoft, a Sun Microsystems, Inc. business.
* Permission to use, copy, modify, and distribute this
* software is freely granted, provided that this notice
* is preserved.
* ====================================================
*/
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
+//#include <sys/cdefs.h>
+//__FBSDID("$FreeBSD$");
/* __kernel_sin( x, y, iy)
* kernel sin function on ~[-pi/4, pi/4] (except on -0), pi/4 ~ 0.7854
* Input x is assumed to be bounded by ~pi/4 in magnitude.
* Input y is the tail of x.
* Input iy indicates whether y is 0. (if iy=0, y assume to be 0).
*
* Algorithm
diff --git a/modules/fdlibm/src/k_tan.cpp b/modules/fdlibm/src/k_tan.cpp
--- a/modules/fdlibm/src/k_tan.cpp
+++ b/modules/fdlibm/src/k_tan.cpp
@@ -6,18 +6,18 @@
*
* Permission to use, copy, modify, and distribute this
* software is freely granted, provided that this notice
* is preserved.
* ====================================================
*/
/* INDENT OFF */
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
+//#include <sys/cdefs.h>
+//__FBSDID("$FreeBSD$");
/* __kernel_tan( x, y, k )
* kernel tan function on ~[-pi/4, pi/4] (except on -0), pi/4 ~ 0.7854
* Input x is assumed to be bounded by ~pi/4 in magnitude.
* Input y is the tail of x.
* Input k indicates whether tan (if k = 1) or -1/tan (if k = -1) is returned.
*
* Algorithm
diff --git a/modules/fdlibm/src/s_cos.cpp b/modules/fdlibm/src/s_cos.cpp
--- a/modules/fdlibm/src/s_cos.cpp
+++ b/modules/fdlibm/src/s_cos.cpp
@@ -5,18 +5,18 @@
*
* 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.
* ====================================================
*/
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
+//#include <sys/cdefs.h>
+//__FBSDID("$FreeBSD$");
/* cos(x)
* Return cosine function of x.
*
* kernel function:
* __kernel_sin ... sine function on [-pi/4,pi/4]
* __kernel_cos ... cosine function on [-pi/4,pi/4]
* __ieee754_rem_pio2 ... argument reduction routine
diff --git a/modules/fdlibm/src/s_sin.cpp b/modules/fdlibm/src/s_sin.cpp
--- a/modules/fdlibm/src/s_sin.cpp
+++ b/modules/fdlibm/src/s_sin.cpp
@@ -5,18 +5,18 @@
*
* 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.
* ====================================================
*/
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
+//#include <sys/cdefs.h>
+//__FBSDID("$FreeBSD$");
/* sin(x)
* Return sine function of x.
*
* kernel function:
* __kernel_sin ... sine function on [-pi/4,pi/4]
* __kernel_cos ... cose function on [-pi/4,pi/4]
* __ieee754_rem_pio2 ... argument reduction routine
diff --git a/modules/fdlibm/src/s_tan.cpp b/modules/fdlibm/src/s_tan.cpp
--- a/modules/fdlibm/src/s_tan.cpp
+++ b/modules/fdlibm/src/s_tan.cpp
@@ -5,18 +5,18 @@
*
* 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.
* ====================================================
*/
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
+//#include <sys/cdefs.h>
+//__FBSDID("$FreeBSD$");
/* tan(x)
* Return tangent function of x.
*
* kernel function:
* __kernel_tan ... tangent function on [-pi/4,pi/4]
* __ieee754_rem_pio2 ... argument reduction routine
*

Просмотреть файл

@ -20,7 +20,7 @@ diff --git a/modules/fdlibm/src/k_exp.cpp b/modules/fdlibm/src/k_exp.cpp
/*
* Compute exp(x), scaled to avoid spurious overflow. An exponent is
* returned separately in 'expt'.
@@ -78,33 +76,8 @@ __ldexp_exp(double x, int expt)
@@ -78,32 +76,8 @@ double
double exp_x, scale;
int ex_expt;
@ -33,7 +33,7 @@ diff --git a/modules/fdlibm/src/k_exp.cpp b/modules/fdlibm/src/k_exp.cpp
-double complex
-__ldexp_cexp(double complex z, int expt)
-{
- double c, exp_x, s, scale1, scale2, x, y;
- double x, y, exp_x, scale1, scale2;
- int ex_expt, half_expt;
-
- x = creal(z);
@ -50,7 +50,6 @@ diff --git a/modules/fdlibm/src/k_exp.cpp b/modules/fdlibm/src/k_exp.cpp
- half_expt = expt - half_expt;
- INSERT_WORDS(scale2, (0x3ff + half_expt) << 20, 0);
-
- sincos(y, &s, &c);
- return (CMPLX(c * exp_x * scale1 * scale2,
- s * exp_x * scale1 * scale2));
- return (CMPLX(cos(y) * exp_x * scale1 * scale2,
- sin(y) * exp_x * scale1 * scale2));
-}

Просмотреть файл

@ -14,8 +14,8 @@ diff --git a/modules/fdlibm/src/math_private.h b/modules/fdlibm/src/math_private
#include <stdint.h>
#include <sys/types.h>
#include "mozilla/EndianUtils.h"
#include "fdlibm.h"
#include "mozilla/EndianUtils.h"
/*

Просмотреть файл

@ -1,7 +1,7 @@
diff --git a/modules/fdlibm/src/math_private.h b/modules/fdlibm/src/math_private.h
--- a/modules/fdlibm/src/math_private.h
+++ b/modules/fdlibm/src/math_private.h
@@ -323,16 +323,27 @@ do { \
@@ -328,16 +328,27 @@ do { \
if (sizeof(type) >= sizeof(long double)) \
(lval) = (rval); \
else { \

Просмотреть файл

@ -1,7 +1,7 @@
diff --git a/modules/fdlibm/src/e_exp.cpp b/modules/fdlibm/src/e_exp.cpp
--- a/modules/fdlibm/src/e_exp.cpp
+++ b/modules/fdlibm/src/e_exp.cpp
@@ -146,14 +146,17 @@ __ieee754_exp(double x) /* default IEEE double exp */
@@ -146,14 +146,17 @@ double
if(k >= -1021)
INSERT_WORDS(twopk,((u_int32_t)(0x3ff+k))<<20, 0);
else

Просмотреть файл

@ -1,7 +1,7 @@
diff --git a/modules/fdlibm/src/s_nearbyint.cpp b/modules/fdlibm/src/s_nearbyint.cpp
--- a/modules/fdlibm/src/s_nearbyint.cpp
+++ b/modules/fdlibm/src/s_nearbyint.cpp
@@ -54,9 +54,8 @@ fn(type x) \
@@ -53,9 +53,8 @@ fn(type x) \
fegetenv(&env); \
ret = rint(x); \
fesetenv(&env); \

Просмотреть файл

@ -1,7 +1,7 @@
diff --git a/modules/fdlibm/src/math_private.h b/modules/fdlibm/src/math_private.h
--- a/modules/fdlibm/src/math_private.h
+++ b/modules/fdlibm/src/math_private.h
@@ -309,17 +309,17 @@ do { \
@@ -314,17 +314,17 @@ do { \
/* The above works on non-i386 too, but we use this to check v. */
#define LD80C(m, ex, v) { .e = (v), }
#endif

Просмотреть файл

@ -1,7 +1,7 @@
diff --git a/modules/fdlibm/src/e_exp.cpp b/modules/fdlibm/src/e_exp.cpp
--- a/modules/fdlibm/src/e_exp.cpp
+++ b/modules/fdlibm/src/e_exp.cpp
@@ -91,16 +91,18 @@ ln2LO[2] ={ 1.90821492927058770002e-10, /* 0x3dea39ef, 0x35793c76 */
@@ -91,16 +91,18 @@ ln2LO[2] ={ 1.90821492927058770002e-10
-1.90821492927058770002e-10,},/* 0xbdea39ef, 0x35793c76 */
invln2 = 1.44269504088896338700e+00, /* 0x3ff71547, 0x652b82fe */
P1 = 1.66666666666666019037e-01, /* 0x3FC55555, 0x5555553E */
@ -20,7 +20,7 @@ diff --git a/modules/fdlibm/src/e_exp.cpp b/modules/fdlibm/src/e_exp.cpp
__ieee754_exp(double x) /* default IEEE double exp */
{
double y,hi=0.0,lo=0.0,c,t,twopk;
@@ -122,16 +124,17 @@ __ieee754_exp(double x) /* default IEEE double exp */
@@ -122,16 +124,17 @@ double
}
if(x > o_threshold) return huge*huge; /* overflow */
if(x < u_threshold) return twom1000*twom1000; /* underflow */

Просмотреть файл

@ -19,7 +19,7 @@ diff --git a/modules/fdlibm/src/e_acos.cpp b/modules/fdlibm/src/e_acos.cpp
one= 1.00000000000000000000e+00, /* 0x3FF00000, 0x00000000 */
pi = 3.14159265358979311600e+00, /* 0x400921FB, 0x54442D18 */
pio2_hi = 1.57079632679489655800e+00; /* 0x3FF921FB, 0x54442D18 */
@@ -82,23 +83,23 @@ __ieee754_acos(double x)
@@ -82,23 +83,23 @@ double
p = z*(pS0+z*(pS1+z*(pS2+z*(pS3+z*(pS4+z*pS5)))));
q = one+z*(qS1+z*(qS2+z*(qS3+z*qS4)));
r = p/q;
@ -66,7 +66,7 @@ diff --git a/modules/fdlibm/src/e_acosh.cpp b/modules/fdlibm/src/e_acosh.cpp
one = 1.0,
ln2 = 6.93147180559945286227e-01; /* 0x3FE62E42, 0xFEFA39EF */
@@ -50,14 +51,14 @@ __ieee754_acosh(double x)
@@ -50,14 +51,14 @@ double
if(hx >=0x7ff00000) { /* x is inf of NaN */
return x+x;
} else
@ -104,7 +104,7 @@ diff --git a/modules/fdlibm/src/e_asin.cpp b/modules/fdlibm/src/e_asin.cpp
one = 1.00000000000000000000e+00, /* 0x3FF00000, 0x00000000 */
huge = 1.000e+300,
pio2_hi = 1.57079632679489655800e+00, /* 0x3FF921FB, 0x54442D18 */
@@ -90,17 +91,17 @@ __ieee754_asin(double x)
@@ -90,17 +91,17 @@ double
w = p/q;
return x+x*w;
}
@ -144,7 +144,7 @@ diff --git a/modules/fdlibm/src/e_hypot.cpp b/modules/fdlibm/src/e_hypot.cpp
__ieee754_hypot(double x, double y)
{
double a,b,t1,t2,y1,y2,w;
@@ -100,25 +101,25 @@ __ieee754_hypot(double x, double y)
@@ -100,26 +101,26 @@ double
}
}
/* medium size a and b */
@ -167,15 +167,16 @@ diff --git a/modules/fdlibm/src/e_hypot.cpp b/modules/fdlibm/src/e_hypot.cpp
+ w = std::sqrt(t1*y1-(w*(-w)-(t1*y2+t2*b)));
}
if(k!=0) {
t1 = 0.0;
SET_HIGH_WORD(t1,(1023+k)<<20);
u_int32_t high;
t1 = 1.0;
GET_HIGH_WORD(high,t1);
SET_HIGH_WORD(t1,high+(k<<20));
return t1*w;
} else return w;
}
diff --git a/modules/fdlibm/src/e_pow.cpp b/modules/fdlibm/src/e_pow.cpp
--- a/modules/fdlibm/src/e_pow.cpp
+++ b/modules/fdlibm/src/e_pow.cpp
@@ -52,16 +52,17 @@
@@ -52,16 +52,18 @@
*
* Constants :
* The hexadecimal values are the intended ones for the following
@ -185,6 +186,7 @@ diff --git a/modules/fdlibm/src/e_pow.cpp b/modules/fdlibm/src/e_pow.cpp
*/
+#include <cmath>
+
#include <float.h>
#include "math_private.h"
@ -193,7 +195,7 @@ diff --git a/modules/fdlibm/src/e_pow.cpp b/modules/fdlibm/src/e_pow.cpp
dp_h[] = { 0.0, 5.84962487220764160156e-01,}, /* 0x3FE2B803, 0x40000000 */
dp_l[] = { 0.0, 1.35003920212974897128e-08,}, /* 0x3E4CFDEB, 0x43CFD006 */
zero = 0.0,
@@ -151,17 +152,17 @@ __ieee754_pow(double x, double y)
@@ -151,17 +153,17 @@ double
return (hy<0)?-y: zero;
}
if(iy==0x3ff00000) { /* y is +-1 */

Просмотреть файл

@ -1,7 +1,7 @@
diff --git a/modules/fdlibm/src/math_private.h b/modules/fdlibm/src/math_private.h
--- a/modules/fdlibm/src/math_private.h
+++ b/modules/fdlibm/src/math_private.h
@@ -612,95 +612,32 @@ rnint(__double_t x)
@@ -617,95 +617,32 @@ rnint(double x)
* magic number would need to be variable. Assuming that the
* rounding precision is always the default is too fragile. This
* and many other complications will move when the default is
@ -45,7 +45,7 @@ diff --git a/modules/fdlibm/src/math_private.h b/modules/fdlibm/src/math_private
* return type provided their arg is a floating point integer. They can
* sometimes be more efficient because no rounding is required.
*/
#if defined(amd64) || defined(__i386__)
#if (defined(amd64) || defined(__i386__)) && defined(__GNUCLIKE_ASM)
#define irint(x) \
(sizeof(x) == sizeof(float) && \
sizeof(__float_t) == sizeof(long double) ? irintf(x) : \
@ -58,7 +58,7 @@ diff --git a/modules/fdlibm/src/math_private.h b/modules/fdlibm/src/math_private
-#define i64rint(x) ((int64_t)(x)) /* only needed for ld128 so not opt. */
-
-#if defined(__i386__)
-#if defined(__i386__) && defined(__GNUCLIKE_ASM)
-static __inline int
-irintf(float x)
-{
@ -78,7 +78,7 @@ diff --git a/modules/fdlibm/src/math_private.h b/modules/fdlibm/src/math_private
-}
-#endif
-
-#if defined(__amd64__) || defined(__i386__)
-#if (defined(__amd64__) || defined(__i386__)) && defined(__GNUCLIKE_ASM)
-static __inline int
-irintl(long double x)
-{

Просмотреть файл

@ -1,16 +1,15 @@
diff --git a/modules/fdlibm/src/math_private.h b/modules/fdlibm/src/math_private.h
--- a/modules/fdlibm/src/math_private.h
+++ b/modules/fdlibm/src/math_private.h
@@ -20,16 +20,24 @@
#include <cfloat>
@@ -21,16 +21,24 @@
#include <stdint.h>
#include <sys/types.h>
#include "mozilla/EndianUtils.h"
#include "fdlibm.h"
+/*
#include "mozilla/EndianUtils.h"
/*
+ * Emulate FreeBSD internal double types.
+ * Adapted from https://github.com/freebsd/freebsd-src/search?q=__double_t
+ */
@ -18,7 +17,7 @@ diff --git a/modules/fdlibm/src/math_private.h b/modules/fdlibm/src/math_private
+typedef double __double_t;
+typedef __double_t double_t;
+
/*
+/*
* The original fdlibm code used statements like:
* n0 = ((*(int*)&one)>>29)^1; * index of high word *
* ix0 = *(n0+(int*)&x); * high word of x *
@ -26,3 +25,4 @@ diff --git a/modules/fdlibm/src/math_private.h b/modules/fdlibm/src/math_private
* to dig two 32 bit words out of the 64 bit IEEE floating point
* value. That is non-ANSI, and, moreover, the gcc instruction
* scheduler gets it wrong. We instead use the following macros.
* Unlike the original code, we determine the endianness at compile

Просмотреть файл

@ -1,7 +1,7 @@
diff --git a/modules/fdlibm/src/e_rem_pio2.cpp b/modules/fdlibm/src/e_rem_pio2.cpp
--- a/modules/fdlibm/src/e_rem_pio2.cpp
+++ b/modules/fdlibm/src/e_rem_pio2.cpp
@@ -43,17 +43,17 @@ invpio2 = 6.36619772367581382433e-01, /* 0x3FE45F30, 0x6DC9C883 */
@@ -43,17 +43,17 @@ invpio2 = 6.36619772367581382433e-01, /
pio2_1 = 1.57079632673412561417e+00, /* 0x3FF921FB, 0x54400000 */
pio2_1t = 6.07710050650619224932e-11, /* 0x3DD0B461, 0x1A626331 */
pio2_2 = 6.07710050630396597660e-11, /* 0x3DD0B461, 0x1A600000 */
@ -20,29 +20,6 @@ diff --git a/modules/fdlibm/src/e_rem_pio2.cpp b/modules/fdlibm/src/e_rem_pio2.c
double tx[3],ty[2];
int32_t e0,i,j,nx,n,ix,hx;
u_int32_t low;
diff --git a/modules/fdlibm/src/k_rem_pio2.cpp b/modules/fdlibm/src/k_rem_pio2.cpp
--- a/modules/fdlibm/src/k_rem_pio2.cpp
+++ b/modules/fdlibm/src/k_rem_pio2.cpp
@@ -305,17 +305,18 @@ __kernel_rem_pio2(double *x, double *y, int e0, int nx, int prec)
q0 = e0-24*(jv+1);
/* set up f[0] to f[jx+jk] where f[jx+jk] = ipio2[jv+jk] */
j = jv-jx; m = jx+jk;
for(i=0;i<=m;i++,j++) f[i] = (j<0)? zero : (double) ipio2[j];
/* compute q[0],q[1],...q[jk] */
for (i=0;i<=jk;i++) {
- for(j=0,fw=0.0;j<=jx;j++) fw += x[j]*f[jx+i-j]; q[i] = fw;
+ for(j=0,fw=0.0;j<=jx;j++) fw += x[j]*f[jx+i-j];
+ q[i] = fw;
}
jz = jk;
recompute:
/* distill q[] into iq[] reversingly */
for(i=0,j=jz,z=q[jz];j>0;i++,j--) {
fw = (double)((int32_t)(twon24* z));
iq[i] = (int32_t)(z-two24*fw);
diff --git a/modules/fdlibm/src/s_cos.cpp b/modules/fdlibm/src/s_cos.cpp
--- a/modules/fdlibm/src/s_cos.cpp
+++ b/modules/fdlibm/src/s_cos.cpp
@ -109,3 +86,26 @@ diff --git a/modules/fdlibm/src/s_tan.cpp b/modules/fdlibm/src/s_tan.cpp
int32_t n, ix;
/* High word of x. */
diff --git a/modules/fdlibm/src/k_rem_pio2.cpp b/modules/fdlibm/src/k_rem_pio2.cpp
--- a/modules/fdlibm/src/k_rem_pio2.cpp
+++ b/modules/fdlibm/src/k_rem_pio2.cpp
@@ -305,17 +305,18 @@ __kernel_rem_pio2(double *x, double *y, int e0, int nx, int prec)
q0 = e0-24*(jv+1);
/* set up f[0] to f[jx+jk] where f[jx+jk] = ipio2[jv+jk] */
j = jv-jx; m = jx+jk;
for(i=0;i<=m;i++,j++) f[i] = (j<0)? zero : (double) ipio2[j];
/* compute q[0],q[1],...q[jk] */
for (i=0;i<=jk;i++) {
- for(j=0,fw=0.0;j<=jx;j++) fw += x[j]*f[jx+i-j]; q[i] = fw;
+ for(j=0,fw=0.0;j<=jx;j++) fw += x[j]*f[jx+i-j];
+ q[i] = fw;
}
jz = jk;
recompute:
/* distill q[] into iq[] reversingly */
for(i=0,j=jz,z=q[jz];j>0;i++,j--) {
fw = (double)((int32_t)(twon24* z));
iq[i] = (int32_t)(z-two24*fw);

Просмотреть файл

@ -0,0 +1,47 @@
diff --git a/modules/fdlibm/src/fdlibm.h b/modules/fdlibm/src/fdlibm.h
--- a/modules/fdlibm/src/fdlibm.h
+++ b/modules/fdlibm/src/fdlibm.h
@@ -19,16 +19,20 @@
namespace fdlibm {
double acos(double);
double asin(double);
double atan(double);
double atan2(double, double);
+double cos(double);
+double sin(double);
+double tan(double);
+
double cosh(double);
double sinh(double);
double tanh(double);
double exp(double);
double log(double);
double log10(double);
diff --git a/modules/fdlibm/src/math_private.h b/modules/fdlibm/src/math_private.h
--- a/modules/fdlibm/src/math_private.h
+++ b/modules/fdlibm/src/math_private.h
@@ -832,16 +832,19 @@ rnint(double_t x)
#define __ieee754_ynf ynf
#define __ieee754_remainderf remainderf
#define __ieee754_scalbf scalbf
#define acos fdlibm::acos
#define asin fdlibm::asin
#define atan fdlibm::atan
#define atan2 fdlibm::atan2
+#define cos fdlibm::cos
+#define sin fdlibm::sin
+#define tan fdlibm::tan
#define cosh fdlibm::cosh
#define sinh fdlibm::sinh
#define tanh fdlibm::tanh
#define exp fdlibm::exp
#define log fdlibm::log
#define log10 fdlibm::log10
#define pow fdlibm::pow
#define ceil fdlibm::ceil

Просмотреть файл

@ -118,8 +118,10 @@ __ieee754_hypot(double x, double y)
w = std::sqrt(t1*y1-(w*(-w)-(t1*y2+t2*b)));
}
if(k!=0) {
t1 = 0.0;
SET_HIGH_WORD(t1,(1023+k)<<20);
u_int32_t high;
t1 = 1.0;
GET_HIGH_WORD(high,t1);
SET_HIGH_WORD(t1,high+(k<<20));
return t1*w;
} else return w;
}

Просмотреть файл

@ -58,6 +58,7 @@
*/
#include <cmath>
#include <float.h>
#include "math_private.h"

Просмотреть файл

@ -23,6 +23,7 @@ double acos(double);
double asin(double);
double atan(double);
double atan2(double, double);
double cos(double);
double sin(double);
double tan(double);
@ -36,10 +37,11 @@ double log(double);
double log10(double);
double pow(double, double);
double ceil(double);
double fabs(double);
double floor(double);
double trunc(double);
double ceil(double);
double acosh(double);
double asinh(double);
@ -53,10 +55,10 @@ double rint(double);
double copysign(double, double);
double nearbyint(double);
double scalbn(double, int);
double trunc(double);
float ceilf(float);
float floorf(float);
float nearbyintf(float);
float rintf(float);
float truncf(float);

Просмотреть файл

@ -21,10 +21,10 @@
#include <stdint.h>
#include <sys/types.h>
#include "mozilla/EndianUtils.h"
#include "fdlibm.h"
#include "mozilla/EndianUtils.h"
/*
* Emulate FreeBSD internal double types.
* Adapted from https://github.com/freebsd/freebsd-src/search?q=__double_t
@ -94,6 +94,11 @@ typedef union
#endif
/*
* A union which permits us to convert between a double and two 32 bit
* ints.
*/
#if MOZ_BIG_ENDIAN()
typedef union
@ -476,7 +481,7 @@ do { \
* or by having |c| a few percent smaller than |a|. Pre-normalization of
* (a, b) may help.
*
* This is a variant of an algorithm of Kahan (see Knuth (1981) 4.2.2
* This is is a variant of an algorithm of Kahan (see Knuth (1981) 4.2.2
* exercise 19). We gain considerable efficiency by requiring the terms to
* be sufficiently normalized and sufficiently increasing.
*/
@ -630,7 +635,7 @@ rnint(__double_t x)
* return type provided their arg is a floating point integer. They can
* sometimes be more efficient because no rounding is required.
*/
#if defined(amd64) || defined(__i386__)
#if (defined(amd64) || defined(__i386__)) && defined(__GNUCLIKE_ASM)
#define irint(x) \
(sizeof(x) == sizeof(float) && \
sizeof(__float_t) == sizeof(long double) ? irintf(x) : \

Просмотреть файл

@ -107,7 +107,7 @@ cbrt(double x)
r=x/s; /* error <= 0.5 ulps; |r| < |t| */
w=t+t; /* t+t is exact */
r=(r-t)/(w+r); /* r-t is exact; w+r ~= 3*t */
t=t+t*r; /* error <= (0.5 + 0.5/3) * ulp */
t=t+t*r; /* error <= 0.5 + 0.5/3 + epsilon */
return(t);
}

Просмотреть файл

@ -30,7 +30,6 @@
//__FBSDID("$FreeBSD$");
#include <fenv.h>
#include "math_private.h"
/*

Просмотреть файл

@ -1,43 +1,60 @@
/* @(#)s_scalbn.c 5.1 93/09/24 */
/*
* Copyright (c) 2005-2020 Rich Felker, et al.
* ====================================================
* Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
*
* SPDX-License-Identifier: MIT
*
* Please see https://git.musl-libc.org/cgit/musl/tree/COPYRIGHT
* for all contributors to musl.
* 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.
* ====================================================
*/
//#include <sys/cdefs.h>
//__FBSDID("$FreeBSD$");
/*
* scalbn (double x, int n)
* scalbn(x,n) returns x* 2**n computed by exponent
* manipulation rather than by actually performing an
* exponentiation or a multiplication.
*/
#include <float.h>
#include <stdint.h>
#include "math_private.h"
double scalbn(double x, int n)
{
union {double f; uint64_t i;} u;
double_t y = x;
static const double
two54 = 1.80143985094819840000e+16, /* 0x43500000, 0x00000000 */
twom54 = 5.55111512312578270212e-17, /* 0x3C900000, 0x00000000 */
huge = 1.0e+300,
tiny = 1.0e-300;
if (n > 1023) {
y *= 0x1p1023;
n -= 1023;
if (n > 1023) {
y *= 0x1p1023;
n -= 1023;
if (n > 1023)
n = 1023;
}
} else if (n < -1022) {
/* make sure final n < -53 to avoid double
rounding in the subnormal range */
y *= 0x1p-1022 * 0x1p53;
n += 1022 - 53;
if (n < -1022) {
y *= 0x1p-1022 * 0x1p53;
n += 1022 - 53;
if (n < -1022)
n = -1022;
}
double
scalbn (double x, int n)
{
int32_t k,hx,lx;
EXTRACT_WORDS(hx,lx,x);
k = (hx&0x7ff00000)>>20; /* extract exponent */
if (k==0) { /* 0 or subnormal x */
if ((lx|(hx&0x7fffffff))==0) return x; /* +-0 */
x *= two54;
GET_HIGH_WORD(hx,x);
k = ((hx&0x7ff00000)>>20) - 54;
if (n< -50000) return tiny*x; /*underflow*/
}
if (k==0x7ff) return x+x; /* NaN or Inf */
k = k+n;
if (k > 0x7fe) return huge*copysign(huge,x); /* overflow */
if (k > 0) /* normal result */
{SET_HIGH_WORD(x,(hx&0x800fffff)|(k<<20)); return x;}
if (k <= -54) {
if (n > 50000) /* in case integer overflow in n+k */
return huge*copysign(huge,x); /*overflow*/
else
return tiny*copysign(tiny,x); /*underflow*/
}
u.i = (uint64_t)(0x3ff+n)<<52;
x = y * u.f;
return x;
k += 54; /* subnormal result */
SET_HIGH_WORD(x,(hx&0x800fffff)|(k<<20));
return x*twom54;
}

Просмотреть файл

@ -9,11 +9,11 @@ API_BASE_URL=https://api.github.com/repos/freebsd/freebsd-src
get_commit() {
curl -s "${API_BASE_URL}/commits?path=lib/msun/src&per_page=1" \
| python3 -c 'import json, sys; print(json.loads(sys.stdin.read())[0]["sha"])'
| python -c 'import json, sys; print(json.loads(sys.stdin.read())[0]["sha"])'
}
get_date() {
curl -s "${API_BASE_URL}/commits/${COMMIT}" \
| python3 -c 'import json, sys; print(json.loads(sys.stdin.read())["commit"]["committer"]["date"])'
| python -c 'import json, sys; print(json.loads(sys.stdin.read())["commit"]["committer"]["date"])'
}
mv ./src/moz.build ./src_moz.build