mirror of
https://github.com/freebsd/freebsd-src
synced 2024-10-01 14:14:56 +00:00
libm: fma: correct zero sign with small inputs
PR: 277783 Reported by: Victor Stinner Submitted by: kargl MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D44433
This commit is contained in:
parent
5ee5c40402
commit
888796ade2
|
@ -267,7 +267,9 @@ fma(double x, double y, double z)
|
|||
*/
|
||||
fesetround(oround);
|
||||
volatile double vzs = zs; /* XXX gcc CSE bug workaround */
|
||||
return (xy.hi + vzs + ldexp(xy.lo, spread));
|
||||
xs = ldexp(xy.lo, spread);
|
||||
xy.hi += vzs;
|
||||
return (xy.hi == 0 ? xs : xy.hi + xs);
|
||||
}
|
||||
|
||||
if (oround != FE_TONEAREST) {
|
||||
|
|
|
@ -248,7 +248,9 @@ fmal(long double x, long double y, long double z)
|
|||
*/
|
||||
fesetround(oround);
|
||||
volatile long double vzs = zs; /* XXX gcc CSE bug workaround */
|
||||
return (xy.hi + vzs + ldexpl(xy.lo, spread));
|
||||
xs = ldexpl(xy.lo, spread);
|
||||
xy.hi += vzs;
|
||||
return (xy.hi == 0 ? xs : xy.hi + xs);
|
||||
}
|
||||
|
||||
if (oround != FE_TONEAREST) {
|
||||
|
|
Loading…
Reference in a new issue