Skip to content

fpu: implement Zfa minimum-number-or-NaN operations - #298

Open
carlosqwqqwq wants to merge 1 commit into
LekKit:stagingfrom
carlosqwqqwq:fix/zfa-fminm-nan
Open

fpu: implement Zfa minimum-number-or-NaN operations#298
carlosqwqqwq wants to merge 1 commit into
LekKit:stagingfrom
carlosqwqqwq:fix/zfa-fminm-nan

Conversation

@carlosqwqqwq

Copy link
Copy Markdown

fpu: implement Zfa minimum-number-or-NaN operations

Fixes #295

Commit message

fpu: implement Zfa minimum-number-or-NaN operations

Description

The Zfa fminm/fmaxm instructions currently call the IEEE-754-2008 fmin/fmax helpers. Those helpers return the numeric operand when one input is NaN, but the minimum-number-or-NaN instructions must return canonical NaN when either input is NaN. Add precision-specific helpers and preserve the existing numeric ordering and signaling-NaN flag behavior.

Validation

  • QEMU (qemu-riscv64, Zfa) returns the canonical qNaN whenever either input is NaN; the patched build matches on the single- and double-precision one-NaN and two-NaN witnesses. The native reference does not implement Zfa and is recorded as a capability boundary.

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.

fminm/fmaxm return numeric operand instead of canonical qNaN on NaN input

1 participant