Sync upstream FreeBSD libm.
Test: treehugger
Change-Id: I583a3e93821d512c975db34fc1610ffd22445d58
diff --git a/libm/upstream-freebsd/lib/msun/ld128/s_expl.c b/libm/upstream-freebsd/lib/msun/ld128/s_expl.c
index 5fc4380..0274a8f 100644
--- a/libm/upstream-freebsd/lib/msun/ld128/s_expl.c
+++ b/libm/upstream-freebsd/lib/msun/ld128/s_expl.c
@@ -65,8 +65,6 @@
int k;
uint16_t hx, ix;
- DOPRINT_START(&x);
-
/* Filter out exceptional cases. */
u.e = x;
hx = u.xbits.expsign;
@@ -74,15 +72,15 @@
if (ix >= BIAS + 13) { /* |x| >= 8192 or x is NaN */
if (ix == BIAS + LDBL_MAX_EXP) {
if (hx & 0x8000) /* x is -Inf or -NaN */
- RETURNP(-1 / x);
- RETURNP(x + x); /* x is +Inf or +NaN */
+ RETURNF(-1 / x);
+ RETURNF(x + x); /* x is +Inf or +NaN */
}
if (x > o_threshold)
- RETURNP(huge * huge);
+ RETURNF(huge * huge);
if (x < u_threshold)
- RETURNP(tiny * tiny);
+ RETURNF(tiny * tiny);
} else if (ix < BIAS - 114) { /* |x| < 0x1p-114 */
- RETURN2P(1, x); /* 1 with inexact iff x != 0 */
+ RETURNF(1 + x); /* 1 with inexact iff x != 0 */
}
ENTERI();
@@ -210,8 +208,6 @@
int k, n, n2;
uint16_t hx, ix;
- DOPRINT_START(&x);
-
/* Filter out exceptional cases. */
u.e = x;
hx = u.xbits.expsign;
@@ -219,11 +215,11 @@
if (ix >= BIAS + 7) { /* |x| >= 128 or x is NaN */
if (ix == BIAS + LDBL_MAX_EXP) {
if (hx & 0x8000) /* x is -Inf or -NaN */
- RETURNP(-1 / x - 1);
- RETURNP(x + x); /* x is +Inf or +NaN */
+ RETURNF(-1 / x - 1);
+ RETURNF(x + x); /* x is +Inf or +NaN */
}
if (x > o_threshold)
- RETURNP(huge * huge);
+ RETURNF(huge * huge);
/*
* expm1l() never underflows, but it must avoid
* unrepresentable large negative exponents. We used a
@@ -232,7 +228,7 @@
* in the same way as large ones here.
*/
if (hx & 0x8000) /* x <= -128 */
- RETURN2P(tiny, -1); /* good for x < -114ln2 - eps */
+ RETURNF(tiny - 1); /* good for x < -114ln2 - eps */
}
ENTERI();
@@ -244,7 +240,7 @@
if (x < T3) {
if (ix < BIAS - 113) { /* |x| < 0x1p-113 */
/* x (rounded) with inexact if x != 0: */
- RETURNPI(x == 0 ? x :
+ RETURNI(x == 0 ? x :
(0x1p200 * x + fabsl(x)) * 0x1p-200);
}
q = x * x2 * C3 + x2 * x2 * (C4 + x * (C5 + x * (C6 +
@@ -265,9 +261,9 @@
hx2_hi = x_hi * x_hi / 2;
hx2_lo = x_lo * (x + x_hi) / 2;
if (ix >= BIAS - 7)
- RETURN2PI(hx2_hi + x_hi, hx2_lo + x_lo + q);
+ RETURNI((hx2_hi + x_hi) + (hx2_lo + x_lo + q));
else
- RETURN2PI(x, hx2_lo + q + hx2_hi);
+ RETURNI(x + (hx2_lo + q + hx2_hi));
}
/* Reduce x to (k*ln2 + endpoint[n2] + r1 + r2). */
diff --git a/libm/upstream-freebsd/lib/msun/ld128/s_logl.c b/libm/upstream-freebsd/lib/msun/ld128/s_logl.c
index 40a22c0..bc53884 100644
--- a/libm/upstream-freebsd/lib/msun/ld128/s_logl.c
+++ b/libm/upstream-freebsd/lib/msun/ld128/s_logl.c
@@ -573,24 +573,23 @@
int i, k;
int16_t ax, hx;
- DOPRINT_START(&x);
EXTRACT_LDBL128_WORDS(hx, lx, llx, x);
if (hx < 0x3fff) { /* x < 1, or x neg NaN */
ax = hx & 0x7fff;
if (ax >= 0x3fff) { /* x <= -1, or x neg NaN */
if (ax == 0x3fff && (lx | llx) == 0)
- RETURNP(-1 / zero); /* log1p(-1) = -Inf */
+ RETURNF(-1 / zero); /* log1p(-1) = -Inf */
/* log1p(x < 1, or x NaN) = qNaN: */
- RETURNP((x - x) / (x - x));
+ RETURNF((x - x) / (x - x));
}
if (ax <= 0x3f8d) { /* |x| < 2**-113 */
if ((int)x == 0)
- RETURNP(x); /* x with inexact if x != 0 */
+ RETURNF(x); /* x with inexact if x != 0 */
}
f_hi = 1;
f_lo = x;
} else if (hx >= 0x7fff) { /* x +Inf or non-neg NaN */
- RETURNP(x + x); /* log1p(Inf or NaN) = Inf or qNaN */
+ RETURNF(x + x); /* log1p(Inf or NaN) = Inf or qNaN */
} else if (hx < 0x40e1) { /* 1 <= x < 2**226 */
f_hi = x;
f_lo = 1;
@@ -669,7 +668,7 @@
#endif
_3sumF(val_hi, val_lo, F_hi(i) + dk * ln2_hi);
- RETURN2PI(val_hi, val_lo);
+ RETURNI(val_hi + val_lo);
}
#ifdef STRUCT_RETURN
@@ -680,7 +679,6 @@
struct ld r;
ENTERI();
- DOPRINT_START(&x);
k_logl(x, &r);
RETURNSPI(&r);
}
@@ -708,15 +706,13 @@
long double hi, lo;
ENTERI();
- DOPRINT_START(&x);
k_logl(x, &r);
if (!r.lo_set)
- RETURNPI(r.hi);
+ RETURNI(r.hi);
_2sumF(r.hi, r.lo);
hi = (float)r.hi;
lo = r.lo + (r.hi - hi);
- RETURN2PI(invln10_hi * hi,
- invln10_lo_plus_hi * lo + invln10_lo * hi);
+ RETURNI(invln10_hi * hi + (invln10_lo_plus_hi * lo + invln10_lo * hi));
}
long double
@@ -726,15 +722,13 @@
long double hi, lo;
ENTERI();
- DOPRINT_START(&x);
k_logl(x, &r);
if (!r.lo_set)
- RETURNPI(r.hi);
+ RETURNI(r.hi);
_2sumF(r.hi, r.lo);
hi = (float)r.hi;
lo = r.lo + (r.hi - hi);
- RETURN2PI(invln2_hi * hi,
- invln2_lo_plus_hi * lo + invln2_lo * hi);
+ RETURNI(invln2_hi * hi + (invln2_lo_plus_hi * lo + invln2_lo * hi));
}
#endif /* STRUCT_RETURN */