Skip to content
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
6 changes: 3 additions & 3 deletions src/cpu/riscv_csr.c
Original file line number Diff line number Diff line change
Expand Up @@ -425,8 +425,8 @@ static void riscv_update_fcsr(rvvm_hart_t* vm, uint32_t old_fcsr, uint32_t new_f
uint32_t new_fflags = bit_cut(new_fcsr, 0, 5);
if (unlikely(new_frm != old_frm)) {
if (new_frm > RM_RMM) {
// Invalid rounding mode written
return;
// Ignore invalid frm, apply other fcsr fields
new_frm = old_frm;
} else {
// Set host rounding mode
fpu_set_rounding_mode(new_frm);
Expand All @@ -438,7 +438,7 @@ static void riscv_update_fcsr(rvvm_hart_t* vm, uint32_t old_fcsr, uint32_t new_f
fpu_set_exceptions(0);
}
}
vm->csr.fcsr = new_fcsr;
vm->csr.fcsr = new_fflags | (new_frm << 5);
}
}

Expand Down
Loading