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

Correct fcvtmod.w.d flag generation logic for exp == 31 #442

Merged
merged 2 commits into from
Apr 29, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion model/riscv_insts_zfa.sail
Original file line number Diff line number Diff line change
Expand Up @@ -745,7 +745,10 @@ function fcvtmod_helper(x64) = {
else integer;

/* Raise FP exception flags, honoring the precedence of nV > nX */
let flags : bits(5) = if (true_exp > 31) then nvFlag()
let max_integer = if sign == 0b1 then unsigned(0x80000000)
else unsigned(0x7fffffff);
let flags : bits(5) = if true_exp > 31 then nvFlag()
else if unsigned(integer) > max_integer then nvFlag()
else if (fractional != zeros()) then nxFlag()
else zeros();

Expand Down
Loading