Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed a bug where MULH would not work as expected. #9

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

robbevandevelde
Copy link

This issue affects the MULH instruction when multiplying large negative numbers. The issue is that the whole 33-bit multiplicant gets copied, which is incorrect while using negative numbers.

This fix allows large negative numbers to be multiplied by each other in a correct manner. By not copying the whole 33 bit multiplicant but limiting it to 32 bits the issue is resolved.

This change is made to the MulDiv.scala file in the plugins folder.

The RISC-V tests ran with make -C tests CORE=riscv.CoreExtMem still returns All tests passed

This issue was not caught by the RISC-V tests because it only affects these high, negative numbers, which are not tested in the test suite.

robbevandevelde and others added 2 commits June 3, 2024 18:59
This fix allows large negative numbers to be multiplied by each other by not copying the whole 33 bit multiplicant but limiting it to 32 bits.
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.

1 participant