diff options
author | Scott Johnson <scott.johnson@arilinc.com> | 2021-10-06 11:15:19 -0700 |
---|---|---|
committer | Scott Johnson <scott.johnson@arilinc.com> | 2021-10-06 11:15:19 -0700 |
commit | 66c4853bdc5b22bf4c4b364218c713e3f1e487f3 (patch) | |
tree | 7e1a71cbfea08ff1d7ab701c2390d4422a4e9aee | |
parent | 4c185074899b6a57db8d45a162faa0a881451f7b (diff) | |
download | spike-66c4853bdc5b22bf4c4b364218c713e3f1e487f3.zip spike-66c4853bdc5b22bf4c4b364218c713e3f1e487f3.tar.gz spike-66c4853bdc5b22bf4c4b364218c713e3f1e487f3.tar.bz2 |
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.
-rw-r--r-- | riscv/csrs.cc | 2 |
1 files changed, 2 insertions, 0 deletions
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; } |