From patchwork Fri Oct 27 14:39:08 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 738697 Delivered-To: patch@linaro.org Received: by 2002:a5d:5101:0:b0:32d:baff:b0ca with SMTP id s1csp475855wrt; Fri, 27 Oct 2023 07:48:04 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGbJhmmGrS68wHrF3z92S7a+5Wtu1EIg2pp4Uuho4EcBYe8xZIPGSO93VmLpB0GumN67DI5 X-Received: by 2002:a05:620a:f05:b0:778:a66a:5a47 with SMTP id v5-20020a05620a0f0500b00778a66a5a47mr2682304qkl.9.1698418084560; Fri, 27 Oct 2023 07:48:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698418084; cv=none; d=google.com; s=arc-20160816; b=sNFpBR1O/UTq/O8hLdYqpiVcMgDndtmhOytLDYoEvcK77Hwa3V15ZM8cit432c/cgV KPf3hAJuOhJSVwsEHC8IDc8iyEvsgtGZOjZBJE/bi45xM3iDCaJOYNpZAAVlDZe4KD0d +8N7TC+Vfzkz3mL4bSY+smAW1LV0PIymoJbRrdAJMW3SACX+2c6CHgqliut6gmCuPmPJ auZd9/gqC5wwP/7Y0z3z/3jYlCD72KYz1fU133JDM4Y+Gsw/BYwvM9ZNCpChRAYXmoNO EBo29QaRkrj6Zq95ch6MlbkBV5sXs4cxRBBGqwb1+miDqTJg11ng5Hn5GS6pKBkJr0cr KWaw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to: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=CzSla6VJ+VFu9HZ2dJfSZCPn1N3Rp6Fy7bChRtXFBsk=; fh=PnYt+qEB9tAfMKoqBm2xjKOFpYyFFGPudh5cVIoieJM=; b=Q27nuZR7sgmbvInNhMVZSdLDD5kdAlL544dgV7nV+Fy8pdtmDaxggaf80m6NtwJnQ6 3GpmBb6HepOTCSSuQ2LODLXNFZPIkg5jZYDUZtLptXXDnzsax87YOf9ofmtP5O3rhYY6 dPOvojT/pEu8ReWNGMyvvtJK+0L0dm/lWqkNnSuYvvt2AJAbbYIycXikEK+VufMFgxr8 O0N26WVUN9UV50U/2F4Aqbd5EBtgOIkza/utlJw35rsfDRq0FqyoGcAiYFdCmYUD/amj RKQdG5Zi+TMUiTxcoLwDys7RChlRFPywXx94ZuR7mOJZOppwVylhpSyg86Oux3AhR7Vz 8O9Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=YvHMXFis; 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 b20-20020a05620a0cd400b007758ffaef15si732497qkj.522.2023.10.27.07.48.04 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 27 Oct 2023 07:48:04 -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=YvHMXFis; 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] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qwO0v-00011s-Ku; Fri, 27 Oct 2023 10:40:41 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qwO0I-0007LO-75 for qemu-devel@nongnu.org; Fri, 27 Oct 2023 10:40:02 -0400 Received: from mail-lf1-x135.google.com ([2a00:1450:4864:20::135]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qwO05-00087E-K5 for qemu-devel@nongnu.org; Fri, 27 Oct 2023 10:40:01 -0400 Received: by mail-lf1-x135.google.com with SMTP id 2adb3069b0e04-507d7b73b74so2984318e87.3 for ; Fri, 27 Oct 2023 07:39:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1698417587; x=1699022387; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=CzSla6VJ+VFu9HZ2dJfSZCPn1N3Rp6Fy7bChRtXFBsk=; b=YvHMXFis3UNUnat+djRYUdPBQBaXhPfzR4XqjFCYqbksO1KAoVfDbUEJkJOOMtZ3UJ xRKqfPKbj0C0MV2JwUGg5Sp3FUPXyimgkw3zvEysnYCBNfzGBy5JiQ7Wstm6FSNobJU8 Vz/63U2IvFLolvhK4AH/fMU4DkT/xxQTwzMXhu0VWXm90nRaB1HynLlggPk9zJH/6Dut P287r7Ytpflw9M2FAcMDd3EljW65w9z85TzXwZoOBxu/jFQULfxH4F0J1PvzDz9fR3a9 kDMiJT2tJHWKaAjqS/xNmNZp2ag1UaRgWR0itbUkRKsdcUlHvYpxSd3gwYfUpALubW4/ NotA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698417587; x=1699022387; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=CzSla6VJ+VFu9HZ2dJfSZCPn1N3Rp6Fy7bChRtXFBsk=; b=jxZ84FQ0t9F6bJUtSAuiFqkKjo6ILf/EoLr4vGJiY+ajw2eMbRg4nbsltj3cO4YDbl tgSwnI2mqGHax3XnfxpysFsCi/d/bx7pUiiAk+iny3VLPk3YroNNRjdnErXnWB3OtCxk h2MVwhGlZGEcs/GZPY0HF7zyGTZrGbFpjhWnxqFOCLRCNQ7E1yZbSt8vQ0tl/jz9JnmS L2+OvNT6KxjkgzTig54gYf8kVkiynbonRtts9YIpTnjbEdjBVmaiQD9Kfj5tjC9zVqkV QiIETR3OoV9X08bHnmfs2L2Yj3IP7AKRE++bQa/g61jsI9KJPKVn7zF2EnynMZcvpOlk sBQQ== X-Gm-Message-State: AOJu0Yx0id+GzRIOZtkv9J1SvPSd+02p2nOdwSC3QT5teoXDO6zrKbHC gQvHAoJvQGDELztFltt0JclSzx/JCRWkz7Vn2kA= X-Received: by 2002:ac2:5e6c:0:b0:503:905:c5a3 with SMTP id a12-20020ac25e6c000000b005030905c5a3mr1779341lfr.35.1698417587466; Fri, 27 Oct 2023 07:39:47 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id e2-20020a5d5002000000b0031c6581d55esm1874123wrt.91.2023.10.27.07.39.47 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 27 Oct 2023 07:39:47 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 07/41] target/arm: Move ID_AA64PFR* tests together Date: Fri, 27 Oct 2023 15:39:08 +0100 Message-Id: <20231027143942.3413881-8-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231027143942.3413881-1-peter.maydell@linaro.org> References: <20231027143942.3413881-1-peter.maydell@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::135; envelope-from=peter.maydell@linaro.org; helo=mail-lf1-x135.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, 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.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Move all the ID_AA64PFR* feature test functions together. Signed-off-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Message-id: 20231024163510.2972081-6-peter.maydell@linaro.org --- target/arm/cpu-features.h | 86 +++++++++++++++++++-------------------- 1 file changed, 43 insertions(+), 43 deletions(-) diff --git a/target/arm/cpu-features.h b/target/arm/cpu-features.h index e73120ef974..0ed05b8b19e 100644 --- a/target/arm/cpu-features.h +++ b/target/arm/cpu-features.h @@ -631,6 +631,49 @@ static inline bool isar_feature_aa64_rme(const ARMISARegisters *id) return FIELD_EX64(id->id_aa64pfr0, ID_AA64PFR0, RME) != 0; } +static inline bool isar_feature_aa64_dit(const ARMISARegisters *id) +{ + return FIELD_EX64(id->id_aa64pfr0, ID_AA64PFR0, DIT) != 0; +} + +static inline bool isar_feature_aa64_scxtnum(const ARMISARegisters *id) +{ + int key = FIELD_EX64(id->id_aa64pfr0, ID_AA64PFR0, CSV2); + if (key >= 2) { + return true; /* FEAT_CSV2_2 */ + } + if (key == 1) { + key = FIELD_EX64(id->id_aa64pfr1, ID_AA64PFR1, CSV2_FRAC); + return key >= 2; /* FEAT_CSV2_1p2 */ + } + return false; +} + +static inline bool isar_feature_aa64_ssbs(const ARMISARegisters *id) +{ + return FIELD_EX64(id->id_aa64pfr1, ID_AA64PFR1, SSBS) != 0; +} + +static inline bool isar_feature_aa64_bti(const ARMISARegisters *id) +{ + return FIELD_EX64(id->id_aa64pfr1, ID_AA64PFR1, BT) != 0; +} + +static inline bool isar_feature_aa64_mte_insn_reg(const ARMISARegisters *id) +{ + return FIELD_EX64(id->id_aa64pfr1, ID_AA64PFR1, MTE) != 0; +} + +static inline bool isar_feature_aa64_mte(const ARMISARegisters *id) +{ + return FIELD_EX64(id->id_aa64pfr1, ID_AA64PFR1, MTE) >= 2; +} + +static inline bool isar_feature_aa64_sme(const ARMISARegisters *id) +{ + return FIELD_EX64(id->id_aa64pfr1, ID_AA64PFR1, SME) != 0; +} + static inline bool isar_feature_aa64_tgran4_lpa2(const ARMISARegisters *id) { return FIELD_SEX64(id->id_aa64mmfr0, ID_AA64MMFR0, TGRAN4) >= 1; @@ -791,26 +834,6 @@ static inline bool isar_feature_aa64_e0pd(const ARMISARegisters *id) return FIELD_EX64(id->id_aa64mmfr2, ID_AA64MMFR2, E0PD) != 0; } -static inline bool isar_feature_aa64_bti(const ARMISARegisters *id) -{ - return FIELD_EX64(id->id_aa64pfr1, ID_AA64PFR1, BT) != 0; -} - -static inline bool isar_feature_aa64_mte_insn_reg(const ARMISARegisters *id) -{ - return FIELD_EX64(id->id_aa64pfr1, ID_AA64PFR1, MTE) != 0; -} - -static inline bool isar_feature_aa64_mte(const ARMISARegisters *id) -{ - return FIELD_EX64(id->id_aa64pfr1, ID_AA64PFR1, MTE) >= 2; -} - -static inline bool isar_feature_aa64_sme(const ARMISARegisters *id) -{ - return FIELD_EX64(id->id_aa64pfr1, ID_AA64PFR1, SME) != 0; -} - static inline bool isar_feature_aa64_pmuv3p1(const ARMISARegisters *id) { return FIELD_EX64(id->id_aa64dfr0, ID_AA64DFR0, PMUVER) >= 4 && @@ -829,29 +852,6 @@ static inline bool isar_feature_aa64_pmuv3p5(const ARMISARegisters *id) FIELD_EX64(id->id_aa64dfr0, ID_AA64DFR0, PMUVER) != 0xf; } -static inline bool isar_feature_aa64_dit(const ARMISARegisters *id) -{ - return FIELD_EX64(id->id_aa64pfr0, ID_AA64PFR0, DIT) != 0; -} - -static inline bool isar_feature_aa64_scxtnum(const ARMISARegisters *id) -{ - int key = FIELD_EX64(id->id_aa64pfr0, ID_AA64PFR0, CSV2); - if (key >= 2) { - return true; /* FEAT_CSV2_2 */ - } - if (key == 1) { - key = FIELD_EX64(id->id_aa64pfr1, ID_AA64PFR1, CSV2_FRAC); - return key >= 2; /* FEAT_CSV2_1p2 */ - } - return false; -} - -static inline bool isar_feature_aa64_ssbs(const ARMISARegisters *id) -{ - return FIELD_EX64(id->id_aa64pfr1, ID_AA64PFR1, SSBS) != 0; -} - static inline bool isar_feature_aa64_debugv8p2(const ARMISARegisters *id) { return FIELD_EX64(id->id_aa64dfr0, ID_AA64DFR0, DEBUGVER) >= 8;