From 66c4853bdc5b22bf4c4b364218c713e3f1e487f3 Mon Sep 17 00:00:00 2001 From: Scott Johnson Date: Wed, 6 Oct 2021 11:15:19 -0700 Subject: Allow instructions considering mstatus.FS/XS/VS to succeed when field doesn't exist This has no functional effect (yet), but will once I change the P-extension instructions that access vxsat to properly consider mstatus.VS. --- riscv/csrs.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/riscv/csrs.cc b/riscv/csrs.cc index 9673106..3f2497a 100644 --- a/riscv/csrs.cc +++ b/riscv/csrs.cc @@ -319,6 +319,8 @@ base_status_csr_t::base_status_csr_t(processor_t* const proc, const reg_t addr): bool base_status_csr_t::enabled(const reg_t which) { + // If the field doesn't exist, it is always enabled. See #823. + if ((sstatus_write_mask & which) == 0) return true; return (read() & which) != 0; } -- cgit v1.1