From patchwork Mon Aug 31 16:05:54 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 248799 Delivered-To: patch@linaro.org Received: by 2002:a92:5b9c:0:0:0:0:0 with SMTP id c28csp3456384ilg; Mon, 31 Aug 2020 09:26:52 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy4k7ZrIijVziCC5shH8eJCMh1TNlct6Zoeb0MTxcE6SqSdGk/Nwamy97a8YwWt/kIwaoEv X-Received: by 2002:a25:4642:: with SMTP id t63mr3348462yba.329.1598891212176; Mon, 31 Aug 2020 09:26:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598891212; cv=none; d=google.com; s=arc-20160816; b=nynsF4GdeQXY/SXNWEEG+YbtXxMERw3BdaOiQoDTB+DrDaofm+cX87TJCSL/k5dP04 hr479YkcYbFb+rDyOiQgjFb+YiR+zG7xTy0oo24FAFjzAryJDEFqqz87CfhVpd1Fg9Uw I5ayoN1GfWT/1iePsgc4f0CfgbSjfUwH8IL+WRWxoGVb+8r/BOIYPqYrAI+wY7rGJSFS LoucmoPJU5t5CeB/2Xs1S/qMlwDr5eof0F/Vw1NHaPfE7VufexZ1EFKwjNNZUZXmBQg1 HbKeEtZIBAO+igHhn9LgYdpGlr4Nj4sK4w7Ekzmacv2U1EYWSNsK5xlew6550t+Ei4pd cEqw== 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=QDTm4Rd7QGp1CLW4zO3AZdAzuiw+MvOs5jtCeQIlMUE=; b=C4yAoh7K1fcl44eNlzaSDIiz7uu+fBcP/iI2Y2F/l/CREHpPpzxyIWrLK5rNUzLK8B zhzEH83UKY3wNceejrtFzKv3EyLzTx9Ibq/GUI0fvFUIMIdEikZGl84vvh4DlHQPVJAi Js2StGO+GBj0n3WtFY7sP69hjYxJMxTONNWqdD7t11Hnhs5kKF66AEBlAGkARv0uiUvl SZPJfzieFVsZs0kc6R4oQk792Pi9R16KPiqK44ML/+aaxDr45Zjaglo2ORVlwhc8zo/W RXL/SqF92FomWomQMDPwt4Ls1muwvc+6V9pTH+R6jmDPIllop8m5SAVZ5fJfkVUOke9t i65w== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b="b/N8Y1oa"; 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 133si7495676ybe.226.2020.08.31.09.26.52 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 31 Aug 2020 09:26:52 -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="b/N8Y1oa"; 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]:42494 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kCmdv-0003f0-Mh for patch@linaro.org; Mon, 31 Aug 2020 12:26:51 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34760) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kCmLM-0006ca-MT for qemu-devel@nongnu.org; Mon, 31 Aug 2020 12:07:40 -0400 Received: from mail-pl1-x631.google.com ([2607:f8b0:4864:20::631]:41753) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kCmLK-0006AO-SE for qemu-devel@nongnu.org; Mon, 31 Aug 2020 12:07:40 -0400 Received: by mail-pl1-x631.google.com with SMTP id l9so1612307plt.8 for ; Mon, 31 Aug 2020 09:07:38 -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=QDTm4Rd7QGp1CLW4zO3AZdAzuiw+MvOs5jtCeQIlMUE=; b=b/N8Y1oaLN/rI99/xNazNhszo83o8gaSFxcoLxtu9Obdb97RfUbv7/W/ewpeRdp2ka 3b0cLjvh9+OXpN4nXNWndE2lJsYX+aYEK7cUo0s2e+3QPT6Q0Hmq1aW0IemCU5ONxSiD GmdZ9dN9KheLxXbSF9f9TP+shu0FlLtCo6SllBYFr8NH+iQwLg+vr8ZznYS3sprQ4+fW JztSeOFUrdMq9kRPSnjg8Nh68y/vPLoBOfSZ8OG6aQFPTR5JsSO+JZ06/J8Jyf4pbUl3 2r1Z3s5s1jdfzLxsQFf5Gwh215kXc3ANep8nlxnCBbeKRLeMhCT8W6Z+l8SVUFSmjLpr VQOQ== 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=QDTm4Rd7QGp1CLW4zO3AZdAzuiw+MvOs5jtCeQIlMUE=; b=Eb/4Wkz2IeJMH28mRCf389rhMlLU1y1TNiGfuXdxqcDTJjutn0Hw7+LAWd8C+YFycM n0kRWZItEWPul1zcY437tVwrYnUm0C8Y0ZzFd5A0sXdnhlqLinvzplKfnZx6NhRn/f0K 9MKrh0j6plyzgjkPyG662f7UmwTQjJW8UTN35h/QhaQMXUiE8Z578dYF6uwHcvsR4W+u W4YxymcWFStZzoI6urIG6pWkOKGnGmVU+SANSp+xCDQaL5uGYI537qqXivcynx4K+/W4 SCMjVCKAc82Arud6Bvn9lLHxxybeft2CuCyAsKPZgENzWm/wVdw4WO+erMrn35CX5bJV 2pnw== X-Gm-Message-State: AOAM533AO6owdo/e0bDlc+K5vc4lRFMBlZeNukMrO28rVKRLmL5ZqMrG inEOrTj2s0AvAL4tFdPa+Pz5uR1UV1h3dQ== X-Received: by 2002:a17:902:6ac3:: with SMTP id i3mr1595395plt.21.1598890057109; Mon, 31 Aug 2020 09:07:37 -0700 (PDT) Received: from localhost.localdomain ([71.212.141.89]) by smtp.gmail.com with ESMTPSA id gt13sm17218pjb.43.2020.08.31.09.07.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 31 Aug 2020 09:07:36 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PULL 69/76] target/microblaze: Tidy do_rti, do_rtb, do_rte Date: Mon, 31 Aug 2020 09:05:54 -0700 Message-Id: <20200831160601.833692-70-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::631; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x631.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" Since cpu_msr is no longer a 64-bit quantity, we can simplify the arithmetic in these functions. Tested-by: Edgar E. Iglesias Reviewed-by: Edgar E. Iglesias Signed-off-by: Richard Henderson --- target/microblaze/translate.c | 65 ++++++++++++++--------------------- 1 file changed, 25 insertions(+), 40 deletions(-) -- 2.25.1 diff --git a/target/microblaze/translate.c b/target/microblaze/translate.c index 6c1855b29a..0872795038 100644 --- a/target/microblaze/translate.c +++ b/target/microblaze/translate.c @@ -1494,59 +1494,44 @@ static void dec_msr(DisasContext *dc) } } -static inline void do_rti(DisasContext *dc) +static void do_rti(DisasContext *dc) { - TCGv_i32 t0, t1; - t0 = tcg_temp_new_i32(); - t1 = tcg_temp_new_i32(); - tcg_gen_mov_i32(t1, cpu_msr); - tcg_gen_shri_i32(t0, t1, 1); - tcg_gen_ori_i32(t1, t1, MSR_IE); - tcg_gen_andi_i32(t0, t0, (MSR_VM | MSR_UM)); + TCGv_i32 tmp = tcg_temp_new_i32(); - tcg_gen_andi_i32(t1, t1, ~(MSR_VM | MSR_UM)); - tcg_gen_or_i32(t1, t1, t0); - msr_write(dc, t1); - tcg_temp_free_i32(t1); - tcg_temp_free_i32(t0); + tcg_gen_shri_i32(tmp, cpu_msr, 1); + tcg_gen_ori_i32(cpu_msr, cpu_msr, MSR_IE); + tcg_gen_andi_i32(tmp, tmp, MSR_VM | MSR_UM); + tcg_gen_andi_i32(cpu_msr, cpu_msr, ~(MSR_VM | MSR_UM)); + tcg_gen_or_i32(cpu_msr, cpu_msr, tmp); + + tcg_temp_free_i32(tmp); dc->tb_flags &= ~DRTI_FLAG; } -static inline void do_rtb(DisasContext *dc) +static void do_rtb(DisasContext *dc) { - TCGv_i32 t0, t1; - t0 = tcg_temp_new_i32(); - t1 = tcg_temp_new_i32(); - tcg_gen_mov_i32(t1, cpu_msr); - tcg_gen_andi_i32(t1, t1, ~MSR_BIP); - tcg_gen_shri_i32(t0, t1, 1); - tcg_gen_andi_i32(t0, t0, (MSR_VM | MSR_UM)); + TCGv_i32 tmp = tcg_temp_new_i32(); - tcg_gen_andi_i32(t1, t1, ~(MSR_VM | MSR_UM)); - tcg_gen_or_i32(t1, t1, t0); - msr_write(dc, t1); - tcg_temp_free_i32(t1); - tcg_temp_free_i32(t0); + tcg_gen_shri_i32(tmp, cpu_msr, 1); + tcg_gen_andi_i32(cpu_msr, cpu_msr, ~(MSR_VM | MSR_UM | MSR_BIP)); + tcg_gen_andi_i32(tmp, tmp, (MSR_VM | MSR_UM)); + tcg_gen_or_i32(cpu_msr, cpu_msr, tmp); + + tcg_temp_free_i32(tmp); dc->tb_flags &= ~DRTB_FLAG; } -static inline void do_rte(DisasContext *dc) +static void do_rte(DisasContext *dc) { - TCGv_i32 t0, t1; - t0 = tcg_temp_new_i32(); - t1 = tcg_temp_new_i32(); + TCGv_i32 tmp = tcg_temp_new_i32(); - tcg_gen_mov_i32(t1, cpu_msr); - tcg_gen_ori_i32(t1, t1, MSR_EE); - tcg_gen_andi_i32(t1, t1, ~MSR_EIP); - tcg_gen_shri_i32(t0, t1, 1); - tcg_gen_andi_i32(t0, t0, (MSR_VM | MSR_UM)); + tcg_gen_shri_i32(tmp, cpu_msr, 1); + tcg_gen_ori_i32(cpu_msr, cpu_msr, MSR_EE); + tcg_gen_andi_i32(tmp, tmp, (MSR_VM | MSR_UM)); + tcg_gen_andi_i32(cpu_msr, cpu_msr, ~(MSR_VM | MSR_UM | MSR_EIP)); + tcg_gen_or_i32(cpu_msr, cpu_msr, tmp); - tcg_gen_andi_i32(t1, t1, ~(MSR_VM | MSR_UM)); - tcg_gen_or_i32(t1, t1, t0); - msr_write(dc, t1); - tcg_temp_free_i32(t1); - tcg_temp_free_i32(t0); + tcg_temp_free_i32(tmp); dc->tb_flags &= ~DRTE_FLAG; }