Skip to content

riscv: avoid FMA error recovery on special operands - #312

Open
carlosqwqqwq wants to merge 1 commit into
LekKit:stagingfrom
carlosqwqqwq:fix/fma-special-operands
Open

riscv: avoid FMA error recovery on special operands#312
carlosqwqqwq wants to merge 1 commit into
LekKit:stagingfrom
carlosqwqqwq:fix/fma-special-operands

Conversation

@carlosqwqqwq

@carlosqwqqwq carlosqwqqwq commented Sep 6, 2026

Copy link
Copy Markdown

riscv: avoid FMA error recovery on special operands

Fixes #306

Commit message

riscv: avoid FMA error recovery on special operands

Description

The software FMA error-recovery path applies finite-value error-bit manipulation to infinity and NaN cases, producing invalid payloads and spurious exception flags. Classify the special operands before the finite error-recovery logic. The change is limited to src/util/fpu_lib.h; validation artifacts stay out of the source diff. The patch applies independently to the staging branch.

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.

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.

FMA software path corrupts inf/NaN inputs and raises spurious OF/NX

1 participant