From 872be901d4563e97b38acd1673536f40b2ce76c4 Mon Sep 17 00:00:00 2001 From: Yongbok Kim Date: Tue, 3 Jul 2018 00:57:01 -0400 Subject: [PATCH] target/mips: Raise a RI when given fs is n/a from CTC1 Fix to raise a Reserved Instruction exception when given fs is not available from CTC1. Backports commit f48a2cb21824217a61ec7be797860a0702e5325c from qemu --- qemu/target/mips/op_helper.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/qemu/target/mips/op_helper.c b/qemu/target/mips/op_helper.c index 1651b73a..2f2ae753 100644 --- a/qemu/target/mips/op_helper.c +++ b/qemu/target/mips/op_helper.c @@ -2617,6 +2617,9 @@ void helper_ctc1(CPUMIPSState *env, target_ulong arg1, uint32_t fs, uint32_t rt) (env->active_fpu.fcr31 & ~(env->active_fpu.fcr31_rw_bitmask)); break; default: + if (env->insn_flags & ISA_MIPS32R6) { + do_raise_exception(env, EXCP_RI, GETPC()); + } return; } restore_fp_status(env);