From patchwork Tue Aug 25 20:59:28 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 248301 Delivered-To: patch@linaro.org Received: by 2002:a17:906:6447:0:0:0:0 with SMTP id l7csp8185ejn; Tue, 25 Aug 2020 14:22:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyPavPOTmDxdNLqajPrpDsQ4eQoNlkoykis7/sZHN5u2ZUqWQs0DXXOlwO7E+U7oSK5R3/e X-Received: by 2002:a25:4288:: with SMTP id p130mr16463274yba.288.1598390528817; Tue, 25 Aug 2020 14:22:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598390528; cv=none; d=google.com; s=arc-20160816; b=gi2jskC967wPXxIcHjnzP9Z/TGTLsUmDDg/DjB3znZWH/AJj7RFzvLMbyNzK/iJCUj q3LwDlz2dCVFdlvBBsH/6s2HFhudHe0mimUSX81zpQyCUpxJoeyP/njAD+Ietewt1/ms kwbKNj90paOguu56AezT3uvZuRkcAtdMoRPNNbUWM8Te3wgVHR2dgzpGfYW9xLpSNvfG QjZRAloRdyylObIBLZeuOUZUTtJqXdkFzA9XjFC9BbWxkk4ppBrPYR1Vs3FYaoZE/h3C 9Fu88PVv88rr6LPVBMnGrrSujwHdww7peyqHYf7YOPM8tTFDUCdmGpHvvNa8+Ohs/6lV ruVw== 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=8b0bp9mk+1WbNfIATZBmVlR2NfvcC4JEryF82Ik81YY=; b=ZEeDGk1v+X/js9nJ6w1zOtpgGSayW6HCfFW+nSfxCHPfOUUyqQCaEBHVzfNJ630kBQ v1OE/UlUdqjTdX9C2KKiuTII8n+ehklm3N4MuSqE7mgluCESUsDnPlx3OQQ0DdHK45vj YGRUN1cFYy2o/Y/HtIQyvAgsu+JxTyc+WUjE9VHr7S9rQ3VXK04XX687z+m4oaT0U7t6 rSstsGvp2iY8gUyAHftEMkSNTibBd+V/P1aOl8jmjnc41Zr0zwRoVyVJ3//firTHulua G1UwQib800BBRJ/GNfnUQDKCH8FmkQuLbiS2xwsABB4vqizap88yUyU//0TFgIBsHcvR k9fw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=r2HUuPvh; 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 i18si78889yba.39.2020.08.25.14.22.08 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 25 Aug 2020 14:22:08 -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=r2HUuPvh; 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]:40442 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kAgOO-00084M-39 for patch@linaro.org; Tue, 25 Aug 2020 17:22:08 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:36352) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kAg43-000099-6a for qemu-devel@nongnu.org; Tue, 25 Aug 2020 17:01:08 -0400 Received: from mail-pj1-x102f.google.com ([2607:f8b0:4864:20::102f]:56102) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kAg3z-0001zq-6t for qemu-devel@nongnu.org; Tue, 25 Aug 2020 17:01:06 -0400 Received: by mail-pj1-x102f.google.com with SMTP id 2so118328pjx.5 for ; Tue, 25 Aug 2020 14:01:02 -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=8b0bp9mk+1WbNfIATZBmVlR2NfvcC4JEryF82Ik81YY=; b=r2HUuPvhKirChEZkUK4KJtTJepETf/6ibKth2j7LthDaibAOMUyHDGPttbFvSVoPrm C0u4l7nJDt9e5WaFlon9bNzBC5mL1dBYmxYTo4zQFDo+hOIZ63CdVSMgw4+IgCqeHg8Q dHQ5Dwz2kgkL7sS0vviy/r/P++szwMibw0unNxk7Sev5vB168PtNMTGgiV1VBe9Upczl PCOpcxCmih2CZGa4451c/HsrSO6qOJE8EpaJsqs7BMvyXh/slnfTGHtBqKdjId9cOxfl M2bxTAdJm4JYMxuQeLpOz7fMFDf24dz3t1/auM6jX+GX2usLaw/my3g/lw6EeGeM/MHH nO+g== 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=8b0bp9mk+1WbNfIATZBmVlR2NfvcC4JEryF82Ik81YY=; b=k4fApancvQgYrGJLGOOz++2EILUGM12nabdmu5MKpygOSxgPzzReQf9fah2QAe6BzA mTuZTy/nwDKbefPDUiij4QtAbqRRuhCEkwgRLqLErDyg3UEPalRGvVSGW91YkyFlSRxW 6dAvsdj1qC7CrB3YHlzdwbh2QSkowdNva2BARcdFZVfbIEFvn3H+0l0NZDHyVBRCnhBi UHfxU4syo0ivluJF3n0b/FElzv7QLWN1sW6LKsWC+enZfS+FoHjtmdny9uwdKU3oyqCt 3eTZjYHtnTWNtI/NYgw1roUfLjsZZPBQbo0Ubm2L3ntuycULqxpjTqsnATYFtPb+1gvP fasg== X-Gm-Message-State: AOAM533ai1pF4B3UlRzCvj1JllW2UwgkrJsBdL+OqlK5R69yx5zAytr1 DBU/Hkloe+hClpHtbFW7GzJV6XaAlkYNmA== X-Received: by 2002:a17:90b:40cb:: with SMTP id hj11mr3227959pjb.67.1598389260896; Tue, 25 Aug 2020 14:01:00 -0700 (PDT) Received: from localhost.localdomain (h216-228-167-147.bendor.dedicated.static.tds.net. [216.228.167.147]) by smtp.gmail.com with ESMTPSA id k4sm16074pgr.87.2020.08.25.14.00.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 25 Aug 2020 14:01:00 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 55/77] target/microblaze: Move bimm to BIMM_FLAG Date: Tue, 25 Aug 2020 13:59:28 -0700 Message-Id: <20200825205950.730499-56-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200825205950.730499-1-richard.henderson@linaro.org> References: <20200825205950.730499-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::102f; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x102f.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.iglesias@gmail.com 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. 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 42d6d2a593..7fd1efd3fb 100644 --- a/target/microblaze/translate.c +++ b/target/microblaze/translate.c @@ -1337,13 +1337,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)