[v3,25/30] target/sh4: Add missing FPSCR.PR == 0 checks
diff mbox

Message ID 20170718200255.31647-26-rth@twiddle.net
State New
Headers show

Commit Message

Richard Henderson July 18, 2017, 8:02 p.m. UTC
Both frchg and fschg require PR == 0, otherwise undefined_operation.

Reviewed-by: Aurelien Jarno <aurelien@aurel32.net>
Signed-off-by: Richard Henderson <rth@twiddle.net>
---
 target/sh4/translate.c | 2 ++
 1 file changed, 2 insertions(+)

Patch
diff mbox

diff --git a/target/sh4/translate.c b/target/sh4/translate.c
index 65cc7d1..a5d07a0 100644
--- a/target/sh4/translate.c
+++ b/target/sh4/translate.c
@@ -479,10 +479,12 @@  static void _decode_opc(DisasContext * ctx)
         tcg_gen_movi_i32(cpu_sr_t, 1);
 	return;
     case 0xfbfd:		/* frchg */
+        CHECK_FPSCR_PR_0
 	tcg_gen_xori_i32(cpu_fpscr, cpu_fpscr, FPSCR_FR);
 	ctx->bstate = BS_STOP;
 	return;
     case 0xf3fd:		/* fschg */
+        CHECK_FPSCR_PR_0
         tcg_gen_xori_i32(cpu_fpscr, cpu_fpscr, FPSCR_SZ);
 	ctx->bstate = BS_STOP;
 	return;