diff --git a/incl/iss/arch/riscv_hart_m_p.h b/incl/iss/arch/riscv_hart_m_p.h
index ceb0058..d0ae20c 100644
--- a/incl/iss/arch/riscv_hart_m_p.h
+++ b/incl/iss/arch/riscv_hart_m_p.h
@@ -804,10 +804,9 @@ iss::status riscv_hart_m_p::write_mem(phys_addr_t paddr, unsigned length,
std::copy(data, data + length, p.data() + (paddr.val & mem.page_addr_mask));
// tohost handling in case of riscv-test
if (paddr.access && iss::access_type::FUNC) {
- auto tohost_upper = (traits::XLEN == 32 && paddr.val == (tohost + 4)) ||
- (traits::XLEN == 64 && paddr.val == tohost);
+ auto tohost_upper = (traits::XLEN == 32 && paddr.val == (tohost + 4));
auto tohost_lower =
- (traits::XLEN == 32 && paddr.val == tohost) || (traits::XLEN == 64 && paddr.val == tohost);
+ (traits::XLEN == 32 && paddr.val == tohost);
if (tohost_lower || tohost_upper) {
uint64_t hostvar = *reinterpret_cast(p.data() + (tohost & mem.page_addr_mask));
if (tohost_upper || (tohost_lower && to_host_wr_cnt > 0)) {
@@ -838,8 +837,7 @@ iss::status riscv_hart_m_p::write_mem(phys_addr_t paddr, unsigned length,
}
} else if (tohost_lower)
to_host_wr_cnt++;
- } else if ((traits::XLEN == 32 && paddr.val == fromhost + 4) ||
- (traits::XLEN == 64 && paddr.val == fromhost)) {
+ } else if (traits::XLEN == 32 && paddr.val == fromhost + 4) {
uint64_t fhostvar = *reinterpret_cast(p.data() + (fromhost & mem.page_addr_mask));
*reinterpret_cast(p.data() + (tohost & mem.page_addr_mask)) = fhostvar;
}