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

Fix rounding mode selection #323

Merged
merged 1 commit into from
Jan 6, 2024
Merged

Conversation

visitorckw
Copy link
Collaborator

Some F extension instructions include an rm field, indicating the rounding mode to be used. When an instruction has an rm field, the rounding mode should be chosen based on the value of that field. If the rm field is set to 0b111, it signifies dynamic selection of the rounding mode based on the fcsr's frm field.

The current implementation always selected the rounding mode dynamically based on fcsr's frm, regardless of the rm field in the instruction. This patch corrects this error, ensuring that the rounding mode is now chosen according to the rm field when present.

src/decode.h Show resolved Hide resolved
src/softfloat.h Outdated Show resolved Hide resolved
@jserv jserv requested a review from qwe661234 January 6, 2024 15:22
@visitorckw visitorckw force-pushed the fix-rounding-mode branch 2 times, most recently from 9239652 to 7bd41e3 Compare January 6, 2024 15:41
src/decode.h Outdated Show resolved Hide resolved
Some F extension instructions include an rm field, indicating the
rounding mode to be used. When an instruction has an rm field, the
rounding mode should be chosen based on the value of that field. If the
rm field is set to 0b111, it signifies dynamic selection of the
rounding mode based on the fcsr's frm field.

The current implementation always selected the rounding mode
dynamically based on fcsr's frm, regardless of the rm field in the
instruction. This patch corrects this error, ensuring that the rounding
mode is now chosen according to the rm field when present.
@jserv jserv merged commit 4975222 into sysprog21:master Jan 6, 2024
6 checks passed
@jserv
Copy link
Contributor

jserv commented Jan 6, 2024

Thank @visitorckw for contributing!

@visitorckw visitorckw deleted the fix-rounding-mode branch January 6, 2024 16:24
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