Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20261029215739.166761-2-bernie@codewiz.org>
Date: Fri, 30 Oct 2026 06:57:39 +0900
From: Bernie Innocenti <bernie@...ewiz.org>
To: musl@...ts.openwall.com
Cc: Bernie Innocenti <bernie@...ewiz.org>
Subject: [PATCH libc-test] math: add fma(x,y,0) double rounding test cases

x*y must round once even when the arithmetic has excess precision
(FLT_EVAL_METHOD==2): on i386 these fail with x*y rounded twice.
---
 src/math/special/fma.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/math/special/fma.h b/src/math/special/fma.h
index d63f816..918575f 100644
--- a/src/math/special/fma.h
+++ b/src/math/special/fma.h
@@ -849,6 +849,8 @@ T(RD,              -0x1p-1000,                0x1p-200,               0x1p-1022,
 T(RZ,              -0x1p-1000,                0x1p-200,               0x1p-1022, 0x1.ffffffffffffep-1023,         -0x1p+0, INEXACT|UNDERFLOW)
 T(RN,              -0x1p-1000,                0x1p-100,                  0x0p+0,                 -0x0p+0,         0x1p-26, INEXACT|UNDERFLOW)
 T(RN,              -0x1p-1000,                0x1p-100,                 -0x0p+0,                 -0x0p+0,         0x1p-26, INEXACT|UNDERFLOW)
+T(RN,  0x1.27365a6456ba5p+0,    0x1.63fdaf7759a4fp+0,                  0x0p+0,    0x1.9a84ea6842dcdp+0,     0x1.ffe0e2p-2, INEXACT)
+T(RN,  0x1.27365a6456ba5p+0,    0x1.63fdaf7759a4fp+0,                 -0x0p+0,    0x1.9a84ea6842dcdp+0,     0x1.ffe0e2p-2, INEXACT)
 T(RZ,              -0x1p-1000,                0x1p-100,                  0x0p+0,                 -0x0p+0,         0x1p-26, INEXACT|UNDERFLOW)
 T(RZ,              -0x1p-1000,                0x1p-100,                 -0x0p+0,                 -0x0p+0,         0x1p-26, INEXACT|UNDERFLOW)
 T(RD,              -0x1p-1000,                0x1p-100,                  0x0p+0,              -0x1p-1074,         -0x1p+0, INEXACT|UNDERFLOW)
-- 
2.56.0

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.