This is the mail archive of the newlib@sourceware.org mailing list for the newlib project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


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.

Jim


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]