From c874f1145ff5d2fa461cef21d6f8d575138fcdbf Mon Sep 17 00:00:00 2001 From: Jim Wilson Date: Tue, 12 Dec 2017 11:39:13 -0800 Subject: newlib: Don't do double divide in powf. * Use 0.0f instead of 0.0 in divide. --- newlib/libm/math/wf_pow.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'newlib/libm') diff --git a/newlib/libm/math/wf_pow.c b/newlib/libm/math/wf_pow.c index 9a10254..f753b52 100644 --- a/newlib/libm/math/wf_pow.c +++ b/newlib/libm/math/wf_pow.c @@ -108,7 +108,9 @@ if (_LIB_VERSION == _SVID_) exc.retval = 0.0; else - exc.retval = 0.0/0.0; /* X/Open allow NaN */ + /* Use a float divide, to avoid a soft-float double + divide call on single-float only targets. */ + exc.retval = (0.0f/0.0f); /* X/Open allow NaN */ if (_LIB_VERSION == _POSIX_) errno = EDOM; else if (!matherr(&exc)) { -- cgit v1.1