Skip to content

riscv: keep tiny FMA RNE/RMM results on the host rounded path - #313

Open
carlosqwqqwq wants to merge 1 commit into
LekKit:stagingfrom
carlosqwqqwq:fix/fma-tiny-rne-rmm
Open

riscv: keep tiny FMA RNE/RMM results on the host rounded path#313
carlosqwqqwq wants to merge 1 commit into
LekKit:stagingfrom
carlosqwqqwq:fix/fma-tiny-rne-rmm

Conversation

@carlosqwqqwq

Copy link
Copy Markdown

riscv: keep tiny FMA RNE/RMM results on the host rounded path

Fixes #307

Commit message

riscv: keep tiny FMA RNE/RMM results on the host rounded path

Description

For very small fmadd.d results, the software error term is
subnormalised and the odd-round correction moves an already correctly
rounded host result by one ulp (and leaks a spurious UF). Under RNE/RMM,
return the host result only when the product and addend do not undergo severe
cancellation; retain the exact-recovery path for that cancellation boundary.
The retained severe-cancellation boundary and directed modes remain outside this
patch's scope. The change is limited to src/util/fpu_lib.h; validation artifacts
stay out of the source diff. This patch applies independently to the staging
branch and does not depend on an unmerged FMA change.

Validation

  • The witness runs on native RISC-V hardware, QEMU, and the affected RVVM build; the patched build matches both references.
  • Both the interpreter and JIT lanes were exercised, and the patched build is limited to this root.

The patch is independently applicable to the staging branch. Its scope is the
non-cancelling RNE/RMM tiny-result path in fpu_fma64_raw.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fmadd.d error recovery is 1 ulp off and raises spurious UF for tiny results

1 participant