From: Andrew Waterman Date: Sat, 4 Apr 2015 22:17:13 +0000 (-0700) Subject: Check for F extension when accessing FCSR X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=5a3324644dfd0ab1da6f3d3dd306f31dd902a55a;p=riscv-isa-sim.git Check for F extension when accessing FCSR --- diff --git a/riscv/processor.cc b/riscv/processor.cc index 1187265..1fe0a9c 100644 --- a/riscv/processor.cc +++ b/riscv/processor.cc @@ -460,12 +460,18 @@ reg_t processor_t::get_csr(int which) { case CSR_FFLAGS: require_fp; + if (!supports_extension('F')) + break; return state.fflags; case CSR_FRM: require_fp; + if (!supports_extension('F')) + break; return state.frm; case CSR_FCSR: require_fp; + if (!supports_extension('F')) + break; return (state.fflags << FSR_AEXC_SHIFT) | (state.frm << FSR_RD_SHIFT); case CSR_CYCLE: case CSR_TIME: