From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR02-DB5-obe.outbound.protection.outlook.com (mail-db5eur02on2051.outbound.protection.outlook.com [40.107.249.51]) by sourceware.org (Postfix) with ESMTPS id 458CA3858D35 for ; Tue, 3 Oct 2023 15:19:50 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 458CA3858D35 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=arm.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=NvxktMzPhs20w3guiZxCdrsXcAERqeoYbSOX7Zz4sVA=; b=SdN5td10f0I8ilcNWYDlfOXjsTHbxQ76iSUPzwBedhkrQZysCyoCdLs1u5nZdnC9b/MtuSvr0TlaUl7WPWzfNo7lWt4rU02L5PLUI0BzbmAXCJyEPxj5ExwMTESBKu6tIQEYRpzD3aotw+fOCPVR9tdPx/OvNpmi0jPHg6JUTnA= Received: from AS9PR06CA0634.eurprd06.prod.outlook.com (2603:10a6:20b:46f::21) by AS2PR08MB9713.eurprd08.prod.outlook.com (2603:10a6:20b:607::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6838.30; Tue, 3 Oct 2023 15:19:47 +0000 Received: from AM7EUR03FT004.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:46f:cafe::62) by AS9PR06CA0634.outlook.office365.com (2603:10a6:20b:46f::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6838.30 via Frontend Transport; Tue, 3 Oct 2023 15:19:47 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 63.35.35.123 as permitted sender) receiver=protection.outlook.com; client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com; pr=C Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by AM7EUR03FT004.mail.protection.outlook.com (100.127.140.210) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6863.24 via Frontend Transport; Tue, 3 Oct 2023 15:19:47 +0000 Received: ("Tessian outbound ab4fc72d2cd4:v211"); Tue, 03 Oct 2023 15:19:47 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 4798d63284989d2b X-CR-MTA-TID: 64aa7808 Received: from 5850fd01e21b.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 3E99D544-10D0-482C-AC5C-CA900CD09002.1; Tue, 03 Oct 2023 15:19:40 +0000 Received: from EUR04-HE1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 5850fd01e21b.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Tue, 03 Oct 2023 15:19:40 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=PyoIzZnIApxJAAVcpyrmuX6cvHR8g2ZDNNoTaMmy0vZVVOjTKSeH6gfdglvco1IuuPoqj+56xJoLH7yibckNOUEtP8UDL4ukLDsyL+WEzDpPipm3JJuzoKx5JFKuIyffBXUjSbfMYwNPUcfmNPksq5MpqXOqh1m1UA+1h/nY4lfD9rcCLmxmyYIcdyCNMtNJQlVzA4v3r3Nw057UC7TY63gooeUoL/1SE31X567DlKoXLzT7p+TnRHiU0Ads4OywA8cKAUgm/ki+3fkxA31B0/wGJ9rydnxzh9ceRw7SgnnYHnKZZ6CxBlcJ9zhevz2sGsdtBRJER+v8TF1Ma++cuw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=NvxktMzPhs20w3guiZxCdrsXcAERqeoYbSOX7Zz4sVA=; b=l8JEZCw1JFmGqW9KUImnls8Dj9iqXKdp/kaaQFzTImJftAn82zW8v17J1Rly7+z3xb6Qz3bf1IR8ReVx/zF6gvC7z1kBqZ5lDKQRRb8vxI87JR4+4USrgHjRc0Op10gpbLTAgtRrkjMyJ9apE+Neq0OxTju+wfrkDQYRND8PTaf0tGe7lL8viornPZCXT9vMm4c1RVAmoY+Io9dcdA5KRfrLxj5oS8x49MtyaOKSeZdiAPzFzk5sja9ORvHZxFcb6jHrdPXyI8mfYQB64hG8P3oNDbyRat1Dj2x6zgskiAeRIbhRKdsR4XHV87S8RUYdvWwh5IB1gcVuGhs/4hobVQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 40.67.248.234) smtp.rcpttodomain=gcc.gnu.org smtp.mailfrom=arm.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=NvxktMzPhs20w3guiZxCdrsXcAERqeoYbSOX7Zz4sVA=; b=SdN5td10f0I8ilcNWYDlfOXjsTHbxQ76iSUPzwBedhkrQZysCyoCdLs1u5nZdnC9b/MtuSvr0TlaUl7WPWzfNo7lWt4rU02L5PLUI0BzbmAXCJyEPxj5ExwMTESBKu6tIQEYRpzD3aotw+fOCPVR9tdPx/OvNpmi0jPHg6JUTnA= Received: from AM5PR0301CA0015.eurprd03.prod.outlook.com (2603:10a6:206:14::28) by AS8PR08MB6071.eurprd08.prod.outlook.com (2603:10a6:20b:29f::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6838.33; Tue, 3 Oct 2023 15:19:36 +0000 Received: from AM7EUR03FT022.eop-EUR03.prod.protection.outlook.com (2603:10a6:206:14:cafe::f) by AM5PR0301CA0015.outlook.office365.com (2603:10a6:206:14::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6838.30 via Frontend Transport; Tue, 3 Oct 2023 15:19:36 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 40.67.248.234) smtp.mailfrom=arm.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 40.67.248.234 as permitted sender) receiver=protection.outlook.com; client-ip=40.67.248.234; helo=nebula.arm.com; pr=C Received: from nebula.arm.com (40.67.248.234) by AM7EUR03FT022.mail.protection.outlook.com (100.127.140.217) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6863.24 via Frontend Transport; Tue, 3 Oct 2023 15:19:36 +0000 Received: from AZ-NEU-EX04.Arm.com (10.251.24.32) by AZ-NEU-EX04.Arm.com (10.251.24.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27; Tue, 3 Oct 2023 15:19:35 +0000 Received: from e125768.cambridge.arm.com (10.2.78.50) by mail.arm.com (10.251.24.32) with Microsoft SMTP Server id 15.1.2507.27 via Frontend Transport; Tue, 3 Oct 2023 15:19:35 +0000 From: Victor Do Nascimento To: CC: , , , Victor Do Nascimento Subject: [PATCH 2/6] aarch64: Add support for aarch64-sys-regs.def Date: Tue, 3 Oct 2023 16:18:33 +0100 Message-ID: <20231003151920.1853404-3-victor.donascimento@arm.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231003151920.1853404-1-victor.donascimento@arm.com> References: <20231003151920.1853404-1-victor.donascimento@arm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-EOPAttributedMessage: 1 X-MS-TrafficTypeDiagnostic: AM7EUR03FT022:EE_|AS8PR08MB6071:EE_|AM7EUR03FT004:EE_|AS2PR08MB9713:EE_ X-MS-Office365-Filtering-Correlation-Id: 774ee182-825f-4e2f-66dc-08dbc4242e04 x-checkrecipientrouted: true NoDisclaimer: true X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: Va56BjN5NTCzkyUKdvIlZTuB9GdHDAKFGGOpW9u9G0/af1SrSXsZn2vQ37QF9WF50BXOfNVHhkiXpn/hN5BhZi51tVMSbklNPIVpU46ZtDIWx3zEU+VC7AzZTV2PKIJ9qYCkFTkzFj7EdH15ol91EhVFT0In2jZ/ZiQb6S3YsYocKiBUPduMOUqhqs9GGAKS8GKX+qTg7eWiF/Cm5dj0b3nCQV0zxDh8h/c8qPpJXaJpPLOLKNVnh0X/FrQfFia4OA6wOIw7cnSez5VkL3ipKRRqg0fL/OSsW9+nHAgLIaojpiiYA/CrFH6sq8dAhanEqcMML9dwrYYLLxcqIuLTCY4Q4TG4AdneQJ/f1iJBl8prbEfkY9BWV1cdD97MPMrKWxMJHn4z1k4rFrH7MzQtrM7ynLjx35XQyBc09V1aveRmyVIQLSfa7gI7oxHR21mGCcEOAa06JIFfOEa9749axjRAobMUP7jQjOX+imu1nMevtNbEcIwN+WE69nVg+7YcrULJFq4OgQ/8CpxtxZsr+tLX4FJKqxB27fM+DbvQyOYhwRIE7BCDO5w9wuuRVPlcPWRzSeijz+tGzE67shhN5IIoATyGy6oA5Y2Xib+396QHCjYQ6cu7eWzYvBOgquKpKsS6Q5FJkh2epDLQlOmeWUBx7WqiEM46hdxlNU3/I8qF66ZQywEuTfxWkwsUoYZpBqD/nyy+J/oRYICMVwW/HPml9gx8vvj3K3hSxvOovix6qjlpRAa7E//j1pEkdohfu2nKAdM9j9MQdPhSfXVYyw== X-Forefront-Antispam-Report-Untrusted: CIP:40.67.248.234;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:nebula.arm.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230031)(4636009)(376002)(396003)(346002)(136003)(39860400002)(230922051799003)(186009)(64100799003)(451199024)(82310400011)(1800799009)(40470700004)(46966006)(36840700001)(7696005)(478600001)(47076005)(83380400001)(26005)(336012)(426003)(1076003)(2616005)(54906003)(2906002)(6916009)(316002)(70206006)(70586007)(8676002)(4326008)(8936002)(5660300002)(41300700001)(36756003)(36860700001)(82740400003)(86362001)(356005)(81166007)(40480700001)(40460700003)(36900700001);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR08MB6071 X-MS-Exchange-Transport-CrossTenantHeadersStripped: AM7EUR03FT004.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 424b35e5-8549-4111-666f-08dbc42427c4 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: mTBdV7T7n9tJGvEfZpipKsFU9SjjEWfK+cVmLY2LrFteKTFiFYdcmopW4j7wNzf3Fk2t5Dv0SdWZxZ19Ux/aeOeM8yTpDRBviGcr6UHCvDt2XnK1Lmc1MIPD/u6SZb9eCxnrGh72uvUQS2Z56YPWcWfiojcdSzqSzwKoa6vMAdbnnjcX4f6+4T0YTiDHmubkk01iXYMAYUeOHMFMaSS8aoKuQhLeGSnJel/VRRYrxPnra/Gf7FDUBY/JR2YuXn86e8y19kwYy+ZU2QExVC/s7SVG+lSBA3pUmQtVpQlhunlx6w+AmbczG1CqciXCPOJYomsAXZbYPFILWgNJLAtdOr0ZMuFlU/n9F7wnb7C2Z5DR2o3erJPLjd+dcNqnyIeA5FyKA/WIOynz2LXieyt5/xq2SVPRW/QjrSUex+bivuLPn2kmSYa8fYIP4wEC2J33MmXPE8xfDkSRLHS+y1OQ6r2dqsn94QthlMxChjm/VpuXLjYJ7TlCZ+Zsja/F5Elo2Mr1BhVdXGe/rzk7mQuSLYsi2/U1afan5Mh6yGJL3u/CQ3Pr49f/VNTRzHfSvki0B+SKAUOwDS5qOvZbLfTrUWf3UeVzCBgr+S1gpvTWodznSQ6CsGjusoNZKhjYeV6h2TQcCyry9srf6s/oI5wgR4ce/7fKtiASwNrKNd8NpwHKuhAOdCafwxIIp4So2O+H8PrTiOlYth/HuXlJ46aP6FGQv4KMnRll/ZX6aQMSA66Onqm6DldgqWHi8TwH4vSc X-Forefront-Antispam-Report: CIP:63.35.35.123;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-1.mta.getcheckrecipient.com;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(13230031)(4636009)(376002)(396003)(346002)(136003)(39860400002)(230922051799003)(64100799003)(186009)(451199024)(82310400011)(1800799009)(40470700004)(36840700001)(46966006)(40460700003)(2906002)(7696005)(70206006)(1076003)(2616005)(83380400001)(478600001)(6916009)(47076005)(86362001)(70586007)(336012)(36860700001)(81166007)(426003)(82740400003)(26005)(316002)(4326008)(40480700001)(36756003)(54906003)(5660300002)(41300700001)(8676002)(8936002);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Oct 2023 15:19:47.2183 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 774ee182-825f-4e2f-66dc-08dbc4242e04 X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[63.35.35.123];Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com] X-MS-Exchange-CrossTenant-AuthSource: AM7EUR03FT004.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS2PR08MB9713 X-Spam-Status: No, score=-12.8 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,FORGED_SPF_HELO,GIT_PATCH_0,KAM_DMARC_NONE,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_NONE,TXREP,UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: This patch defines the structure of a new .def file used for representing the aarch64 system registers, what information it should hold and the basic framework in GCC to process this file. Entries in the aarch64-system-regs.def file should be as follows: SYSREG (NAME, CPENC (sn,op1,cn,cm,op2), FLAG1 | ... | FLAGn, ARCH) Where the arguments to SYSREG correspond to: - NAME: The system register name, as used in the assembly language. - CPENC: The system register encoding, mapping to: s__c_c_ - FLAG: The entries in the FLAGS field are bitwise-OR'd together to encode extra information required to ensure proper use of the system register. For example, a read-only system register will have the flag F_REG_READ, while write-only registers will be labeled F_REG_WRITE. Such flags are tested against at compile-time. - ARCH: The architectural features the system register is associated with. This is encoded via one of three possible macros: 1. When a system register is universally implemented, we say it has no feature requirements, so we tag it with the AARCH64_NO_FEATURES macro. 2. When a register is only implemented for a single architectural extension EXT, the AARCH64_FEATURE (EXT), is used. 3. When a given system register is made available by any of N possible architectural extensions, the AARCH64_FEATURES(N, ...) macro is used to combine them accordingly. In order to enable proper interpretation of the SYSREG entries by the compiler, flags defining system register behavior such as `F_REG_READ' and `F_REG_WRITE' are also defined here, so they can later be used for the validation of system register properties. Finally, any architectural feature flags from Binutils missing from GCC have appropriate aliases defined here so as to ensure cross-compatibility of SYSREG entries across the toolchain. gcc/ChangeLog: * gcc/config/aarch64/aarch64.cc (sysreg_names): New. (sysreg_names_generic): Likewise. (sysreg_reqs): Likewise. (sysreg_properties): Likewise. (nsysreg): Likewise. * gcc/config/aarch64/aarch64.h (AARCH64_ISA_V8A): Add missing ISA flag. (AARCH64_ISA_V8_1A): Likewise. (AARCH64_ISA_V8_7A): Likewise. (AARCH64_ISA_V8_8A): Likewise. (AARCH64_NO_FEATURES): Likewise. (AARCH64_FL_RAS): New ISA flag alias. (AARCH64_FL_LOR): Likewise. (AARCH64_FL_PAN): Likewise. (AARCH64_FL_AMU): Likewise. (AARCH64_FL_SCXTNUM): Likewise. (AARCH64_FL_ID_PFR2): Likewise. (F_DEPRECATED): New. (F_REG_READ): Likewise. (F_REG_WRITE): Likewise. (F_ARCHEXT): Likewise. (F_REG_ALIAS): Likewise. --- gcc/config/aarch64/aarch64.cc | 55 +++++++++++++++++++++++++++++++++++ gcc/config/aarch64/aarch64.h | 36 +++++++++++++++++++++++ 2 files changed, 91 insertions(+) diff --git a/gcc/config/aarch64/aarch64.cc b/gcc/config/aarch64/aarch64.cc index 9fbfc548a89..030b39ded1a 100644 --- a/gcc/config/aarch64/aarch64.cc +++ b/gcc/config/aarch64/aarch64.cc @@ -89,6 +89,8 @@ /* This file should be included last. */ #include "target-def.h" +#include "aarch64.h" + /* Defined for convenience. */ #define POINTER_BYTES (POINTER_SIZE / BITS_PER_UNIT) @@ -2807,6 +2809,59 @@ static const struct processor all_cores[] = {NULL, aarch64_none, aarch64_none, aarch64_no_arch, 0, NULL} }; +/* Database of system register names. */ +const char *sysreg_names[] = +{ +#define SYSREG(NAME, ENC, FLAGS, ARCH) NAME, +#include "aarch64-sys-regs.def" +#undef SYSREG +}; + +const char *sysreg_names_generic[] = +{ +#define CPENC(SN, OP1, CN, CM, OP2) "s"#SN"_"#OP1"_c"#CN"_c"#CM"_"#OP2 +#define SYSREG(NAME, ENC, FLAGS, ARCH) ENC, +#include "aarch64-sys-regs.def" +#undef SYSREG +}; + +/* An aarch64_feature_set initializer for a single feature, + AARCH64_FEATURE_. */ +#define AARCH64_FEATURE(FEAT) AARCH64_FL_##FEAT + +/* Used by AARCH64_FEATURES. */ +#define AARCH64_OR_FEATURES_1(X, F1) \ + AARCH64_FEATURE (F1) +#define AARCH64_OR_FEATURES_2(X, F1, F2) \ + (AARCH64_FEATURE (F1) | AARCH64_OR_FEATURES_1 (X, F2)) +#define AARCH64_OR_FEATURES_3(X, F1, ...) \ + (AARCH64_FEATURE (F1) | AARCH64_OR_FEATURES_2 (X, __VA_ARGS__)) + +/* An aarch64_feature_set initializer for the N features listed in "...". */ +#define AARCH64_FEATURES(N, ...) \ + AARCH64_OR_FEATURES_##N (0, __VA_ARGS__) + +/* Database of system register architectural requirements. */ +const unsigned long long sysreg_reqs[] = +{ +#define SYSREG(NAME, ENC, FLAGS, ARCH) ARCH, +#include "aarch64-sys-regs.def" +#undef SYSREG +}; + +/* Database of system register properties. Properties assigned unique + bits in bitfield and combined via bitwise-OR. */ +const unsigned sysreg_properties[] = +{ +#define SYSREG(NAME, ENC, FLAGS, ARCH) FLAGS, +#include "aarch64-sys-regs.def" +#undef SYSREG +}; + +#define TOTAL_ITEMS (sizeof sysreg_reqs / sizeof sysreg_reqs[0]) +const unsigned nsysreg = TOTAL_ITEMS; +#undef TOTAL_ITEMS + /* The current tuning set. */ struct tune_params aarch64_tune_params = generic_tunings; diff --git a/gcc/config/aarch64/aarch64.h b/gcc/config/aarch64/aarch64.h index d74e9116fc5..cf3969a11aa 100644 --- a/gcc/config/aarch64/aarch64.h +++ b/gcc/config/aarch64/aarch64.h @@ -179,6 +179,8 @@ enum class aarch64_feature : unsigned char { /* Macros to test ISA flags. */ +#define AARCH64_ISA_V8A (aarch64_isa_flags & AARCH64_FL_V8A) +#define AARCH64_ISA_V8_1A (aarch64_isa_flags & AARCH64_FL_V8_1A) #define AARCH64_ISA_CRC (aarch64_isa_flags & AARCH64_FL_CRC) #define AARCH64_ISA_CRYPTO (aarch64_isa_flags & AARCH64_FL_CRYPTO) #define AARCH64_ISA_FP (aarch64_isa_flags & AARCH64_FL_FP) @@ -215,6 +217,8 @@ enum class aarch64_feature : unsigned char { #define AARCH64_ISA_SB (aarch64_isa_flags & AARCH64_FL_SB) #define AARCH64_ISA_V8R (aarch64_isa_flags & AARCH64_FL_V8R) #define AARCH64_ISA_PAUTH (aarch64_isa_flags & AARCH64_FL_PAUTH) +#define AARCH64_ISA_V8_7A (aarch64_isa_flags & AARCH64_FL_V8_7A) +#define AARCH64_ISA_V8_8A (aarch64_isa_flags & AARCH64_FL_V8_8A) #define AARCH64_ISA_V9A (aarch64_isa_flags & AARCH64_FL_V9A) #define AARCH64_ISA_V9_1A (aarch64_isa_flags & AARCH64_FL_V9_1A) #define AARCH64_ISA_V9_2A (aarch64_isa_flags & AARCH64_FL_V9_2A) @@ -223,6 +227,38 @@ enum class aarch64_feature : unsigned char { #define AARCH64_ISA_LS64 (aarch64_isa_flags & AARCH64_FL_LS64) #define AARCH64_ISA_CSSC (aarch64_isa_flags & AARCH64_FL_CSSC) +/* AARCH64_FL options necessary for system register implementation. */ + +/* Mask for core system registers. System registers requiring no architectural + extensions set up a feature-checking mask which returns any passed flags + unchanged when ANDd with. */ +#define AARCH64_NO_FEATURES (uint64_t)-1 + +/* Define AARCH64_FL aliases for architectural features which are protected + by -march flags in binutils but which receive no special treatment by GCC. + + Such flags are inherited from the Binutils definition of system registers + and are mapped to the architecture in which the feature is implemented. */ +#define AARCH64_FL_RAS AARCH64_FL_V8A +#define AARCH64_FL_LOR AARCH64_FL_V8_1A +#define AARCH64_FL_PAN AARCH64_FL_V8_1A +#define AARCH64_FL_AMU AARCH64_FL_V8_4A +#define AARCH64_FL_SCXTNUM AARCH64_FL_V8_5A +#define AARCH64_FL_ID_PFR2 AARCH64_FL_V8_5A + +/* Define AARCH64_FL aliases for features note yet implemented in GCC. + Accept them unconditionally. */ +#define AARCH64_FL_SME -1 + +/* Flags associated with the properties of system registers. It mainly serves + to mark particular registers as read or write only. */ +#define F_DEPRECATED (1 << 1) +#define F_REG_READ (1 << 2) +#define F_REG_WRITE (1 << 3) +#define F_ARCHEXT (1 << 4) +/* Flag indicating register name is alias for another system register. */ +#define F_REG_ALIAS (1 << 5) + /* Crypto is an optional extension to AdvSIMD. */ #define TARGET_CRYPTO (AARCH64_ISA_CRYPTO) -- 2.41.0