diff --git a/emulate.c b/emulate.c index 7f13af56..3a68de21 100644 --- a/emulate.c +++ b/emulate.c @@ -1066,7 +1066,7 @@ static inline bool op_fp(struct riscv_t *rv, uint32_t insn) } case 0b0010100: switch (rm) { - case 0b000: /* FMIN */ + case 0b000: { /* FMIN */ /* In IEEE754-201x, fmin(x, y) return - min(x,y) if both numbers are not NaN @@ -1107,8 +1107,9 @@ static inline bool op_fp(struct riscv_t *rv, uint32_t insn) } } break; - case 0b001: /* FMAX */ - + } + case 0b001:{ /* FMAX */ + uint32_t x, y; memcpy(&x, rv->F + rs1, 4); memcpy(&y, rv->F + rs2, 4); if (is_nan(x) || is_nan(y)) { @@ -1142,6 +1143,7 @@ static inline bool op_fp(struct riscv_t *rv, uint32_t insn) break; + } default: rv_except_illegal_insn(rv, insn); return false;