[PATCH 2/3] powerpc: POWER8 fmod optimization
Adhemerval Zanella
azanella@linux.vnet.ibm.com
Wed Nov 12 18:29:00 GMT 2014
On 12-11-2014 14:19, Joseph Myers wrote:
> On Wed, 12 Nov 2014, Adhemerval Zanella wrote:
>
>> Indeed I overlook it, as I am seeing now with a more extensive testing.
>> Checking now, it seems using a FP division operation in the loop to
>> correct it not the best strategy to achieve better performance.
> And there are other problems with the division I didn't notice previously.
> If the exponent difference is large enough, the division may overflow.
> And you're assuming the result of (round to next integer toward 0 (divide
> and round in current rounding mode)) is the same as (divide in infinite
> precision, round once to an integer toward 0) - but depending on the
> arguments and rounding mode, the result of the division may be rounded
> away from 0 to an integer with magnitude greater than the desired result.
>
Yes, I noted that my naive approach is far from correct. I'm dropping this patch,
thanks for the review.
More information about the Libc-alpha
mailing list