riscv_fpu: IEEE 754 conformance for the scalar FPU#239
Open
SolAstrius wants to merge 11 commits into
Open
Conversation
Signed-off-by: Sol Astrius Phoenix <sol@astrius.ink>
Signed-off-by: Sol Astrius Phoenix <sol@astrius.ink>
Signed-off-by: Sol Astrius Phoenix <sol@astrius.ink>
Signed-off-by: Sol Astrius Phoenix <sol@astrius.ink>
Signed-off-by: Sol Astrius Phoenix <sol@astrius.ink>
Signed-off-by: Sol Astrius Phoenix <sol@astrius.ink>
Signed-off-by: Sol Astrius Phoenix <sol@astrius.ink>
Signed-off-by: Sol Astrius Phoenix <sol@astrius.ink>
Signed-off-by: Sol Astrius Phoenix <sol@astrius.ink>
…low boundary Signed-off-by: Sol Astrius Phoenix <sol@astrius.ink>
Signed-off-by: Sol Astrius Phoenix <sol@astrius.ink>
Contributor
Author
|
@purplesyringa please help us with your wisdom 🙏 |
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.
Summary
Bring RVVM's scalar F/D floating-point up to full IEEE 754 / RISC-V conformance. Against riscv-arch-test (ACT4) F, D, I and M with a Spike reference it goes from 101/260 to 260/260, with no change to any non-FPU behaviour.
This began as the #204 RMM (
roundTiesToAway) fix and grew to close every remaining gap the conformance suite exposed.What's fixed
rmfield honoured (not justfrm) for all arithmetic ops.func_opt_sizedropped) — roughly 2x interpreter FP throughput at zero size cost, since the FP path is not JIT'd.sqrt(-0.0)returns-0.0without raising invalid.fnmaddoperand-negation fix), RMM exact ties via an error-free FMA, and the underflow flag set by true IEEE after-rounding tininess.INEXACTflag leaked by integer rounding, removed.Everything stays within the existing
fpu_libwrapper discipline — no raw host FP, no host-fenv-only tricks — so it remains compatible with a software-fenv / jittable softfloat path.Validation
101 -> 260/260.examples/rmm-test):43652/0over the five OP-FP ops and the four FMA ops, each under both dynamicfrm=RMMand the static,rmmsuffix, including subnormal and underflow-boundary ties.Notes
The 11 commits are split one-fix-per-commit for review; No functional change outside
src/cpu/riscv_fpu.{c,h}andsrc/util/fpu_lib.{c,h}.