[PATCH] libm,ieee754:New algorithm of fmod function for, dbl-64/wordsize-64
Joseph Myers
joseph@codesourcery.com
Fri Nov 20 01:02:51 GMT 2020
On Fri, 20 Nov 2020, Kirill Okhotnikov via Libc-alpha wrote:
> > > + * Performance:
> > > + * Various tests on AArch64 and x86_64 shows that the current algorithm
> > > is faster than the previous one by factor 1.5-10 depend
> > > + * on input.
> > I think performance information belongs in the proposed commit message,
> > not in comments in the code which should describe the code as it is in a
> > self-contained way rather than referring to a previous version.
> Sorry. I did not get the idea.
I don't think comments in the code should refer to the previous algorithm;
I think they should only relate to the version of the code containing
those comments.
Comparisons of performance of the two versions are fully appropriate in
the commit message, however.
> > > + sx.value *= one; /* Optimized out? May be math_check_force_underflow?
> > > */
> > math_check_force_underflow would be incorrect here. We don't try to
> > ensure exact underflow exceptions (the case where IEEE signals
> > FE_UNDERFLOW without FE_INEXACT and default exception handling does not
> > raise the corresponding flag). fmod always produces exact results
> > ("invalid" is the only exception it can raise the flag for, for x infinite
> > or y zero if the other is not a NaN, or if either argument is a signaling
> > NaN).
> >
> I just get it from previous code. Such thing was also questionable for me.
> Fully remove it?
Yes, I think remove it.
--
Joseph S. Myers
joseph@codesourcery.com
More information about the Libc-alpha
mailing list