You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
DPI FPU fmin.s / fmax.s drop fflags.NV when both inputs are NaN #449
Stock XLEN=32 configuration, F enabled, C disabled, IALIGN=32, shipped DPI FPU backend. Tested at commit b447578d9f3bb116d658c614cf3407153f0536da. Driver: rtlsim built DEBUG=1; test is a bare-metal ELF.
01_fminmax_nan_fflags.S clears fflags, runs fmin.s / fmax.s with both operands NaN (at least one signaling NaN), and reads fflags after each.
Prebuilt dut.elf / ref.elf are attached.
# rtlsim built DEBUG=1 from the commit above (XLEN=32, F on, C off).
spike -l --log-commits --isa=rv32imaf -m128 ref.elf
./rtlsim dut.elf
Both runs exited cleanly (spike_rc=0, dut_rc=0).
Expected behavior
Per the RISC-V Unprivileged ISA, F extension (FMIN.S/FMAX.S):
Signaling NaN inputs set the invalid operation exception flag, even when the result is not NaN.
Observed results
Both engines produce the canonical qNaN result. The accrued flag differs.
DUT (dut.dbg.log, commits of csrr t1,fflags after the both-NaN cases):
Comparing the two commit logs (compare.json in the attachment, 90 checks) gives 8 differences, all of the form dut 0x00000000 / ref 0x00000010 at the fflags readbacks (PCs 0x80000058, 0x80000078, 0x80000098, 0x800000b8) and their companion stores. Controls in the same run where only one operand is NaN do set NV on the DUT (e.g. commit at PC 0x800000fc reads 0x10), so the missing flag is specific to the both-NaN early-return path.
I suspect an early return in the DPI FPU backend skips the NV flag when both inputs are NaN, but I have not traced it. The RTL FNCP min/max path was not run.
Affected revision and environment
Tested at commit b447578d9f3bb116d658c614cf3407153f0536da
changed the title [-]DPI FPU fmin.s/fmax.sdropfflags.NV when both inputs are NaN[/-][+]DPI FPU fmin.s / fmax.s drop fflags.NV when both inputs are NaN[/+]on Nov 5, 2026
Activity
[-]DPI FPU fmin.s/fmax.sdropfflags.NV when both inputs are NaN[/-][+]DPI FPU fmin.s / fmax.s drop fflags.NV when both inputs are NaN[/+]tinebp commentedon Nov 19, 2026
Fixed by #485.