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: 927600 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 4148y81GTVz9rxs for ; Mon, 11 Jun 2018 20:53:36 +1000 (AEST) Received: from localhost ([::1]:47663 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fSKRz-0004yP-CH for incoming@patchwork.ozlabs.org; Mon, 11 Jun 2018 06:53:27 -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+incoming=patchwork.ozlabs.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(-) 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: