aboutsummaryrefslogtreecommitdiff
path: root/riscv/csrs.cc
diff options
context:
space:
mode:
authorScott Johnson <scott.johnson@arilinc.com>2022-07-13 09:14:05 -0700
committerScott Johnson <scott.johnson@arilinc.com>2022-07-13 18:57:55 -0700
commit8f36f1a5f8a47282743706e7777a277b9f17ba6f (patch)
tree0b5ceb80195cb63612d260d1baa843f72bb5bdb5 /riscv/csrs.cc
parent00c38fdb95dff4e18ed75361da03436075a03b3a (diff)
downloadspike-8f36f1a5f8a47282743706e7777a277b9f17ba6f.zip
spike-8f36f1a5f8a47282743706e7777a277b9f17ba6f.tar.gz
spike-8f36f1a5f8a47282743706e7777a277b9f17ba6f.tar.bz2
Remove no-longer-needed mask from rv32_high_csr_t
Diffstat (limited to 'riscv/csrs.cc')
-rw-r--r--riscv/csrs.cc4
1 files changed, 2 insertions, 2 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