From patchwork Mon Mar 15 18:46:10 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 400534 Delivered-To: patch@linaro.org Received: by 2002:a02:8562:0:0:0:0:0 with SMTP id g89csp3679724jai; Mon, 15 Mar 2021 11:59:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzOwwaT7866IOkkCrLT5AbgCzdvmt9qmnuE4POsWTiw9YdwGE5/h/+L4eUF6GdN+g2q5qCj X-Received: by 2002:a02:3c01:: with SMTP id m1mr10534321jaa.87.1615834797901; Mon, 15 Mar 2021 11:59:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1615834797; cv=none; d=google.com; s=arc-20160816; b=BKMOH30lHKyHmwxLyRUnm58Oszkp/WTWoY+VPA3DMYc7TXAQJp7yPRMJ79VDtrYK7g SLe4Ou7JwIhVNUo9nvUi/wky5oA5bRb228vCaihqdl03V2ctZTRGY2J/fUJEsIk3Znfx npmgGBpwVUZZd1qdMIq21P7xonGiRVboBWNv7PHsNkb+dhpEJ3HXVDgWpRDzX3m6XM4l H4/HT01spAGEWIH0oYy6UsWBqqSa4HtnHT350vNYrTX/wzUFqxHsv9Sn/mjrTg8qWy9T 1aNhkKFzpBfLzZ1n15Fgl9JloKNHFFfTe6926F9Z8RSzy8Zt7z6LCJJcCfi69EmPDt68 gRTA== 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=bCT8Z895v2OzlUZ7cD3kW9yujJdvuk9uwCXjA4T3jIk=; b=J5OubJPuNLo7+mRYNJA7NJ1KfDvbRec9e97CqVlz4xpCLIPqBL+EVAJu/KTJRal6/z dd+7vzi6KXK5qYMIY5ttNSJPtSmSyQ1nyhPuPa14MkWkg3KIVATpzA1NlTGCGkx/QraA Lvf7RGNePgodCfQxvwrYxm5zDznnOzwBIO74KQk7O3kLqZ9er3HQiOkJqD2fm9EF+gco K9PNFHbF9QWFx7xA7p2getdJCHiZITzb8N65ylOCEB0Hvr5l68E68NAf6Fc+dhqieXWF XT4F4G1FT02xK8BVBFTBD8DVvmjO9gaY1ZX9BTm2qqaOBw84SllzaYCsJXNIQi8Ubk7M VUMQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="S/l/QMh7"; 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 n13si12318209ioc.51.2021.03.15.11.59.57 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 15 Mar 2021 11:59:57 -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="S/l/QMh7"; 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]:47260 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lLsRZ-00010t-8Y for patch@linaro.org; Mon, 15 Mar 2021 14:59:57 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:49156) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lLsEe-0007Vg-Bw for qemu-devel@nongnu.org; Mon, 15 Mar 2021 14:46:36 -0400 Received: from mail-oi1-x229.google.com ([2607:f8b0:4864:20::229]:34962) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lLsEb-0001gV-SR for qemu-devel@nongnu.org; Mon, 15 Mar 2021 14:46:36 -0400 Received: by mail-oi1-x229.google.com with SMTP id u6so28161086oic.2 for ; Mon, 15 Mar 2021 11:46:33 -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=bCT8Z895v2OzlUZ7cD3kW9yujJdvuk9uwCXjA4T3jIk=; b=S/l/QMh7JpW4qnOefRCyNXvksyo8S217mnklRgwRikpgnXDQydBS0T0GeGdqp/IzJh NKAznWgRc0arFaroB3NaXS0bGpwBfO4VQM5oxciFJGmFHXJsRRthu0qDObSoWqmbKdN5 jVGrxJwPM3nmf1RXMDhWjoiw7u+ObDcte2JOUKmyk/uxaQNyaLvZT3oMG2R74aLDvSEg 7sJbFzGPEerrce9CUNMapXG3qIzy3Ey0HBe2kSHe3nrrDf3BC+Qib2c96Y2jq47OxiN6 QqOWHei4eQ+DYNAA0SMvzVrHABsPZdxAFe6e8Wbw13itqAFFEQXRKTXkoz31pkB0DO7G k+jg== 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=bCT8Z895v2OzlUZ7cD3kW9yujJdvuk9uwCXjA4T3jIk=; b=uKCgz+oDlA4c/HIeXCZQsbFLU1sblCdkZi5pbm6tdUvIt8RgX9LScDgx+9vk/jW22M Rh3K+aOi0m5xk+uJFwGau/mVqhFyrVM0l4rfy+eZZxzYAkJdbBVcNPsg0UFLNszE9x+H hpylq+FE5Xoh3PnjV5uQjrJuVseDWL1Ym9iL+JFJMV3Agw5rKpsitP/iC0c4lCARfQom J0mEv34wuRQVHgk6oR9Dk6LB+x30jBXCNA0j98/kIhwaQ27bNyprC7QMOrgU+dgX1JXs hh4NYQqfCDH9TJy5YAu1iVM5Q038ymPwnWyLHi92Ja8cqGOOD+xTWiHv7a88vYKCVb13 l37A== X-Gm-Message-State: AOAM533e3Pilj0ncVux5jgHx0GE9/iAx8S5cTvy9btBO2sHv3rXodWCx CyawwR0A6SJfiT0ZHDkIMk3UGB861884lk3K X-Received: by 2002:a54:4413:: with SMTP id k19mr387861oiw.72.1615833992777; Mon, 15 Mar 2021 11:46:32 -0700 (PDT) Received: from localhost.localdomain (fixed-187-189-51-144.totalplay.net. [187.189.51.144]) by smtp.gmail.com with ESMTPSA id o25sm7519851otk.11.2021.03.15.11.46.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Mar 2021 11:46:32 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v4 12/17] target/ppc: Remove MSR_SA and MSR_AP from hflags Date: Mon, 15 Mar 2021 12:46:10 -0600 Message-Id: <20210315184615.1985590-13-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210315184615.1985590-1-richard.henderson@linaro.org> References: <20210315184615.1985590-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::229; envelope-from=richard.henderson@linaro.org; helo=mail-oi1-x229.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: qemu-ppc@nongnu.org, david@gibson.dropbear.id.au Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Nothing within the translator -- or anywhere else for that matter -- checks MSR_SA or MSR_AP on the 602. This may be a mistake. However, for the moment, we need not record these bits in hflags. This allows us to simplify HFLAGS_VSX computation by moving it to overlap with MSR_VSX. Signed-off-by: Richard Henderson --- target/ppc/cpu.h | 4 +--- target/ppc/helper_regs.c | 7 +++---- 2 files changed, 4 insertions(+), 7 deletions(-) -- 2.25.1 Reviewed-by: David Gibson diff --git a/target/ppc/cpu.h b/target/ppc/cpu.h index 07a4331eec..23ff16c154 100644 --- a/target/ppc/cpu.h +++ b/target/ppc/cpu.h @@ -599,14 +599,12 @@ enum { HFLAGS_DR = 4, /* MSR_DR */ HFLAGS_IR = 5, /* MSR_IR */ HFLAGS_SPE = 6, /* from MSR_SPE if cpu has SPE; avoid overlap w/ MSR_VR */ - HFLAGS_VSX = 7, /* from MSR_VSX if cpu has VSX; avoid overlap w/ MSR_AP */ HFLAGS_TM = 8, /* computed from MSR_TM */ HFLAGS_BE = 9, /* MSR_BE -- from elsewhere on embedded ppc */ HFLAGS_SE = 10, /* MSR_SE -- from elsewhere on embedded ppc */ HFLAGS_GTSE = 11, /* computed from SPR_LPCR[GTSE] */ HFLAGS_FP = 13, /* MSR_FP */ - HFLAGS_SA = 22, /* MSR_SA */ - HFLAGS_AP = 23, /* MSR_AP */ + HFLAGS_VSX = 23, /* MSR_VSX if cpu has VSX */ HFLAGS_VR = 25, /* MSR_VR if cpu has VRE */ }; diff --git a/target/ppc/helper_regs.c b/target/ppc/helper_regs.c index 8479789e24..d62921c322 100644 --- a/target/ppc/helper_regs.c +++ b/target/ppc/helper_regs.c @@ -95,8 +95,7 @@ void hreg_compute_hflags(CPUPPCState *env) /* Some bits come straight across from MSR. */ msr_mask = ((1 << MSR_LE) | (1 << MSR_PR) | - (1 << MSR_DR) | (1 << MSR_IR) | - (1 << MSR_FP) | (1 << MSR_SA) | (1 << MSR_AP)); + (1 << MSR_DR) | (1 << MSR_IR) | (1 << MSR_FP)); if (ppc_flags & POWERPC_FLAG_HID0_LE) { /* @@ -133,8 +132,8 @@ void hreg_compute_hflags(CPUPPCState *env) if (ppc_flags & POWERPC_FLAG_VRE) { msr_mask |= 1 << MSR_VR; } - if ((ppc_flags & POWERPC_FLAG_VSX) && (msr & (1 << MSR_VSX))) { - hflags |= 1 << HFLAGS_VSX; + if (ppc_flags & POWERPC_FLAG_VSX) { + msr_mask |= 1 << MSR_VSX; } if ((ppc_flags & POWERPC_FLAG_TM) && (msr & (1ull << MSR_TM))) { hflags |= 1 << HFLAGS_TM;