riscv: implement fcvtmod.w.d with modulo-2^32 semantics - #304
Open
carlosqwqqwq wants to merge 1 commit into
Open
riscv: implement fcvtmod.w.d with modulo-2^32 semantics#304carlosqwqqwq wants to merge 1 commit into
carlosqwqqwq wants to merge 1 commit into
Conversation
carlosqwqqwq
force-pushed
the
fix/zfa-fcvtmod-modulo
branch
from
September 5, 2026 12:20
a2ddfa4 to
79b70dc
Compare
carlosqwqqwq
force-pushed
the
fix/zfa-fcvtmod-modulo
branch
from
September 6, 2026 07:11
79b70dc to
f8a02b2
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
riscv: implement fcvtmod.w.d with modulo-2^32 semantics
Commit message
Description
fpu_lib.h: newfpu_fcvtmod_f64_to_i32performs RTZ rounding on the raw double bits, extracts the low 32 bits of the rounded value, and applies the sign; NV is raised for NaN/infinity/out-of-range, NX for inexact truncation. The in-range path uses direct bit-level extraction for the common case (|x| < 2^31).riscv_fpu.c: case 0x08 calls the new routine; reserved rounding-modeencodings retain the existing illegal path. The separate fall-through defect
is handled by PR #303, and this semantic patch remains independently
applicable to the same
stagingbaseline.Validation
-cpu maxfor the modulo result andfflagsproduced by this conversion path; instruction retirement remains theseparate scope of PR riscv: return after valid fcvtmod.w.d #303.
conversion semantics are independent of the control-flow defect in riscv: return after valid fcvtmod.w.d #303.
Fixes #297