FreeBSD Bugzilla – Attachment 251489 Details for
Bug 277783
libc fma() doesn't not return the correct zero sign
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
New patch
fma.diff (text/plain), 1.16 KB, created by
Steve Kargl
on 2024-06-16 02:26:01 UTC
(
hide
)
Description:
New patch
Filename:
MIME Type:
Creator:
Steve Kargl
Created:
2024-06-16 02:26:01 UTC
Size:
1.16 KB
patch
obsolete
>diff --git a/lib/msun/src/s_fma.c b/lib/msun/src/s_fma.c >index b8a342646d85..4f9623f4c125 100644 >--- a/lib/msun/src/s_fma.c >+++ b/lib/msun/src/s_fma.c >@@ -260,14 +260,14 @@ fma(double x, double y, double z) > > spread = ex + ey; > >- if (r.hi == 0.0) { >+ if (r.hi == 0.0 && xy.lo == 0) { > /* > * When the addends cancel to 0, ensure that the result has > * the correct sign. > */ > fesetround(oround); > volatile double vzs = zs; /* XXX gcc CSE bug workaround */ >- return (xy.hi + vzs + ldexp(xy.lo, spread)); >+ return (xy.hi + vzs); > } > > if (oround != FE_TONEAREST) { >diff --git a/lib/msun/src/s_fmal.c b/lib/msun/src/s_fmal.c >index 3d333632127c..3694ef6bbfa1 100644 >--- a/lib/msun/src/s_fmal.c >+++ b/lib/msun/src/s_fmal.c >@@ -241,14 +241,14 @@ fmal(long double x, long double y, long double z) > > spread = ex + ey; > >- if (r.hi == 0.0) { >+ if (r.hi == 0.0 && xy.lo == 0) { > /* > * When the addends cancel to 0, ensure that the result has > * the correct sign. > */ > fesetround(oround); > volatile long double vzs = zs; /* XXX gcc CSE bug workaround */ >- return (xy.hi + vzs + ldexpl(xy.lo, spread)); >+ return (xy.hi + vzs); > } > > if (oround != FE_TONEAREST) {
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 277783
:
249266
|
251421
|
251488
| 251489