Fix neg pseudo-op to use rs2 instead of rs1 - #428
Merged
Conversation
Signed-off-by: HasKeyboard <166684937+HasKeyboard@users.noreply.github.com>
Andrew Waterman (aswaterman)
approved these changes
Aug 12, 2026
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #428 +/- ##
==========================================
- Coverage 97.08% 96.78% -0.30%
==========================================
Files 14 14
Lines 926 933 +7
==========================================
+ Hits 899 903 +4
- Misses 27 30 +3 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Andrew Waterman (aswaterman)
merged commit Aug 12, 2026
6bf30f5
into
riscv:master
11 of 12 checks passed
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.
Currently, the neg pseudo-op in rv_i hardcodes rs2 to zero, which expands to sub rd, rs1, x0 (computing rd = rs1 - 0).
This PR fixes the hardware mapping by accepting rs2 from the user and hardcoding rs1 to zero. This correctly expands to sub rd, x0, rs2 (computing rd = 0 - rs2).