[PATCH] Don't call double rint from float powf.

Jim Wilson jimw@sifive.com
Tue Dec 12 18:14:00 GMT 2017

On 12/12/2017 04:48 AM, Corinna Vinschen wrote:
> On Dec 11 19:37, Craig Howland wrote:
>>> +		       if(x<0.0&&rintf(y)!=y) exc.retval = -HUGE_VAL;
>>>    		    }
>>>    		    if (_LIB_VERSION == _POSIX_)
>>>    		        errno = ERANGE;
>> To be most rigorous, "0.0" on the same lines as the rintf() should be "0.0F"
>> (as otherwise the comparison strictly should be done in double).  (Not
>> addressing the exact change you are making, but is the same class of fix and
>> are on the same line of source code.)
> Also, HUGE_VAL is double, so it should better be replaced with HUGE_VALF.

The "struct exception" type uses doubles, so this has to be HUGE_VAL.

Even with my two patches, we still have extendsfdf2 and truncdfsf2 
calls, but those will be much harder to get rid of, as we can't change 
struct exception without breaking matherr.  All of the other soft-float 
calls are gone though.


More information about the Newlib mailing list