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: