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: 138209 Delivered-To: patch@linaro.org Received: by 2002:a2e:970d:0:0:0:0:0 with SMTP id r13-v6csp3895647lji; Mon, 11 Jun 2018 03:50:25 -0700 (PDT) X-Google-Smtp-Source: ADUXVKL1V+JaPgyQv6hmlUoHTfvCJ2RGM5cPUiwC9+dWKlpI4/ToVcahutjdxMfW3k8Q7gjJYi6u X-Received: by 2002:ac8:3251:: with SMTP id y17-v6mr15557673qta.86.1528714225881; Mon, 11 Jun 2018 03:50:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528714225; cv=none; d=google.com; s=arc-20160816; b=nOsYXZ6mMrQZqUIHjPWgda4QxNgXJGXy0NoTvvF7nrqE9tZG4Eb34YSl2O8XQbQn1X Nr5b14EmBoCQdw/6M5xNpeksGs4SX0I2n1909SMpJ4e5polxNpHxbotqazGQ+XiRswJ4 p3QV/hHsk8fB9oOAgxwilR/mKXpfX3+2myDKBrjj7j98uZKpDaZkRg3BrJi3UMLD7MQv 05mhTk/P9qDVpDUt8g1eebg5/WJCjqtXt9n3OtC3wsLAoHf7ZsTF/TZTN3uR0daNXbNM U/KRmW7VnKqTx8UK1U26U9ynXyESGLNUPlWnFBt6PxJ2COpeLq/B7BvPjqpgOkZo0QBv VjqA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:references:in-reply-to :message-id:date:to:from:arc-authentication-results; bh=icnll5vnEVw9XJczlvFXRuYtyw3+tmGF9IXdtoGqIW4=; b=oQm+7EdKmGU2sGfGePGKscVz94zMR82V5JDMfDr6ofn+g8bAWtnUzms+6ENk23CNAL FtlDDxn/J2r43R8uPXBPMlaATg/izji39pKtPg33IpfljHU+E3tV8WX8OULGNj4ok53w LkVBm+VW/YkYGLvjfq40P7MwkRWLQ4XCETDNKoLMnqLbCxf9YMzDn71qTpvCQKPcgCPl u+mzXPjCS6em54ZFd53Ll/9J2QG4SXssa9TZbtzCU5PaKS85MI7L845RMwE17XKlVkhf 9euYn6KpCCQtVhXqA9Ty20mqfXRMC8UP403s/7/B/0Rg6WK59g1SgVhGADdkFFOcf13/ z7xg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom=qemu-devel-bounces+patch=linaro.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id q75-v6si6808587qki.370.2018.06.11.03.50.25 for (version=TLS1 cipher=AES128-SHA bits=128/128); Mon, 11 Jun 2018 03:50:25 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Authentication-Results: mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom=qemu-devel-bounces+patch=linaro.org@nongnu.org Received: from localhost ([::1]:47645 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fSKP3-0002UK-Bn for patch@linaro.org; Mon, 11 Jun 2018 06:50:25 -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+patch=linaro.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(-) -- 2.14.4 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; } From patchwork Mon Jun 11 10:49:28 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Vivier X-Patchwork-Id: 138210 Delivered-To: patch@linaro.org Received: by 2002:a2e:970d:0:0:0:0:0 with SMTP id r13-v6csp3896516lji; Mon, 11 Jun 2018 03:51:34 -0700 (PDT) X-Google-Smtp-Source: ADUXVKITIi6DbZcy/E/wLxe74DqyN0CWVluWa0WPta2gIJy3/WILZYYSy4rUs+P4wV+43mlvxGv5 X-Received: by 2002:aed:3caa:: with SMTP id d39-v6mr15989143qtf.408.1528714294057; Mon, 11 Jun 2018 03:51:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528714294; cv=none; d=google.com; s=arc-20160816; b=TFXnM0mJV32AJvtPE2FRZIw/PQVFuyg16lS1Pj5TujfgDTGQ5DmO4A6DQ53e4rf4KW N/O6Ow12YZbOo+dGaaJY9N12WBm40PIzrIh/WAghNewFy0sa1k7gymNcDk6SHSjRnB7Q aCyHYuvpe3zcjU93Psje6hbKKPB66083k810SG4C4q6htulBzstburG1WhEYc0qQ1ZYi MJ3qWtsWjwRrisBAB0iQ3/1hEIWmzFHp9Qaiz/jqI6+n2ymhKD4eHiwYAGqXPPVvEMtp ZLQRrGYSIQiDZI/1tds084BfGUOn2Q+oJln9oViy/OxrOG/sPctiQ9VgGb3nhn9tG2lu DkLg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:references:in-reply-to :message-id:date:to:from:arc-authentication-results; bh=Ywk5qH6logF6esDFPrYqlX6AuWdp+Ing9deMXaybZnA=; b=S4BB0BepGwEwjnzuLORXzBzigtCdcHGL8XDvZKy8O8FHeZwa5rVKnjtGnIVPFxf6S/ QXK0crxbHReiImLvVod1ZqKjyxOAv+3tVeXq2BnkRYRtuY1/05hgc4x8xa5FhJn8bbbV o0EWVdnbQkzLfSb/koy8XUDaIcqGm4cAWE+siQoOubwaRAuDrrbmNF+QPP5XXYOb3oeQ 3yyVl8fCd9lPOAuRDFZRKXZe/o+R91wvl+kDjUjoN2exOPTtRXQOEawKvNUiNoUHsro+ ynqFlvUQpMA2M85ZkOks1B6uYeShN76e1KevmpmyUkA1eDsZWQdRMg0TTcaJObyYgpBP rNBQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom=qemu-devel-bounces+patch=linaro.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id h14-v6si10906317qvo.159.2018.06.11.03.51.33 for (version=TLS1 cipher=AES128-SHA bits=128/128); Mon, 11 Jun 2018 03:51:34 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Authentication-Results: mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom=qemu-devel-bounces+patch=linaro.org@nongnu.org Received: from localhost ([::1]:47653 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fSKQ9-0003Uj-Hq for patch@linaro.org; Mon, 11 Jun 2018 06:51:33 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56324) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fSKOj-0002WY-GI for qemu-devel@nongnu.org; Mon, 11 Jun 2018 06:50:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fSKOf-0000mQ-8v for qemu-devel@nongnu.org; Mon, 11 Jun 2018 06:50:05 -0400 Received: from mout.kundenserver.de ([212.227.126.187]:59969) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fSKOe-0000kL-P0 for qemu-devel@nongnu.org; Mon, 11 Jun 2018 06:50:01 -0400 Received: from localhost.localdomain ([78.238.229.36]) by mrelayeu.kundenserver.de (mreue003 [212.227.15.167]) with ESMTPSA (Nemesis) id 0LvNnr-1gRkS21pfn-010gUw; Mon, 11 Jun 2018 12:49:45 +0200 From: Laurent Vivier To: qemu-devel@nongnu.org Date: Mon, 11 Jun 2018 12:49:28 +0200 Message-Id: <20180611104935.20499-3-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:VoZRQbMk6j672HEf1YtE9qMJffJV/f0pS5F5xnUJc6VORQZFGP5 e7cm5iuCuMjRpRBvkHIrOR10knRi1aILwWdP9tpFKbT0t8La1aoKTX1kc/AdpXrSb7extzW TMi+pF1pmHeI+34ZhsFOd/5DJ3SLkrlPCKaXCsqsLjIpUQ03Vg+bt0DNX1B/PE6ZOwLliY3 i+PZhjAxEV/VgGuHaebEg== X-UI-Out-Filterresults: notjunk:1; V01:K0:ofhFGGODWSM=:YH6iEuNrxvZu8heGSx/pQL VDgM2GicO0i+wqu+epfUXcWShrtyZTVILkQWnR0bdt2AKKryJjort10eiQLvuT9WyyDGpU1JI 4ki6YQ5vZzK7TZqC9zm+J8pVfpuygy15c2CCIAVmLxdPfe4tsNVv+ha0wvi1xoCMWvaSe7SZI VsMKKu10odNjPxIRVcpGw/lNA2dmoI3nxJJZUdikPLad4Td0PZFAMsgiERQPEko8yd8jr5F/x byraDtWuff4JwOdczkgv/R0rQg1976SliN8tj+nix2JMSfUl8soR7BYs1lM03A/EDMJXVkogM wnW1lWC2AdDthw6tr57ozs3+MGRlvynAXZd3uIYlwaV+kR/iyhkxIi5a1jhUzf2riQxObGpiM 42ZqUccguUFYu0i2kTVM2C16am9rw5q29GQOYypo6dRefHeq2D0zpPsTfK9kPhZUtk6MNHk9m MWxYjJfHesl1G2hWL0M6ukSmJLgw/6kTrHLG/WZ3Mte/WZrhmOe302jZU039Te5ldPNGj6Al+ JaMSUKZ4s893gqO0Z0vQWjWQZnwURqGuIi5opHghgW/6yHPKR+BA7RMoepiFya1jBc0Uhn0/B 9YjgiAXg4+h37HEyGiMrU0kwmzDOOh0pdPK1dag2e4yW3SvzF3VL2abkPHQgT1vykXHVULwxx 0lkvFp6Ft21jk2yp12DF1J+nbDBvkcXsAhtWQTpdb87Y3LSVYUtd1mJOU+JTIZ2QPEn0= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 212.227.126.187 Subject: [Qemu-devel] [PULL 2/9] target/m68k: Replace DISAS_TB_JUMP with DISAS_NORETURN 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+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Richard Henderson We have exited the TB after using goto_tb; there is no distinction from DISAS_NORETURN. Signed-off-by: Richard Henderson Message-Id: <20180512050250.12774-3-richard.henderson@linaro.org> Signed-off-by: Laurent Vivier --- target/m68k/translate.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) -- 2.14.4 diff --git a/target/m68k/translate.c b/target/m68k/translate.c index de1be58f65..bfa30cde0a 100644 --- a/target/m68k/translate.c +++ b/target/m68k/translate.c @@ -199,7 +199,6 @@ static void do_writebacks(DisasContext *s) /* is_jmp field values */ #define DISAS_JUMP DISAS_TARGET_0 /* only pc was modified dynamically */ #define DISAS_UPDATE DISAS_TARGET_1 /* cpu state was modified dynamically */ -#define DISAS_TB_JUMP DISAS_TARGET_2 /* only pc was modified statically */ #define DISAS_JUMP_NEXT DISAS_TARGET_3 #if defined(CONFIG_USER_ONLY) @@ -1496,7 +1495,7 @@ static void gen_jmp_tb(DisasContext *s, int n, uint32_t dest) gen_jmp_im(s, dest); tcg_gen_exit_tb(NULL, 0); } - s->is_jmp = DISAS_TB_JUMP; + s->is_jmp = DISAS_NORETURN; } DISAS_INSN(scc) @@ -6148,7 +6147,6 @@ void gen_intermediate_code(CPUState *cs, TranslationBlock *tb) /* indicate that the hash table must be used to find the next TB */ tcg_gen_exit_tb(NULL, 0); break; - case DISAS_TB_JUMP: case DISAS_NORETURN: /* nothing more to generate */ break; From patchwork Mon Jun 11 10:49:29 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Vivier X-Patchwork-Id: 138218 Delivered-To: patch@linaro.org Received: by 2002:a2e:970d:0:0:0:0:0 with SMTP id r13-v6csp3900345lji; Mon, 11 Jun 2018 03:56:24 -0700 (PDT) X-Google-Smtp-Source: ADUXVKI31u9xNpRNkzzvHi1T0mzrdBVdqK5k7A1A9TYlZGCDVnlnKxOJHmEs5wRSLU7IlgPTDp3Z X-Received: by 2002:ae9:d8c1:: with SMTP id u184-v6mr14542699qkf.396.1528714584501; Mon, 11 Jun 2018 03:56:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528714584; cv=none; d=google.com; s=arc-20160816; b=Fsdhymuumaxt9tKDfs9pFnt9wwOChQjk6BzTU5m1TUDlGCqRs3024rYFWeQKIm6O0r 2B8YiVLFvXm7HTyGxJnWtbWCsiV+KlMauJ9mmP0ClYhM6+Pp8ZrLjrFkDJaumyBBONx+ EBo/2VxLPueqkJetOmpCt3u57ayw2z3QEB9tslbwnI0+744DWgIcGcX0V22N1V6l4Rb0 MsMJbMKQRJwHheo6fjCVWKrtxZviWmTBljbuCXaq+iaJ5ausVQSvGaVsUJqJouoe3PdL MGdSv400a72HCc8CT5Q20lRLeLV2bqVQzzgm+HvGZ4swDe96MqbJNOkOYT/QLclEeb0f vvYw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:references:in-reply-to :message-id:date:to:from:arc-authentication-results; bh=Hss/VdUZ7afxuSGpZoLvPtwfEZq8DIwignnbd16DFqg=; b=Y6OBmITLEvzfpoDtEJfsVd/R+Nlw0LAtCBPP7YUf2dtrvCgFROTD1bYCFs4lLC5kmO B2OoEigFwWy/bIUPrZgjNjZh2FjhZJ9YoYlsc65ivrY4jZp7TLI2Og5v4Ya270uZ8pJ0 wZoOrNGFh/gYaOAAN74DiVecDYOiJemdUbIkMAL6JnDvJflKx1iivxhdS3XYAt6KQlav x4prsqWhy09PpmBtrSmX5rgY3ly/mHqvXiaAgWBDrpjrZ6qXnzY9keF0oqaJpKuhkBjH LFwE7A3MlWF8CXgytJsB2hI9mnH8kwAY9pPofJ1E6z60NFzQEnV7eTHZFx8Dy9dwjiRH 8QQQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom=qemu-devel-bounces+patch=linaro.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id e26-v6si3453732qvb.180.2018.06.11.03.56.24 for (version=TLS1 cipher=AES128-SHA bits=128/128); Mon, 11 Jun 2018 03:56:24 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Authentication-Results: mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom=qemu-devel-bounces+patch=linaro.org@nongnu.org Received: from localhost ([::1]:47688 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fSKUq-0007Z7-1L for patch@linaro.org; Mon, 11 Jun 2018 06:56:24 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56344) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fSKOk-0002ZS-GM for qemu-devel@nongnu.org; Mon, 11 Jun 2018 06:50:10 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fSKOg-0000nL-5X for qemu-devel@nongnu.org; Mon, 11 Jun 2018 06:50:06 -0400 Received: from mout.kundenserver.de ([212.227.126.133]:39971) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fSKOf-0000lP-MB for qemu-devel@nongnu.org; Mon, 11 Jun 2018 06:50:02 -0400 Received: from localhost.localdomain ([78.238.229.36]) by mrelayeu.kundenserver.de (mreue003 [212.227.15.167]) with ESMTPSA (Nemesis) id 0MMrpj-1fKLVl2OJr-008XEY; Mon, 11 Jun 2018 12:49:47 +0200 From: Laurent Vivier To: qemu-devel@nongnu.org Date: Mon, 11 Jun 2018 12:49:29 +0200 Message-Id: <20180611104935.20499-4-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:OgKmforX4dkOkPctVyfFlhb/dF5WjieGKGuO8GgP3JSvtB2Jt4g Zy2RO8H1LBq77vw/38a7qCwB94+k4NtT6gXcqpIawZiPjEuRKq4UhC4ML5B05qXr4ylDY45 1xjx7F/XZydQvWFwC56KZOtQ8U5kHt3OGPHGlwaovhmRzXaKrkUFEmDv/7Jn2GFC+4TZYQV ea85nfZ/7Wrzc/5tIw6fg== X-UI-Out-Filterresults: notjunk:1; V01:K0:afXNlaAhi+8=:qX8MgkFiXUhEklZHH6+qIQ fL85OGegxfki1EsFjD0LDX9SEG/dCL41pNEssuuko4PazepYvTvlo1Ay9ckk5ICy57SC+3Owx kM95jH90woGibLxT1rmmzQJ6IPN7WfJx1wyrqjCFfFxHwYWJ/AzD4RP9Mm7Yj3zk7CgRqAuYm mC0gNTq3mr7cJLaW8wgq2gthPmLJTZP1n8dXnq+O9oci4EzE93oOLncrSVPW9ObjuJ2y9ptWK keY6SvDznyIDNwL+iC0EslIFtsLDG1GS5lw/D4C5YO0lnHRpgiDeg59k6hRkbHVm+4l1h1v+F Uo1suYMr/eEFD6wmKrsT/yyNDRkF9FI04jbHhFGwwlQZwF/ujHTBjsrXc8ZOwa8tXNOfq670j OBtHAoeJ4wRt58qKvC9KdJchtuPzcs2vjzPbZbKgnWtVd6x6IvlP6Gim+4xJbW+MFVnmA/g2R ke8Q++q9OHd7eVqhXU7+ufjCx2CzPoQkUxONabKbInzvXZqUmHJaGwwKA+6iAhuDURqtVfabA PaCkrKkYhnV9TLD8SyBl7Fqo8h0njKS6XopaSGtaYKGNU4UjxsgPUYKOwLFmonhi3Sty58x+I 1jJMCZqoi5LS4plZTv3tEwM1joqNTdnTzYJ9IhSshOZn+Y+wo8wbnCDitznxVqs4M/ZwKohgQ k2IhAvC+aCba5+B5FW6YgrANT4ifeckeJHy3IntfKGZPl5ktTuodLH3BC7+nehCElES4= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 212.227.126.133 Subject: [Qemu-devel] [PULL 3/9] target/m68k: Remove DISAS_JUMP_NEXT as unused 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+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Richard Henderson Signed-off-by: Richard Henderson Message-Id: <20180512050250.12774-4-richard.henderson@linaro.org> Signed-off-by: Laurent Vivier --- target/m68k/translate.c | 1 - 1 file changed, 1 deletion(-) -- 2.14.4 diff --git a/target/m68k/translate.c b/target/m68k/translate.c index bfa30cde0a..6238d9edc9 100644 --- a/target/m68k/translate.c +++ b/target/m68k/translate.c @@ -199,7 +199,6 @@ static void do_writebacks(DisasContext *s) /* is_jmp field values */ #define DISAS_JUMP DISAS_TARGET_0 /* only pc was modified dynamically */ #define DISAS_UPDATE DISAS_TARGET_1 /* cpu state was modified dynamically */ -#define DISAS_JUMP_NEXT DISAS_TARGET_3 #if defined(CONFIG_USER_ONLY) #define IS_USER(s) 1 From patchwork Mon Jun 11 10:49:30 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Vivier X-Patchwork-Id: 138211 Delivered-To: patch@linaro.org Received: by 2002:a2e:970d:0:0:0:0:0 with SMTP id r13-v6csp3898099lji; Mon, 11 Jun 2018 03:53:34 -0700 (PDT) X-Google-Smtp-Source: ADUXVKIUhIqNwi5IP69cea94c9U92KYivkIRdZIZCpposGUtBgJmUanYJJsLl5f4F3eV06S2egJq X-Received: by 2002:a37:cf0d:: with SMTP id e13-v6mr13381692qkj.203.1528714414556; Mon, 11 Jun 2018 03:53:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528714414; cv=none; d=google.com; s=arc-20160816; b=fUOcqXL4mTAGb7dWZeq+WODV4Zb7MqiTyicN06JPZSs8GPIo6usAQ61HG2ffZGtH0Y FvBNynn5vR2pvdsvX8L1DYxBOg8kLTEd3I8zRODaswgD2+3DSPrGwhE6wNgVcAdbN3Yi lDMIs6H4dg61fNmYurOAFEbjSqCYZgkajtAilUD8T3DbiXXfQaBaUqRC6LkWMAtGnTRD H3oQ1otlywkKF9EAw5SMsrFEzUH/ZVkEmQ+R+qniQul+m3kpm6hx0qdC8PyBvUpBCkSp nSWpdMfa3ESgIs1iVGjOjVxFZApmd7yZFCDMqqAG8klTzLCtTCD8poJSW55EnEAWLbLf MPYA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:references:in-reply-to :message-id:date:to:from:arc-authentication-results; bh=dMkPkqlRvM4O7IPgG6bECoUWp2Hjh3zMLl6YveG8i8M=; b=GFmm8ZsW5UQ+/+iJW6HWZ4a1N4Bty4jk+WM4R2GMDlycBPjQbnfM/z4NdZKfFwfTjX DirzwkiY2rC4Yxqger1jCxWXJGdYevlXlk3cnxqT2NjXn+BooOkxrHFiZ5HTSv9n1EUN MkTa8DyhT2xOFN2dGQdzTyVpm300+SoFQ8f4vFeDrpk425Pv4RSqVUhmn/MfjhUyQY3O r0XSAmi+FVO/jyEKnEYU6EQISIraNYdNqkjTEg7Ehi8GkKGQCGeLaX7PV9TTMvwNKb4q D/LDq/VDKqiZ1UTpS+YMVeNoRECVG08Rxzrwws2PlPSA2GRiS7kGGazYoAHDarCopDbc o7kQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom=qemu-devel-bounces+patch=linaro.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id l50-v6si4645781qtl.321.2018.06.11.03.53.34 for (version=TLS1 cipher=AES128-SHA bits=128/128); Mon, 11 Jun 2018 03:53:34 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Authentication-Results: mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom=qemu-devel-bounces+patch=linaro.org@nongnu.org Received: from localhost ([::1]:47665 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fSKRg-00056F-GF for patch@linaro.org; Mon, 11 Jun 2018 06:53:08 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56385) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fSKOm-0002bd-OG for qemu-devel@nongnu.org; Mon, 11 Jun 2018 06:50:10 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fSKOg-0000nm-NL for qemu-devel@nongnu.org; Mon, 11 Jun 2018 06:50:08 -0400 Received: from mout.kundenserver.de ([212.227.126.187]:55203) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fSKOg-0000m8-AU for qemu-devel@nongnu.org; Mon, 11 Jun 2018 06:50:02 -0400 Received: from localhost.localdomain ([78.238.229.36]) by mrelayeu.kundenserver.de (mreue003 [212.227.15.167]) with ESMTPSA (Nemesis) id 0Lvfyq-1gKK4F320C-017Xqr; Mon, 11 Jun 2018 12:49:48 +0200 From: Laurent Vivier To: qemu-devel@nongnu.org Date: Mon, 11 Jun 2018 12:49:30 +0200 Message-Id: <20180611104935.20499-5-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:IjgPmg5q801LlwIKZSY42k7eW7EjITX5dvordQC0aSBpAQGdx5H GNYnU8biMVXYKMwZlJ7YqhaWeuDBGBtm5MR7r7A/mtY61qJdBLc0BjR7PvSbqlch4PFCGk1 NzLFGxLJWIKbuVEL1BUUb7QS0uj0zYxlAg7Y5lx+VQWrSygFllGyyG27bEWfUbliHq3KQA5 Yepy5Q2/i+WLgVe78k3Mg== X-UI-Out-Filterresults: notjunk:1; V01:K0:DYHy58s5qKU=:bAipvdZuLpWTIQY7/ZO1hC wJDkuNitMD4T6FylCv+5D5zMgnt9Wlao+miWysjbu3k+xfM2dRa4zIVBhkAdhmFCwbyTweMoD 6rpb7ndjnmOQF6KYYk3X1O2ptCw1NILd9lAz/uaE/bHOqlhdJSRQ6HEOMe/w/QZ2b1n2ih6QI UrK8DGwe4yStanLQ/mqgqPTHxMpPMkjKI1hwrXvi1+Mo96Q+RwxRK9NAAKn2U/XPfaK/GW0o/ TQ1F1Zb0y5zQ8ByhDnJ6nMi32DohK2YYsw81o82MN1aMTKVjQPw0KAV93WwMn/rOf55m2YdDw O4w375dQjM5Ld0O8wEtGKWSSRQ5eNz+Wo9Z2GHJCZdmREqYMTDb3zh7F0KMfYAZQFKulAzHhJ h+LVKFdjP6hqivYDA8If+CcmNyFDuZ0Yn4rqrX16H6md+Sc3xAPI17uDFNatUkjVM4OLevV61 vt+7ywHJccdlXV7xs13deRBwB6f3m6+sQXyIEZUhb5jATyxmay6SLwM3GrLGB1nxZ0SLy/EUt o7EvwBvxgZBqU6GMX869Ze8O+hvxu8OIlhjSmBR+EGk4f4S32dHB5SZ1gf7ZzWI6Dh9HLV0S1 GUnI/jGCLpEhn8MDHnBDtNrN/y5mw0FV0VqMwdS+Dg+EtsXEC8+msBGqPqulJvb5cnTPIKZUX lfpJWVxRDULOopiaRCeym0UMK++g73k54bBDsIoZsPtwnlud5hPxLNq4FwRuDDKZVC7g= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 212.227.126.187 Subject: [Qemu-devel] [PULL 4/9] target/m68k: Use lookup_and_goto_tb for DISAS_JUMP 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+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Richard Henderson These are all indirect or out-of-page direct jumps. We can indirectly chain to the next TB without going back to the main loop. Signed-off-by: Richard Henderson Message-Id: <20180512050250.12774-5-richard.henderson@linaro.org> Signed-off-by: Laurent Vivier --- target/m68k/translate.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) -- 2.14.4 diff --git a/target/m68k/translate.c b/target/m68k/translate.c index 6238d9edc9..4b92a20c05 100644 --- a/target/m68k/translate.c +++ b/target/m68k/translate.c @@ -6139,8 +6139,11 @@ void gen_intermediate_code(CPUState *cs, TranslationBlock *tb) update_cc_op(dc); gen_jmp_tb(dc, 0, dc->pc); break; - default: case DISAS_JUMP: + /* We updated CC_OP and PC in gen_jmp/gen_jmp_im. */ + tcg_gen_lookup_and_goto_ptr(); + break; + default: case DISAS_UPDATE: update_cc_op(dc); /* indicate that the hash table must be used to find the next TB */ From patchwork Mon Jun 11 10:49:31 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Vivier X-Patchwork-Id: 138216 Delivered-To: patch@linaro.org Received: by 2002:a2e:970d:0:0:0:0:0 with SMTP id r13-v6csp3899293lji; Mon, 11 Jun 2018 03:55:11 -0700 (PDT) X-Google-Smtp-Source: ADUXVKJ/ld/HRLVfSkOLhcF/HaNMyFA28ox2Jy4Rr49qNcsJH1umDkbXSn7smBhI8+1FIo+U6j4t X-Received: by 2002:a37:1807:: with SMTP id j7-v6mr14542390qkh.333.1528714511002; Mon, 11 Jun 2018 03:55:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528714511; cv=none; d=google.com; s=arc-20160816; b=kR+JxUkB5xoHUhsszbd1fvYA3WHRQz+IJX/ZO0z6wqoBCocODAlzR5Rh2mQep0tjZf JbRUOpbh1TI6A+InlUSR3SObbPXV+05e6b2HNXbk3bIWb8qLhJEtM/THIKjXdEerFic9 zWHQ1YDrSYgcQoJlUTJAcmeyx070YmF6vB6Ir3il/CWadCUp5RpY365mKjOuoQvadUNJ HzVL+US1xqaBmiZnPjwS4DAwY3dp+NoIx4hW/hUgfS+GhupV4JIp+0qj3XkFxta9zTh+ pSa9hXb9Wi6cSvIOQjQ2mo3sSYk5iG/jBrNWCgVEoX0hUX9vI1UBBzO+9HqWdXz6jBWO hgqw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:references:in-reply-to :message-id:date:to:from:arc-authentication-results; bh=40N53AKdvTup0GNvSJf78u3VixhM5/ra1g9KGFORLU8=; b=XFv6AD4wpc7sBN1vKQIgxjRMTG55b1E9igSBuSdKGmW8T92UOxtNoPWBahioYvDs1K hjbfQguOYZjDNwOhAsrQcuqzgiLsvSxSsrGSrsc8G5IXQ8Nfrhf0YQUjRwaVpPe86O9W HfEW5AXkm2pr4V38QS42PoDfnY+yhhFWJdZ3NnYYGf2ewtZJsQVtNyzd5Q4qXYYCoZKI k5Ivx5ZwsHK31fg8UrUuTrcZjEmCHKXOfazotcvoGH5a46lTDM78NO1zV06Wm4wExHQb qMWG/yfgwjRGAMfpwq5I0pckWW4nEhK5z0nOXw7eXFG0XDuHOtErP+/Gqu8seV4Bz4gS lFUQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom=qemu-devel-bounces+patch=linaro.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id m7-v6si19910227qvo.247.2018.06.11.03.55.10 for (version=TLS1 cipher=AES128-SHA bits=128/128); Mon, 11 Jun 2018 03:55:10 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Authentication-Results: mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom=qemu-devel-bounces+patch=linaro.org@nongnu.org Received: from localhost ([::1]:47679 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fSKTe-0006jn-FD for patch@linaro.org; Mon, 11 Jun 2018 06:55:10 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56276) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fSKOf-0002TO-7n for qemu-devel@nongnu.org; Mon, 11 Jun 2018 06:50:02 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fSKOd-0000lC-Nf for qemu-devel@nongnu.org; Mon, 11 Jun 2018 06:50:01 -0400 Received: from mout.kundenserver.de ([212.227.126.130]:49987) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fSKOd-0000j8-7T for qemu-devel@nongnu.org; Mon, 11 Jun 2018 06:49:59 -0400 Received: from localhost.localdomain ([78.238.229.36]) by mrelayeu.kundenserver.de (mreue003 [212.227.15.167]) with ESMTPSA (Nemesis) id 0MEaNR-1fUpNN2mld-00FimK; Mon, 11 Jun 2018 12:49:49 +0200 From: Laurent Vivier To: qemu-devel@nongnu.org Date: Mon, 11 Jun 2018 12:49:31 +0200 Message-Id: <20180611104935.20499-6-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:+6BAKN6deKzu+xqeYC6hDupNawjRubQqDgkq5EpN6so86to3UJz dZ4XTRmt0e1K3xllKv7lE5IItICS0XJHhFCpl59DPbj+v+gyPCrw0s9YuunAyv701QIkpYv oU2nwI12h3J8FrGkuhMTwPrmx+mGdFO1cnnvCpDcwIiFbaTfsDCMTymWO14lxwsJwMe4l4J UiEepq/nNTjjnYGgTpg9w== X-UI-Out-Filterresults: notjunk:1; V01:K0:tFJv4n01P2w=:i39fdTC04vjiOKYTLDVrWe xP3LOEeV7IcAXLUI4bdXKztDHDybs49LOwMMcrqxoGFnEjMDX5aYXRAhxYnNExKzvJiaVUqK7 odPY03h2My80Hm0CIvaslH0YZJaWnBLrym8Djffnw7U+Aw2pHjMuWU61l/UKk3z7QX5d2+LG4 i+E8PF2NyB8RvS+6i0Jn3/HrYDMDYOV/MbXqJ729IbRuNWm0/iG7SKfMJy/FHITB66GPzKOlT LKnMOZypAFTTV315r10Veun2wSGoKRW58RzDEuRjgd2Fmnk9XCGzX8eWKPldtgtLZSuS1Bg7r 6hBDItyEjDJ+CYj/LQUuJ45VD0OHqIcHr74c47Ey2S71gJUFsIgP9qzwNGPnwv8v22WmyQJkk xF++1+V714g4ak3z6xVwnWiIHnLatOWEU8iZvC6sE3H1xhNTeaYrREtU4IYLxAJuZCdqmLwkA 5jcZOmCM324oe/IFssbUi20rbXJ0zXoTtO6VVYRRNv1d7mSiY0EHSToLtEIVPPy2ZSf/qitv4 Una6eYBG8U8TtNeQjk145IInbwHvNVoD6gVpMmCuRPJUI0A08A2I2GOMaziPs5XAykEtD9tgj u+CNPwk1MuAaf+Hyee/UxcVHQY1rz9kgNDGRCBh6+5RIIRJS56Sf3xmlXYPrEiVxOae196cAQ 9tkNGchI6uhHUuzNS8Nct/m0mKuFo4LFjeKRy3PkceEqZ9V4/oQSrh/ACaobIQ3w3hSw= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 212.227.126.130 Subject: [Qemu-devel] [PULL 5/9] target/m68k: Rename DISAS_UPDATE and gen_lookup_tb 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+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Richard Henderson The name gen_lookup_tb is at odds with tcg_gen_lookup_and_goto_tb. For these cases, we do indeed want to exit back to the main loop. Similarly, DISAS_UPDATE performs no actual update, whereas DISAS_EXIT does what it says. Signed-off-by: Richard Henderson Message-Id: <20180512050250.12774-6-richard.henderson@linaro.org> Signed-off-by: Laurent Vivier --- target/m68k/translate.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) -- 2.14.4 diff --git a/target/m68k/translate.c b/target/m68k/translate.c index 4b92a20c05..0cbd715550 100644 --- a/target/m68k/translate.c +++ b/target/m68k/translate.c @@ -198,7 +198,7 @@ static void do_writebacks(DisasContext *s) /* is_jmp field values */ #define DISAS_JUMP DISAS_TARGET_0 /* only pc was modified dynamically */ -#define DISAS_UPDATE DISAS_TARGET_1 /* cpu state was modified dynamically */ +#define DISAS_EXIT DISAS_TARGET_1 /* cpu state was modified dynamically */ #if defined(CONFIG_USER_ONLY) #define IS_USER(s) 1 @@ -1446,11 +1446,11 @@ static void gen_jmpcc(DisasContext *s, int cond, TCGLabel *l1) } /* Force a TB lookup after an instruction that changes the CPU state. */ -static void gen_lookup_tb(DisasContext *s) +static void gen_exit_tb(DisasContext *s) { update_cc_op(s); tcg_gen_movi_i32(QREG_PC, s->pc); - s->is_jmp = DISAS_UPDATE; + s->is_jmp = DISAS_EXIT; } #define SRC_EA(env, result, opsize, op_sign, addrp) do { \ @@ -4604,7 +4604,7 @@ DISAS_INSN(move_to_sr) return; } gen_move_to_sr(env, s, insn, false); - gen_lookup_tb(s); + gen_exit_tb(s); } DISAS_INSN(move_from_usp) @@ -4680,7 +4680,7 @@ DISAS_INSN(cf_movec) reg = DREG(ext, 12); } gen_helper_cf_movec_to(cpu_env, tcg_const_i32(ext & 0xfff), reg); - gen_lookup_tb(s); + gen_exit_tb(s); } DISAS_INSN(m68k_movec) @@ -4705,7 +4705,7 @@ DISAS_INSN(m68k_movec) } else { gen_helper_m68k_movec_from(reg, cpu_env, tcg_const_i32(ext & 0xfff)); } - gen_lookup_tb(s); + gen_exit_tb(s); } DISAS_INSN(intouch) @@ -5749,7 +5749,7 @@ DISAS_INSN(to_macsr) TCGv val; SRC_EA(env, val, OS_LONG, 0, NULL); gen_helper_set_macsr(cpu_env, val); - gen_lookup_tb(s); + gen_exit_tb(s); } DISAS_INSN(to_mask) @@ -6144,9 +6144,9 @@ void gen_intermediate_code(CPUState *cs, TranslationBlock *tb) tcg_gen_lookup_and_goto_ptr(); break; default: - case DISAS_UPDATE: - update_cc_op(dc); - /* indicate that the hash table must be used to find the next TB */ + case DISAS_EXIT: + /* We updated CC_OP and PC in gen_exit_tb, but also modified + other state that may require returning to the main loop. */ tcg_gen_exit_tb(NULL, 0); break; case DISAS_NORETURN: From patchwork Mon Jun 11 10:49:32 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Vivier X-Patchwork-Id: 138214 Delivered-To: patch@linaro.org Received: by 2002:a2e:970d:0:0:0:0:0 with SMTP id r13-v6csp3898581lji; Mon, 11 Jun 2018 03:54:13 -0700 (PDT) X-Google-Smtp-Source: ADUXVKKorNfm85SwZi6NG9g8HW2p3iqumOG63AdVYbpQCQKSXlP+QciB/qYM20DDGBaaejR5y4S1 X-Received: by 2002:a0c:f88e:: with SMTP id u14-v6mr14629161qvn.155.1528714453618; Mon, 11 Jun 2018 03:54:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528714453; cv=none; d=google.com; s=arc-20160816; b=uMNJfj5Ol7/4vHJLSGOB5ghKU5227hrALMt5/Cxr62e132pBawPicu76UnkaUE9VFh aMbmnOJGS3s9btEq1nh0Uz7+/AtVwJaWr2WhLdWtfJ8eM9f3x4/fjitMMPsHDfGrh7dx H39mLKH2ivJHAicPw9qh1mibcwsayfMhzxKrTksjPIWaWtBaovi5o8pka6Pkqp5l5p5H MItTounr1XFvkBeAIl9yfXY+61d44TiZmFMDd26xeT6RznhKxErgeb8L3i12oM+Fgy9S uYrdmKnyTUdHV6lpQWhZ/ZIrtWasuwQx4MwCBfDCFmOAfcW81Xf7x09eTu4i2Hu/TLY5 pXAg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:references:in-reply-to :message-id:date:to:from:arc-authentication-results; bh=3ZcNZnuookVDC7tqT/quShh0+rYYP78Noydmpf4XyoI=; b=kw5NWGpSkkOZr0hTx4C46ibtzabTv9yKRMUEZKSvPJe3Jyv0e+eKTVaJyuXHnbFBUJ dbrFGw2LzJfA8gLAtZoUty22ix88l82ijwZts3drvP19hGQfC5nc6ScRndqcSoxCHqAV IkNr3KqV8RxsHARB6AlZ4+wpI1/g/RK+1n/GnZRJJMHd2E7O/AQUwoOUl0eVSs2CX9SY CziRDxT16I91DBH1pTVW8k1Nl4FmfLLfD+A+hR6hAag42brEEXm0q/AfmFPD0y3nQJK+ 0BR/+jKctcP4vHABY5HJHYw3E5VT39YYlcsw/HQFk0foaY4/OcZ33Zu98nm7Z4DGg4EJ /6ZQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom=qemu-devel-bounces+patch=linaro.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id p5-v6si18836700qkc.230.2018.06.11.03.54.13 for (version=TLS1 cipher=AES128-SHA bits=128/128); Mon, 11 Jun 2018 03:54:13 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Authentication-Results: mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom=qemu-devel-bounces+patch=linaro.org@nongnu.org Received: from localhost ([::1]:47668 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fSKSj-0005cp-3O for patch@linaro.org; Mon, 11 Jun 2018 06:54:13 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56313) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fSKOh-0002UN-8y for qemu-devel@nongnu.org; Mon, 11 Jun 2018 06:50:10 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fSKOe-0000mC-RK for qemu-devel@nongnu.org; Mon, 11 Jun 2018 06:50:03 -0400 Received: from mout.kundenserver.de ([212.227.126.130]:41753) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fSKOe-0000jy-3j for qemu-devel@nongnu.org; Mon, 11 Jun 2018 06:50:00 -0400 Received: from localhost.localdomain ([78.238.229.36]) by mrelayeu.kundenserver.de (mreue003 [212.227.15.167]) with ESMTPSA (Nemesis) id 0MJHKw-1fPaIp2sTy-002mbv; Mon, 11 Jun 2018 12:49:50 +0200 From: Laurent Vivier To: qemu-devel@nongnu.org Date: Mon, 11 Jun 2018 12:49:32 +0200 Message-Id: <20180611104935.20499-7-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:t+3SyEqmGDkZoiEN6fM7dviYW++fkaHVrcMzbQ+xfyZULC0UrEF 5mppCAKDJWn2WT8wjLVaE+/Zov7CFxnfXxuNT9tTaWnJS60JRIIUTLDkEayXYyZtTWf626+ pY2SzleH0ZGkl9RCm+VqEUoJBHlwBvJR3dkuQSK4JaQ0Zvy8EFDEmRif145zjTSDMH9KyVk qyH18W9KqJ+5hju8m9C3g== X-UI-Out-Filterresults: notjunk:1; V01:K0:ZNBpua/0rXE=:HpUDmphmJGCBtVb5GCJBru kbbhK74rm7qFoARdJgPoqVQda9kwEvudlfcDLljDOiDQkJKbX93h+okxZgYfewfdZ5gZgWr2D RKWNPUPMpLCdOw5CMM5/uTxveGWcloM8bZyTFi4Ieers1HbYeCvk+pI2etjCqK+Ckeao8mSll FCxspmJ6ohA23Uda5WMCG2Xy1AxbFUlZKDHkouAmDETf8xGPA88cRI8YWyEOnXN3U6+/+5emr 1S8Lb929pqePM24RqAyvyrMAibP8yyoccWYIEb1eKONvwqgmQznWLz8LpwQYqUF4hCI3tQzJo Nyrw8tRYAaIZK6vxScBmmkoOvVWe6QerDbnX0zvvHyosBJod9z+TG6lkjN0Wj6oNGw4XBITou JtEFMddNeAX4wRh/BZHyWEZ8C/ebWEi1OgO66Cr/0rJaia9XBSuMz5eRZFGbiBVcx4K9CLKk0 UYR8D81wYLurOiluTwz3jcYZkXpCn5x8dmhFPWPL4ZT+dTlP4Y4hqu4WuqwMbVCjxefl1uBai FKChr3TCe4JpsVqyCLVn2lwjazCgv73+H2zPFqZ3r/6ot68G67yntdIYUsOaLrVvXItnILlHg t07H3Uzut5roG9M/NT1NDN2g9JvqSLh/tvfug2XPQIY0GhqbsSbRnmnedGJCHIgtngDcvIV3b 9bzlW8qC/1E2yNZ6pUoq/9ixmy+xVrd/OFAQqkHzbKTiJBtEgS4dpLBCm0PKLOTqKz3s= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 212.227.126.130 Subject: [Qemu-devel] [PULL 6/9] target/m68k: Convert to DisasContextBase 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+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Richard Henderson Removed ctx->insn_pc in favour of ctx->base.pc_next. Yes, it is annoying, but didn't want to waste its 4 bytes. Signed-off-by: Richard Henderson Message-Id: <20180512050250.12774-7-richard.henderson@linaro.org> Signed-off-by: Laurent Vivier --- target/m68k/translate.c | 137 +++++++++++++++++++++++------------------------- 1 file changed, 67 insertions(+), 70 deletions(-) -- 2.14.4 diff --git a/target/m68k/translate.c b/target/m68k/translate.c index 0cbd715550..12a74b0b59 100644 --- a/target/m68k/translate.c +++ b/target/m68k/translate.c @@ -111,14 +111,11 @@ void m68k_tcg_init(void) /* internal defines */ typedef struct DisasContext { + DisasContextBase base; CPUM68KState *env; - target_ulong insn_pc; /* Start of the current instruction. */ target_ulong pc; - int is_jmp; CCOp cc_op; /* Current CC operation */ int cc_op_synced; - struct TranslationBlock *tb; - int singlestep_enabled; TCGv_i64 mactmp; int done_mac; int writeback_mask; @@ -203,10 +200,10 @@ static void do_writebacks(DisasContext *s) #if defined(CONFIG_USER_ONLY) #define IS_USER(s) 1 #else -#define IS_USER(s) (!(s->tb->flags & TB_FLAGS_MSR_S)) -#define SFC_INDEX(s) ((s->tb->flags & TB_FLAGS_SFC_S) ? \ +#define IS_USER(s) (!(s->base.tb->flags & TB_FLAGS_MSR_S)) +#define SFC_INDEX(s) ((s->base.tb->flags & TB_FLAGS_SFC_S) ? \ MMU_KERNEL_IDX : MMU_USER_IDX) -#define DFC_INDEX(s) ((s->tb->flags & TB_FLAGS_DFC_S) ? \ +#define DFC_INDEX(s) ((s->base.tb->flags & TB_FLAGS_DFC_S) ? \ MMU_KERNEL_IDX : MMU_USER_IDX) #endif @@ -278,7 +275,7 @@ static void gen_jmp_im(DisasContext *s, uint32_t dest) { update_cc_op(s); tcg_gen_movi_i32(QREG_PC, dest); - s->is_jmp = DISAS_JUMP; + s->base.is_jmp = DISAS_JUMP; } /* Generate a jump to the address in qreg DEST. */ @@ -286,7 +283,7 @@ static void gen_jmp(DisasContext *s, TCGv dest) { update_cc_op(s); tcg_gen_mov_i32(QREG_PC, dest); - s->is_jmp = DISAS_JUMP; + s->base.is_jmp = DISAS_JUMP; } static void gen_exception(DisasContext *s, uint32_t dest, int nr) @@ -300,12 +297,12 @@ static void gen_exception(DisasContext *s, uint32_t dest, int nr) gen_helper_raise_exception(cpu_env, tmp); tcg_temp_free_i32(tmp); - s->is_jmp = DISAS_NORETURN; + s->base.is_jmp = DISAS_NORETURN; } static inline void gen_addr_fault(DisasContext *s) { - gen_exception(s, s->insn_pc, EXCP_ADDRESS); + gen_exception(s, s->base.pc_next, EXCP_ADDRESS); } /* Generate a load from the specified address. Narrow values are @@ -1003,7 +1000,7 @@ static void gen_load_fp(DisasContext *s, int opsize, TCGv addr, TCGv_ptr fp, break; case OS_EXTENDED: if (m68k_feature(s->env, M68K_FEATURE_CF_FPU)) { - gen_exception(s, s->insn_pc, EXCP_FP_UNIMP); + gen_exception(s, s->base.pc_next, EXCP_FP_UNIMP); break; } tcg_gen_qemu_ld32u(tmp, addr, index); @@ -1017,7 +1014,7 @@ static void gen_load_fp(DisasContext *s, int opsize, TCGv addr, TCGv_ptr fp, /* unimplemented data type on 68040/ColdFire * FIXME if needed for another FPU */ - gen_exception(s, s->insn_pc, EXCP_FP_UNIMP); + gen_exception(s, s->base.pc_next, EXCP_FP_UNIMP); break; default: g_assert_not_reached(); @@ -1057,7 +1054,7 @@ static void gen_store_fp(DisasContext *s, int opsize, TCGv addr, TCGv_ptr fp, break; case OS_EXTENDED: if (m68k_feature(s->env, M68K_FEATURE_CF_FPU)) { - gen_exception(s, s->insn_pc, EXCP_FP_UNIMP); + gen_exception(s, s->base.pc_next, EXCP_FP_UNIMP); break; } tcg_gen_ld16u_i32(tmp, fp, offsetof(FPReg, l.upper)); @@ -1071,7 +1068,7 @@ static void gen_store_fp(DisasContext *s, int opsize, TCGv addr, TCGv_ptr fp, /* unimplemented data type on 68040/ColdFire * FIXME if needed for another FPU */ - gen_exception(s, s->insn_pc, EXCP_FP_UNIMP); + gen_exception(s, s->base.pc_next, EXCP_FP_UNIMP); break; default: g_assert_not_reached(); @@ -1203,7 +1200,7 @@ static int gen_ea_mode_fp(CPUM68KState *env, DisasContext *s, int mode, break; case OS_EXTENDED: if (m68k_feature(s->env, M68K_FEATURE_CF_FPU)) { - gen_exception(s, s->insn_pc, EXCP_FP_UNIMP); + gen_exception(s, s->base.pc_next, EXCP_FP_UNIMP); break; } tmp = tcg_const_i32(read_im32(env, s) >> 16); @@ -1217,7 +1214,7 @@ static int gen_ea_mode_fp(CPUM68KState *env, DisasContext *s, int mode, /* unimplemented data type on 68040/ColdFire * FIXME if needed for another FPU */ - gen_exception(s, s->insn_pc, EXCP_FP_UNIMP); + gen_exception(s, s->base.pc_next, EXCP_FP_UNIMP); break; default: g_assert_not_reached(); @@ -1450,7 +1447,7 @@ static void gen_exit_tb(DisasContext *s) { update_cc_op(s); tcg_gen_movi_i32(QREG_PC, s->pc); - s->is_jmp = DISAS_EXIT; + s->base.is_jmp = DISAS_EXIT; } #define SRC_EA(env, result, opsize, op_sign, addrp) do { \ @@ -1474,8 +1471,8 @@ static void gen_exit_tb(DisasContext *s) static inline bool use_goto_tb(DisasContext *s, uint32_t dest) { #ifndef CONFIG_USER_ONLY - return (s->tb->pc & TARGET_PAGE_MASK) == (dest & TARGET_PAGE_MASK) || - (s->insn_pc & TARGET_PAGE_MASK) == (dest & TARGET_PAGE_MASK); + return (s->base.pc_first & TARGET_PAGE_MASK) == (dest & TARGET_PAGE_MASK) + || (s->base.pc_next & TARGET_PAGE_MASK) == (dest & TARGET_PAGE_MASK); #else return true; #endif @@ -1484,17 +1481,17 @@ static inline bool use_goto_tb(DisasContext *s, uint32_t dest) /* Generate a jump to an immediate address. */ static void gen_jmp_tb(DisasContext *s, int n, uint32_t dest) { - if (unlikely(s->singlestep_enabled)) { + if (unlikely(s->base.singlestep_enabled)) { gen_exception(s, dest, EXCP_DEBUG); } else if (use_goto_tb(s, dest)) { tcg_gen_goto_tb(n); tcg_gen_movi_i32(QREG_PC, dest); - tcg_gen_exit_tb(s->tb, n); + tcg_gen_exit_tb(s->base.tb, n); } else { gen_jmp_im(s, dest); tcg_gen_exit_tb(NULL, 0); } - s->is_jmp = DISAS_NORETURN; + s->base.is_jmp = DISAS_NORETURN; } DISAS_INSN(scc) @@ -1541,12 +1538,12 @@ DISAS_INSN(dbcc) DISAS_INSN(undef_mac) { - gen_exception(s, s->insn_pc, EXCP_LINEA); + gen_exception(s, s->base.pc_next, EXCP_LINEA); } DISAS_INSN(undef_fpu) { - gen_exception(s, s->insn_pc, EXCP_LINEF); + gen_exception(s, s->base.pc_next, EXCP_LINEF); } DISAS_INSN(undef) @@ -1555,8 +1552,8 @@ DISAS_INSN(undef) for the 680x0 series, as well as those that are implemented but actually illegal for CPU32 or pre-68020. */ qemu_log_mask(LOG_UNIMP, "Illegal instruction: %04x @ %08x\n", - insn, s->insn_pc); - gen_exception(s, s->insn_pc, EXCP_UNSUPPORTED); + insn, s->base.pc_next); + gen_exception(s, s->base.pc_next, EXCP_UNSUPPORTED); } DISAS_INSN(mulw) @@ -1616,7 +1613,7 @@ DISAS_INSN(divl) if (ext & 0x400) { if (!m68k_feature(s->env, M68K_FEATURE_QUAD_MULDIV)) { - gen_exception(s, s->insn_pc, EXCP_ILLEGAL); + gen_exception(s, s->base.pc_next, EXCP_ILLEGAL); return; } @@ -2310,7 +2307,7 @@ DISAS_INSN(arith_im) break; case OS_WORD: if (IS_USER(s)) { - gen_exception(s, s->insn_pc, EXCP_PRIVILEGE); + gen_exception(s, s->base.pc_next, EXCP_PRIVILEGE); return; } src1 = gen_get_sr(s); @@ -2479,7 +2476,7 @@ DISAS_INSN(cas2w) (REG(ext1, 6) << 3) | (REG(ext2, 0) << 6) | (REG(ext1, 0) << 9)); - if (tb_cflags(s->tb) & CF_PARALLEL) { + if (tb_cflags(s->base.tb) & CF_PARALLEL) { gen_helper_exit_atomic(cpu_env); } else { gen_helper_cas2w(cpu_env, regs, addr1, addr2); @@ -2529,7 +2526,7 @@ DISAS_INSN(cas2l) (REG(ext1, 6) << 3) | (REG(ext2, 0) << 6) | (REG(ext1, 0) << 9)); - if (tb_cflags(s->tb) & CF_PARALLEL) { + if (tb_cflags(s->base.tb) & CF_PARALLEL) { gen_helper_cas2l_parallel(cpu_env, regs, addr1, addr2); } else { gen_helper_cas2l(cpu_env, regs, addr1, addr2); @@ -2720,7 +2717,7 @@ DISAS_INSN(swap) DISAS_INSN(bkpt) { - gen_exception(s, s->insn_pc, EXCP_DEBUG); + gen_exception(s, s->base.pc_next, EXCP_DEBUG); } DISAS_INSN(pea) @@ -2773,7 +2770,7 @@ DISAS_INSN(pulse) DISAS_INSN(illegal) { - gen_exception(s, s->insn_pc, EXCP_ILLEGAL); + gen_exception(s, s->base.pc_next, EXCP_ILLEGAL); } /* ??? This should be atomic. */ @@ -2803,7 +2800,7 @@ DISAS_INSN(mull) if (ext & 0x400) { if (!m68k_feature(s->env, M68K_FEATURE_QUAD_MULDIV)) { - gen_exception(s, s->insn_pc, EXCP_UNSUPPORTED); + gen_exception(s, s->base.pc_next, EXCP_UNSUPPORTED); return; } @@ -2904,7 +2901,7 @@ DISAS_INSN(unlk) DISAS_INSN(reset) { if (IS_USER(s)) { - gen_exception(s, s->insn_pc, EXCP_PRIVILEGE); + gen_exception(s, s->base.pc_next, EXCP_PRIVILEGE); return; } @@ -4375,7 +4372,7 @@ DISAS_INSN(chk) } /* fallthru */ default: - gen_exception(s, s->insn_pc, EXCP_ILLEGAL); + gen_exception(s, s->base.pc_next, EXCP_ILLEGAL); return; } SRC_EA(env, src, opsize, 1, NULL); @@ -4402,13 +4399,13 @@ DISAS_INSN(chk2) opsize = OS_LONG; break; default: - gen_exception(s, s->insn_pc, EXCP_ILLEGAL); + gen_exception(s, s->base.pc_next, EXCP_ILLEGAL); return; } ext = read_im16(env, s); if ((ext & 0x0800) == 0) { - gen_exception(s, s->insn_pc, EXCP_ILLEGAL); + gen_exception(s, s->base.pc_next, EXCP_ILLEGAL); return; } @@ -4468,7 +4465,7 @@ DISAS_INSN(move16_reg) ext = read_im16(env, s); if ((ext & (1 << 15)) == 0) { - gen_exception(s, s->insn_pc, EXCP_ILLEGAL); + gen_exception(s, s->base.pc_next, EXCP_ILLEGAL); } m68k_copy_line(AREG(ext, 12), AREG(insn, 0), index); @@ -4530,7 +4527,7 @@ DISAS_INSN(move_from_sr) TCGv sr; if (IS_USER(s) && !m68k_feature(env, M68K_FEATURE_M68000)) { - gen_exception(s, s->insn_pc, EXCP_PRIVILEGE); + gen_exception(s, s->base.pc_next, EXCP_PRIVILEGE); return; } sr = gen_get_sr(s); @@ -4547,7 +4544,7 @@ DISAS_INSN(moves) int extend; if (IS_USER(s)) { - gen_exception(s, s->insn_pc, EXCP_PRIVILEGE); + gen_exception(s, s->base.pc_next, EXCP_PRIVILEGE); return; } @@ -4600,7 +4597,7 @@ DISAS_INSN(moves) DISAS_INSN(move_to_sr) { if (IS_USER(s)) { - gen_exception(s, s->insn_pc, EXCP_PRIVILEGE); + gen_exception(s, s->base.pc_next, EXCP_PRIVILEGE); return; } gen_move_to_sr(env, s, insn, false); @@ -4610,7 +4607,7 @@ DISAS_INSN(move_to_sr) DISAS_INSN(move_from_usp) { if (IS_USER(s)) { - gen_exception(s, s->insn_pc, EXCP_PRIVILEGE); + gen_exception(s, s->base.pc_next, EXCP_PRIVILEGE); return; } tcg_gen_ld_i32(AREG(insn, 0), cpu_env, @@ -4620,7 +4617,7 @@ DISAS_INSN(move_from_usp) DISAS_INSN(move_to_usp) { if (IS_USER(s)) { - gen_exception(s, s->insn_pc, EXCP_PRIVILEGE); + gen_exception(s, s->base.pc_next, EXCP_PRIVILEGE); return; } tcg_gen_st_i32(AREG(insn, 0), cpu_env, @@ -4630,7 +4627,7 @@ DISAS_INSN(move_to_usp) DISAS_INSN(halt) { if (IS_USER(s)) { - gen_exception(s, s->insn_pc, EXCP_PRIVILEGE); + gen_exception(s, s->base.pc_next, EXCP_PRIVILEGE); return; } @@ -4642,7 +4639,7 @@ DISAS_INSN(stop) uint16_t ext; if (IS_USER(s)) { - gen_exception(s, s->insn_pc, EXCP_PRIVILEGE); + gen_exception(s, s->base.pc_next, EXCP_PRIVILEGE); return; } @@ -4656,10 +4653,10 @@ DISAS_INSN(stop) DISAS_INSN(rte) { if (IS_USER(s)) { - gen_exception(s, s->insn_pc, EXCP_PRIVILEGE); + gen_exception(s, s->base.pc_next, EXCP_PRIVILEGE); return; } - gen_exception(s, s->insn_pc, EXCP_RTE); + gen_exception(s, s->base.pc_next, EXCP_RTE); } DISAS_INSN(cf_movec) @@ -4668,7 +4665,7 @@ DISAS_INSN(cf_movec) TCGv reg; if (IS_USER(s)) { - gen_exception(s, s->insn_pc, EXCP_PRIVILEGE); + gen_exception(s, s->base.pc_next, EXCP_PRIVILEGE); return; } @@ -4689,7 +4686,7 @@ DISAS_INSN(m68k_movec) TCGv reg; if (IS_USER(s)) { - gen_exception(s, s->insn_pc, EXCP_PRIVILEGE); + gen_exception(s, s->base.pc_next, EXCP_PRIVILEGE); return; } @@ -4711,7 +4708,7 @@ DISAS_INSN(m68k_movec) DISAS_INSN(intouch) { if (IS_USER(s)) { - gen_exception(s, s->insn_pc, EXCP_PRIVILEGE); + gen_exception(s, s->base.pc_next, EXCP_PRIVILEGE); return; } /* ICache fetch. Implement as no-op. */ @@ -4720,7 +4717,7 @@ DISAS_INSN(intouch) DISAS_INSN(cpushl) { if (IS_USER(s)) { - gen_exception(s, s->insn_pc, EXCP_PRIVILEGE); + gen_exception(s, s->base.pc_next, EXCP_PRIVILEGE); return; } /* Cache push/invalidate. Implement as no-op. */ @@ -4729,7 +4726,7 @@ DISAS_INSN(cpushl) DISAS_INSN(cpush) { if (IS_USER(s)) { - gen_exception(s, s->insn_pc, EXCP_PRIVILEGE); + gen_exception(s, s->base.pc_next, EXCP_PRIVILEGE); return; } /* Cache push/invalidate. Implement as no-op. */ @@ -4738,7 +4735,7 @@ DISAS_INSN(cpush) DISAS_INSN(cinv) { if (IS_USER(s)) { - gen_exception(s, s->insn_pc, EXCP_PRIVILEGE); + gen_exception(s, s->base.pc_next, EXCP_PRIVILEGE); return; } /* Invalidate cache line. Implement as no-op. */ @@ -4750,7 +4747,7 @@ DISAS_INSN(pflush) TCGv opmode; if (IS_USER(s)) { - gen_exception(s, s->insn_pc, EXCP_PRIVILEGE); + gen_exception(s, s->base.pc_next, EXCP_PRIVILEGE); return; } @@ -4764,7 +4761,7 @@ DISAS_INSN(ptest) TCGv is_read; if (IS_USER(s)) { - gen_exception(s, s->insn_pc, EXCP_PRIVILEGE); + gen_exception(s, s->base.pc_next, EXCP_PRIVILEGE); return; } is_read = tcg_const_i32((insn >> 5) & 1); @@ -4775,7 +4772,7 @@ DISAS_INSN(ptest) DISAS_INSN(wddata) { - gen_exception(s, s->insn_pc, EXCP_PRIVILEGE); + gen_exception(s, s->base.pc_next, EXCP_PRIVILEGE); } DISAS_INSN(wdebug) @@ -4783,7 +4780,7 @@ DISAS_INSN(wdebug) M68kCPU *cpu = m68k_env_get_cpu(env); if (IS_USER(s)) { - gen_exception(s, s->insn_pc, EXCP_PRIVILEGE); + gen_exception(s, s->base.pc_next, EXCP_PRIVILEGE); return; } /* TODO: Implement wdebug. */ @@ -4793,7 +4790,7 @@ DISAS_INSN(wdebug) DISAS_INSN(trap) { - gen_exception(s, s->insn_pc, EXCP_TRAP0 + (insn & 0xf)); + gen_exception(s, s->base.pc_next, EXCP_TRAP0 + (insn & 0xf)); } static void gen_load_fcr(DisasContext *s, TCGv res, int reg) @@ -4860,7 +4857,7 @@ static void gen_op_fmove_fcr(CPUM68KState *env, DisasContext *s, switch (mode) { case 0: /* Dn */ if (mask != M68K_FPIAR && mask != M68K_FPSR && mask != M68K_FPCR) { - gen_exception(s, s->insn_pc, EXCP_ILLEGAL); + gen_exception(s, s->base.pc_next, EXCP_ILLEGAL); return; } if (is_write) { @@ -4871,7 +4868,7 @@ static void gen_op_fmove_fcr(CPUM68KState *env, DisasContext *s, return; case 1: /* An, only with FPIAR */ if (mask != M68K_FPIAR) { - gen_exception(s, s->insn_pc, EXCP_ILLEGAL); + gen_exception(s, s->base.pc_next, EXCP_ILLEGAL); return; } if (is_write) { @@ -5429,7 +5426,7 @@ DISAS_INSN(frestore) TCGv addr; if (IS_USER(s)) { - gen_exception(s, s->insn_pc, EXCP_PRIVILEGE); + gen_exception(s, s->base.pc_next, EXCP_PRIVILEGE); return; } if (m68k_feature(s->env, M68K_FEATURE_M68040)) { @@ -5443,7 +5440,7 @@ DISAS_INSN(frestore) DISAS_INSN(fsave) { if (IS_USER(s)) { - gen_exception(s, s->insn_pc, EXCP_PRIVILEGE); + gen_exception(s, s->base.pc_next, EXCP_PRIVILEGE); return; } @@ -6075,14 +6072,14 @@ void gen_intermediate_code(CPUState *cs, TranslationBlock *tb) /* generate intermediate code */ pc_start = tb->pc; - dc->tb = tb; + dc->base.tb = tb; dc->env = env; - dc->is_jmp = DISAS_NEXT; + dc->base.is_jmp = DISAS_NEXT; dc->pc = pc_start; dc->cc_op = CC_OP_DYNAMIC; dc->cc_op_synced = 1; - dc->singlestep_enabled = cs->singlestep_enabled; + dc->base.singlestep_enabled = cs->singlestep_enabled; dc->done_mac = 0; dc->writeback_mask = 0; num_insns = 0; @@ -6116,9 +6113,9 @@ void gen_intermediate_code(CPUState *cs, TranslationBlock *tb) gen_io_start(); } - dc->insn_pc = dc->pc; + dc->base.pc_next = dc->pc; disas_m68k_insn(env, dc); - } while (!dc->is_jmp && !tcg_op_buf_full() && + } while (!dc->base.is_jmp && !tcg_op_buf_full() && !cs->singlestep_enabled && !singlestep && (pc_offset) < (TARGET_PAGE_SIZE - 32) && @@ -6128,13 +6125,13 @@ void gen_intermediate_code(CPUState *cs, TranslationBlock *tb) gen_io_end(); if (unlikely(cs->singlestep_enabled)) { /* Make sure the pc is updated, and raise a debug exception. */ - if (!dc->is_jmp) { + if (!dc->base.is_jmp) { update_cc_op(dc); tcg_gen_movi_i32(QREG_PC, dc->pc); } gen_helper_raise_exception(cpu_env, tcg_const_i32(EXCP_DEBUG)); } else { - switch(dc->is_jmp) { + switch (dc->base.is_jmp) { case DISAS_NEXT: update_cc_op(dc); gen_jmp_tb(dc, 0, dc->pc); From patchwork Mon Jun 11 10:49:33 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Vivier X-Patchwork-Id: 138224 Delivered-To: patch@linaro.org Received: by 2002:a2e:970d:0:0:0:0:0 with SMTP id r13-v6csp3902483lji; Mon, 11 Jun 2018 03:59:18 -0700 (PDT) X-Google-Smtp-Source: ADUXVKJRZJY8FpV276mFhhWB4KysuC/6JcsAWJqCLU5rd2QoEEfduaDmTQ1MT1oZrSRdmWftk3Wt X-Received: by 2002:a37:b401:: with SMTP id d1-v6mr14367138qkf.332.1528714758887; Mon, 11 Jun 2018 03:59:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528714758; cv=none; d=google.com; s=arc-20160816; b=Vg/jK4h5XXsbKwiPWPZ+eVQZMfiy5IeURdUAA0jHlY3EK4oof09+JfphIvQ+TyzxoM EEsZV3OFFSxhVihEuxco8dFVZI1TijXRDOiVyCNY3SCbLAvadnNG5MvmQwh2bhiqFcuk 0aduR5+vQYNjFbZew+GZsWRhsBG+xcVlNr/AZLkGCaVbpy3GqRDZ6M4/5TmXKUP7gMsB ghqrbvEyFF8X32KmWYPazGfBpAsxPNN5ZUEN4D60bt/H8kxI2+ohmP3VwQanqcZx2wS7 /o1KyRn16QN64/iKkVRlbCnHbVxGBue7YEQ4B0rmUOfOHhSscFV6DURgyGmdlHBuPTu3 Op0g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:references:in-reply-to :message-id:date:to:from:arc-authentication-results; bh=cUCkb2nYhc/GuLOAixpNex+2SPicyzUBgobMXIPiEsM=; b=wR1W2cQXBzta4uFr6vUt+tf6j98dVU6vaO+TsJGTV6eXb/CdmMo94+VRUArNy8739+ g03xZkjYoi+csy1fdj3Qj7Po+k4qlxcpFZseACAPs7KFzDtA34gb5o6wSZKwN+O3vuh2 p1ZjMTI8T9fDnbLmO0G7oJPaMZDJ/IqSfOEEsugI72Ee1Dj/JGQoTG5GEYE1MPZEM2ZR CA+ORHW6Ywq6+I/bJZWRcoYRywHfIMsaNsSXHaMljlCLxfwHl82hR3jTlraz+UTe9J4v f/RWm+vuVXNCO7OQd5+USE51G1RfauxaLEOaIEtMRAqL2FBep4sslzUtQnk2B2J6Us1I Cybg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom=qemu-devel-bounces+patch=linaro.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id k5-v6si2228036qkb.128.2018.06.11.03.59.18 for (version=TLS1 cipher=AES128-SHA bits=128/128); Mon, 11 Jun 2018 03:59:18 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Authentication-Results: mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom=qemu-devel-bounces+patch=linaro.org@nongnu.org Received: from localhost ([::1]:47702 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fSKXe-0001MU-Dz for patch@linaro.org; Mon, 11 Jun 2018 06:59:18 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56339) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fSKOk-0002X1-26 for qemu-devel@nongnu.org; Mon, 11 Jun 2018 06:50:10 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fSKOf-0000mp-OT for qemu-devel@nongnu.org; Mon, 11 Jun 2018 06:50:06 -0400 Received: from mout.kundenserver.de ([212.227.126.130]:36959) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fSKOf-0000lA-96 for qemu-devel@nongnu.org; Mon, 11 Jun 2018 06:50:01 -0400 Received: from localhost.localdomain ([78.238.229.36]) by mrelayeu.kundenserver.de (mreue003 [212.227.15.167]) with ESMTPSA (Nemesis) id 0LeyRX-1g2Vxx3pOx-00qhgo; Mon, 11 Jun 2018 12:49:51 +0200 From: Laurent Vivier To: qemu-devel@nongnu.org Date: Mon, 11 Jun 2018 12:49:33 +0200 Message-Id: <20180611104935.20499-8-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:2jkxnmMzSOFDvAZkRGyfgWULs/6xV8czI9ehYuojr152/CZ1gNy pNvMejcMxCiRgiPfiQlz7/VmzJ6Ybd1Yg7cnQ2TxTO8gId7z73LFOW8SsYrsP7i21WcSfuk fx8PDM60Pf1XS4kQDToEziBeIFTF9/WRAnK/YiM1AmRkJwIAzuXTfVcogM+Z4/4yRkE8PdM z9FRRwx5oXyiFwe0PvXFQ== X-UI-Out-Filterresults: notjunk:1; V01:K0:SouSPykwuOU=:F4LmCDJnXJPoxGnFMgBPsK 4eubJrP/kwRsud5Sb6n9mipdr2CL9u5NbZ+BIs4dRzJGt2ZSsgXFpzqj/PRp/GIxDZh7e+foI 1ZvfaluXKaFlmQLm5gOa5z2Atar94puRV5zqShXvt+OI0rNyrycqXwavtHkrmYEX6bz/Bf596 nWerOslpKbRsuFjPdV+if0b/MRJ58M0hxbYqmTO64BmRhTfbpEqAkltS3akYhdbnXDq7kXMRa 1Jihnh5D0e50HqUHdlUuxcGy/CIoeTVWOCn5j4lszAxs/6w9Bxwces+0a7vILVGBOXnQMSFit 7fGsEI/uBFPg4Xz8NzmcmKbYeL47Q4j8qChghnHs35mSJo+NKHIIvwxlvBxVy5Mr6nzOmnr5u QarEyumNWnEHsn9d0asJXtIbp9QfMTwQtjFM3BTBdxUDPejIZJmJVHu/fVOFQNVt4+eLgRj7y 5BUwMiiI14P64xBO6moZgF5GuGsOEVE+Y+Gr9QFURW0X0o/ALRxK8BakBT6jQBeyaTgdAm75P 8mpJaYT5CW7icVk0FG3KxHWszeKFwiy62NbHypcu//hRFNO3VjcfCxVpUHmebt+FKicsvjS5c qNJ1hphRspN85skT/A6XBOT3CpXRPDfL0uxuGiT7nrFyVtihsMYPvZtgewozp4llP5F8SvTWl VnuZi4GyiD1frg/D4ZQcZ0Jsbdfx6bDrxpJeQ4vxjk/gtNKLqGM/kKsuLP9gV8pU+FkA= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 212.227.126.130 Subject: [Qemu-devel] [PULL 7/9] target/m68k: Convert to TranslatorOps 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+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Richard Henderson Signed-off-by: Richard Henderson Message-Id: <20180512050250.12774-8-richard.henderson@linaro.org> Signed-off-by: Laurent Vivier --- target/m68k/translate.c | 180 +++++++++++++++++++++++------------------------- 1 file changed, 88 insertions(+), 92 deletions(-) -- 2.14.4 diff --git a/target/m68k/translate.c b/target/m68k/translate.c index 12a74b0b59..62a96bedcd 100644 --- a/target/m68k/translate.c +++ b/target/m68k/translate.c @@ -6059,113 +6059,109 @@ static void disas_m68k_insn(CPUM68KState * env, DisasContext *s) do_release(s); } -/* generate intermediate code for basic block 'tb'. */ -void gen_intermediate_code(CPUState *cs, TranslationBlock *tb) +static void m68k_tr_init_disas_context(DisasContextBase *dcbase, CPUState *cpu) { - CPUM68KState *env = cs->env_ptr; - DisasContext dc1, *dc = &dc1; - target_ulong pc_start; - int pc_offset; - int num_insns; - int max_insns; - - /* generate intermediate code */ - pc_start = tb->pc; - - dc->base.tb = tb; + DisasContext *dc = container_of(dcbase, DisasContext, base); + CPUM68KState *env = cpu->env_ptr; dc->env = env; - dc->base.is_jmp = DISAS_NEXT; - dc->pc = pc_start; + dc->pc = dc->base.pc_first; dc->cc_op = CC_OP_DYNAMIC; dc->cc_op_synced = 1; - dc->base.singlestep_enabled = cs->singlestep_enabled; dc->done_mac = 0; dc->writeback_mask = 0; - num_insns = 0; - max_insns = tb_cflags(tb) & CF_COUNT_MASK; - if (max_insns == 0) { - max_insns = CF_COUNT_MASK; - } - if (max_insns > TCG_MAX_INSNS) { - max_insns = TCG_MAX_INSNS; - } - init_release_array(dc); +} - gen_tb_start(tb); - do { - pc_offset = dc->pc - pc_start; - tcg_gen_insn_start(dc->pc, dc->cc_op); - num_insns++; - - if (unlikely(cpu_breakpoint_test(cs, dc->pc, BP_ANY))) { - gen_exception(dc, dc->pc, EXCP_DEBUG); - /* 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 - the logic setting tb->size below does the right thing. */ - dc->pc += 2; - break; - } +static void m68k_tr_tb_start(DisasContextBase *dcbase, CPUState *cpu) +{ +} - if (num_insns == max_insns && (tb_cflags(tb) & CF_LAST_IO)) { - gen_io_start(); - } +static void m68k_tr_insn_start(DisasContextBase *dcbase, CPUState *cpu) +{ + DisasContext *dc = container_of(dcbase, DisasContext, base); + tcg_gen_insn_start(dc->base.pc_next, dc->cc_op); +} - dc->base.pc_next = dc->pc; - disas_m68k_insn(env, dc); - } while (!dc->base.is_jmp && !tcg_op_buf_full() && - !cs->singlestep_enabled && - !singlestep && - (pc_offset) < (TARGET_PAGE_SIZE - 32) && - num_insns < max_insns); - - if (tb_cflags(tb) & CF_LAST_IO) - gen_io_end(); - if (unlikely(cs->singlestep_enabled)) { - /* Make sure the pc is updated, and raise a debug exception. */ - if (!dc->base.is_jmp) { - update_cc_op(dc); - tcg_gen_movi_i32(QREG_PC, dc->pc); - } +static bool m68k_tr_breakpoint_check(DisasContextBase *dcbase, CPUState *cpu, + const CPUBreakpoint *bp) +{ + DisasContext *dc = container_of(dcbase, DisasContext, base); + + gen_exception(dc, dc->base.pc_next, EXCP_DEBUG); + /* 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 + the logic setting tb->size below does the right thing. */ + dc->base.pc_next += 2; + + return true; +} + +static void m68k_tr_translate_insn(DisasContextBase *dcbase, CPUState *cpu) +{ + DisasContext *dc = container_of(dcbase, DisasContext, base); + + disas_m68k_insn(cpu->env_ptr, dc); + dc->base.pc_next = dc->pc; + + if (dc->base.is_jmp == DISAS_NEXT + && dc->pc - dc->base.pc_first >= TARGET_PAGE_SIZE - 32) { + dc->base.is_jmp = DISAS_TOO_MANY; + } +} + +static void m68k_tr_tb_stop(DisasContextBase *dcbase, CPUState *cpu) +{ + DisasContext *dc = container_of(dcbase, DisasContext, base); + + if (dc->base.is_jmp == DISAS_NORETURN) { + return; + } + if (dc->base.singlestep_enabled) { gen_helper_raise_exception(cpu_env, tcg_const_i32(EXCP_DEBUG)); - } else { - switch (dc->base.is_jmp) { - case DISAS_NEXT: - update_cc_op(dc); - gen_jmp_tb(dc, 0, dc->pc); - break; - case DISAS_JUMP: - /* We updated CC_OP and PC in gen_jmp/gen_jmp_im. */ - tcg_gen_lookup_and_goto_ptr(); - break; - default: - case DISAS_EXIT: - /* We updated CC_OP and PC in gen_exit_tb, but also modified - other state that may require returning to the main loop. */ - tcg_gen_exit_tb(NULL, 0); - break; - case DISAS_NORETURN: - /* nothing more to generate */ - break; - } + return; } - gen_tb_end(tb, num_insns); -#ifdef DEBUG_DISAS - if (qemu_loglevel_mask(CPU_LOG_TB_IN_ASM) - && qemu_log_in_addr_range(pc_start)) { - qemu_log_lock(); - qemu_log("----------------\n"); - qemu_log("IN: %s\n", lookup_symbol(pc_start)); - log_target_disas(cs, pc_start, dc->pc - pc_start); - qemu_log("\n"); - qemu_log_unlock(); + switch (dc->base.is_jmp) { + case DISAS_TOO_MANY: + update_cc_op(dc); + gen_jmp_tb(dc, 0, dc->pc); + break; + case DISAS_JUMP: + /* We updated CC_OP and PC in gen_jmp/gen_jmp_im. */ + tcg_gen_lookup_and_goto_ptr(); + break; + case DISAS_EXIT: + /* We updated CC_OP and PC in gen_exit_tb, but also modified + other state that may require returning to the main loop. */ + tcg_gen_exit_tb(NULL, 0); + break; + default: + g_assert_not_reached(); } -#endif - tb->size = dc->pc - pc_start; - tb->icount = num_insns; +} + +static void m68k_tr_disas_log(const DisasContextBase *dcbase, CPUState *cpu) +{ + qemu_log("IN: %s\n", lookup_symbol(dcbase->pc_first)); + log_target_disas(cpu, dcbase->pc_first, dcbase->tb->size); +} + +static const TranslatorOps m68k_tr_ops = { + .init_disas_context = m68k_tr_init_disas_context, + .tb_start = m68k_tr_tb_start, + .insn_start = m68k_tr_insn_start, + .breakpoint_check = m68k_tr_breakpoint_check, + .translate_insn = m68k_tr_translate_insn, + .tb_stop = m68k_tr_tb_stop, + .disas_log = m68k_tr_disas_log, +}; + +void gen_intermediate_code(CPUState *cpu, TranslationBlock *tb) +{ + DisasContext dc; + translator_loop(&m68k_tr_ops, &dc.base, cpu, tb); } static double floatx80_to_double(CPUM68KState *env, uint16_t high, uint64_t low) From patchwork Mon Jun 11 10:49:34 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Vivier X-Patchwork-Id: 138217 Delivered-To: patch@linaro.org Received: by 2002:a2e:970d:0:0:0:0:0 with SMTP id r13-v6csp3899601lji; Mon, 11 Jun 2018 03:55:32 -0700 (PDT) X-Google-Smtp-Source: ADUXVKKL/1HJri9y9nB65F154Tp9uqldzZGO/AolUn+0yiSYIi1Jm8+EoNyxGNHp0jzz+ecZ+NfZ X-Received: by 2002:a0c:c944:: with SMTP id v4-v6mr14528608qvj.232.1528714532781; Mon, 11 Jun 2018 03:55:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528714532; cv=none; d=google.com; s=arc-20160816; b=Z21iDP9JwyvQxwoVHDccESO8SqA6Iw+YTmRPZMbQZmzUOkvV/APFaQWRepF2AI8fCG Qp9QBxo8FUA6oq73hm7BwXWG8YCJEKXmaja1Rzxe9FZRe9sbv+gy20qYyjbJPlJMz5CM MGNAchfao9KF8TuuPwxxa02+l/El5mLHlkim7Po8BrH5hnyN7c1SsEdf7zqCsfdV5NHd tYDoNRfnN9lb/HkZ45LMQS6itpfwpQLHprkSqVCByD2XdXuUN0M9mSLKDbrP9tlz8lAF SeW4/O532qiUbjLS+jOF5hM2ZfcHg/cfyNGvs85K3s4+Usr9xtOHSVcy+vbx4WV0qe6M IhlA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:references:in-reply-to :message-id:date:to:from:arc-authentication-results; bh=1gVjAkn2eUxl7dnt3pWGT6mtj5X1efpHswpoMQ6HyLk=; b=rT7oLBLbhbgODRVCAZGJDgWi0+G0CrP3h0fv7tf8lvFb9hhGIZ18brziptDWKwF242 cWEJZ0gBFCySgzqrbiII2zlT/cXsVS88htYZJV6YQnvBTleqZZo3HHDvI3sJ93ij8Aay TfjA6MdNT5X+Nu6k33SS1UG6n9ZZxUC8bVUnUReMW6emHEd+wgwJ9GCD54LZ+oDK0Trf 3bTWT6miDBKE6AD3tpGe9IbbDw2UnKPXXysydrpTYkdu0W8K3947StCNSv/jibSvQAOc j73o8HPxPVssOTlOJ1cDoLqQMQj08zZHff54hb6AB3fXLrjiEfPkHuulDOa4StRrSR8S gQSw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom=qemu-devel-bounces+patch=linaro.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id i187-v6si1137049qke.393.2018.06.11.03.55.32 for (version=TLS1 cipher=AES128-SHA bits=128/128); Mon, 11 Jun 2018 03:55:32 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Authentication-Results: mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom=qemu-devel-bounces+patch=linaro.org@nongnu.org Received: from localhost ([::1]:47682 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fSKU0-0006pI-Ay for patch@linaro.org; Mon, 11 Jun 2018 06:55:32 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56358) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fSKOl-0002aE-9M for qemu-devel@nongnu.org; Mon, 11 Jun 2018 06:50:10 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fSKOg-0000nv-Ts for qemu-devel@nongnu.org; Mon, 11 Jun 2018 06:50:07 -0400 Received: from mout.kundenserver.de ([212.227.126.134]:41915) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fSKOg-0000mG-Er for qemu-devel@nongnu.org; Mon, 11 Jun 2018 06:50:02 -0400 Received: from localhost.localdomain ([78.238.229.36]) by mrelayeu.kundenserver.de (mreue003 [212.227.15.167]) with ESMTPSA (Nemesis) id 0LgtBS-1g4QqP3rGQ-00oDmV; Mon, 11 Jun 2018 12:49:52 +0200 From: Laurent Vivier To: qemu-devel@nongnu.org Date: Mon, 11 Jun 2018 12:49:34 +0200 Message-Id: <20180611104935.20499-9-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:xJuptGrbJoP7xgZbyn2M/H/imje7/kxeZF5Wd9BD2gI4SV5LCBw mgmMNsOZz4XdlE4QrbrbYsJf8n53DKyuowU4cjiZ7kBPh53anSlKgo7V9fzGV/5FCUVZR63 CXVu+ylWSsHwmaWlugUFdQb60PHyr/hLmTBk83EySNCEc1fkpk4z/O4fP6wBFT79SMVsTRf IZC1DmCO0RtojX0jzA2Pg== X-UI-Out-Filterresults: notjunk:1; V01:K0:XvYeMDdpAeA=:nH0hfuDJMYzOJgPr2e8DGa 5Wf9AnMk3CFVnnlxdT3naTvPc2DyYLzcbhex21ml8A6QhIJbc9iTfurv7CbylBaXmjHB4Hpr8 ePCAu/LnEXfyaSDLNk+oGp0D3iYe6gUqok1XA3O17nmntXF5ckSiVbhY81Xstvf5TK/18BT/7 rR4T5k3slJzGY1Fi/KA1uPAobH5ah9zVRBgmujBRZLFJ1yeupE12WoFOLjNC8uPuq1vz+TtZZ nXYWXF+HOny+dH9nFOhXsvOI+QT4JJg6UrThh/hLt44USURXLiVGOrkiF3fU3WuF+CclM/76z A4I41o6A9RoItMfULcQ+gVgxtgSGCt9r4Q3bdAG7uMs7l5XiszpcwZ8QHhZld070zclMtXe2r rhEPAJNXgi4q35h/MiC9nOAIi1JXoEiU1+wIR/mLJQaEb1jOiyPmgYr2tQNjJcdxM2tkhj5Gu VDOe8h0jkTDlWc4EolM4h9+3fTFylo0mp6yTcMgntzvprHPEKOcAQlUK6HG+IlrHs7iLFgbMx cQLRpeMdAZBI6YAyqAOiFBQ5dCVLBryk4Z0W3HBAeaTc07N8+1KkI9oFhz6gX+WAkeMBTH7U1 bI8wk4yy9pfQtxXbZbs3erKOOc46gr3A0AbdJQBYjMtdFah7MGDKnJjcdxqi/hHVWL8MyTbpy 3drRQAaK1MWoiq1CaV+qPwfRgwT6O3MtWFhFgytvXO8XDU8TopbmcspBpY27G7l4a3uY= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 212.227.126.134 Subject: [Qemu-devel] [PULL 8/9] target/m68k: Improve ending TB at page boundaries 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+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Richard Henderson Rather than limit total TB size to PAGE-32 bytes, end the TB when near the end of a page. This should provide proper semantics of SIGSEGV when executing near the end of a page. Signed-off-by: Richard Henderson Message-Id: <20180512050250.12774-9-richard.henderson@linaro.org> Signed-off-by: Laurent Vivier --- target/m68k/translate.c | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) -- 2.14.4 diff --git a/target/m68k/translate.c b/target/m68k/translate.c index 62a96bedcd..ff3493d8ab 100644 --- a/target/m68k/translate.c +++ b/target/m68k/translate.c @@ -6105,9 +6105,25 @@ static void m68k_tr_translate_insn(DisasContextBase *dcbase, CPUState *cpu) disas_m68k_insn(cpu->env_ptr, dc); dc->base.pc_next = dc->pc; - if (dc->base.is_jmp == DISAS_NEXT - && dc->pc - dc->base.pc_first >= TARGET_PAGE_SIZE - 32) { - dc->base.is_jmp = DISAS_TOO_MANY; + if (dc->base.is_jmp == DISAS_NEXT) { + /* Stop translation when the next insn might touch a new page. + * This ensures that prefetch aborts at the right place. + * + * We cannot determine the size of the next insn without + * completely decoding it. However, the maximum insn size + * is 32 bytes, so end if we do not have that much remaining. + * This may produce several small TBs at the end of each page, + * but they will all be linked with goto_tb. + * + * ??? ColdFire maximum is 4 bytes; MC68000's maximum is also + * smaller than MC68020's. + */ + target_ulong start_page_offset + = dc->pc - (dc->base.pc_first & TARGET_PAGE_MASK); + + if (start_page_offset >= TARGET_PAGE_SIZE - 32) { + dc->base.is_jmp = DISAS_TOO_MANY; + } } } From patchwork Mon Jun 11 10:49:35 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Vivier X-Patchwork-Id: 138219 Delivered-To: patch@linaro.org Received: by 2002:a2e:970d:0:0:0:0:0 with SMTP id r13-v6csp3901037lji; Mon, 11 Jun 2018 03:57:25 -0700 (PDT) X-Google-Smtp-Source: ADUXVKL+PUflGkOBy6lND6vP6M/Q5y/RsL0nQX/lnDBSBlF6BFFbzSAz6IntguFLTMAxIOeLqy+8 X-Received: by 2002:ac8:34f1:: with SMTP id x46-v6mr15582444qtb.135.1528714645038; Mon, 11 Jun 2018 03:57:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528714645; cv=none; d=google.com; s=arc-20160816; b=UK1SU2VblhU6Nws8G8m9xG/Xusv1vM5l0J4pd9yUXIM45WvvtqYMU3dzQC7TWsYC9p P1Pa42cNFNO2DQvHl0rT4ZDwfbTXqkgGgcTOKudV5Ndl0iq626WoLJxElLZEkzoJamkF HS8P042RZ/23cLV4u+CkHqNa8HCbkBWvI0Ux3RbkF31lRTad9Pw0kcckDkeHsPz1lPl5 aWQj6MII7DPOZFDEGzIXn/Bmb81BNjP0tpwna0NXwgnjLbKYjF/zWThy3EnSSd/MVVB0 Lx6qbs9+maCMZAes9GxZEcddLSiX0ITofuf2FWspBHXTiw3IlvAXg3F63HzVLPHALOxw gU2w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:references:in-reply-to :message-id:date:to:from:arc-authentication-results; bh=4pJDLMBOodtl0s01G7rOFyMObGB4IsxIzVzlAQVy0T4=; b=EtEvPB71R6ds3j6TTCsrAGUblEHar+twWPWZXuaA1B5wbez7ZeckAYwKQ1YH3wUue6 rYtmBsvqXq6wEDLuzkbcpA+M5YXiAEPn9aATqVPakTh4ulozn4C/uECdpbJfbch48NHk 9aL+3gvXrdFGpmDKm1Z9NJAERi7hvsohMSFl0q9O8XPk5ASnpDk7MSAOKHrHyMVE15ZE 3uO54z5H/82Nb/VrVP0U7mTioxbM/UCCQ4znU2wOmIFU8Pn7OnMeStOhgArPCVox1vL8 aa8Gi47TE2zuJDTJcZgEI47C3BcpZ2d2pDpvTiFDYPojY2XwZA+/vfMu16qugP6UKBe0 uTAQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom=qemu-devel-bounces+patch=linaro.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id v20-v6si1272556qvj.27.2018.06.11.03.57.24 for (version=TLS1 cipher=AES128-SHA bits=128/128); Mon, 11 Jun 2018 03:57:25 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Authentication-Results: mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom=qemu-devel-bounces+patch=linaro.org@nongnu.org Received: from localhost ([::1]:47692 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fSKVo-0008Ia-IW for patch@linaro.org; Mon, 11 Jun 2018 06:57:24 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56392) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fSKOn-0002cj-TD for qemu-devel@nongnu.org; Mon, 11 Jun 2018 06:50:10 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fSKOj-0000pI-NB for qemu-devel@nongnu.org; Mon, 11 Jun 2018 06:50:09 -0400 Received: from mout.kundenserver.de ([212.227.126.187]:51061) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fSKOj-0000oT-9Z for qemu-devel@nongnu.org; Mon, 11 Jun 2018 06:50:05 -0400 Received: from localhost.localdomain ([78.238.229.36]) by mrelayeu.kundenserver.de (mreue003 [212.227.15.167]) with ESMTPSA (Nemesis) id 0LkUkZ-1fzC2d2uJX-00cOLO; Mon, 11 Jun 2018 12:49:52 +0200 From: Laurent Vivier To: qemu-devel@nongnu.org Date: Mon, 11 Jun 2018 12:49:35 +0200 Message-Id: <20180611104935.20499-10-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:PYDJ7nCSX6R/z4Us2yconzbMVfCxldQ8nnqygtoc48Qw1htb3Px gSFw/1gbcE0AS3jzXuTsSWkXvGSHUlRAC9lm15FYeZqd0mLyaSIL2IU5TxGZTCvVuiRhUpw m3m3x6Dn/aHuJ1YzOh6lY5i67h/VLAaIewVVaXU2JpLP/8wa+q9bQoWRwPFSoy71S5EkR7g s6ybiXK9cy37es5ZCjXoQ== X-UI-Out-Filterresults: notjunk:1; V01:K0:7BL5OGmEb9o=:a1PElOz0IglWH2YZgxxCfM 1jcjDFrfoLuAqaNuvYUoliGz0UGUqhU5ONuU5DU3MoCF7GtiukSGf3LSO61ZaIExYqb9xIKpJ PSQ0u+S1sxyz9WcMaMcJJ4x/rmmpqbh9dfXpDZJciTVRVnPFOrsG4h9x26Nb+gHGFDYjgyL0B SrZASh6/fVm/CZcymsNQFpBrlTSx54M19vyjnNInd8KL6yYRIirMN+X5GNqK5VVz5NaNolIUs 1ay1hB3ps14lgrbKa/Lvp/ZPeW/+nO0s38xmTAFftKiXRxdm1K9nWIfZFJz9Km1+jU8L2pKJk Xf/hBbtk/9jfDBVAkqpngqldIxNGIJcjFRaFLyUeTWKbmCkEU6w8fAfONgSY+GKt1qzB5z9AT cZLraYEi4L/LZaqCWwhhNITh2+cwzzGFgvptl26WU/AlSK1jXyj+9h/VgX9RSwpldC6LYhYT+ Y5OrMqo1gP1kHTfm92801bHITxwcK2EuAGX3u+oqbdXH9vdl8PxitS3Bk7cS6ztUzPtmDrvvi prsmc0HczYOvoEBgNcrCKzGeDXwYbtel/4CzRmvY5rSGXblNnGdpxJcHe8VBAAKCqcWhdP6M4 iXPTR+kRQgBpwWkivXYl6t0kWKE8EB3pRVnqpdl3fI3E6SCWz3rNlEvis4Jj7WVxbL4GxVUF4 6O2dCBynuSOOeK6aN486yCYm5OOuWbPrwtgh8rJsz8SkkhQKD9B7lKOPdIEKtGNkVrOI= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 212.227.126.187 Subject: [Qemu-devel] [PULL 9/9] target/m68k: Merge disas_m68k_insn into m68k_tr_translate_insn 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+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Richard Henderson Signed-off-by: Richard Henderson Message-Id: <20180512050250.12774-10-richard.henderson@linaro.org> Signed-off-by: Laurent Vivier --- target/m68k/translate.c | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) -- 2.14.4 diff --git a/target/m68k/translate.c b/target/m68k/translate.c index ff3493d8ab..ae3651b867 100644 --- a/target/m68k/translate.c +++ b/target/m68k/translate.c @@ -6049,16 +6049,6 @@ void register_m68k_insns (CPUM68KState *env) #undef INSN } -/* ??? Some of this implementation is not exception safe. We should always - write back the result to memory before setting the condition codes. */ -static void disas_m68k_insn(CPUM68KState * env, DisasContext *s) -{ - uint16_t insn = read_im16(env, s); - opcode_table[insn](env, s, insn); - do_writebacks(s); - do_release(s); -} - static void m68k_tr_init_disas_context(DisasContextBase *dcbase, CPUState *cpu) { DisasContext *dc = container_of(dcbase, DisasContext, base); @@ -6101,8 +6091,13 @@ static bool m68k_tr_breakpoint_check(DisasContextBase *dcbase, CPUState *cpu, static void m68k_tr_translate_insn(DisasContextBase *dcbase, CPUState *cpu) { DisasContext *dc = container_of(dcbase, DisasContext, base); + CPUM68KState *env = cpu->env_ptr; + uint16_t insn = read_im16(env, dc); + + opcode_table[insn](env, dc, insn); + do_writebacks(dc); + do_release(dc); - disas_m68k_insn(cpu->env_ptr, dc); dc->base.pc_next = dc->pc; if (dc->base.is_jmp == DISAS_NEXT) {