Browse Source

Fix CSR read-only check regression introduced in 463001198

pull/721/head
Andrew Waterman 5 years ago
parent
commit
62526773c0
  1. 6
      riscv/decode.h

6
riscv/decode.h

@ -373,7 +373,11 @@ inline freg_t f128_negate(freg_t a)
#define validate_csr(which, write) ({ \
if (!STATE.serialized) return PC_SERIALIZE_BEFORE; \
STATE.serialized = false; \
/* permissions check occurs in get_csr */ \
/* disallow writes to read-only CSRs */ \
unsigned csr_read_only = get_field((which), 0xC00) == 3; \
if ((write) && csr_read_only) \
throw trap_illegal_instruction(insn.bits()); \
/* other permissions checks occur in get_csr */ \
(which); })
/* For debug only. This will fail if the native machine's float types are not IEEE */

Loading…
Cancel
Save