On 11/19/26 04:04, Philippe Mathieu-Daudé wrote:
On 17/11/26 20:37, Richard Henderson wrote:
Isn't the larger problem that this should be using a fused multiply-
add via float64_muladd, and thus the negation via
float_muladd_negate_result (which will not affect NaN results).
Certainly MD00087 says the product uses infinite precision.
MD00087 says the opposite for NMADD/NMSUB... Vol II-A rev 6.06,
NMADD.fmt (p.376) and NMSUB.fmt (p.378):
"The intermediate product is rounded according to the current
rounding mode in FCSR [...] The results and flags are as if
separate floating-point multiply and add and negate instructions
were executed"
The infinite-precision-product wording is from the Release 6
MADDF.fmt/MSUBF.fmt (p.324), which the same manual describes as
replacing the pre-R6 instructions that were "unfused multiply-add,
with an intermediate rounding".
Those are already implemented with float_muladd (float_maddf_*/
float_msubf_*); using it for NMADD/NMSUB would remove the required
intermediate rounding and change Inexact in double-rounding cases.
Weird.
MD00087 rev 2.00, p269:
The value in FPR fs is multiplied by the value in FPR ft to produce an
intermediate product. The value in FPR fr is added to the product. The
result sum is calculated to infinite precision, rounded according to the
current rounding mode in FCSR, negated by changing the sign bit, and
placed into FPR fd. The operands and result are values in format fmt.
Hmph. rev 5 adds the language that rounds the intermediate product.
Oh well.
Reviewed-by: Richard Henderson <[email protected]>
r~