4
0
mirror of git://sourceware.org/git/newlib-cygwin.git synced 2025-03-02 13:05:42 +08:00

libm: switch sf_log1p from double error routines to float

sf_log1p was using __math_divzero and __math_invalid, which
drag in a pile of double-precision code. Switch to using the
single-precision variants. This also required making those
available in __OBSOLETE_MATH mode.

Signed-off-by: Keith Packard <keithp@keithp.com>
This commit is contained in:
Keith Packard 2019-11-29 11:23:20 -08:00 committed by Ken Brown
parent c66050e931
commit 32d9f672cd
2 changed files with 2 additions and 4 deletions

View File

@ -75,7 +75,6 @@ __math_oflowf (uint32_t sign)
return xflowf (sign, 0x1p97f); return xflowf (sign, 0x1p97f);
} }
#if !__OBSOLETE_MATH
HIDDEN float HIDDEN float
__math_divzerof (uint32_t sign) __math_divzerof (uint32_t sign)
{ {
@ -89,4 +88,3 @@ __math_invalidf (float x)
float y = (x - x) / (x - x); float y = (x - x) / (x - x);
return isnan (x) ? y : with_errnof (y, EDOM); return isnan (x) ? y : with_errnof (y, EDOM);
} }
#endif /* !__OBSOLETE_MATH */

View File

@ -56,9 +56,9 @@ static float zero = 0.0;
if (hx < 0x3ed413d7) { /* x < 0.41422 */ if (hx < 0x3ed413d7) { /* x < 0.41422 */
if(ax>=0x3f800000) { /* x <= -1.0 */ if(ax>=0x3f800000) { /* x <= -1.0 */
if(x==(float)-1.0) if(x==(float)-1.0)
return __math_divzero (1); /* log1p(-1)=-inf */ return __math_divzerof (1); /* log1p(-1)=-inf */
else else
return __math_invalid (x); /* log1p(x<-1)=NaN */ return __math_invalidf (x); /* log1p(x<-1)=NaN */
} }
if(ax<0x31000000) { /* |x| < 2**-29 */ if(ax<0x31000000) { /* |x| < 2**-29 */
if(two25+x>zero /* raise inexact */ if(two25+x>zero /* raise inexact */