Skip to content

Fix neg pseudo-op to use rs2 instead of rs1 - #428

Merged
Andrew Waterman (aswaterman) merged 1 commit into
riscv:masterfrom
HasKeyboard:master
Aug 12, 2026
Merged

Fix neg pseudo-op to use rs2 instead of rs1#428
Andrew Waterman (aswaterman) merged 1 commit into
riscv:masterfrom
HasKeyboard:master

Conversation

@HasKeyboard

Copy link
Copy Markdown
Contributor

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).

Signed-off-by: HasKeyboard <166684937+HasKeyboard@users.noreply.github.com>
@codecov

codecov Bot commented Aug 12, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 96.78%. Comparing base (4644ba3) to head (639fa1a).
⚠️ Report is 19 commits behind head on master.

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@aswaterman
Andrew Waterman (aswaterman) merged commit 6bf30f5 into riscv:master Aug 12, 2026
11 of 12 checks passed
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.

2 participants