add missing weak references for long double functions

This ensures that all standard long double functions are defined when
building with 64-bit long double.
This commit is contained in:
Lephenixnoir 2021-05-20 21:51:33 +02:00
parent 39ede78797
commit 8afd538dc8
No known key found for this signature in database
GPG key ID: 1BBA026E13FC0495
15 changed files with 73 additions and 0 deletions

View file

@ -38,6 +38,7 @@
* acknowledged. * acknowledged.
*/ */
#include <float.h>
#include <openlibm_math.h> #include <openlibm_math.h>
#include "mathimpl.h" #include "mathimpl.h"
@ -312,3 +313,7 @@ neg_gam(x)
if (sgn < 0) y = -y; if (sgn < 0) y = -y;
return (M_PI / (y*z)); return (M_PI / (y*z));
} }
#if (LDBL_MANT_DIG == 53)
openlibm_weak_reference(tgamma, tgammal);
#endif

View file

@ -29,6 +29,7 @@
* acosh(NaN) is NaN without signal. * acosh(NaN) is NaN without signal.
*/ */
#include <float.h>
#include <openlibm_math.h> #include <openlibm_math.h>
#include "math_private.h" #include "math_private.h"
@ -61,3 +62,7 @@ __ieee754_acosh(double x)
return log1p(t+sqrt(2.0*t+t*t)); return log1p(t+sqrt(2.0*t+t*t));
} }
} }
#if (LDBL_MANT_DIG == 53)
openlibm_weak_reference(acosh, acoshl);
#endif

View file

@ -33,6 +33,7 @@
* *
*/ */
#include <float.h>
#include <openlibm_math.h> #include <openlibm_math.h>
#include "math_private.h" #include "math_private.h"
@ -61,3 +62,7 @@ __ieee754_atanh(double x)
t = 0.5*log1p((x+x)/(one-x)); t = 0.5*log1p((x+x)/(one-x));
if(hx>=0) return t; else return -t; if(hx>=0) return t; else return -t;
} }
#if (LDBL_MANT_DIG == 53)
openlibm_weak_reference(atanh, atanhl);
#endif

View file

@ -35,6 +35,7 @@
* only cosh(0)=1 is exact for finite x. * only cosh(0)=1 is exact for finite x.
*/ */
#include <float.h>
#include <openlibm_math.h> #include <openlibm_math.h>
#include "math_private.h" #include "math_private.h"
@ -78,3 +79,7 @@ __ieee754_cosh(double x)
/* |x| > overflowthresold, cosh(x) overflow */ /* |x| > overflowthresold, cosh(x) overflow */
return huge*huge; return huge*huge;
} }
#if (LDBL_MANT_DIG == 53)
openlibm_weak_reference(cosh, coshl);
#endif

View file

@ -165,3 +165,7 @@ __ieee754_exp(double x) /* default IEEE double exp */
return y*twopk*twom1000; return y*twopk*twom1000;
} }
} }
#if (LDBL_MANT_DIG == 53)
openlibm_weak_reference(exp, expl);
#endif

View file

@ -65,6 +65,7 @@
* to produce the hexadecimal values shown. * to produce the hexadecimal values shown.
*/ */
#include <float.h>
#include <openlibm_math.h> #include <openlibm_math.h>
#include "math_private.h" #include "math_private.h"
@ -139,3 +140,7 @@ __ieee754_log(double x)
return dk*ln2_hi-((s*(f-R)-dk*ln2_lo)-f); return dk*ln2_hi-((s*(f-R)-dk*ln2_lo)-f);
} }
} }
#if (LDBL_MANT_DIG == 53)
openlibm_weak_reference(log, logl);
#endif

View file

@ -22,6 +22,7 @@
* in not-quite-routine extra precision. * in not-quite-routine extra precision.
*/ */
#include <float.h>
#include <openlibm_math.h> #include <openlibm_math.h>
#include "math_private.h" #include "math_private.h"
@ -86,3 +87,7 @@ __ieee754_log10(double x)
return val_lo + val_hi; return val_lo + val_hi;
} }
#if (LDBL_MANT_DIG == 53)
openlibm_weak_reference(log10, log10l);
#endif

View file

@ -24,6 +24,7 @@
* in not-quite-routine extra precision. * in not-quite-routine extra precision.
*/ */
#include <float.h>
#include <openlibm_math.h> #include <openlibm_math.h>
#include "math_private.h" #include "math_private.h"
@ -109,3 +110,7 @@ __ieee754_log2(double x)
return val_lo + val_hi; return val_lo + val_hi;
} }
#if (LDBL_MANT_DIG == 53)
openlibm_weak_reference(log2, log2l);
#endif

View file

@ -57,6 +57,7 @@
* to produce the hexadecimal values shown. * to produce the hexadecimal values shown.
*/ */
#include <float.h>
#include <openlibm_math.h> #include <openlibm_math.h>
#include "math_private.h" #include "math_private.h"
@ -310,3 +311,7 @@ __ieee754_pow(double x, double y)
else SET_HIGH_WORD(z,j); else SET_HIGH_WORD(z,j);
return s*z; return s*z;
} }
#if (LDBL_MANT_DIG == 53)
openlibm_weak_reference(pow, powl);
#endif

View file

@ -32,6 +32,7 @@
* only sinh(0)=0 is exact for finite x. * only sinh(0)=0 is exact for finite x.
*/ */
#include <float.h>
#include <openlibm_math.h> #include <openlibm_math.h>
#include "math_private.h" #include "math_private.h"
@ -72,3 +73,7 @@ __ieee754_sinh(double x)
/* |x| > overflowthresold, sinh(x) overflow */ /* |x| > overflowthresold, sinh(x) overflow */
return x*shuge; return x*shuge;
} }
#if (LDBL_MANT_DIG == 53)
openlibm_weak_reference(sinh, sinhl);
#endif

View file

@ -24,6 +24,7 @@
* := sign(x)*log1p(|x| + x^2/(1 + sqrt(1+x^2))) * := sign(x)*log1p(|x| + x^2/(1 + sqrt(1+x^2)))
*/ */
#include <float.h>
#include <openlibm_math.h> #include <openlibm_math.h>
#include "math_private.h" #include "math_private.h"
@ -55,3 +56,7 @@ asinh(double x)
} }
if(hx>0) return w; else return -w; if(hx>0) return w; else return -w;
} }
#if (LDBL_MANT_DIG == 53)
openlibm_weak_reference(asinh, asinhl);
#endif

View file

@ -107,6 +107,7 @@
* erfc/erf(NaN) is NaN * erfc/erf(NaN) is NaN
*/ */
#include <float.h>
#include <openlibm_math.h> #include <openlibm_math.h>
#include "math_private.h" #include "math_private.h"
@ -299,3 +300,8 @@ erfc(double x)
if(hx>0) return tiny*tiny; else return two-tiny; if(hx>0) return tiny*tiny; else return two-tiny;
} }
} }
#if (LDBL_MANT_DIG == 53)
openlibm_weak_reference(erf, erfl);
openlibm_weak_reference(erfc, erfcl);
#endif

View file

@ -215,3 +215,7 @@ expm1(double x)
} }
return y; return y;
} }
#if (LDBL_MANT_DIG == 53)
openlibm_weak_reference(expm1, expm1l);
#endif

View file

@ -173,3 +173,7 @@ log1p(double x)
if(k==0) return f-(hfsq-s*(hfsq+R)); else if(k==0) return f-(hfsq-s*(hfsq+R)); else
return k*ln2_hi-((hfsq-(s*(hfsq+R)+(k*ln2_lo+c)))-f); return k*ln2_hi-((hfsq-(s*(hfsq+R)+(k*ln2_lo+c)))-f);
} }
#if (LDBL_MANT_DIG == 53)
openlibm_weak_reference(log1p, log1pl);
#endif

View file

@ -37,6 +37,7 @@
* only tanh(0)=0 is exact for finite argument. * only tanh(0)=0 is exact for finite argument.
*/ */
#include <float.h>
#include <openlibm_math.h> #include <openlibm_math.h>
#include "math_private.h" #include "math_private.h"
@ -76,3 +77,7 @@ tanh(double x)
} }
return (jx>=0)? z: -z; return (jx>=0)? z: -z;
} }
#if (LDBL_MANT_DIG == 53)
openlibm_weak_reference(tanh, tanhl);
#endif