From patchwork Tue Jun 29 18:54:18 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 468346 Delivered-To: patch@linaro.org Received: by 2002:a02:c94a:0:0:0:0:0 with SMTP id u10csp5258134jao; Tue, 29 Jun 2021 12:37:43 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxlrG2qbeamJSJxxZZa8WfA1biqKD3Bri2aLUbNJCo3SRnFBkO4R3qWOGF+waYWk++ctf2i X-Received: by 2002:a25:888e:: with SMTP id d14mr39434069ybl.443.1624995463792; Tue, 29 Jun 2021 12:37:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624995463; cv=none; d=google.com; s=arc-20160816; b=f88CeYe3JqhoC0CXD9QLySAx7qVE0ddw+eDH6iLTNmnszzEGEnxCDHng6nKKvdifyK h01X0gJXXhf4PaqbXPMDpbjljFfak8s35RFkRTPklMuryJpLyb03z1xBvfUI8LkaGxxk /inve+afEIrw3ebrmqpUtORZmm0vOJ2bcdr1QdqQLJ9AO1Grf8X/f38GeX33zKC+Oupe 0mcjig/Fzy6lLm7NBr65Y3+t80KQ/E/dMI1P9iHJs4iYqR5zxFK23e3dav/dJ1RMOJu8 6ZYHm558EX9msGG5zSW1bgAEOldvdsH/trmfJ6j1w9/t2qpLE3p+/KCm4dBIkq7SBJew htnQ== 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:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=TmE3ty8MFHw5l53WoOarVMR7r8mrPkuN/VqQisWZNow=; b=qhMXKI+/1OaQGGg1UISWM59Gf7dPzRUkHwobjTrP1QpaccMjltgPOlWo9gVsaCVHRD ATc82TVoGsySgUABo+Wj6S1YopdkPE59SkZ09GbSST3k+OBvxCTTuWd+qVoAN+gnoNvQ tLWRE1DK7qvTQJoJufF8Gii8stTDDWV4u6PiuXVzDb56hAOv2GHf10Bn6knOmI3MVt7s To/2Alacx3T8hPBCnMsauiFh0iQyLKdUnXBhfotb2NMm/wKDYbTRPXBR45NYI9LAe9jg AwIZ/hL180sLwOt1vTJ+GzaItnm6qa1DRtUF7I1ruXpBSD0tyh/hwXxCMi7auyVwxlTa cAmg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=VagcJCg+; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id z1si17274625ybj.455.2021.06.29.12.37.43 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 29 Jun 2021 12:37:43 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=VagcJCg+; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:46294 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lyJYF-0000vU-6L for patch@linaro.org; Tue, 29 Jun 2021 15:37:43 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:38718) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lyItQ-0008U5-1o for qemu-devel@nongnu.org; Tue, 29 Jun 2021 14:55:32 -0400 Received: from mail-pg1-x52b.google.com ([2607:f8b0:4864:20::52b]:39529) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lyItA-0000u0-6m for qemu-devel@nongnu.org; Tue, 29 Jun 2021 14:55:31 -0400 Received: by mail-pg1-x52b.google.com with SMTP id a2so19348443pgi.6 for ; Tue, 29 Jun 2021 11:55:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=TmE3ty8MFHw5l53WoOarVMR7r8mrPkuN/VqQisWZNow=; b=VagcJCg+8PKv7Un9QpSXaMhROyqusSVdbeZJ8cNbFyOe1zJuOl26fxBdCUeRWsCYhJ jINVtJi30w1x9f2JLcYK7LroXYYo/eNa3cETC8MZDpfIN7YvJDstWEDlh69/ueqxxRhs A1fV8DBQ6rwAzJhNxqz0L1DnuWLZk8H7E4fuu/mnQz4I8yXfp9e/VeIqRaXjH3luKc8j ZhlCR+TyAbEPsTayQrFtbIer1511kbchtd6pSK5QukEYU8dI8T+E+mIiBuayUabRzYKA /58mWoK5KAAz8D5lqaaFjnhYYi36dOQVK7yR5JmA+KvfKOBzMNxh2AAqfCbJU22MJMnY 7N9g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=TmE3ty8MFHw5l53WoOarVMR7r8mrPkuN/VqQisWZNow=; b=sudcwY5wbv2d5uf7/RgJKT73SJT5WqeV1E81yD2T1zYSrTp0t5/HdUB2FHqnqaV+c1 uZkQCZy9vqtWNYEkY3i1JnfOB+7A1h/gc/nxHgTNC8TvaYvG28Pph2/dbF4cww/nkL7E xGIXQMjA8lcczDeTDE4VhxkfwNXezo7QEzYL0RUzn09dctfglIYvfDXyVf6W7DY7K1uu I8gw0a5fYJnxDKsNK5bDRL5ehylOedKWhsjnNK31fctOZjx1EcZ7Rps2lEx1t2aj94Kl M6A5v6UAZErpbqzt8eYl+Qzcd7SueTWno3U0A3yo2nO40nX8P1JmqaSOYkpG0qZ2sy5o hMfw== X-Gm-Message-State: AOAM5336wjIgglC7o/ENwPNKBFNA0z3Qvh4k98sfeYg9PNk5f4oykYIv 03Wr17Ji6Xr8WdfvMrfMInf7F28PvE3CuA== X-Received: by 2002:a63:f557:: with SMTP id e23mr29717312pgk.55.1624992911053; Tue, 29 Jun 2021 11:55:11 -0700 (PDT) Received: from localhost.localdomain ([71.212.149.176]) by smtp.gmail.com with ESMTPSA id j2sm18811253pfb.53.2021.06.29.11.55.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 29 Jun 2021 11:55:10 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PULL 26/63] target/cris: Improve JMP_INDIRECT Date: Tue, 29 Jun 2021 11:54:18 -0700 Message-Id: <20210629185455.3131172-27-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210629185455.3131172-1-richard.henderson@linaro.org> References: <20210629185455.3131172-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::52b; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x52b.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "Edgar E . Iglesias" Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Use movcond instead of brcond to set env_pc. Discard the btarget and btaken variables to improve register allocation and avoid unnecessary writeback. Reviewed-by: Edgar E. Iglesias Tested-by: Edgar E. Iglesias Signed-off-by: Richard Henderson --- target/cris/translate.c | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) -- 2.25.1 diff --git a/target/cris/translate.c b/target/cris/translate.c index 8b379522c6..1d4c78eab2 100644 --- a/target/cris/translate.c +++ b/target/cris/translate.c @@ -522,17 +522,6 @@ static void t_gen_swapr(TCGv d, TCGv s) tcg_temp_free(org_s); } -static void t_gen_cc_jmp(TCGv pc_true, TCGv pc_false) -{ - TCGLabel *l1 = gen_new_label(); - - /* Conditional jmp. */ - tcg_gen_mov_tl(env_pc, pc_false); - tcg_gen_brcondi_tl(TCG_COND_EQ, env_btaken, 0, l1); - tcg_gen_mov_tl(env_pc, pc_true); - gen_set_label(l1); -} - static bool use_goto_tb(DisasContext *dc, target_ulong dest) { return ((dest ^ dc->base.pc_first) & TARGET_PAGE_MASK) == 0; @@ -3321,8 +3310,17 @@ static void cris_tr_tb_stop(DisasContextBase *dcbase, CPUState *cpu) /* fall through */ case JMP_INDIRECT: - t_gen_cc_jmp(env_btarget, tcg_constant_tl(npc)); + tcg_gen_movcond_tl(TCG_COND_NE, env_pc, + env_btaken, tcg_constant_tl(0), + env_btarget, tcg_constant_tl(npc)); is_jmp = dc->cpustate_changed ? DISAS_UPDATE : DISAS_JUMP; + + /* + * We have now consumed btaken and btarget. Hint to the + * tcg compiler that the writeback to env may be dropped. + */ + tcg_gen_discard_tl(env_btaken); + tcg_gen_discard_tl(env_btarget); break; default: