From nobody Wed Nov 5 10:07:11 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1499395110032767.0627262594198; Thu, 6 Jul 2017 19:38:30 -0700 (PDT) Received: from localhost ([::1]:54173 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dTJA4-0006TD-QG for importer@patchew.org; Thu, 06 Jul 2017 22:38:28 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35036) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dTIwj-0003Jv-VF for qemu-devel@nongnu.org; Thu, 06 Jul 2017 22:24:42 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dTIwj-000151-5P for qemu-devel@nongnu.org; Thu, 06 Jul 2017 22:24:41 -0400 Received: from mail-qk0-x241.google.com ([2607:f8b0:400d:c09::241]:33211) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dTIwj-00014o-0n for qemu-devel@nongnu.org; Thu, 06 Jul 2017 22:24:41 -0400 Received: by mail-qk0-x241.google.com with SMTP id p21so2760478qke.0 for ; Thu, 06 Jul 2017 19:24:40 -0700 (PDT) Received: from bigtime.twiddle.net.com (rrcs-66-91-136-156.west.biz.rr.com. [66.91.136.156]) by smtp.gmail.com with ESMTPSA id i85sm1407176qke.66.2017.07.06.19.24.37 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 06 Jul 2017 19:24:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=UqTxQ/VJdPczOBf3ZqJD6xzHjSw4rbseaMYBqv+Z66g=; b=rNwuo3KWitD5a+vKuxs/Lzth15epWe8nPvMVg7ZCVRp/bPZod+9sPFG8CfcKhcRzYh lGp4yrne2ugYr48YbHyd6aXk6zmeRlmyxL/FCj/dATyWSTkkA/NBRog9WzUuh2OfWCcu Td0evn4aRWfIwpJ+L/v2WpWZsvdhzxCBKL2Q8PNjHp3O53WyvA/rOVsnuU1FjP12WcpZ bfH/5nsv4FtMKSlnR8jsfR5anyC5/H6kKpbBW8Nwvt5vCTlIJnY6u8UiioRcY4LcdtX+ q/Mu3X5AoFcrnqZzMB9MiLwN6ZeXW0ia7OpgHmfDjP+ExGbZKvc4ptr8hj+wZZr3NpVz WY/Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=UqTxQ/VJdPczOBf3ZqJD6xzHjSw4rbseaMYBqv+Z66g=; b=inHUxa85tRS9byKWIl/Zv6Cv9EIkfAzToTXTXWiBfMELkQN3DBJrCfWzZyEUB4BzX+ pXvOaCcgt5aVt4dOQrF4ycwIfclPiimKPHrsK6wASEwcxEGVO/HIcj0TTIsv1hetyU8l dvjTfsn4ySCzdaylFHuWiQfuDAdIEP5upePhpJOJBufWJnhd/KyLB36tduqQfrWzVMw8 MMNPHb8mrn+xKojXRRN5qDai+jwwlrb9EqsL5nQ00L4QU6qDlQFkmNxlScRhoXA9dOJm O670rQhFreqN8VMIOFAr4QfXYooNRQGBbYXUhcRqmh217gyavmUcmvM5r5Y5WaoDjhN1 rbCw== X-Gm-Message-State: AKS2vOxRQETUPS6J/GOpw9jRpVCsnGkVxGnu3u2lIhHJtcQu+W13ig9i k/ftNKdntbyCuY5KGY0= X-Received: by 10.233.221.70 with SMTP id r67mr60896163qkf.81.1499394280405; Thu, 06 Jul 2017 19:24:40 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Thu, 6 Jul 2017 16:21:02 -1000 Message-Id: <20170707022111.21836-19-rth@twiddle.net> X-Mailer: git-send-email 2.9.4 In-Reply-To: <20170707022111.21836-1-rth@twiddle.net> References: <20170707022111.21836-1-rth@twiddle.net> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c09::241 Subject: [Qemu-devel] [PATCH v2 18/27] target/sh4: Unify code for CHECK_NOT_DELAY_SLOT X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: bruno@clisp.org, laurent@vivier.eu, aurelien@aurel32.net, glaubitz@debian.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" We do not need to emit N copies of raising an exception. Signed-off-by: Richard Henderson Reviewed-by: Aurelien Jarno Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- target/sh4/translate.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/target/sh4/translate.c b/target/sh4/translate.c index 3453f19..41157a0 100644 --- a/target/sh4/translate.c +++ b/target/sh4/translate.c @@ -377,11 +377,8 @@ static inline void gen_store_fpr64(DisasContext *ctx, = TCGv_i64 t, int reg) #define XHACK(x) ((((x) & 1 ) << 4) | ((x) & 0xe)) =20 #define CHECK_NOT_DELAY_SLOT \ - if (ctx->envflags & DELAY_SLOT_MASK) { \ - gen_save_cpu_state(ctx, true); \ - gen_helper_raise_slot_illegal_instruction(cpu_env); \ - ctx->bstate =3D BS_EXCP; \ - return; \ + if (ctx->envflags & DELAY_SLOT_MASK) { \ + goto do_illegal_slot; \ } =20 #define CHECK_PRIVILEGED \ @@ -1820,10 +1817,12 @@ static void _decode_opc(DisasContext * ctx) ctx->opcode, ctx->pc); fflush(stderr); #endif - gen_save_cpu_state(ctx, true); if (ctx->envflags & DELAY_SLOT_MASK) { + do_illegal_slot: + gen_save_cpu_state(ctx, true); gen_helper_raise_slot_illegal_instruction(cpu_env); } else { + gen_save_cpu_state(ctx, true); gen_helper_raise_illegal_instruction(cpu_env); } ctx->bstate =3D BS_EXCP; --=20 2.9.4