From patchwork Mon Jun 11 10:49:27 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Vivier X-Patchwork-Id: 927597 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=vivier.eu Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4148tt3mXwz9s01 for ; Mon, 11 Jun 2018 20:50:45 +1000 (AEST) Received: from localhost ([::1]:47645 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fSKPL-0002UK-GB for incoming@patchwork.ozlabs.org; Mon, 11 Jun 2018 06:50:43 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56273) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fSKOe-0002TN-UD for qemu-devel@nongnu.org; Mon, 11 Jun 2018 06:50:01 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fSKOa-0000in-N6 for qemu-devel@nongnu.org; Mon, 11 Jun 2018 06:50:00 -0400 Received: from mout.kundenserver.de ([212.227.126.135]:39581) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fSKOa-0000hz-96 for qemu-devel@nongnu.org; Mon, 11 Jun 2018 06:49:56 -0400 Received: from localhost.localdomain ([78.238.229.36]) by mrelayeu.kundenserver.de (mreue003 [212.227.15.167]) with ESMTPSA (Nemesis) id 0LpRkv-1fwQM11QPd-00f6pM; Mon, 11 Jun 2018 12:49:44 +0200 From: Laurent Vivier To: qemu-devel@nongnu.org Date: Mon, 11 Jun 2018 12:49:27 +0200 Message-Id: <20180611104935.20499-2-laurent@vivier.eu> X-Mailer: git-send-email 2.14.4 In-Reply-To: <20180611104935.20499-1-laurent@vivier.eu> References: <20180611104935.20499-1-laurent@vivier.eu> X-Provags-ID: V03:K1:mPi4jLRS/skLCPNrU2PQGxYtMxYdYB32TUvgSKvq+teciXEcCB5 3ljS6/lRpynkCb211sx0hRdJwWtSJ5dyiZvEHrme+ON3GxQL0E9mTqtWmSXcxPUShogB+65 EpUz+ihPqCIYXOnbYl5LLpxx6YtgugYR4Z3kujgOAGiyu53hsjGxBuINGcPGhNhOq8dxRGr wQ1+b6YtuVoccZ/RFilHw== X-UI-Out-Filterresults: notjunk:1; V01:K0:GLxzrVEs2q0=:SngLXzBQraqqyoKE8vlF0E +SQQ1YJ1eGTX+jXt3vWYPyO5eo/CFHg/UBjbuoVXXSYB1eaEag4qBDDEgU5SQVbVM3t1rmUUI nlekFc68jQLPz/pHLgw1NuCBiS5eL51Av+Vh0cusdMiyoMjlxgoKxdsd4dlPqJBvrz18haRmM ugAAbcW9eg2TvcDmI73+xLQz2oAuDUGKsHNy+v/T9X8X7anPGW3zczdgl9C4gTLZskk61G+BW vSUjN3OpefUfpVRXObEMO8PjBATyGqd2LBY+XRHE7ILQxtRTiy5Dz+iq1neEw16otZ34GM2oK VcpGHeFkw+f3u4/uzHvkBlZU0+8oTjX7P/g8YP4LG0Qm+7dareRX19xcvXPEWnogJy89zw+XP IMMpejBP/kQjr9IKFNMppMWLP89ltssxL3JvuB1YfIHAnU3oSNC3Gqt94z4Ef//9qdy1yQjXL iaGCw23Pfml+VdmMhet3JwtxbtmC3vfd5nnU+BAW0v7+b8Mb3We9QCVTAGndoFSjx6hRKQ2JW C1CsAcIEDVLvEKVrlHzP95ixyxlbg3CBXlcbvMbbV7VTWFyLgCZEWacm7IYzmeKPb5/ChkFFc V38W0Q/tftzmLfPGf5XoiMlVK9F5HTk0QAZALRkxCbbgXOO9A64mka7ZzpSMrhQwh0kv1cf4I s5F1D/+BR1iuzpaS5L3iHAc+fb8Xl9vfH3P2yYhjxWIq+mm5EwgI/b77bPQ9ObVGQtxw= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 212.227.126.135 Subject: [Qemu-devel] [PULL 1/9] target/m68k: Use DISAS_NORETURN for exceptions 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: Riku Voipio , Richard Henderson , Laurent Vivier Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Richard Henderson The raise_exception helper does not return. Do not generate any code following that. Signed-off-by: Richard Henderson Message-Id: <20180512050250.12774-2-richard.henderson@linaro.org> Signed-off-by: Laurent Vivier --- target/m68k/translate.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/target/m68k/translate.c b/target/m68k/translate.c index 4b5dbdb51c..de1be58f65 100644 --- a/target/m68k/translate.c +++ b/target/m68k/translate.c @@ -291,18 +291,18 @@ static void gen_jmp(DisasContext *s, TCGv dest) s->is_jmp = DISAS_JUMP; } -static void gen_raise_exception(int nr) +static void gen_exception(DisasContext *s, uint32_t dest, int nr) { - TCGv_i32 tmp = tcg_const_i32(nr); + TCGv_i32 tmp; + update_cc_op(s); + tcg_gen_movi_i32(QREG_PC, dest); + + tmp = tcg_const_i32(nr); gen_helper_raise_exception(cpu_env, tmp); tcg_temp_free_i32(tmp); -} -static void gen_exception(DisasContext *s, uint32_t where, int nr) -{ - gen_jmp_im(s, where); - gen_raise_exception(nr); + s->is_jmp = DISAS_NORETURN; } static inline void gen_addr_fault(DisasContext *s) @@ -6106,7 +6106,6 @@ void gen_intermediate_code(CPUState *cs, TranslationBlock *tb) if (unlikely(cpu_breakpoint_test(cs, dc->pc, BP_ANY))) { gen_exception(dc, dc->pc, EXCP_DEBUG); - dc->is_jmp = DISAS_JUMP; /* The address covered by the breakpoint must be included in [tb->pc, tb->pc + tb->size) in order to for it to be properly cleared -- thus we increment the PC here so that @@ -6150,6 +6149,7 @@ void gen_intermediate_code(CPUState *cs, TranslationBlock *tb) tcg_gen_exit_tb(NULL, 0); break; case DISAS_TB_JUMP: + case DISAS_NORETURN: /* nothing more to generate */ break; }