Skip to content

fix signed loads lh and lb on both 32-bit and 64-bit RISC-V#344

Merged
dcamarmas merged 2 commits into
creatorsim:masterfrom
mathewduong:master
Mar 24, 2026
Merged

fix signed loads lh and lb on both 32-bit and 64-bit RISC-V#344
dcamarmas merged 2 commits into
creatorsim:masterfrom
mathewduong:master

Conversation

@mathewduong
Copy link
Copy Markdown
Contributor

Hello,

Thank you for your work, your simulator is very well done.

I noticed a small issue with the implementation of the lh and lb instructions in both RISC-V 32-bit and 64-bit modes. It appears that sign extension is not being applied when loading values. As a result, the loaded data may not correctly preserve the sign when expanded to the full register width.

Copy link
Copy Markdown
Member

@ALVAROPING1 ALVAROPING1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for noticing the issue, just a couple things

Comment thread architecture/RISCV/RV32IMFD.yml Outdated
Comment thread architecture/RISCV/RV32IMFD.yml Outdated
Comment thread architecture/RISCV/RV32IMFD.yml Outdated
Comment thread architecture/RISCV/RV64IMFD.yml Outdated
Comment thread architecture/RISCV/RV64IMFD.yml Outdated
Co-authored-by: ALVAROPING1 <43814863+ALVAROPING1@users.noreply.github.com>
@mathewduong
Copy link
Copy Markdown
Contributor Author

Thanks for the suggestions! I've applied the changes

Copy link
Copy Markdown
Member

@ALVAROPING1 ALVAROPING1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@dcamarmas dcamarmas merged commit 84eff7f into creatorsim:master Mar 24, 2026
9 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.

3 participants