From patchwork Mon Aug 31 16:05:40 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 248807 Delivered-To: patch@linaro.org Received: by 2002:a92:5b9c:0:0:0:0:0 with SMTP id c28csp3458944ilg; Mon, 31 Aug 2020 09:30:30 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzNsjB+7arczvy3+9aOoPqad55jgqtSfLpUpOeiRsbKNy9aCIjpJmVcUIRyBZHqOknrPejj X-Received: by 2002:a05:6102:5a:: with SMTP id k26mr1998979vsp.52.1598891430442; Mon, 31 Aug 2020 09:30:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598891430; cv=none; d=google.com; s=arc-20160816; b=z0OSdFSNxHeZtb8bTOkWNCTWa0aO2rTJ0ZWwxMgLKYKS5Eo/dHjC6MIyX4YUUqFBOB oTa1D83mxMYvgM6yVp6U90cDOgZ556V2l6IZjYKsp7pSya2X2jwsbJp5ohKo2XeIBnXl JgeOLpEyEW+bLwb9+xJNaCs+So+vlohdQiklni4XkuVZPOa/jESqItYjNnmVUpQTOt+m IsWifFXRS2xMSpcRMSJUiFbHme90/G/gBx4M7qgU8AS0RqGYm5LHQCUOPsXlO2pwqNif UBskCWOPo8F1UePHpVOmBWAXbr9mc0ccxJq/MVO0050PYUucL7rYifP+v55f7x8CF+yT uqCg== 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=9yukNREp9KLx7ngPQjIPDt7zSrwG6GvjIbptJAOWSaU=; b=LFGLvad6T/wRSNfz2yfbneYc/oOJAWdC3HArdRk9js06A/brxU+GSHyNycF7EoxNkM +6b/tVEVbD4oWWrtBhomHJElKTXDyVwnDUUjtXtw2fBgHumkghOA9eE7ew2BSUMlL1RS Ug9IDvKftdjZjr5jqxJJ2gPXM55DVU0Zbn0hOyX+4+x4iKkm4/X8hfbXAdQSE0/5Zm2o 60sRjUP+St+Kcm6yczG5v5SPBf/zPx2VNn0mcUG7fIuGhUVshCZ+7Mc1Lc1PusoOOSf0 aSevfH4STxj/5Q1nz0Jvano2IJrsZ90W4FsgG6AHqVn9xfqoywVf8vW+zoOrwBGe7EKJ IQfQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=S1UuJNZg; 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 i20si1196353uat.97.2020.08.31.09.30.30 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 31 Aug 2020 09:30:30 -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=S1UuJNZg; 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]:34882 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kCmhR-0003SV-SH for patch@linaro.org; Mon, 31 Aug 2020 12:30:29 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34486) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kCmL4-00061q-4U for qemu-devel@nongnu.org; Mon, 31 Aug 2020 12:07:22 -0400 Received: from mail-pf1-x42f.google.com ([2607:f8b0:4864:20::42f]:46348) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kCmL2-00067k-9r for qemu-devel@nongnu.org; Mon, 31 Aug 2020 12:07:21 -0400 Received: by mail-pf1-x42f.google.com with SMTP id b124so794988pfg.13 for ; Mon, 31 Aug 2020 09:07:19 -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=9yukNREp9KLx7ngPQjIPDt7zSrwG6GvjIbptJAOWSaU=; b=S1UuJNZgcEJpKE9BCCMllrjEz+ym5UOpgwvm0aohS/w+SqoiWqqSDj1lZHKM0XlTHh 1tHf2Zm1IJryROZkrjHsqmcKW4ZCc9NkUfZJI8AGi6KgnbEOd/5SXXGDyCSNwNhZ3ydO zR5OjdQHiB2m6kU5aRcllqRJVtEEXKk/xXluyCuS/YOeNb2+s1+7zGBzfp2hUZQDRrm8 52hxWsTRjM4z/lwcJXSxI2ZkDYRjcRtdMAzYUgEYJLn73RB2xUh5xwWZ/7AnR/o0Ov+L xpjzufxA1LYso56u/9Zdg1aItJfvPb4PpaotgssZK+1+Ya5EjbiBiGAry8IdjNriftQv PKYw== 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=9yukNREp9KLx7ngPQjIPDt7zSrwG6GvjIbptJAOWSaU=; b=JKte2rFEe+M1RZaeYerptUFtTkgH0IwE7GkTnMRNHUQEmMcBp8roUqDBk+18tnx+4N HGyT/Burv5f0U1qshFJ/1mtJKQ60/r4DfJpMmJtRnm2jvdVZNlVj6azju+EvbFnZXCvV xvY1Ib4JMZ49d/BqrDumEPwecWg6BWYUzdOncR3elbTzDoufy3GWMe0YHXhZOmJeXCac kUQCwqV9bUnC1/+xzTOQHM7dtHs/OsFlwzx9p1jAP8DpGQ4rRkMZcrEV7S+7X8KqX0mv /4dtfgSxdwW/KwmBUC0czjeYeYpGqJ+m9AQuMUtDePita1crSlNA43EQ/pbjjc9s78Uc n63w== X-Gm-Message-State: AOAM533Z+BUsLt3frszq9GETDhyAzszjXSD3w2ugEvJfUrU5Uufe+nno NA2xFUe745ZOnjrc3HUhDyqauW7u775unQ== X-Received: by 2002:aa7:96b0:: with SMTP id g16mr1875113pfk.46.1598890038007; Mon, 31 Aug 2020 09:07:18 -0700 (PDT) Received: from localhost.localdomain ([71.212.141.89]) by smtp.gmail.com with ESMTPSA id gt13sm17218pjb.43.2020.08.31.09.07.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 31 Aug 2020 09:07:17 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PULL 55/76] target/microblaze: Move bimm to BIMM_FLAG Date: Mon, 31 Aug 2020 09:05:40 -0700 Message-Id: <20200831160601.833692-56-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::42f; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x42f.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" It makes sense to keep BIMM with D_FLAG, as they can be written back to iflags at the same time. BIMM_FLAG does not need to be added to IFLAGS_TB_MASK because it does not affect the next TB, only the exception path out of the current TB. Renumber IMM_FLAG, as the value 4 holds no particular significance; pack these two flags at the bottom of the bitfield. Tested-by: Edgar E. Iglesias Reviewed-by: Edgar E. Iglesias Signed-off-by: Richard Henderson --- target/microblaze/cpu.h | 4 ++-- target/microblaze/helper.c | 2 +- target/microblaze/translate.c | 12 +++++------- 3 files changed, 8 insertions(+), 10 deletions(-) -- 2.25.1 diff --git a/target/microblaze/cpu.h b/target/microblaze/cpu.h index 2fc7cf26f1..a5df1fa28f 100644 --- a/target/microblaze/cpu.h +++ b/target/microblaze/cpu.h @@ -231,7 +231,6 @@ typedef struct CPUMBState CPUMBState; struct CPUMBState { uint32_t btaken; uint32_t btarget; - uint32_t bimm; uint32_t imm; uint32_t regs[32]; @@ -253,7 +252,8 @@ struct CPUMBState { uint32_t res_val; /* Internal flags. */ -#define IMM_FLAG 4 +#define IMM_FLAG (1 << 0) +#define BIMM_FLAG (1 << 1) /* MSR_EE (1 << 8) */ /* MSR_UM (1 << 11) */ /* MSR_VM (1 << 13) */ diff --git a/target/microblaze/helper.c b/target/microblaze/helper.c index f8e2ca12a9..06f4322e09 100644 --- a/target/microblaze/helper.c +++ b/target/microblaze/helper.c @@ -166,7 +166,7 @@ void mb_cpu_do_interrupt(CPUState *cs) /* Reexecute the branch. */ env->regs[17] -= 4; /* was the branch immprefixed?. */ - if (env->bimm) { + if (env->iflags & BIMM_FLAG) { env->regs[17] -= 4; log_cpu_state_mask(CPU_LOG_INT, cs, 0); } diff --git a/target/microblaze/translate.c b/target/microblaze/translate.c index d2baa7db0e..97a436c8d5 100644 --- a/target/microblaze/translate.c +++ b/target/microblaze/translate.c @@ -1351,13 +1351,11 @@ static void eval_cond_jmp(DisasContext *dc, TCGv_i32 pc_true, TCGv_i32 pc_false) static void dec_setup_dslot(DisasContext *dc) { - TCGv_i32 tmp = tcg_const_i32(dc->type_b && (dc->tb_flags & IMM_FLAG)); - - dc->delayed_branch = 2; - dc->tb_flags |= D_FLAG; - - tcg_gen_st_i32(tmp, cpu_env, offsetof(CPUMBState, bimm)); - tcg_temp_free_i32(tmp); + dc->delayed_branch = 2; + dc->tb_flags |= D_FLAG; + if (dc->type_b && (dc->tb_flags & IMM_FLAG)) { + dc->tb_flags |= BIMM_FLAG; + } } static void dec_bcc(DisasContext *dc)