This allows the OS to track FP state dirtiness.
#define require_privilege(p) if (get_field(STATE.mstatus, MSTATUS_PRV) < (p)) throw trap_illegal_instruction()
#define require_rv64 if(unlikely(xlen != 64)) throw trap_illegal_instruction()
#define require_rv32 if(unlikely(xlen != 32)) throw trap_illegal_instruction()
-#define require_fp if (unlikely((STATE.mstatus & MSTATUS_FS) == 0)) throw trap_illegal_instruction()
+#ifdef RISCV_ENABLE_FPU
+# define require_fp if (unlikely((STATE.mstatus & MSTATUS_FS) == 0)) throw trap_illegal_instruction()
+#else
+# define require_fp throw trap_illegal_instruction()
+#endif
#define require_accelerator if (unlikely((STATE.mstatus & MSTATUS_XS) == 0)) throw trap_illegal_instruction()
#define cmp_trunc(reg) (reg_t(reg) << (64-xlen))
mmu->flush_tlb();
reg_t mask = MSTATUS_SSIP | MSTATUS_MSIP | MSTATUS_IE | MSTATUS_IE1
- | MSTATUS_IE2 | MSTATUS_IE3 | MSTATUS_STIE;
-#ifdef RISCV_ENABLE_FPU
- mask |= MSTATUS_FS;
-#endif
+ | MSTATUS_IE2 | MSTATUS_IE3 | MSTATUS_STIE | MSTATUS_FS;
if (ext)
mask |= MSTATUS_XS;
state.mstatus = (state.mstatus & ~mask) | (val & mask);