From patchwork Mon Aug 31 16:05:45 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 248818 Delivered-To: patch@linaro.org Received: by 2002:a92:5b9c:0:0:0:0:0 with SMTP id c28csp3463154ilg; Mon, 31 Aug 2020 09:36:12 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzimtVm1oziD1iOQew/lpUYSFlxUjJPcwhXJ04okN3EfjGkzSIaKCfq7OLUpNX01lPwKMe1 X-Received: by 2002:a25:1f44:: with SMTP id f65mr3596443ybf.438.1598891772510; Mon, 31 Aug 2020 09:36:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598891772; cv=none; d=google.com; s=arc-20160816; b=xi07M13GQbhAPOHfnCqUYIFDt4337uM8Y6AUr5wweh2Bjo4yGl0GV/l+euYy9zYHc9 Dpn86VplBDoOUao62Ky3DCcAS8Qgz+Tp5ovUWTH5vuBH0aKpZT9LJtnXkaSbcEuY4X4h cW3/RP//reH9PzEUrVFaOXBnjquDFTwUb8MpV2wq0q2+54ft05FcqhBg/8gUX0tiQgD6 fQbtFfY7sod3zBpsz5ijJ4DKUUoGYmqUGb7t+PDrIdU9Q4N27omzNlYZjvYrMdWkkG5T 1UzTmZXgfk55SbYXQFBpUWRU/sAT1ZkUT3OSEwxQLSi6CFlzpzof/w8PTIMWX0vHE0X4 CSSA== 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=HE8Wik9vttKTZZENz5zVdtMEhiCJ7C/1UlGJaVpED9U=; b=HyJkumsLk3NohSXZyiVdcWXrnVYk65dUcg9BE2kWl6IcjPEZfQ2I3pAcNT3SOW6bwY PWhTtm1HChBGFtrjvvwFYfnfWPlOj8t40uw9WXI01OU6kTjzMCvFlCjVXWdyN92xzS1k PwP589vbPV4OAkcZNiF5gNPsrUO5WJmeFrR5RFzn0YKbM85oc6ZXoYkfsTI1QpRi3Vgw H8kXYDj4/LtnMxSQev2wt8R1ukRkShPo8qyzjUKYEPqvjNDy3PmQQ8Ba5qQWMSQLTWbV +OpXlz5AJZ/AsVz5UIUa3gXtrS8bIS4RV/3FmFhxWUG/VeCkufUY6sc4mHXzQLQrPu72 ZYnA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=GejGOa5t; 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=fail (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 j3si8317322ybp.222.2020.08.31.09.36.12 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 31 Aug 2020 09:36:12 -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=fail header.i=@linaro.org header.s=google header.b=GejGOa5t; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:34324 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kCmmx-0006Nw-TT for patch@linaro.org; Mon, 31 Aug 2020 12:36:11 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34570) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kCmLC-0006Ej-8k for qemu-devel@nongnu.org; Mon, 31 Aug 2020 12:07:30 -0400 Received: from mail-pg1-x544.google.com ([2607:f8b0:4864:20::544]:35756) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kCmL8-00068V-LT for qemu-devel@nongnu.org; Mon, 31 Aug 2020 12:07:29 -0400 Received: by mail-pg1-x544.google.com with SMTP id g29so843674pgl.2 for ; Mon, 31 Aug 2020 09:07:26 -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=HE8Wik9vttKTZZENz5zVdtMEhiCJ7C/1UlGJaVpED9U=; b=GejGOa5tD4nNLq3MjRuxcqGWZynkrKKlL80BiRBXfkwhCByzj9HYKafVw5HDHneVKo m1Ndq/hTKE0ouNYm1JaPFF9WwZYSfKdXDktSMHREzWgIiQ/VllYm/mLS8kiCuXHZeRtj Ne8W+RgwkYmVO/Dqqx9otxn+gfhVT6ZuReBqYQ+QBVSjbFWIy/ZF8lK3zs/CE0a++nx8 qZsfLTflRIvAlWrK37g2RJO3hLe0YxDqGDPTy6tPH1eeee9iHpTJ6HjkBYO1PCkY18cH WWzi2kVU5/xSeeI0+VZ1lV4R5PllF+QGkFhbwC0XYP1H3GDK9S9ZmiX71d6c6Mi+vWqG zLaQ== 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=HE8Wik9vttKTZZENz5zVdtMEhiCJ7C/1UlGJaVpED9U=; b=q4oas1AkJT2/DXTZsCOfHbrQ1bR2k9j6dlBj5FiHxfX6/NPvhyIbSnmSYW8C2n4h2i 19YgPD3GHzP1JxEva07Gl94euN+ewFuKe7LJyMQ4LLkfRqNuoPNTdqkbSeHFs2TSrSCi BgB06MOiUxJqYQr/6pryituqDKoDrkAEd7x6tcsvEDabkAJgH201XBWjm3h9qbNePOP1 5mVLhoXwgJSEniv52M9dQZSG3ijktlTmF20CU0GCkCwmIdj9Q/bDwzKQliVLmbNdAoDC oqDC1dnD4RjPV+Wrs4zlZWzf1XUsREg3qzrkmEMn4rRYg7t7in10+E7L7E2ngEjZ9mOH +SCw== X-Gm-Message-State: AOAM533c6rRrplICqO5gfI7th2icvizO2/LfAn5fbPeh34dL9eWz+FVv PiA/73DTZfsT5p7Ldeb3ollnPKcOHvPVkQ== X-Received: by 2002:a63:b24b:: with SMTP id t11mr1747404pgo.233.1598890044938; Mon, 31 Aug 2020 09:07:24 -0700 (PDT) Received: from localhost.localdomain ([71.212.141.89]) by smtp.gmail.com with ESMTPSA id gt13sm17218pjb.43.2020.08.31.09.07.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 31 Aug 2020 09:07:24 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PULL 60/76] target/microblaze: Replace clear_imm with tb_flags_to_set Date: Mon, 31 Aug 2020 09:05:45 -0700 Message-Id: <20200831160601.833692-61-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200831160601.833692-1-richard.henderson@linaro.org> References: <20200831160601.833692-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::544; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x544.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. 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" , peter.maydell@linaro.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" This more general update variable will be able to handle delay slots as well. Tested-by: Edgar E. Iglesias Reviewed-by: Edgar E. Iglesias Signed-off-by: Richard Henderson --- target/microblaze/translate.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) -- 2.25.1 diff --git a/target/microblaze/translate.c b/target/microblaze/translate.c index 597b96ffb3..c0b586f467 100644 --- a/target/microblaze/translate.c +++ b/target/microblaze/translate.c @@ -75,7 +75,7 @@ typedef struct DisasContext { unsigned int cpustate_changed; unsigned int delayed_branch; unsigned int tb_flags; - unsigned int clear_imm; + unsigned int tb_flags_to_set; int mem_index; #define JMP_NOJMP 0 @@ -535,8 +535,7 @@ static bool trans_imm(DisasContext *dc, arg_imm *arg) { dc->ext_imm = arg->imm << 16; tcg_gen_movi_i32(cpu_imm, dc->ext_imm); - dc->tb_flags |= IMM_FLAG; - dc->clear_imm = 0; + dc->tb_flags_to_set = IMM_FLAG; return true; } @@ -1688,7 +1687,8 @@ static void mb_tr_translate_insn(DisasContextBase *dcb, CPUState *cs) (uint32_t)dc->base.pc_next); } - dc->clear_imm = 1; + dc->tb_flags_to_set = 0; + ir = cpu_ldl_code(env, dc->base.pc_next); if (!decode(dc, ir)) { old_decode(dc, ir); @@ -1700,10 +1700,13 @@ static void mb_tr_translate_insn(DisasContextBase *dcb, CPUState *cs) dc->r0_set = false; } - if (dc->clear_imm && (dc->tb_flags & IMM_FLAG)) { - dc->tb_flags &= ~IMM_FLAG; + /* Discard the imm global when its contents cannot be used. */ + if ((dc->tb_flags & ~dc->tb_flags_to_set) & IMM_FLAG) { tcg_gen_discard_i32(cpu_imm); } + + dc->tb_flags &= ~IMM_FLAG; + dc->tb_flags |= dc->tb_flags_to_set; dc->base.pc_next += 4; if (dc->delayed_branch && --dc->delayed_branch == 0) {