Skip to content

Commit

Permalink
Fix envcfg check when S/H-mode is not available
Browse files Browse the repository at this point in the history
  • Loading branch information
mimiqdev committed Jan 21, 2025
1 parent 58da6a2 commit 64d27a5
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions riscv/decode_macros.h
Original file line number Diff line number Diff line change
Expand Up @@ -193,10 +193,10 @@ static inline bool is_aligned(const unsigned val, const unsigned pos)
#define require_envcfg(field) \
do { \
if (((STATE.prv != PRV_M) && (m##field == 0)) || \
((STATE.prv == PRV_U && !STATE.v) && (s##field == 0))) \
(p->extension_enabled('S') && (STATE.prv == PRV_U && !STATE.v) && (s##field == 0))) \
throw trap_illegal_instruction(insn.bits()); \
else if (STATE.v && ((h##field == 0) || \
((STATE.prv == PRV_U) && (s##field == 0)))) \
else if (p->extension_enabled('H') && STATE.v && ((h##field == 0) || \
(p->extension_enabled('S') && (STATE.prv == PRV_U) && (s##field == 0)))) \
throw trap_virtual_instruction(insn.bits()); \
} while (0);

Expand Down

0 comments on commit 64d27a5

Please sign in to comment.