Skip to content

Commit

Permalink
Correct fcvtmod.w.d flag generation logic
Browse files Browse the repository at this point in the history
  • Loading branch information
jordancarlin committed Apr 25, 2024
1 parent 495b52c commit 824e357
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion model/riscv_insts_zfa.sail
Original file line number Diff line number Diff line change
Expand Up @@ -745,7 +745,9 @@ 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 | unsigned(integer) > max_integer) then nvFlag()
else if (fractional != zeros()) then nxFlag()
else zeros();

Expand Down

0 comments on commit 824e357

Please sign in to comment.