qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Richard Henderson <rth@twiddle.net>
To: qemu-devel@nongnu.org
Cc: aurelien@aurel32.net, laurent@vivier.eu, bruno@clisp.org,
	glaubitz@debian.org
Subject: [Qemu-devel] [PATCH v2 21/27] target/sh4: Tidy misc illegal insn checks
Date: Thu,  6 Jul 2017 16:21:05 -1000	[thread overview]
Message-ID: <20170707022111.21836-22-rth@twiddle.net> (raw)
In-Reply-To: <20170707022111.21836-1-rth@twiddle.net>

Now that we have a do_illegal label, use goto in order
to self-document the forcing of the exception.

Signed-off-by: Richard Henderson <rth@twiddle.net>
---
 target/sh4/translate.c | 22 +++++++++++++---------
 1 file changed, 13 insertions(+), 9 deletions(-)

diff --git a/target/sh4/translate.c b/target/sh4/translate.c
index a4370c6..06cf649 100644
--- a/target/sh4/translate.c
+++ b/target/sh4/translate.c
@@ -1079,8 +1079,9 @@ static void _decode_opc(DisasContext * ctx)
             if (ctx->tbflags & FPSCR_PR) {
                 TCGv_i64 fp0, fp1;
 
-		if (ctx->opcode & 0x0110)
-		    break; /* illegal instruction */
+                if (ctx->opcode & 0x0110) {
+                    goto do_illegal;
+                }
 		fp0 = tcg_temp_new_i64();
 		fp1 = tcg_temp_new_i64();
 		gen_load_fpr64(ctx, fp0, B11_8);
@@ -1142,7 +1143,7 @@ static void _decode_opc(DisasContext * ctx)
         {
             CHECK_FPU_ENABLED
             if (ctx->tbflags & FPSCR_PR) {
-                break; /* illegal instruction */
+                goto do_illegal;
             } else {
                 gen_helper_fmac_FT(FREG(B11_8), cpu_env,
                                    FREG(0), FREG(B7_4), FREG(B11_8));
@@ -1693,8 +1694,9 @@ static void _decode_opc(DisasContext * ctx)
 	CHECK_FPU_ENABLED
         if (ctx->tbflags & FPSCR_PR) {
 	    TCGv_i64 fp;
-	    if (ctx->opcode & 0x0100)
-		break; /* illegal instruction */
+            if (ctx->opcode & 0x0100) {
+                goto do_illegal;
+            }
 	    fp = tcg_temp_new_i64();
             gen_helper_float_DT(fp, cpu_env, cpu_fpul);
 	    gen_store_fpr64(ctx, fp, B11_8);
@@ -1708,8 +1710,9 @@ static void _decode_opc(DisasContext * ctx)
 	CHECK_FPU_ENABLED
         if (ctx->tbflags & FPSCR_PR) {
 	    TCGv_i64 fp;
-	    if (ctx->opcode & 0x0100)
-		break; /* illegal instruction */
+            if (ctx->opcode & 0x0100) {
+		goto do_illegal;
+            }
 	    fp = tcg_temp_new_i64();
 	    gen_load_fpr64(ctx, fp, B11_8);
             gen_helper_ftrc_DT(cpu_fpul, cpu_env, fp);
@@ -1730,8 +1733,9 @@ static void _decode_opc(DisasContext * ctx)
     case 0xf06d: /* fsqrt FRn */
 	CHECK_FPU_ENABLED
         if (ctx->tbflags & FPSCR_PR) {
-	    if (ctx->opcode & 0x0100)
-		break; /* illegal instruction */
+            if (ctx->opcode & 0x0100) {
+		goto do_illegal;
+            }
 	    TCGv_i64 fp = tcg_temp_new_i64();
 	    gen_load_fpr64(ctx, fp, B11_8);
             gen_helper_fsqrt_DT(fp, cpu_env, fp);
-- 
2.9.4

  parent reply	other threads:[~2017-07-07  2:24 UTC|newest]

Thread overview: 89+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-07  2:20 [Qemu-devel] [PATCH v2 00/27] target/sh4 improvements Richard Henderson
2017-07-07  2:20 ` [Qemu-devel] [PATCH v2 01/27] target/sh4: Use cmpxchg for movco Richard Henderson
2017-07-15 23:22   ` Aurelien Jarno
2017-07-16 21:55     ` Aurelien Jarno
2017-07-07  2:20 ` [Qemu-devel] [PATCH v2 02/27] target/sh4: Consolidate end-of-TB tests Richard Henderson
2017-07-07 21:42   ` Aurelien Jarno
2017-07-07  2:20 ` [Qemu-devel] [PATCH v2 03/27] target/sh4: Introduce TB_FLAG_ENVFLAGS_MASK Richard Henderson
2017-07-07 21:42   ` Aurelien Jarno
2017-07-08 16:29   ` Philippe Mathieu-Daudé
2017-07-07  2:20 ` [Qemu-devel] [PATCH v2 04/27] target/sh4: Keep env->flags clean Richard Henderson
2017-07-07 21:42   ` Aurelien Jarno
2017-07-08 16:31   ` Philippe Mathieu-Daudé
2017-07-07  2:20 ` [Qemu-devel] [PATCH v2 05/27] target/sh4: Adjust TB_FLAG_PENDING_MOVCA Richard Henderson
2017-07-07 21:42   ` Aurelien Jarno
2017-07-08 16:31   ` Philippe Mathieu-Daudé
2017-07-07  2:20 ` [Qemu-devel] [PATCH v2 06/27] target/sh4: Handle user-space atomics Richard Henderson
2017-07-15 22:14   ` Aurelien Jarno
2017-07-15 22:16     ` John Paul Adrian Glaubitz
2017-07-16  2:30     ` Richard Henderson
2017-07-16 15:18       ` Aurelien Jarno
2017-07-16 19:35         ` Richard Henderson
2017-07-16 21:43           ` Aurelien Jarno
2017-07-16 21:59             ` Richard Henderson
2017-07-16 22:16               ` Aurelien Jarno
2017-07-07  2:20 ` [Qemu-devel] [PATCH v2 07/27] target/sh4: Recognize common gUSA sequences Richard Henderson
2017-07-17 14:10   ` Aurelien Jarno
2017-07-07  2:20 ` [Qemu-devel] [PATCH v2 08/27] linux-user/sh4: Notice gUSA regions during signal delivery Richard Henderson
2017-07-07  7:25   ` John Paul Adrian Glaubitz
2017-07-07  8:20     ` Richard Henderson
2017-07-07  8:30       ` John Paul Adrian Glaubitz
2017-07-07  8:35         ` John Paul Adrian Glaubitz
2017-07-07 16:22           ` Richard Henderson
2017-07-13  9:09             ` John Paul Adrian Glaubitz
2017-07-13 10:56               ` John Paul Adrian Glaubitz
2017-07-13 21:37                 ` Richard Henderson
2017-07-13 21:42                   ` John Paul Adrian Glaubitz
     [not found]           ` <20170707163826.22631-1-rth@twiddle.net>
2017-07-07 17:57             ` [Qemu-devel] Fwd: [PATCH v2.5] fixup! " Richard Henderson
2017-07-07 19:00               ` Richard Henderson
2017-07-17 14:15                 ` Aurelien Jarno
2017-07-07  9:05   ` [Qemu-devel] [PATCH v2 08/27] " Laurent Vivier
2017-07-07  9:09     ` Laurent Vivier
2017-07-07  9:13     ` John Paul Adrian Glaubitz
2017-07-15 22:52   ` Aurelien Jarno
2017-07-07  2:20 ` [Qemu-devel] [PATCH v2 09/27] linux-user/sh4: Clean env->flags on signal boundaries Richard Henderson
2017-07-15 22:59   ` Aurelien Jarno
2017-07-16  2:33     ` Richard Henderson
2017-07-16 15:18       ` Aurelien Jarno
2017-07-07  2:20 ` [Qemu-devel] [PATCH v2 10/27] target/sh4: Hoist register bank selection Richard Henderson
2017-07-07 21:48   ` Aurelien Jarno
2017-07-07  2:20 ` [Qemu-devel] [PATCH v2 11/27] target/sh4: Unify cpu_fregs into FREG Richard Henderson
2017-07-07 21:54   ` Aurelien Jarno
2017-07-08 16:54   ` Philippe Mathieu-Daudé
2017-07-07  2:20 ` [Qemu-devel] [PATCH v2 12/27] target/sh4: Pass DisasContext to fpr64 routines Richard Henderson
2017-07-07 21:55   ` Aurelien Jarno
2017-07-08 16:56   ` Philippe Mathieu-Daudé
2017-07-07  2:20 ` [Qemu-devel] [PATCH v2 13/27] target/sh4: Hoist fp register bank selection Richard Henderson
2017-07-07 21:57   ` Aurelien Jarno
2017-07-07  2:20 ` [Qemu-devel] [PATCH v2 14/27] target/sh4: Eliminate unused XREG macro Richard Henderson
2017-07-07 21:59   ` Aurelien Jarno
2017-07-07  2:20 ` [Qemu-devel] [PATCH v2 15/27] target/sh4: Merge DREG into fpr64 routines Richard Henderson
2017-07-07 22:06   ` Aurelien Jarno
2017-07-07  2:21 ` [Qemu-devel] [PATCH v2 16/27] target/sh4: Load/store Dr as 64-bit quantities Richard Henderson
2017-07-07 22:14   ` Aurelien Jarno
2017-07-07  2:21 ` [Qemu-devel] [PATCH v2 17/27] target/sh4: Simplify 64-bit fp reg-reg move Richard Henderson
2017-07-07 22:15   ` Aurelien Jarno
2017-07-07  2:21 ` [Qemu-devel] [PATCH v2 18/27] target/sh4: Unify code for CHECK_NOT_DELAY_SLOT Richard Henderson
2017-07-07 22:17   ` Aurelien Jarno
2017-07-08 16:59   ` Philippe Mathieu-Daudé
2017-07-07  2:21 ` [Qemu-devel] [PATCH v2 19/27] target/sh4: Unify code for CHECK_PRIVILEGED Richard Henderson
2017-07-07 22:17   ` Aurelien Jarno
2017-07-08 17:00   ` Philippe Mathieu-Daudé
2017-07-07  2:21 ` [Qemu-devel] [PATCH v2 20/27] target/sh4: Unify code for CHECK_FPU_ENABLED Richard Henderson
2017-07-07 22:18   ` Aurelien Jarno
2017-07-08 17:01   ` Philippe Mathieu-Daudé
2017-07-07  2:21 ` Richard Henderson [this message]
2017-07-07 22:18   ` [Qemu-devel] [PATCH v2 21/27] target/sh4: Tidy misc illegal insn checks Aurelien Jarno
2017-07-08 17:02   ` Philippe Mathieu-Daudé
2017-07-07  2:21 ` [Qemu-devel] [PATCH v2 22/27] target/sh4: Introduce CHECK_FPSCR_PR_* Richard Henderson
2017-07-07 22:20   ` Aurelien Jarno
2017-07-07  2:21 ` [Qemu-devel] [PATCH v2 23/27] target/sh4: Introduce CHECK_SH4A Richard Henderson
2017-07-07 22:21   ` Aurelien Jarno
2017-07-07  2:21 ` [Qemu-devel] [PATCH v2 24/27] target/sh4: Implement fpchg Richard Henderson
2017-07-07 22:23   ` Aurelien Jarno
2017-07-07  2:21 ` [Qemu-devel] [PATCH v2 25/27] target/sh4: Add missing FPSCR.PR == 0 checks Richard Henderson
2017-07-07 22:24   ` Aurelien Jarno
2017-07-07  2:21 ` [Qemu-devel] [PATCH v2 26/27] target/sh4: Implement fsrra Richard Henderson
2017-07-07 22:27   ` Aurelien Jarno
2017-07-07  2:21 ` [Qemu-devel] [PATCH v2 27/27] target/sh4: Use tcg_gen_lookup_and_goto_ptr Richard Henderson
2017-07-18  7:51 ` [Qemu-devel] [PATCH v2 00/27] target/sh4 improvements Aurelien Jarno

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170707022111.21836-22-rth@twiddle.net \
    --to=rth@twiddle.net \
    --cc=aurelien@aurel32.net \
    --cc=bruno@clisp.org \
    --cc=glaubitz@debian.org \
    --cc=laurent@vivier.eu \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).