diff options
author | Scott Johnson <scott.johnson@arilinc.com> | 2022-07-13 09:14:05 -0700 |
---|---|---|
committer | Scott Johnson <scott.johnson@arilinc.com> | 2022-07-13 18:57:55 -0700 |
commit | 8f36f1a5f8a47282743706e7777a277b9f17ba6f (patch) | |
tree | 0b5ceb80195cb63612d260d1baa843f72bb5bdb5 | |
parent | 00c38fdb95dff4e18ed75361da03436075a03b3a (diff) | |
download | riscv-isa-sim-8f36f1a5f8a47282743706e7777a277b9f17ba6f.zip riscv-isa-sim-8f36f1a5f8a47282743706e7777a277b9f17ba6f.tar.gz riscv-isa-sim-8f36f1a5f8a47282743706e7777a277b9f17ba6f.tar.bz2 |
Remove no-longer-needed mask from rv32_high_csr_t
-rw-r--r-- | riscv/csrs.cc | 4 | ||||
-rw-r--r-- | riscv/csrs.h | 1 |
2 files changed, 2 insertions, 3 deletions
diff --git a/riscv/csrs.cc b/riscv/csrs.cc index 18956ff..3a929ff 100644 --- a/riscv/csrs.cc +++ b/riscv/csrs.cc @@ -500,7 +500,7 @@ rv32_high_csr_t::rv32_high_csr_t(processor_t* const proc, const reg_t addr, csr_ } reg_t rv32_high_csr_t::read() const noexcept { - return (orig->read() >> 32) & mask; + return (orig->read() >> 32) & 0xffffffffU; } void rv32_high_csr_t::verify_permissions(insn_t insn, bool write) const { @@ -508,7 +508,7 @@ void rv32_high_csr_t::verify_permissions(insn_t insn, bool write) const { } bool rv32_high_csr_t::unlogged_write(const reg_t val) noexcept { - return orig->unlogged_write((orig->written_value() & ~(mask << 32)) | ((val & mask) << 32)); + return orig->unlogged_write((orig->written_value() << 32 >> 32) | ((val & 0xffffffffU) << 32)); } // implement class sstatus_csr_t diff --git a/riscv/csrs.h b/riscv/csrs.h index 7b1f87c..3998d79 100644 --- a/riscv/csrs.h +++ b/riscv/csrs.h @@ -258,7 +258,6 @@ class rv32_high_csr_t: public csr_t { virtual bool unlogged_write(const reg_t val) noexcept override; private: csr_t_p orig; - const reg_t mask = -1; }; class sstatus_proxy_csr_t final: public base_status_csr_t { |