From patchwork Fri Oct 27 14:39:06 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 738696 Delivered-To: patch@linaro.org Received: by 2002:a5d:5101:0:b0:32d:baff:b0ca with SMTP id s1csp475850wrt; Fri, 27 Oct 2023 07:48:04 -0700 (PDT) X-Google-Smtp-Source: AGHT+IH2aqFvOzV8XXCXBhBTberdV7XEqqAhwrGfI1xvXhArDoIDCA4ZumQdWBOqzlk5YQaF5Lx5 X-Received: by 2002:a05:620a:4007:b0:774:9dc7:ce04 with SMTP id h7-20020a05620a400700b007749dc7ce04mr3220061qko.14.1698418084136; 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=cm0qYgPmT/KMcwW7ZYgIn2a//I0wWxWZwjuOnVDyIbwrbBRqjrytuWXX9zBP3MJzS9 twhMgN5g6TmeuzuNzGo3PpmxBJg9ugGPvBq7iDok5YN0bO/pcQubM13tGEE4ToN2qb1H dVsB+ldjqM0SDC8gZQOUEtc75ZIPG9FWaBcNFlWyNhG+qK9tyrr7AlY9Mr6dsi8OO214 l8HkjCqQ/wkHNc+l71zfcCk1mZyiJEQLSEQmKhS2Z/ZjNBtWRaw323SjncHMg7bCeLNV EM+X88mt3kt77jJYC3+VepoMnyhuHFI380Z4aOq2IlMTrSY74hfqFulQQ5T5i6XU6PY0 fr4w== 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=a5UT81fbfzfhP+2DLCF06+YDd0SwIv4OzRvdR3APDic=; fh=PnYt+qEB9tAfMKoqBm2xjKOFpYyFFGPudh5cVIoieJM=; b=Ha/MWhj3uqtp9RyymzXHULdkG4HPA50rJw11Pu1sDXo7up9V8ss32rZ+cTNgVj6hCS aL/UL1m2OImIAPxm72hhEoyyZTnYUxihxA+/9OznlcEnq9Btc3FbzPKrfmOIm5wDP38M PPqdtdWQjkchWp+6JP2Iuu3xShx3qUTw0lI5bN3lqKMv6cJhi8XVHsftc1eKZwmmjyPi Fc22X958gQmRnMBRK08SWuCgEDXBbIq8RD6BvQzSzN66pLd9C0bphF7YRxyheA/0e8le VXhL4y+YCPf66AL6yBO5LACg1uLBxwg//ecduPGlcBHv1nbPw2gx7BXvunMdJKWAa5co EROw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="QGuVWTl/"; 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 a11-20020a05620a124b00b0077435f2b668si755175qkl.207.2023.10.27.07.48.03 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="QGuVWTl/"; 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 1qwO08-0007Cq-6v; Fri, 27 Oct 2023 10:39:52 -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 1qwO07-0007CD-8b for qemu-devel@nongnu.org; Fri, 27 Oct 2023 10:39:51 -0400 Received: from mail-lf1-x131.google.com ([2a00:1450:4864:20::131]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qwO05-00087D-Dt for qemu-devel@nongnu.org; Fri, 27 Oct 2023 10:39:51 -0400 Received: by mail-lf1-x131.google.com with SMTP id 2adb3069b0e04-507b9408c61so3024250e87.0 for ; Fri, 27 Oct 2023 07:39:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1698417586; x=1699022386; 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=a5UT81fbfzfhP+2DLCF06+YDd0SwIv4OzRvdR3APDic=; b=QGuVWTl/YoEmfdVRsG0nfJRLcIOoz1+VONurjgv6meXLHvFrq2fB9ocA/Ki2b0Sm0t Qqhb6QhCPob8YGGefbcNUb0FWhkaT4bJo5gc+6ykbvnrTGfp//PhClNu4K2V+/1M1K49 25a6OO+a6ExR4UuW6xFDxqqlGrYwjSEPQYdy3Es+nqKfSm5SjMwY6YPeI1T0oLiyY8iV Do6quncjkTuMJ21dLK0VnSV+tEik64b1U8TD07MgSWD/q3ycUkKWgmTaNuX46pd7Y6MB Vcwn+7ZmEBLACKsXahxg4y9/DO/Wz5QOLF0J3JgMZy0bsYYby1pnq80uOsYcElSIDmNA fg4Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698417586; x=1699022386; 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=a5UT81fbfzfhP+2DLCF06+YDd0SwIv4OzRvdR3APDic=; b=pSCgGIvy+u68LSCODY6RRVkmVtsogtbTwysTuMhUMcWbQHcUcmxlYML6f6uRBIhdQm W9YEqWvxV1EFtrrKa8aQuMcVDmsOcWY190Os+jVMmXhEL8I/OvIsCQ0hWnK6oDAdYcqy 2Lw1WtgFulkxHuPEh0NzScu0A3Huf8IXEtBdus6bVshN4R1hU5hlI4bB8NPYZiaxgGP1 nhFffdkl/fVUJQw2YvNOfXey4w4rlcnE8cH4AmcI/UsHm236O2IrW1nOpzPo20nO0/xT eZUTP1Ijyf90pObLcxp/RDAXrL17tfj40RVNsTuMVtWpp+dV/f92O1hJKlRqnmHTDcdl NmPA== X-Gm-Message-State: AOJu0Ywi6d6I1Pthm3pyP3fxFlNPHZsR57/cLgFqQFRlMNzUpGff/r3f P5wjs1z4xYXOG9D4NUTVz3ZQX5gsS+N/2qCEFwY= X-Received: by 2002:ac2:46d4:0:b0:508:1851:d29b with SMTP id p20-20020ac246d4000000b005081851d29bmr1959301lfo.17.1698417586521; Fri, 27 Oct 2023 07:39:46 -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.46 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 27 Oct 2023 07:39:46 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 05/41] target/arm: Move ID_AA64MMFR0 tests up to before MMFR1 and MMFR2 Date: Fri, 27 Oct 2023 15:39:06 +0100 Message-Id: <20231027143942.3413881-6-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::131; envelope-from=peter.maydell@linaro.org; helo=mail-lf1-x131.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.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 the ID_AA64MMFR0 feature test functions up so they are before the ones for ID_AA64MMFR1 and ID_AA64MMFR2. Signed-off-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Message-id: 20231024163510.2972081-4-peter.maydell@linaro.org --- target/arm/cpu-features.h | 120 +++++++++++++++++++------------------- 1 file changed, 60 insertions(+), 60 deletions(-) diff --git a/target/arm/cpu-features.h b/target/arm/cpu-features.h index fc85a8fe130..90200a4b98f 100644 --- a/target/arm/cpu-features.h +++ b/target/arm/cpu-features.h @@ -606,6 +606,66 @@ 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_tgran4_lpa2(const ARMISARegisters *id) +{ + return FIELD_SEX64(id->id_aa64mmfr0, ID_AA64MMFR0, TGRAN4) >= 1; +} + +static inline bool isar_feature_aa64_tgran4_2_lpa2(const ARMISARegisters *id) +{ + unsigned t = FIELD_EX64(id->id_aa64mmfr0, ID_AA64MMFR0, TGRAN4_2); + return t >= 3 || (t == 0 && isar_feature_aa64_tgran4_lpa2(id)); +} + +static inline bool isar_feature_aa64_tgran16_lpa2(const ARMISARegisters *id) +{ + return FIELD_EX64(id->id_aa64mmfr0, ID_AA64MMFR0, TGRAN16) >= 2; +} + +static inline bool isar_feature_aa64_tgran16_2_lpa2(const ARMISARegisters *id) +{ + unsigned t = FIELD_EX64(id->id_aa64mmfr0, ID_AA64MMFR0, TGRAN16_2); + return t >= 3 || (t == 0 && isar_feature_aa64_tgran16_lpa2(id)); +} + +static inline bool isar_feature_aa64_tgran4(const ARMISARegisters *id) +{ + return FIELD_SEX64(id->id_aa64mmfr0, ID_AA64MMFR0, TGRAN4) >= 0; +} + +static inline bool isar_feature_aa64_tgran16(const ARMISARegisters *id) +{ + return FIELD_EX64(id->id_aa64mmfr0, ID_AA64MMFR0, TGRAN16) >= 1; +} + +static inline bool isar_feature_aa64_tgran64(const ARMISARegisters *id) +{ + return FIELD_SEX64(id->id_aa64mmfr0, ID_AA64MMFR0, TGRAN64) >= 0; +} + +static inline bool isar_feature_aa64_tgran4_2(const ARMISARegisters *id) +{ + unsigned t = FIELD_EX64(id->id_aa64mmfr0, ID_AA64MMFR0, TGRAN4_2); + return t >= 2 || (t == 0 && isar_feature_aa64_tgran4(id)); +} + +static inline bool isar_feature_aa64_tgran16_2(const ARMISARegisters *id) +{ + unsigned t = FIELD_EX64(id->id_aa64mmfr0, ID_AA64MMFR0, TGRAN16_2); + return t >= 2 || (t == 0 && isar_feature_aa64_tgran16(id)); +} + +static inline bool isar_feature_aa64_tgran64_2(const ARMISARegisters *id) +{ + unsigned t = FIELD_EX64(id->id_aa64mmfr0, ID_AA64MMFR0, TGRAN64_2); + return t >= 2 || (t == 0 && isar_feature_aa64_tgran64(id)); +} + +static inline bool isar_feature_aa64_fgt(const ARMISARegisters *id) +{ + return FIELD_EX64(id->id_aa64mmfr0, ID_AA64MMFR0, FGT) != 0; +} + static inline bool isar_feature_aa64_vh(const ARMISARegisters *id) { return FIELD_EX64(id->id_aa64mmfr1, ID_AA64MMFR1, VH) != 0; @@ -764,66 +824,6 @@ static inline bool isar_feature_aa64_hbc(const ARMISARegisters *id) return FIELD_EX64(id->id_aa64isar2, ID_AA64ISAR2, BC) != 0; } -static inline bool isar_feature_aa64_tgran4_lpa2(const ARMISARegisters *id) -{ - return FIELD_SEX64(id->id_aa64mmfr0, ID_AA64MMFR0, TGRAN4) >= 1; -} - -static inline bool isar_feature_aa64_tgran4_2_lpa2(const ARMISARegisters *id) -{ - unsigned t = FIELD_EX64(id->id_aa64mmfr0, ID_AA64MMFR0, TGRAN4_2); - return t >= 3 || (t == 0 && isar_feature_aa64_tgran4_lpa2(id)); -} - -static inline bool isar_feature_aa64_tgran16_lpa2(const ARMISARegisters *id) -{ - return FIELD_EX64(id->id_aa64mmfr0, ID_AA64MMFR0, TGRAN16) >= 2; -} - -static inline bool isar_feature_aa64_tgran16_2_lpa2(const ARMISARegisters *id) -{ - unsigned t = FIELD_EX64(id->id_aa64mmfr0, ID_AA64MMFR0, TGRAN16_2); - return t >= 3 || (t == 0 && isar_feature_aa64_tgran16_lpa2(id)); -} - -static inline bool isar_feature_aa64_tgran4(const ARMISARegisters *id) -{ - return FIELD_SEX64(id->id_aa64mmfr0, ID_AA64MMFR0, TGRAN4) >= 0; -} - -static inline bool isar_feature_aa64_tgran16(const ARMISARegisters *id) -{ - return FIELD_EX64(id->id_aa64mmfr0, ID_AA64MMFR0, TGRAN16) >= 1; -} - -static inline bool isar_feature_aa64_tgran64(const ARMISARegisters *id) -{ - return FIELD_SEX64(id->id_aa64mmfr0, ID_AA64MMFR0, TGRAN64) >= 0; -} - -static inline bool isar_feature_aa64_tgran4_2(const ARMISARegisters *id) -{ - unsigned t = FIELD_EX64(id->id_aa64mmfr0, ID_AA64MMFR0, TGRAN4_2); - return t >= 2 || (t == 0 && isar_feature_aa64_tgran4(id)); -} - -static inline bool isar_feature_aa64_tgran16_2(const ARMISARegisters *id) -{ - unsigned t = FIELD_EX64(id->id_aa64mmfr0, ID_AA64MMFR0, TGRAN16_2); - return t >= 2 || (t == 0 && isar_feature_aa64_tgran16(id)); -} - -static inline bool isar_feature_aa64_tgran64_2(const ARMISARegisters *id) -{ - unsigned t = FIELD_EX64(id->id_aa64mmfr0, ID_AA64MMFR0, TGRAN64_2); - return t >= 2 || (t == 0 && isar_feature_aa64_tgran64(id)); -} - -static inline bool isar_feature_aa64_fgt(const ARMISARegisters *id) -{ - return FIELD_EX64(id->id_aa64mmfr0, ID_AA64MMFR0, FGT) != 0; -} - static inline bool isar_feature_aa64_dit(const ARMISARegisters *id) { return FIELD_EX64(id->id_aa64pfr0, ID_AA64PFR0, DIT) != 0;