From patchwork Fri Jan 10 17:21:48 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Carlotti X-Patchwork-Id: 104509 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 7C68F385701E for ; Fri, 10 Jan 2025 17:24:54 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 7C68F385701E Authentication-Results: sourceware.org; dkim=pass (1024-bit key, unprotected) header.d=arm.com header.i=@arm.com header.a=rsa-sha256 header.s=selector1 header.b=RrbnCsJU X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05on20601.outbound.protection.outlook.com [IPv6:2a01:111:f403:2613::601]) by sourceware.org (Postfix) with ESMTPS id 14645385AC19 for ; Fri, 10 Jan 2025 17:21:57 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 14645385AC19 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=arm.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 14645385AC19 Authentication-Results: server2.sourceware.org; arc=pass smtp.remote-ip=2a01:111:f403:2613::601 ARC-Seal: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1736529717; cv=pass; b=qMXzQ3n/+F0sZDK2JQjwahUmne+El6jDj2GuAngySY7Sc1/KiDcU+aiNf5/JZwWPr9ZmokjXfya0kyFmIuIEBRxGjc4xkqkOmoiTTmbfo4I7c8Tv1haMnT486FmZTw1HgzphY89+oX6Ti8LY80emTfZfIU8De+iyTD4ezjHjrg8= ARC-Message-Signature: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1736529717; c=relaxed/simple; bh=VObOXL3HQkzb8NSKPssHYtNY7slpaZ1v0Wt3lakKy88=; h=DKIM-Signature:Date:From:To:Subject:Message-ID:MIME-Version; b=cbTA2lS07Dk61G+pUWzG4AEuTSJu7ESaqNtxtqv6lEeIwarL5UU7kzqfdtRKAqKxsCKWCw7eWHeVIzrpM1ewUCIpYQcPgIgYR+t2ehB1hRtEXV7nLXhW/vQWOdkTl1qd+Q/bE2p/JiZbSEhjOt3PmyE5rPzJpnRovgGuxxNe8kw= ARC-Authentication-Results: i=2; server2.sourceware.org ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=JkPvpsOueyl1Gk+ePS7cOlv1THPYZLSdhyv1x9/TlCGRfJleqwObT7p2dF9T53JfeU4XZ14l0ONGWARbi/fRXTDFXJ5TuipxJKrqhpbF6qxIIWwaL/1uLSVAAVPsT8rBzicwWUylIKlmbgqi0Dq1XswVnMgAQr8vO8ouqFzPjBd8DLIOyIJUyXHNRmZp9EsIGSHgpUq6urzhjbsOLq2U/Ogga4n+m/PlWYZrr49G7ehA4D01YtyazH6lWBrWiVTgbRo8gdI48h9g4jq/kYV0mcaVZB/C7yWa0OMHCFQle4qfUq6tqMtU+KSim8yd+R3nCoWXG2g+TIMykVK98y8Cxg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=cBibfgjed9NcpjBGzWnBz7TvxZcUXl02hm0mLX+7VFg=; b=MQM0f8rP4o3ERGmbDslgqZBPHHeHZjZhNlIsxyylv21UzDOOgYTxFbVIt72K1KGpC6Ezg30UrUOFNXlyXDxPzOiH5jxAplLTd2QEbKJg2F3tHXUNPukSfXSEFAs3Z7ayISefFbjE3j5ls7PUHF1faZ4QXm5J1NXx2uqYYWRHB666+aPI723Afl4itrzEOczcX+NNYbanSi73GO2BLiC+GCTi0hlH7aNFb8H4L4ZDVGUHbx3hs3oFEQ6YEqnj2Jq2OzaYitNlzUkJq8I3yWncvOGTLqX90pqfhYcmIPSMF3Tl+dn5d+zhUcdRvnv4ZUTz90XUYGQ9d3pMsg1hekXAHw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arm.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=cBibfgjed9NcpjBGzWnBz7TvxZcUXl02hm0mLX+7VFg=; b=RrbnCsJUIEVpeKMPB3UI2lCY4GWOuut8wI2pekknZ2Nhf8vazBK+9ZvfrBuTt1ouFrXUe8eFad2M5pNnV3Ym3XjE0K7a+1TRFKiVsbtz1YWLrg84Uo3894cs+KiVM/arMldOzBjPctvQxxiYhp+9/l8EoLkuPiiP9nWCmF2sTcs= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com; Received: from DU0PR08MB8255.eurprd08.prod.outlook.com (2603:10a6:10:411::9) by PA4PR08MB7457.eurprd08.prod.outlook.com (2603:10a6:102:2a4::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8335.14; Fri, 10 Jan 2025 17:21:50 +0000 Received: from DU0PR08MB8255.eurprd08.prod.outlook.com ([fe80::cbc8:c020:6a1b:d27a]) by DU0PR08MB8255.eurprd08.prod.outlook.com ([fe80::cbc8:c020:6a1b:d27a%3]) with mapi id 15.20.8335.011; Fri, 10 Jan 2025 17:21:50 +0000 Date: Fri, 10 Jan 2025 17:21:48 +0000 From: Andrew Carlotti To: gcc-patches@gcc.gnu.org Cc: Richard Sandiford , Kyrylo Tkachov Subject: [PATCH 01/11] aarch64: Improve mcpu/march conflict check Message-ID: References: Content-Disposition: inline In-Reply-To: X-ClientProxiedBy: LO6P123CA0005.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:338::10) To DU0PR08MB8255.eurprd08.prod.outlook.com (2603:10a6:10:411::9) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DU0PR08MB8255:EE_|PA4PR08MB7457:EE_ X-MS-Office365-Filtering-Correlation-Id: 445dd834-bcb4-4ae0-c454-08dd319b4518 x-checkrecipientrouted: true NoDisclaimer: true X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|366016|1800799024|376014; X-Microsoft-Antispam-Message-Info: ktEl7UvXWZGIlpOqevVuRg7McHSr3NdyzIr/N5FtrW1ZiLPeSu3z6KdjPqj9+S+VeT0hmKCHrmkJo0q0kpswK9SHDIlAyz53T5dvU4pWhqfgCAuLL1q6t3RJY02KxsSBfzeLc9sE/BA9H2yV7uiG8LuBFPTIY4KR88L7TQ91HuUQkmLaRGdT0GB4vunQuWshZIc6lJCIbyDFZLleFwBKgJfSNt5MPN6J/fn70I19nCe3zFHcjNtNzYfcSBFPQeYjjVWQdLrJ+jeunk+Pxewqbj8M/zXfo60L8m9z9iE9/6V+syL4JLhiAt0AEbt0foRHrVr09e19RLUAKOBym7LPrzu3WQx2EN8AqD1trLPCmGKxKofShTMzx4aRnAVZeJnlHEYIYgckMg4LpUm/Po1MoDREGKn2TPomga1JFJizLjiWzyqcanuYX1fSELg71T1yVaocTxb1qVuSZuPe9UYcS75CfSOQSNkIwG39N0CirrKYAo4sE0EvEkbqHUEZOtb8oKPhUB32VJbwx++7p3nidQQpsKAcugZIwcrwdBXPLf/9GtgrBGAq/oJV933mEvCbrf36WcwiIrbJhheAPPy5NHf72cXb8dj+gW1wkGlBzWxVQEiFRg86AiKhJoHdTiRVIRuPrxoLVsIYrJWuUrmlUGhu16MlQv5UpCd0e1DA5KsA4UHWQZTK5yQhC9vs5AgFvA4hDwZP+3EqI9uhU+YPoVrulUmc+d6TQjhPMX70JOQyFYq4b9TeSEbuU1uIuS+OqS4sTJa/7i/M75Wyu4PmJh4755u8wtSn2X7WCrzVBIyGz/AITRr2eyzGAs8gH61CvLhn/6c9N9zmZViD9ztyHdjFiCiDIbziMaFSbqbk0QKzdgrGG8Ic2fC0Q0TgSRhV2mpOk5ZshRiPegBEXy4RDmYlUNVrkLnsmWLNcDzWVkQr+Y6/+QoImVdOVGZdyyeQ0bjhHBRgZpGTKuZ78BRZ6SKhnwfhMPhiRO0ckbJRambcDwYNuT5d25TV+27A8ZeG/PGyZn5Wjcgw/8/Kk8zJoQHIyXxadkV9Pj+YpYYZ9XKymqYdGuRXPoe+nOub9rtsatuiho0YYrLhEhARDmpd5oAdJTMo6NEtttpNURKXRd1nA+Be/a3egyKqu4Z+lirDcKnOR0iCfwWLXP2cmkx63R07mkH8qi57FYyBFrPb7pnrRSfXXc0eaHYmkYeru31NS/IHVskydH9Xx92Bil1B3Jie+nj4N6ZEA/4pj9OgwWBLcMb+iBDkchft/EWAijzaCKkcJoGffhrnZWMnTGXTpSvu+UO8JzL2r5iDaFDD7sUXnotjNI+johd3JL+zSf7wY4LCxrGNHPim3H9VxV/n0g== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DU0PR08MB8255.eurprd08.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(366016)(1800799024)(376014); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: e/oMScfz3LF8PSDpBd/hWZnBjXGKvnXoxzuUiFSy0AqWMrED+dJ788jRX2J0eBxndxCRuTQG14Mt47AEc0WuMz4OF65IWrnhTUt2sSj6b/X/SzjG5Zk6Jo9afTHMVu1o3YGblb61eD/1JCFUnQyWNczD6VfhA5AWuvVsHYQfU7Yzp+jOuA7BH75Feqs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O1kytdYNmGQLhWNn1/zL6HQHPQxYxlkmUen4a1v7ih4entloEiZATtdTghs5XQDCDJG+pF0PCbiOBPPyb0DAfs4rSRbYd+uUjgNhB28XXQeCa90+Ss3LFQzYdnR8donJ2rTvS/rP9Dd/MeMAJcnzdik303tty+PVu6mphU7VMoalti8ghZ03z4jNoggk4huMNpWttTSxGvkgofhhEZgd41VfUY/lVMJfWzp4oJTZ9EzkVjtG4PAxgVH8iQXbKK1rLM1OwtvAW67GepnHEFYF1a2pkVL2YM85cHgZx1Q3HDoBFwG0jwW5OG4GVs2gT9fr34dfF5ayviY2+vDbPuEwlB0bchl+TzMreiQ== X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-Network-Message-Id: 445dd834-bcb4-4ae0-c454-08dd319b4518 X-MS-Exchange-CrossTenant-AuthSource: DU0PR08MB8255.eurprd08.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Jan 2025 17:21:50.6350 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: MEcwvGqWVeqj0lawpGkrCu5jGsQ/A/RvaAJbEOs3L+u7x8CCBTaXPSw8xNZHlK37/oVkXW0JiTsloUkcO6Bf7w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PA4PR08MB7457 X-Spam-Status: No, score=-11.5 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FORGED_SPF_HELO, GIT_PATCH_0, KAM_LOTSOFHASH, KAM_SHORT, RCVD_IN_DNSWL_NONE, SPF_HELO_PASS, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces~patchwork=sourceware.org@gcc.gnu.org Features from a cpu or base architecture that were explicitly disabled by a +nofeat option were being incorrectly added back in before checking for conflicts between -mcpu and -march options. This patch instead compares the returned feature masks directly. gcc/ChangeLog: * config/aarch64/aarch64.cc (aarch64_override_options): Compare returned feature masks directly. gcc/testsuite/ChangeLog: * gcc.target/aarch64/target_attr_crypto_ice_1.c: Prune warning. * gcc.target/aarch64/target_attr_crypto_ice_2.c: Ditto. diff --git a/gcc/config/aarch64/aarch64.cc b/gcc/config/aarch64/aarch64.cc index ad31e9d255c05dda00c7c2b4755ccec33ae2c83d..330a04c147a97bcd99d6819290d7f82ff5066a44 100644 --- a/gcc/config/aarch64/aarch64.cc +++ b/gcc/config/aarch64/aarch64.cc @@ -19282,13 +19282,10 @@ aarch64_override_options (void) cpu features would end up disabling an achitecture feature. In otherwords the cpu features need to be a strict superset of the arch features and if so prefer the -march ISA flags. */ - auto full_arch_flags = arch->flags | arch_isa; - auto full_cpu_flags = cpu->flags | cpu_isa; - if (~full_cpu_flags & full_arch_flags) + if (~cpu_isa & arch_isa) { std::string ext_diff - = aarch64_get_extension_string_for_isa_flags (full_arch_flags, - full_cpu_flags); + = aarch64_get_extension_string_for_isa_flags (arch_isa, cpu_isa); warning (0, "switch %<-mcpu=%s%> conflicts with %<-march=%s%> switch " "and resulted in options %qs being added", aarch64_cpu_string, diff --git a/gcc/testsuite/gcc.target/aarch64/target_attr_crypto_ice_1.c b/gcc/testsuite/gcc.target/aarch64/target_attr_crypto_ice_1.c index 3b354c0611092b1fb66e4a9c2098a9806c749825..f13e5e2560cd43aab570ab5d240e4cf1975d2f12 100644 --- a/gcc/testsuite/gcc.target/aarch64/target_attr_crypto_ice_1.c +++ b/gcc/testsuite/gcc.target/aarch64/target_attr_crypto_ice_1.c @@ -1,5 +1,6 @@ /* { dg-do compile } */ /* { dg-options "-O2 -mcpu=thunderx+nofp -march=armv8-a" } */ +/* { dg-prune-output "warning: switch .* conflicts" } */ #include "arm_neon.h" diff --git a/gcc/testsuite/gcc.target/aarch64/target_attr_crypto_ice_2.c b/gcc/testsuite/gcc.target/aarch64/target_attr_crypto_ice_2.c index d0a62b83351b671d157ec0de083d681394056d79..ab2549228a7fa06aa26592e02d0d2055f6b990ed 100644 --- a/gcc/testsuite/gcc.target/aarch64/target_attr_crypto_ice_2.c +++ b/gcc/testsuite/gcc.target/aarch64/target_attr_crypto_ice_2.c @@ -1,5 +1,6 @@ /* { dg-do compile } */ /* { dg-options "-O2 -mcpu=thunderx+nofp -march=armv8-a" } */ +/* { dg-prune-output "warning: switch .* conflicts" } */ /* Make sure that we don't ICE when dealing with vector parameters in a simd-tagged function within a non-simd translation unit. */ From patchwork Fri Jan 10 17:22:16 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Carlotti X-Patchwork-Id: 104505 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id F365B385AC26 for ; Fri, 10 Jan 2025 17:23:05 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on20624.outbound.protection.outlook.com [IPv6:2a01:111:f403:2612::624]) by sourceware.org (Postfix) with ESMTPS id 4B444385735B for ; Fri, 10 Jan 2025 17:22:27 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 4B444385735B Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=arm.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 4B444385735B Authentication-Results: server2.sourceware.org; arc=pass smtp.remote-ip=2a01:111:f403:2612::624 ARC-Seal: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1736529747; cv=pass; b=Buk/P9NI0Xw/5Z3xZw6YQ2SCiJ6Ns4KkSgjmDNBBnzUBwqoYmX0KutgiGCoohM51OI+5oaXNjzO5UeRqb0iyKHgBMIRbfC5iYQT6/bbTeEJ0oo0AhnWZUtGw7IFIb0hkhco9areXo2jvYpNDOURp+JNZtFC0N/dOPnkZ7pbmpuY= ARC-Message-Signature: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1736529747; c=relaxed/simple; bh=Wyy5UM3QN+pWy99PKIc4/Nk40WPATvn6DmikUZKbExw=; h=DKIM-Signature:Date:From:To:Subject:Message-ID:MIME-Version; b=dKmJNlm/EMvWD+KAvXqoyH1HQ3MEmckcmu18Sq5+MZ004ZOpkRVZcci2LaLiNLUFWutF6yqxfAq3glvG1PZtu8W/4A6UKVx1CvPn8XJs1+pRSN6yu6KkNq5CLzyzVa7M5crQjlLGKaXwRGMtwpBxtCVel9QCNOV7wt2Q/T/2xvw= ARC-Authentication-Results: i=2; server2.sourceware.org ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=r2KPV+jTaiWg2QgWyDC6YrJG/R/YjBuF+J6LtwDLWkt/f7cJkBf4q12JhYMDHcg3H4/SDt3Gv7/eiTo0ikb0GnGgn4I7qmM3Rya2mAjBkjGAILOOc6n66HvHA6Hh5pqQ/n1vTJMUfzacBw3+IWohPRA9ljVtvZB4SyhwRTyC4bM6dN8it/B/QY8ld36smaJNHBqCeq9lMRsbykC6XFbjRtiI7zky9YFQAOBR2UIeV1VgDPWWer2/xle5Er5ghJ3XujMr0XgxuCW2y9VrvjT/dTCejpGTq/nel+yRQb1pr39yHR/PpNtxzuQvYzWvTEJlPj5xpC/JWjzCa7duTLJlhw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=NNKPTg3ipWobZrOqr+ly3qka4kqHvyaAJ8cYYv4iVVw=; b=FBWqNQpsPUVuxAVYx6wjeQJwbfYsCp/vWDWRZLAgSIkbp2fRg+De6PfLe5lyniQ2kKdYZARwtlPUeRq0HqVqb3cDf4UzN+E4JNhdViAhN+oojuwvDUIxy8Ck5rdXXOwTT7CjMU/xhRgYZdsjGbSCoOV33xDfvOKjzYKTcs9T98HDnz4wpvI3SM1zqgGsxfgfu7vXOdgX4CnhxfNJ9Akxaj4KA6vBssiXvy9PjeFvhs68Mv/Ijgh4A2u6eEMNyYiGPPqbcZ8B/Zcr2tMDWlQgBEJmJViwvGLgcbKH6Nd+HgPLFBbMHI85GdCBM8xXXnSCOczXDDAmyGaCvOqwgG/IVg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arm.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=NNKPTg3ipWobZrOqr+ly3qka4kqHvyaAJ8cYYv4iVVw=; b=eiuJyLfdXGZjQxDd81WjMlkoYiom1JAuUdcosL1yd0e9AAzZwwiDL3OSRdpB9jQJCS6A2zzuJcdVbIJcpAGuOEVkGMgRU7RzII+NbKotRZcQIy+kl7yOiJA5IgVt8WmBIZndayG9i2pFEYoFRqKbMYuxXebohcZkYk+8C/lp0Jw= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com; Received: from DU0PR08MB8255.eurprd08.prod.outlook.com (2603:10a6:10:411::9) by PA4PR08MB7457.eurprd08.prod.outlook.com (2603:10a6:102:2a4::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8335.14; Fri, 10 Jan 2025 17:22:24 +0000 Received: from DU0PR08MB8255.eurprd08.prod.outlook.com ([fe80::cbc8:c020:6a1b:d27a]) by DU0PR08MB8255.eurprd08.prod.outlook.com ([fe80::cbc8:c020:6a1b:d27a%3]) with mapi id 15.20.8335.011; Fri, 10 Jan 2025 17:22:24 +0000 Date: Fri, 10 Jan 2025 17:22:16 +0000 From: Andrew Carlotti To: gcc-patches@gcc.gnu.org Cc: Richard Sandiford , Kyrylo Tkachov Subject: [PATCH 02/11] aarch64: Replace duplicate cpu enums Message-ID: <9fb04f51-72f9-4fd3-ed07-4fe73f1a27fb@e124511.cambridge.arm.com> References: Content-Disposition: inline In-Reply-To: X-ClientProxiedBy: LO0P123CA0003.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:354::11) To DU0PR08MB8255.eurprd08.prod.outlook.com (2603:10a6:10:411::9) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DU0PR08MB8255:EE_|PA4PR08MB7457:EE_ X-MS-Office365-Filtering-Correlation-Id: ed2876af-9fbe-411c-9de4-08dd319b596b x-checkrecipientrouted: true NoDisclaimer: true X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|366016|1800799024|376014; X-Microsoft-Antispam-Message-Info: WWAcIniKE7xALFtMi5wE/wXL6Z3cjYzrD1hKrPXrHowylp0NqoiL2alU0NBSNIST7Z0dx/QQ+FXnQhxLLgPsLyt8dWhgCTWJYL767BmEVhdIqoKPB0cOnONhuzAM99hBBx9nALUZnd+LQUYjRYp3f35Y2qEKNmyjSD1/16vt/jBaMqbJMG/RnXvbk9mJTEVZNW8sBJ3LN/GwL0lLt4RgvjZRKLORm12frzSCIH/Fct7G1sJM0lAJAsL49xwr91R9BnD8Eq5hJeojKC9qwMdTNDhE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4IFM/DBdxtDHHe0XsABeLA7yi3AZueEyEsZTiK X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DU0PR08MB8255.eurprd08.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(366016)(1800799024)(376014); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 0/tE5KNfiBV5LGPTybS9ahBkzYQq+N7RWUsw4C60AzfthzMMDbGP8/QnADZMryqr5uXGJBoZVGXhn5eBuIYMqhEK41fNE8mArGlzYm5z9DIvJa5xYeNVIZ1fx1SHYIJqUHJL7yxNLvVMQGJu+sz/zFFoG4uzpTlhfVVYIesmSxTIZAmsEcwu2mAQkTaxKi8zfW9dZ0vc1mPCVW0OhLpLh3vm6C8Bb+GCDJAWRtpmMgboecN7seAg4erqdF60zkyg03uGm/HvXwjMr2FqDEqVO+AqzVf6xnDxvtPRcZMkZWmqcvrISocmxQW0HWQatS4S+lCUfP6NdcF+8pR8piokSmO8CJXnsL2CYqHyh9FsDURoWkSDRmTbhfQAJqbCBaCJ+N/DhX3HnJzfPP4fBs2EW5aOZqnarTrD6hsiR3829Dg1CyBsYANFUzutaiJfCkeCScm+hL6txSpew92NI/7gSPmTPa+E3gqnw1bWLIOPNFn3mv3ox7anp8Ng6mUQ24X2t4xj8Vv4k7PmXIzNn4Knsy82OWNLSYo9X76wnv/BH2duSaQWOkCvO44mRv28X8eai9eMZ/sekKjPlnF1lz33Xw3898i/+KUi4plbln0w9OF153D5hiqtForKlb49y061YGB2O+MUlXXo1CvBO7aF1+7TasHf9rW641dpEToSqflXEv2twD/Uv2QfhufgiqUYV2kDVxiPHquLn49zos5pm0C8MOtNerbaSozZ9XZ5R+lHVxo8NlWNa8TOkEHhtcEvWwqo/GnyrtwYusw3cAZ27PKRx6Nrlmtt69eEK7DMDaFsBNsRhZiV2GGFtTIA0g4TN2N/zb7JwJZZF1bwr2wesLios2k+WgwvEtLjo5cxrsC4wW7gvoCkeAJYiku/RyvtLBuZ3wmK42URV7aAcQgDRiEwMYowsdxs6BvlXPs5/p3u6KAN3SbCJR57pC+B2kaHMFLVmi49UyaK/GplgAxcx8vFmrsH6jmPqT0/ojz/5JUaL5+j3V1JYc40QLiG29piNvpF4XWYQop+fna6PaoIWkrfoYEzHQIZ8U18cswefc2wkTPo0ruU3RX8huJDrGz9LW1IBEIndyKaeHz44nXYrOJblbR7Yx19nM9iJtDcozABT4fF2pfymWJig0bqFxvaymnNoRcJ8eTgNFZyKBVxVl4xwtPfkbQynk77tR23VBsAq/zUtGqqaJMNz+lCgc4ZvcK1lqB5+kGBBMqjgIrSLnDyc57b/KjmqrfTe2PHE6ATIEbgzZb10zguWLVfvzs48Mv+N0ig+AcX6YGLlXHk07AjC8C05DOLDCR0Ggvj61h6B+mPsAK/nhc1OEDBLuSqCjvq+6skiPJsHW2qohDvwXBoPqxFYIYK3c9irgq2lB/x2Wo1HDlNOYBZ1irHAqeAYEN76UcNh3gC/84p9Nh3KIi5mkDIIaQOQ/2oZUV3Q6arxFgxlYf2VaK2EdhSgf/0yLyOzzEcqSob0N01UAi9HVk3r2vUSmhVWNU+oAgNxfwSMnOQKQWtl9obKMmm+w9KDB5evDiWOSRmqS6GjLe5mGSw5zJ7HVKhziAHOSy9YjScS2GgHFALDqhUv0PVYbtzuvDLNVy/M3ieh/zGVnSlew== X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-Network-Message-Id: ed2876af-9fbe-411c-9de4-08dd319b596b X-MS-Exchange-CrossTenant-AuthSource: DU0PR08MB8255.eurprd08.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Jan 2025 17:22:24.7555 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: f+z/bKJh5CN6+VtL2a6YO6gcGFrj/PVzEmY1j6SxlDJwwktDTi5Tel1kXVfYy2+Q23Tl+TvOkghQ2kxmq7RQpQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PA4PR08MB7457 X-Spam-Status: No, score=-11.5 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FORGED_SPF_HELO, GIT_PATCH_0, KAM_LOTSOFHASH, RCVD_IN_DNSWL_NONE, SPF_HELO_PASS, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces~patchwork=sourceware.org@gcc.gnu.org Replace `enum aarch64_processor` and `enum target_cpus` with `enum aarch64_cpu`, and prefix the entries with `AARCH64_CPU_`. Also rename aarch64_none to aarch64_no_cpu. gcc/ChangeLog: * config/aarch64/aarch64-opts.h (enum aarch64_processor): Rename to... (enum aarch64_cpu): ...this, and rename the entries. * config/aarch64/aarch64.cc (aarch64_type): Rename type and initial value. (struct processor): Rename member types. (all_architectures): Rename enum members. (all_cores): Ditto. (aarch64_get_tune_cpu): Rename type and enum member. * config/aarch64/aarch64.h (enum target_cpus): Remove. (TARGET_CPU_DEFAULT): Rename default value. (aarch64_tune): Rename type. * config/aarch64/aarch64.opt: (selected_tune): Rename type and default value. diff --git a/gcc/config/aarch64/aarch64-opts.h b/gcc/config/aarch64/aarch64-opts.h index 3f0b1e9414c32ce5cb0ae808b2bb38bee86b40d5..a6ca5cf016b05982572297a434b53a9f8fc1443b 100644 --- a/gcc/config/aarch64/aarch64-opts.h +++ b/gcc/config/aarch64/aarch64-opts.h @@ -38,13 +38,13 @@ typedef bbitmap<2> aarch64_feature_flags; #endif /* The various cores that implement AArch64. */ -enum aarch64_processor +enum aarch64_cpu { #define AARCH64_CORE(NAME, INTERNAL_IDENT, SCHED, ARCH, FLAGS, COSTS, IMP, PART, VARIANT) \ - INTERNAL_IDENT, + AARCH64_CPU_##INTERNAL_IDENT, #include "aarch64-cores.def" /* Used to mark the end of the processor table. */ - aarch64_none + aarch64_no_cpu }; enum aarch64_arch diff --git a/gcc/config/aarch64/aarch64.h b/gcc/config/aarch64/aarch64.h index 1ab49e229b080d29187690abdb0c0767c12a157a..cee1c7f04cefc4789ca4b9f4e5b946ea642c5e47 100644 --- a/gcc/config/aarch64/aarch64.h +++ b/gcc/config/aarch64/aarch64.h @@ -924,16 +924,9 @@ enum reg_class /* CPU/ARCH option handling. */ #include "config/aarch64/aarch64-opts.h" -enum target_cpus -{ -#define AARCH64_CORE(NAME, INTERNAL_IDENT, SCHED, ARCH, FLAGS, COSTS, IMP, PART, VARIANT) \ - TARGET_CPU_##INTERNAL_IDENT, -#include "aarch64-cores.def" -}; - /* If there is no CPU defined at configure, use generic as default. */ #ifndef TARGET_CPU_DEFAULT -# define TARGET_CPU_DEFAULT TARGET_CPU_generic_armv8_a +# define TARGET_CPU_DEFAULT AARCH64_CPU_generic_armv8_a #endif /* If inserting NOP before a mult-accumulate insn remember to adjust the @@ -949,7 +942,7 @@ enum target_cpus aarch64_final_prescan_insn (INSN); \ /* The processor for which instructions should be scheduled. */ -extern enum aarch64_processor aarch64_tune; +extern enum aarch64_cpu aarch64_tune; /* RTL generation support. */ #define INIT_EXPANDERS aarch64_init_expanders () diff --git a/gcc/config/aarch64/aarch64.cc b/gcc/config/aarch64/aarch64.cc index 330a04c147a97bcd99d6819290d7f82ff5066a44..d8a2916d8230cc25122f21818b88fd347e72693a 100644 --- a/gcc/config/aarch64/aarch64.cc +++ b/gcc/config/aarch64/aarch64.cc @@ -357,7 +357,7 @@ static bool aarch64_print_address_internal (FILE*, machine_mode, rtx, aarch64_addr_query_type); /* The processor for which instructions should be scheduled. */ -enum aarch64_processor aarch64_tune = cortexa53; +enum aarch64_cpu aarch64_tune = AARCH64_CPU_cortexa53; /* Global flag for PC relative loads. */ bool aarch64_pcrelative_literal_loads; @@ -451,8 +451,8 @@ aarch64_tuning_override_functions[] = struct processor { const char *name; - aarch64_processor ident; - aarch64_processor sched_core; + aarch64_cpu ident; + aarch64_cpu sched_core; aarch64_arch arch; aarch64_feature_flags flags; const tune_params *tune; @@ -462,20 +462,20 @@ struct processor static CONSTEXPR const processor all_architectures[] = { #define AARCH64_ARCH(NAME, CORE, ARCH_IDENT, D, E) \ - {NAME, CORE, CORE, AARCH64_ARCH_##ARCH_IDENT, \ + {NAME, AARCH64_CPU_##CORE, AARCH64_CPU_##CORE, AARCH64_ARCH_##ARCH_IDENT, \ feature_deps::ARCH_IDENT ().enable, NULL}, #include "aarch64-arches.def" - {NULL, aarch64_none, aarch64_none, aarch64_no_arch, 0, NULL} + {NULL, aarch64_no_cpu, aarch64_no_cpu, aarch64_no_arch, 0, NULL} }; /* Processor cores implementing AArch64. */ static const struct processor all_cores[] = { #define AARCH64_CORE(NAME, IDENT, SCHED, ARCH, E, COSTS, G, H, I) \ - {NAME, IDENT, SCHED, AARCH64_ARCH_##ARCH, \ + {NAME, AARCH64_CPU_##IDENT, AARCH64_CPU_##SCHED, AARCH64_ARCH_##ARCH, \ feature_deps::cpu_##IDENT, &COSTS##_tunings}, #include "aarch64-cores.def" - {NULL, aarch64_none, aarch64_none, aarch64_no_arch, 0, NULL} + {NULL, aarch64_no_cpu, aarch64_no_cpu, aarch64_no_arch, 0, NULL} }; /* Internal representation of system registers. */ typedef struct { @@ -18559,9 +18559,9 @@ initialize_aarch64_tls_size (struct gcc_options *opts) /* Return the CPU corresponding to the enum CPU. */ static const struct processor * -aarch64_get_tune_cpu (enum aarch64_processor cpu) +aarch64_get_tune_cpu (enum aarch64_cpu cpu) { - gcc_assert (cpu != aarch64_none); + gcc_assert (cpu != aarch64_no_cpu); return &all_cores[cpu]; } diff --git a/gcc/config/aarch64/aarch64.opt b/gcc/config/aarch64/aarch64.opt index da9e0c18d47781dee1b954735cbc28da1e7f1846..db462035bd26013a784a8403e871298247e0b5bf 100644 --- a/gcc/config/aarch64/aarch64.opt +++ b/gcc/config/aarch64/aarch64.opt @@ -25,7 +25,7 @@ HeaderInclude config/arm/aarch-common.h TargetVariable -enum aarch64_processor selected_tune = aarch64_none +enum aarch64_cpu selected_tune = aarch64_no_cpu TargetVariable enum aarch64_arch selected_arch = aarch64_no_arch From patchwork Fri Jan 10 17:22:39 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Carlotti X-Patchwork-Id: 104513 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id A392A3858CD9 for ; Fri, 10 Jan 2025 17:29:35 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A392A3858CD9 Authentication-Results: sourceware.org; dkim=pass (1024-bit key, unprotected) header.d=arm.com header.i=@arm.com header.a=rsa-sha256 header.s=selector1 header.b=W5RHNNUY X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on2062c.outbound.protection.outlook.com [IPv6:2a01:111:f403:2612::62c]) by sourceware.org (Postfix) with ESMTPS id E06623857718 for ; Fri, 10 Jan 2025 17:22:49 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org E06623857718 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=arm.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org E06623857718 Authentication-Results: server2.sourceware.org; arc=pass smtp.remote-ip=2a01:111:f403:2612::62c ARC-Seal: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1736529770; cv=pass; b=t0F9FY5QDqBwHlWgWEytDqIO5VjK231HV2RD2s4KTYpFqf/3dh9y9A1i8cc5HPz51fDgOqDDcgSRNLO3aXmLOwfr+ma8l6OHLKZ55ss95Ob4N3B+0d4EpP+IqvS4EO1Jf0CV7Qi87davWkYi+3EvVWQPM9+i8cArrqt2Fz4qyo8= ARC-Message-Signature: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1736529770; c=relaxed/simple; bh=QCZx4DLFxQ44gouAIYtn0O0IvDg+bfA5/uehibbBigs=; h=DKIM-Signature:Date:From:To:Subject:Message-ID:MIME-Version; b=kI/icx9dg/jt2w2hx/zNyunRpfZF2bfVOvrPPlhoBdT3SFSwYuSvkkCaKb7660ZNp5y1WGK5hCNT0u3aUjVgpWZJvNkj9UNf5mYI6OMNjKLoaltkUxwJpngyc2XBnYMBrUbiqa3gfQrdxLLgWM+wfU/02/nu6FVzkqe269sLNEA= ARC-Authentication-Results: i=2; server2.sourceware.org ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=bhZMQczIyyuP565WgVnfh7+HnMptCpBhKzkujLdVqAA4W3asvq+4e4Yxv+sJRGZssp7EJe1QPLz7GcNzBDcyfsJySt4zfhsx4/5328CUPx3bsorLMadgpZrVeuYxhb2dM7TdDPpD1PDwBq1dyltzqd9sr5egw86fBCYaPWqlFIEUeu962ZhAvPSwkZJczQQkNApt3zgfX+1rByvsAcRIz0pQ4G4jGuCd2PhaD2IKdTLKHkZ/JLPKQcZov563pHjuf+V4v19g7ArsYo8TdEu5X6O/NxhaL78oN9bbmEjjfkyFL2zcSMFnv2PItW5++SaUhnLwpinBTk3xyfcAYLqSqw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=VsW7lLejjwTRO8HXtGksuYBPvaq1d2Sogfw+dB4NX3k=; b=rKNY0V64U76Gr5cZgdYRAgE2GS/dfDAaB5b2jVN9POTliyE0wWTkP5YnuFAXsX/41gPODj5YL7ZP86HRnrTMqV8+4OPAkNTi7ns2G1nxTVDc3Jm3nMvkow4emokX7C2FInCP0vQClIeE7qNnzgzbxQWKlxeTCCVgy281LVu9/Pg7UtLMHKwXGjM+HkkQAyQNQRMbPcyCadEy745F0ffGwlX7ARSOXxPJVPW/P9V244Lbl6pGeloIXOHHu6kfZtlNaHIqisThhzKrxxq5t60ODOIJob1PUx2pV8hToufPYAzp7QmWy8+lCIK37nvjYz+FBfYL5GVDqWNwncziSA8BKQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arm.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=VsW7lLejjwTRO8HXtGksuYBPvaq1d2Sogfw+dB4NX3k=; b=W5RHNNUYPM9ar6HSK/0kLK9FxQO1u+Xyg0vW+AjSIGDUQg61hSn9MngrNmsiqoXEtCrCWwalHtM1SBeEfBNFSSsTp24lQbLOXVv0UV4xukCl5QE7+kOsB5lYDM8l+jfLEgHSANp8oE/2PNiyNpiTTDbGfRmA3tLs9XOp5Kbm110= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com; Received: from DU0PR08MB8255.eurprd08.prod.outlook.com (2603:10a6:10:411::9) by PA4PR08MB7457.eurprd08.prod.outlook.com (2603:10a6:102:2a4::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8335.14; Fri, 10 Jan 2025 17:22:41 +0000 Received: from DU0PR08MB8255.eurprd08.prod.outlook.com ([fe80::cbc8:c020:6a1b:d27a]) by DU0PR08MB8255.eurprd08.prod.outlook.com ([fe80::cbc8:c020:6a1b:d27a%3]) with mapi id 15.20.8335.011; Fri, 10 Jan 2025 17:22:41 +0000 Date: Fri, 10 Jan 2025 17:22:39 +0000 From: Andrew Carlotti To: gcc-patches@gcc.gnu.org Cc: Richard Sandiford , Kyrylo Tkachov Subject: [PATCH 03/11] aarch64: Remove redundant generic cpu entry Message-ID: References: Content-Disposition: inline In-Reply-To: X-ClientProxiedBy: LO4P123CA0252.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:1a7::23) To DU0PR08MB8255.eurprd08.prod.outlook.com (2603:10a6:10:411::9) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DU0PR08MB8255:EE_|PA4PR08MB7457:EE_ X-MS-Office365-Filtering-Correlation-Id: c202884f-bf7f-45eb-26b7-08dd319b6337 x-checkrecipientrouted: true NoDisclaimer: true X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|366016|1800799024|376014; X-Microsoft-Antispam-Message-Info: Mf6ZuScrCtptV0pcJZt8+Y2wfAIu4NOKWBBPz6XvihyWsZZvg77z8WMRZmY7dVHpDQosOlOc1Hata9ijLoVyWpLHWEXJR0o3ICqlGwgG1ZfDuQE0nP1wbtGF1NlqAIFJN02LNaXmqr4e/o5z8315cm8HLGC+lRfqNYiV4Q1f9a0mixnDlJvLnDWpb4cmORCOeCJJO8eQs5cHkyhu7rgLMa1n1X+0vrkL1rRksJs/9RzFCFrkkn0y4sZFKc79XEZBagirizli325K5g5e8fubxcTMChVFflZ8QEcHAOFSFQJMz/RdBovi1FU65QSqXuJcp9hcZWc7i6W6xzniRP7MyuVu19MGVSuHro2nwQvQ/PDfPzyTxlF5ROg9hXXRQ3MkbjqdGKW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; H:DU0PR08MB8255.eurprd08.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(366016)(1800799024)(376014); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: TDbEWmeA4MCATJ5OgqIFyk29fHnonINHCRi9a5uExSemK1rHfbWTEl7BE4Y9wrywYwPMh1q9n+E0aWjT5aVAEOCU5zF6hZxKixNbOYT2ZY6LBpqMl3mN0CmQrix89T1VsRX1yo2jRLez11SgW5WmpFbC3e67rxXl5ih7gnMzNugeqfZVhuFdDXi3w8oTauTb+PzHY0a7P2ot0rAsGam6BnEIZ3rSnoEaCyO1+/j/bZIByiDAJ2zIiW5a/gb6XkbLxwVa5Ve2WWrmcsOJyHskVR9aIwRGYZ29bvwon/KeuzRt2VNvLSC7JSOl1BLGbOUuoRwou2Uyf468XY5gjP7J0l0hoR7IbOgEB+mGDWNADAJVTD+SAhnxUSQYIyj04d9/2sqmk63klGusJu7wS8k90JUkVFZ2/R0Rce2BoKALd5WfiA61zovtdvySwmaYSW7iJrlgVvWW10Q/IySW5woR+Rap1T/HK05s/ltUlCmxXF0GkrfUYG+fSyChcais0BBqVts6EqqHRNiyah7/J2DJv0OcGLd4XeCGpODqzM2aWwpFnmCdiSTmAcPIEKsan9UyV6+9z7D6ISJ8wvVcU2gmXUCkV5TBZad6FBP09uo2I5rG4ZmzYH1YCDSgDFgW1Ubx6gSAAUigJs7t9UPXXDbqDUnGhLnpWmXHu8PWTbSwZtJOFi0aKCg6+kAKTZVA0ydRg2VrSaon12qyH6Q/0LNDvNK2wAEyN6n92LHz/TANqUAz2RwHFw+7MF9jqusPqUtAbYVtTtTE6+u2q+aUfPypNdqBeZ0IA0J+CtHp7yfVOwQ5Ke6SEkC8rVPlMvcZXhOlpu/xo0zNWIXLAnokc+f3LSsImdcaREemZkR2er6W71lJOj8e7HTwJi8FNcg4Diq0vF5KNUY0cuSxdc3VnP+oR5JxOGVZn2Pp6cLy31x5YpiB8N4eXUbO1FZ2+O6XuoW61e9cS2BLGayi6oZzLTxxUg71A+dXHR9aJGbjK7XerA/LmLoOR0FukiWZk+JGJf/8J12/Ye5zZy67JReiPqhvzBFj2Fvsi3Yx6+OyTI00jsfTJreS0L7RMSWyr5Js7K3dTT8RcCQgJZ82r9DVoFuxF/dj7Q/wQFfhAgfVgB6ladrb+5jLSf0Bm7jV75L4bQK8KwYMWIKsyAAMj9CtDxtaL60PsBUgvjG79CGcgkh2h6qWhmxdzrzen8xafiJq858qd4Fqzx1luTK1e0ZAQJgySQkhIgtyRnFu0HXTj371+x4o+3hHgzHlSfZzrfvDd3art5Wi3L+/dfqhNimmIvtxFvGcK95Is8mRYuBFLM48DpheCSAgredaPUvA9RP+Q4F6Q19WtTKWjiyC7KqYo0KXfQYgBWdaX2b5qZKW9gmPoWGOEe6p/e9kMevOAcDh0JpS91xf9P1slHpQTaJBpfKYNoB1cYlj28zBQ0Kn2LXnPVmmrt1PzceFLUFkOiPD6+oxZLK9oPILoDLpW0fTycpq4P4GCl3i+CaMCdC3jUKEAVLILN4TlVeA8eH02KMmYOw84nVAsAsV+PbDEFwL4CgV2S9EuTsHTNev06TJ7vOyeiM8h2juLL2RttSVgWc4hCWV7GTHywzn3fOctI8NiHPk+Q== X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-Network-Message-Id: c202884f-bf7f-45eb-26b7-08dd319b6337 X-MS-Exchange-CrossTenant-AuthSource: DU0PR08MB8255.eurprd08.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Jan 2025 17:22:41.1659 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: chQjWcnWfbnXXtiWviBWYStItuugE1z37Uh72BcHJy+gAozbLN/gZ8q2wqhULvabU8zuOyhqpUdYjNSjkea0Jw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PA4PR08MB7457 X-Spam-Status: No, score=-11.6 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FORGED_SPF_HELO, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_PASS, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces~patchwork=sourceware.org@gcc.gnu.org The list of cores in aarch64-common.cc included an explicit "generic" entry, despite this entry also being present in aarch64-cores.def. gcc/ChangeLog: * common/config/aarch64/aarch64-common.cc (all_cores): Remove explicit generic entry. diff --git a/gcc/common/config/aarch64/aarch64-common.cc b/gcc/common/config/aarch64/aarch64-common.cc index 92df8b619305ba8b1c9a4b92f0674f02784f1a3a..75600548fdc6ba6383174ba81202a3a079a2bf27 100644 --- a/gcc/common/config/aarch64/aarch64-common.cc +++ b/gcc/common/config/aarch64/aarch64-common.cc @@ -189,7 +189,6 @@ static constexpr processor_name_to_arch all_cores[] = #define AARCH64_CORE(NAME, CORE_IDENT, C, ARCH_IDENT, E, F, G, H, I) \ {NAME, AARCH64_ARCH_##ARCH_IDENT, feature_deps::cpu_##CORE_IDENT}, #include "config/aarch64/aarch64-cores.def" - {"generic", AARCH64_ARCH_V8A, feature_deps::V8A ().enable}, {"", aarch64_no_arch, 0} }; From patchwork Fri Jan 10 17:22:55 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Carlotti X-Patchwork-Id: 104506 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id D09AA385AC2C for ; Fri, 10 Jan 2025 17:23:58 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on2062a.outbound.protection.outlook.com [IPv6:2a01:111:f403:2612::62a]) by sourceware.org (Postfix) with ESMTPS id E5776385AC19 for ; Fri, 10 Jan 2025 17:23:13 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org E5776385AC19 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=arm.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org E5776385AC19 Authentication-Results: server2.sourceware.org; arc=pass smtp.remote-ip=2a01:111:f403:2612::62a ARC-Seal: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1736529794; cv=pass; b=M2B1dDGFYVeGjSvAYMJVcF2uhZPseuzCur4S1iaHA0LgaWi/b4wDMTzj8diMRsE54Mu1WckjTlxfzxj18F0RgvewJKZB5f8/7G+kqZTwyqldPwV37OMmvn2Qvo2P20ZB5EglpUEIauDCHZEl3hRiFClX8MvwqknLbUnptU5+Rps= ARC-Message-Signature: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1736529794; c=relaxed/simple; bh=0Mau5VZg/Brbb/WJPnTF1ChiynoMKKGmGCvjbfBpHj0=; h=DKIM-Signature:Date:From:To:Subject:Message-ID:MIME-Version; b=wUoeJ73Ca6k9es4j7EVr2jJEJmjVtsJSkkO8mdnCKWRJ3tTvIMXBzss1OJraGRj3R05+vA5EmTD7vFM4Fzur5FTsyTj4s0ZNXKwgROjM2nXfOQoPZ7kxkAgJsqv3wHBjV5KJDwNBrqaxfDEN0CM+Md1pDsUbUSnaY3SwpUmAK1o= ARC-Authentication-Results: i=2; server2.sourceware.org ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=TT4JTkYGsUWrAwLe67Qums4DlGhtWxhhxRc4rDfCBQM4FgUD6YriD20ZfQ8QD5gJbIU9vpZ66pUyLNHTWluYnvXPuV814+4yA0OHWdZJineq/NrqU97Q90EU61ZVPETay+AMHBZZa7lSJZTUqKuxFL5SKHJeSdv4SkAzo+W9vWyfFS4QTcS/A3MDdZMsxrJLsful0Usy2Fu8ioHmWiWoOSVK/RdenwRzI820e9yh3gYzegP/n5JoKWQwson5Sf2Pb/JjgJYioQEzbb8xZDjM/FR364GHQd/98qQioikFVZe2OxoDP9wwJONOgeTiy1PlT+WUCELAcA4vVU+Te88lIw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=ig3xHl+mxpp/p94vr+ggz1nKJUvmZCEhZUofBVXdDO0=; b=KsmNzwSbFWrZOe/nQjxp6ZkZadwRJudb5hd+nX8WxyaVNKazhBAEIsqmHYUC3JHcWJnl+A/x0PcwiMlC9Ocb3br6RDlCTiRTAKTIjvizIVi8vhC4CDzIEa3rt+rtu5Sqg6EX9QPchIUF4wbk3/evw4eo6ja8kUEuu2GpNwy4WEo6wA5TpFcSc93rjN0ukLaz8qW59TlJMSnO3kVYfPwUqGWy2lt3JjaTaW8ZbMF/h9Ila6G5pzVZYLJsDeaKcH/jMcCuW86L5rAHOBUaZ/yqfFQBR4u8Svub5+DbHqso8Ak/ud9LEJQJT6j5vHNVBNYGhBUXRb7Kb1YGVg5haPxOkw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arm.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ig3xHl+mxpp/p94vr+ggz1nKJUvmZCEhZUofBVXdDO0=; b=Ihg204GgpvC9iCQP9l6oOUZDlS+eh8+okKm26ZKniYtCG0F6D2W4YdmmRX0YH3unYOEAo4hT0CR06MrwTtpSxxUDYC9SxX+bP0x9UwkgiwUq2GpjD/SVMwwSgIF0E/mXeWmtaZX1+N1W7uO/+Wm/ZpzM884A3z8849C2ZcpVW68= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com; Received: from DU0PR08MB8255.eurprd08.prod.outlook.com (2603:10a6:10:411::9) by PA4PR08MB7457.eurprd08.prod.outlook.com (2603:10a6:102:2a4::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8335.14; Fri, 10 Jan 2025 17:22:57 +0000 Received: from DU0PR08MB8255.eurprd08.prod.outlook.com ([fe80::cbc8:c020:6a1b:d27a]) by DU0PR08MB8255.eurprd08.prod.outlook.com ([fe80::cbc8:c020:6a1b:d27a%3]) with mapi id 15.20.8335.011; Fri, 10 Jan 2025 17:22:57 +0000 Date: Fri, 10 Jan 2025 17:22:55 +0000 From: Andrew Carlotti To: gcc-patches@gcc.gnu.org Cc: Richard Sandiford , Kyrylo Tkachov Subject: [PATCH 04/11] aarch64: Rename info structs in aarch64-common.cc Message-ID: References: Content-Disposition: inline In-Reply-To: X-ClientProxiedBy: LO2P265CA0275.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:a1::23) To DU0PR08MB8255.eurprd08.prod.outlook.com (2603:10a6:10:411::9) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DU0PR08MB8255:EE_|PA4PR08MB7457:EE_ X-MS-Office365-Filtering-Correlation-Id: ca5efa35-e6fe-4187-6819-08dd319b6d05 x-checkrecipientrouted: true NoDisclaimer: true X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|366016|1800799024|376014; X-Microsoft-Antispam-Message-Info: 01kG7MQ0IIRMDqjiFIo1ms+YMAw5xMHHQhbTQmr20cS9Dk6llyz+DjUEHA9Clo79fovzm84PbYQbukkETeiOh12TIQ4W0sKFKAtScx8WmS9Gngma101W691auS02S1aV0kMapM/SryiXTGiBbWasU0Xr033Bbq+wKBa1hYeGhIz5Gyt+JYP7SBD52zle+h0WVYlqdS3eW08J0NRZzoMOiRcNGcnFSsjUXJf3NpHupnJNKADA4zl/xUSnSHTZdK680BJlseDuPzidIE0UCQAUl9JOeTup9ySbM6qFNVHclZkrYYes7LTnO7IXCEr1WZXTU1LmAAwxj2LNVY2rLWRcDgr6fljXPv4eOth/kvBhvQbGpITH1h+TXqYM21raUo1SN+BMj8wjOqbfS6fGQMZxdoQAPx2X9L7DTCiGSnjPLyiMFSuql6Afq0HJtI6AN+bV4Z1FFfkIov18Qp+8BluN2kUNUw2jCLcHwbyX9+M6THOF8edXLM4f8s+KLIlFEx6U9otc3d/gK3jSQufW+RSy1AFpGw2ybgOKBjPuZ9UaWrlLRntfVwQ6k5CS+lhBRZGMCkSKjfbc/DwK9tV+aSoIG+u7SnIyYprzF2/FvZvod8lxbODaV3Cc5rkwPcR1IF32hFHymCU90UCPuhvnDZAWjwZONyh53kN2/e2MMjt/+BsDnNcEnpcp3q7CAfKo0DfFP7CG6C/ju6V76wUoHRaGKTpG4eRGQsSsOFR+0a6KN+FYNKkGQn7ihsGt4+nAU3XN5nsHcc9wPeGnKpuWVAG9Hc5B0/VjG5crHnf4twwqCHrsuXq+hMDQ5txB1z1CVnmhcbsWu533nLOgyRI1VmaO6y1d0qioE46jm7+gypigelD8iAXIUkv2zOYFn9cxDGgcqnZ5tUJ/mfnT7ir3eujK2++sUVw4e00o2iJRJIo5DiQHnzu6vQEIMXXJ0dRadbwwGUeRhqJaomPPVl3tE08USiWL1yZXnBkaNAKNskTXsn31be4pggBZE1ZtKnjTmFXn+diEpTnGzbK/GPRWjg/NsX0APdqZ/yysl/IyyYbFTvWSBk5JV3kKyXS3XhDwxlQpvK6DPQ03UVhL9oicAY1BetP7DCYWlMc1YhvLs0MOzpQg4+RxvTZklakQYc7RT8ZRYbfkH+rc0/3sAoZU+ConCxH7A8oiJPzNTJBCMXbj2cyuavp0rHVNHSHG8u7QMKozcfeKAx/HlGguFRpvYhV3deDkM76xBC5D2fXV6fjolaR4JoVss6NjnDmupOLhSWqCC+jr0W/sJbnke3xA0Y0hd29U8+2uqXUKgvNIa2t8UX27NNAcy7f71juHqlKEsLYbpJOFpvfyhYPHgtKzlOhtlGx0LeNK59oPaL1ZPiBRmJAi+/hiOzKXGWQaYQLg6Zon X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DU0PR08MB8255.eurprd08.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(366016)(1800799024)(376014); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: pvl8cfcJflTdLHYFpsxsKZha1zXwYiBDnLtTr8I4LhmnrPOdYIXYonfxkqLPiNM+p0O1anxQJoTOHTRW+mLhaWDR0cjVd86vXdpEAUY9O2urEJQ+x5LNcRnDNTG1S4Q2abfsybRxdNoUqQ1qX3BPHOTQ2GGV7hwZqMH0a8fYc9tVGvgRxFR63cJaloyPok+QhvuCbWltdg2AiTSNdZbefsQmWXHsHs18IMlyUDeECznBg655RWJyZAsEPMUip+CAOJGrgXyb5LDjSzOP5BsQYC62Z0OcLIF7rKe7Ei/IxgJrffhD8up6/m66OTrKNv6jsZa/1bRc0+wr8BedzId9tXCk2KjpfQb94Npj9RAtpwGTuOG35qX0cXhavvVjPzvsrLnot43ReyWFFhwTMn8k2byZ4s4gzsuh6N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T1QUp9sImwTJTLb8jBWfjSedXuZvkBsrs6NEnq00NFk+lUgUtSZ2LfM9F+4yQYutokH5Ur0uoM6uN2kBwd28sNGO7J2ha1NBKjyUSUs0Ppn2QUKKyL/ZZp4UQ== X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-Network-Message-Id: ca5efa35-e6fe-4187-6819-08dd319b6d05 X-MS-Exchange-CrossTenant-AuthSource: DU0PR08MB8255.eurprd08.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Jan 2025 17:22:57.6075 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 9sVgimiPtQ1SgfwP6j7TBnXSTDvv/NV8/8y/+qKV5xjxSeGO0f1AOGgVYdlkdc8JwBANkNpiWtyZlgkIbDreHQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PA4PR08MB7457 X-Spam-Status: No, score=-11.7 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FORGED_SPF_HELO, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_PASS, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces~patchwork=sourceware.org@gcc.gnu.org Also add a (currently unused) processor field to processor_info, and change name from "" to NULL for the terminating array entries. gcc/ChangeLog: * common/config/aarch64/aarch64-common.cc (struct aarch64_option_extension): Rename to.. (struct extension_info): ...this. (all_extensions): Update type name. (struct arch_info): Rename to... (struct arch_to_arch_name): ...this, and rename name field. (all_architectures): Update type names, and move before... (struct processor_name_to_arch): ...this. Rename to... (struct processor_info): ...this, rename name field and add cpu field. (all_cores): Update type name, and set new field. (aarch64_parse_extension): Update names. (aarch64_get_all_extension_candidates): Ditto. (aarch64_rewrite_selected_cpu): Ditto. diff --git a/gcc/common/config/aarch64/aarch64-common.cc b/gcc/common/config/aarch64/aarch64-common.cc index 75600548fdc6ba6383174ba81202a3a079a2bf27..4f4e363539b7b9311bfcb7a8b30b706000e50352 100644 --- a/gcc/common/config/aarch64/aarch64-common.cc +++ b/gcc/common/config/aarch64/aarch64-common.cc @@ -145,8 +145,9 @@ aarch64_handle_option (struct gcc_options *opts, } } + /* An ISA extension in the co-processor and main instruction set space. */ -struct aarch64_option_extension +struct extension_info { /* The extension name to pass on to the assembler. */ const char *name; @@ -159,7 +160,7 @@ struct aarch64_option_extension }; /* ISA extensions in AArch64. */ -static constexpr aarch64_option_extension all_extensions[] = +static constexpr extension_info all_extensions[] = { #define AARCH64_OPT_EXTENSION(NAME, IDENT, C, D, E, FEATURE_STRING) \ {NAME, AARCH64_FL_##IDENT, feature_deps::IDENT ().explicit_on, \ @@ -168,38 +169,41 @@ static constexpr aarch64_option_extension all_extensions[] = {NULL, 0, 0, 0} }; -struct processor_name_to_arch +struct arch_info { - const char *processor_name; + const char *name; aarch64_arch arch; aarch64_feature_flags flags; }; -struct arch_to_arch_name +/* Map architecture revisions to their string representation. */ +static constexpr arch_info all_architectures[] = +{ +#define AARCH64_ARCH(NAME, B, ARCH_IDENT, D, E) \ + {NAME, AARCH64_ARCH_##ARCH_IDENT, feature_deps::ARCH_IDENT ().enable}, +#include "config/aarch64/aarch64-arches.def" + {NULL, aarch64_no_arch, 0} +}; + +struct processor_info { + const char *name; + aarch64_cpu processor; aarch64_arch arch; - const char *arch_name; aarch64_feature_flags flags; }; /* Map processor names to the architecture revision they implement and the default set of architectural feature flags they support. */ -static constexpr processor_name_to_arch all_cores[] = +static constexpr processor_info all_cores[] = { #define AARCH64_CORE(NAME, CORE_IDENT, C, ARCH_IDENT, E, F, G, H, I) \ - {NAME, AARCH64_ARCH_##ARCH_IDENT, feature_deps::cpu_##CORE_IDENT}, + {NAME, AARCH64_CPU_##CORE_IDENT, AARCH64_ARCH_##ARCH_IDENT, \ + feature_deps::cpu_##CORE_IDENT}, #include "config/aarch64/aarch64-cores.def" - {"", aarch64_no_arch, 0} + {NULL, aarch64_no_cpu, aarch64_no_arch, 0} }; -/* Map architecture revisions to their string representation. */ -static constexpr arch_to_arch_name all_architectures[] = -{ -#define AARCH64_ARCH(NAME, B, ARCH_IDENT, D, E) \ - {AARCH64_ARCH_##ARCH_IDENT, NAME, feature_deps::ARCH_IDENT ().enable}, -#include "config/aarch64/aarch64-arches.def" - {aarch64_no_arch, "", 0} -}; /* Parse the architecture extension string STR and update ISA_FLAGS with the architecture features turned on or off. Return a @@ -212,7 +216,7 @@ aarch64_parse_extension (const char *str, aarch64_feature_flags *isa_flags, std::string *invalid_extension) { /* The extension string is parsed left to right. */ - const struct aarch64_option_extension *opt = NULL; + const struct extension_info *opt = NULL; /* Flag to say whether we are adding or removing an extension. */ int adding_ext = -1; @@ -276,7 +280,7 @@ aarch64_parse_extension (const char *str, aarch64_feature_flags *isa_flags, void aarch64_get_all_extension_candidates (auto_vec *candidates) { - const struct aarch64_option_extension *opt; + const struct extension_info *opt; for (opt = all_extensions; opt->name != NULL; opt++) candidates->safe_push (opt->name); } @@ -396,16 +400,16 @@ aarch64_rewrite_selected_cpu (const char *name) processor = original_string; } - const struct processor_name_to_arch* p_to_a; + const struct processor_info* p_to_a; for (p_to_a = all_cores; p_to_a->arch != aarch64_no_arch; p_to_a++) { - if (p_to_a->processor_name == processor) + if (p_to_a->name == processor) break; } - const struct arch_to_arch_name* a_to_an; + const struct arch_info* a_to_an; for (a_to_an = all_architectures; a_to_an->arch != aarch64_no_arch; a_to_an++) @@ -423,7 +427,7 @@ aarch64_rewrite_selected_cpu (const char *name) aarch64_feature_flags extensions = p_to_a->flags; aarch64_parse_extension (extension_str.c_str (), &extensions, NULL); - std::string outstr = a_to_an->arch_name + std::string outstr = a_to_an->name + aarch64_get_extension_string_for_isa_flags (extensions, a_to_an->flags); From patchwork Fri Jan 10 17:23:13 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Carlotti X-Patchwork-Id: 104507 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 24EBD3856DC8 for ; Fri, 10 Jan 2025 17:24:12 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on2062d.outbound.protection.outlook.com [IPv6:2a01:111:f403:2612::62d]) by sourceware.org (Postfix) with ESMTPS id DEDB1385AC1C for ; Fri, 10 Jan 2025 17:23:35 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org DEDB1385AC1C Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=arm.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org DEDB1385AC1C Authentication-Results: server2.sourceware.org; arc=pass smtp.remote-ip=2a01:111:f403:2612::62d ARC-Seal: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1736529816; cv=pass; b=Zuyfd9GEZLXS4mML+EfSck3n+bf0LNDfgIi4hQDk8782uOp3hVJ0nHkrQh6r37PV3z8WUX3jZg2jm9PUDFRk0oDAM+qvrijGPOlYQMm4wv9j5C00h0rWmg8RLljcSOwt4qS42fewl9uccTmdcK68T/Bn5wLZteHCEXqlxWH3430= ARC-Message-Signature: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1736529816; c=relaxed/simple; bh=jxv4Mty+4afpRiWuxl29VhstURcDN9QncTBWhHqa5rw=; h=DKIM-Signature:Date:From:To:Subject:Message-ID:MIME-Version; b=XHZ0m/16s5xGzZgtKmoOdciEixlGG9Dd90VLPTT9yQVnsPrG/48ioVrSdjRhYTzWEfx9HUud8V6C7G308cXwa1lAMsekINpGhr4nJ9gDi8Ljh/9USgrZ35qGnw48Qjn1IqFwBX1OcEbs7eybTS91c8aUenCr/K4Mr6HHSZ94wTQ= ARC-Authentication-Results: i=2; server2.sourceware.org ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=raH27w2rzBBWML9ceX4zbdEWS25eijRE3IJ8LD7Zbt+ctDlGBhhIsnrrvQ1HDCbFpd91evBIt5rBPkkatu+Sf/cDDkARWxrVYfTpdQh2ttQvyr1KLCpJUCuuSU7xpLn9r942n87usa0yyH5OCzIkhhz1zPoYrCaPnvMeOeI1wO4UernMaOlKlYGYAJQepIaz4XvsCmw/u+efClWovFfYiyLNH3D8J7b23fiYCsG6wiHaFnuaFoQ553AfV8ZtbeOKC7zLfHOHbPxP3jQv04mQ6umziK/C8p6j59i0mX1JnbCcSMFpZyRblOwHkIJsL63cE+1Utk+krnN9aJmFYYUTMQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=kn+6V8ZvBXmfrJtQlhhRXjgsdUnncJV3cXYkNwnjyAw=; b=n9XMKxdkLfI+eq5UB4DLbH6tN3KuADgSnuiWKpxjjcbwqJIJpX67GFsQkPznCqZAkhCmHuqFenp2qkhsidlIXqHcmWzpkUAWFe+TNfuBlsublvRNHrxdAtujleDLjvNqOtGyYliv8VIEVvDXNfSxx6PsKb58Ay6JDZAEqwQYM6pkFcK1cTqgR3JxGTnAv8g8DKeB5epdZqIxtXW+QvUf1MFJJBaBkJct42jEw0jIIzmT9W3waG89YYP+BlqzcIwEkDCj92OmVsl4tR3FA9gKut5o82YKt3m98FmSOz6uZnuscnL2iL/0oxqgaQQZkbmlt1q+csYrcIVohqKb0KnyHw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arm.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=kn+6V8ZvBXmfrJtQlhhRXjgsdUnncJV3cXYkNwnjyAw=; b=HhrKbIMycj080LcIlv1nziyhsVJg1lthd5LRxQYxitKshhSnl9G+X5X/FAJTBsLh09MKee8hCNUby1ntjBjvb6tjJ1zKHwPsmK1kzwk4RLthrhZ9+K5Z82S4xGKHFlobLt7lyXKRnBSQJ5JH2wmadQ+qxNUgx+CHKL/y8gqktfE= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com; Received: from DU0PR08MB8255.eurprd08.prod.outlook.com (2603:10a6:10:411::9) by PA4PR08MB7457.eurprd08.prod.outlook.com (2603:10a6:102:2a4::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8335.14; Fri, 10 Jan 2025 17:23:20 +0000 Received: from DU0PR08MB8255.eurprd08.prod.outlook.com ([fe80::cbc8:c020:6a1b:d27a]) by DU0PR08MB8255.eurprd08.prod.outlook.com ([fe80::cbc8:c020:6a1b:d27a%3]) with mapi id 15.20.8335.011; Fri, 10 Jan 2025 17:23:20 +0000 Date: Fri, 10 Jan 2025 17:23:13 +0000 From: Andrew Carlotti To: gcc-patches@gcc.gnu.org Cc: Richard Sandiford , Kyrylo Tkachov Subject: [PATCH 05/11] aarch64: Adjust option parsing parameter types. Message-ID: <38daa7b2-5c55-67aa-8459-fa374ce168c7@e124511.cambridge.arm.com> References: Content-Disposition: inline In-Reply-To: X-ClientProxiedBy: LO4P302CA0024.GBRP302.PROD.OUTLOOK.COM (2603:10a6:600:2c1::10) To DU0PR08MB8255.eurprd08.prod.outlook.com (2603:10a6:10:411::9) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DU0PR08MB8255:EE_|PA4PR08MB7457:EE_ X-MS-Office365-Filtering-Correlation-Id: e89fd78f-87b6-47d2-68ec-08dd319b7a71 x-checkrecipientrouted: true NoDisclaimer: true X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|366016|1800799024|376014; X-Microsoft-Antispam-Message-Info: CzYjFgeGeiimY/rLWUfNY0X35FUVTT+NGLxP/x0Ta/Tu7HvOxbDO0ofCWPUcIUrlrAkJ8jzURcrk6s55sGlcq9T1Tlvfl7f/NbcOll1RhTRrt0QE8T6iYxQ7LFZC/Kj5qZhVzpHo5C7l7RSuYKJyh2Ca6vlHtOdzzrGRvegqbu+mlwr8eevW7D2D77a0mQpVqVb9gvbvm5AmyH+/NXrOK34vriLhYuHUAx4Mvx7j9xZpezMpf8Tv/k9RGFp8/L7JsCPjtScHVHOLT8NmZDYAPiIm/8GwWsNRUuYOtbX7Z9PSLv2pkssDkzhbg0xFdKVk3014a4oYaJdxLt7nKxAiUX7HfuFhqPB0pOxU7rGn5fRfCEMjWIX8MrZkc25DR4JZ3J+Nz3c9PDgmxa1FLjvHPJH8naj2dDZuxyxyznVf9Gsgjf7f2aIzEwF7zIyGyoXCSp8YLZ6HTzVh+J6vtJpR9VKoR5KbizxXqN++o2uYXQ0gT1NisLStZCvUuwQZZ1yUkz74K83Id0D2xG/jPlDdtdNeHz7RLio502tftSgAmfpGeUQGpszTIRlTO/qnszfrp+gix2mpNftxp3dpxEuamY5L0SqdUjxzleNFV9BeWkBhFqPtzcjoJAVmdcw+4yCFSsRTJ/Qga6WzRdqiQNTiTv0qpeTmHuGfK23E0hDim73b3Sk0/qo0fZtSF/fAy3GKJUtM+xOt15pNExktmxcszya0Vs7S52/5yLr/TRocryqHMCB06L+DfcFPDizXjHF4H73kUDlhgMHW9EpvGQk6IsEWXMD4PYWZwc1OnNpHCwJaUZiS6updZgjOSZXaxjGXBOI0OV0TEMJh39yHic5DFlCK7zA/w8z+5uraTtvzoXZoO8bH8nNOPbwDCOZ9XUJx/AbrQdVv8WK+w1DlgKIiHsWNWPBjsi5INr7+Fvme3upNuTzSk4YpK6uDilD3ThZjmaeAETXUX+zQc3dcOwxdXoaGNlhoHKciLdRdx9xbCBfbJuSvdsWiu9ZJkq3ZY9qLYG3yH36XtC5bXRY4oKy1JkVifG2FsGbndkPFjZNjRXn12kFL+lm6mbGXdL+ECVwdazzutqFFO3WQFGM5MV2eLEHebSHuwMP2WH0/nqd7w+5SMVZfoy2q3AU77Io0hqcv5UY1WTKwI8eO87E4YXGXLCXYaAShiunX4vCjBhMEQDtpFTb+gj17X3wxGpxoy+jh2Ic22VDj00s6GoCDi/T/yafSONQMvA3QbaXolJW7xaNYevISk2GYh4MZWxP/XjgIvDMmYuJecNXVnpcuWPgpcY0gIJyRiCYDWcEavVAOQeDyMMqe5Lw5A3T3U9o5N28JC1bYEadwLTdW+WmHlCrvJzj/2QKiB20UFmCB6Inem2NTh73uLL9GojcGYUlgLFVX X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DU0PR08MB8255.eurprd08.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(366016)(1800799024)(376014); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: //BfpUyID7PsuBnkvuconHW9Z2SV7SKY7IxSVyBjZsSegZ0I0LEIP1k2TXhZZpPuAQhbXjWdo7vqBsrL5RJUq/9Dl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hsxEh6Q7B0A1rsNn/gc5TefKsITkc2i/CoI9r5MUhed17irvYmk5udEy0Zh5BKunbvEP/r9zDDLzK+I1Z3Rw3eJGXH66Ris5G4JzNDs6z1ed4s6T3mRDvxxrHGyAyVG7fzDva59g0qdnLnP/Qpmq3VqsvHAS83jiRFMdzT0U1M1c4koEzWZ/wVHaCEyEz13AqrvzyDuqnKJeDowKBC1ztpT4jaFKLqYXV38DJVwLx4PvqY7nBgE4nJnZEykj2UZ5AwGkwAVu6M7k9jDqVuzCg+pkooO05LyjpvmyodJ8NRsS3BrI5wU+M25tVEG8Hl4+CEogt5y5Q9EwTUu6uwLROnayQsU/iHnblmikVYZXPgn+PnnfF5zzN1s+gRd6gXYfDz9V3RO95xwq+vqO7O6W4nAZghTjrK64Hv0d1GDOfD/GbaiOLnxjY7eFkuKo7ZctXX7wfDQLmm2HfOHK3wVOg== X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-Network-Message-Id: e89fd78f-87b6-47d2-68ec-08dd319b7a71 X-MS-Exchange-CrossTenant-AuthSource: DU0PR08MB8255.eurprd08.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Jan 2025 17:23:20.1724 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: wZ8M1FfnjGO0WtTvPNx3697nJ3zj6WrHREpLlYIYmOesYDeT41AOfY//w2pSpvaMcG7dEVK4FvAqmRE9f4dDFQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PA4PR08MB7457 X-Spam-Status: No, score=-11.7 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FORGED_SPF_HELO, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_PASS, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces~patchwork=sourceware.org@gcc.gnu.org Replace `const struct processor *` in output parameters with `aarch64_arch` or `aarch64_cpu`. Replace `std:string` parameter in aarch64_print_hint_for_extensions with `char *`. Also name the return parameters more clearly and consistently. gcc/ChangeLog: * config/aarch64/aarch64.cc (aarch64_print_hint_for_extensions): Receive string as a char *. (aarch64_parse_arch): Don't return a const struct processor *. (aarch64_parse_cpu): Ditto. (aarch64_parse_tune): Ditto. (aarch64_validate_mtune): Ditto. (aarch64_validate_mcpu): Ditto, and use temporary variables for march/mcpu cross-check. (aarch64_validate_march): Ditto. (aarch64_override_options): Adjust for changed parameter types. (aarch64_handle_attr_arch): Ditto. (aarch64_handle_attr_cpu): Ditto. (aarch64_handle_attr_tune): Ditto. diff --git a/gcc/config/aarch64/aarch64.cc b/gcc/config/aarch64/aarch64.cc index d8a2916d8230cc25122f21818b88fd347e72693a..9b44d08f3e5fe6b4a7aa8f040e7001e3070b362d 100644 --- a/gcc/config/aarch64/aarch64.cc +++ b/gcc/config/aarch64/aarch64.cc @@ -18217,16 +18217,16 @@ better_main_loop_than_p (const vector_costs *uncast_other) const static void initialize_aarch64_code_model (struct gcc_options *); -/* Parse the TO_PARSE string and put the architecture struct that it - selects into RES and the architectural features into ISA_FLAGS. +/* Parse the TO_PARSE string and put the architecture that it + selects into RES_ARCH and the architectural features into RES_FLAGS. Return an aarch_parse_opt_result describing the parse result. - If there is an error parsing, RES and ISA_FLAGS are left unchanged. + If there is an error parsing, RES_ARCH and RES_FLAGS are left unchanged. When the TO_PARSE string contains an invalid extension, a copy of the string is created and stored to INVALID_EXTENSION. */ static enum aarch_parse_opt_result -aarch64_parse_arch (const char *to_parse, const struct processor **res, - aarch64_feature_flags *isa_flags, +aarch64_parse_arch (const char *to_parse, aarch64_arch *res_arch, + aarch64_feature_flags *res_flags, std::string *invalid_extension) { const char *ext; @@ -18250,21 +18250,21 @@ aarch64_parse_arch (const char *to_parse, const struct processor **res, if (strlen (arch->name) == len && strncmp (arch->name, to_parse, len) == 0) { - auto isa_temp = arch->flags; + auto isa_flags = arch->flags; if (ext != NULL) { /* TO_PARSE string contains at least one extension. */ enum aarch_parse_opt_result ext_res - = aarch64_parse_extension (ext, &isa_temp, invalid_extension); + = aarch64_parse_extension (ext, &isa_flags, invalid_extension); if (ext_res != AARCH_PARSE_OK) return ext_res; } /* Extension parsing was successful. Confirm the result arch and ISA flags. */ - *res = arch; - *isa_flags = isa_temp; + *res_arch = arch->arch; + *res_flags = isa_flags; return AARCH_PARSE_OK; } } @@ -18273,16 +18273,16 @@ aarch64_parse_arch (const char *to_parse, const struct processor **res, return AARCH_PARSE_INVALID_ARG; } -/* Parse the TO_PARSE string and put the result tuning in RES and the - architecture flags in ISA_FLAGS. Return an aarch_parse_opt_result - describing the parse result. If there is an error parsing, RES and - ISA_FLAGS are left unchanged. +/* Parse the TO_PARSE string and put the result tuning in RES_CPU and the + architecture flags in RES_FLAGS. Return an aarch_parse_opt_result + describing the parse result. If there is an error parsing, RES_CPU and + RES_FLAGS are left unchanged. When the TO_PARSE string contains an invalid extension, a copy of the string is created and stored to INVALID_EXTENSION. */ static enum aarch_parse_opt_result -aarch64_parse_cpu (const char *to_parse, const struct processor **res, - aarch64_feature_flags *isa_flags, +aarch64_parse_cpu (const char *to_parse, aarch64_cpu *res_cpu, + aarch64_feature_flags *res_flags, std::string *invalid_extension) { const char *ext; @@ -18305,21 +18305,21 @@ aarch64_parse_cpu (const char *to_parse, const struct processor **res, { if (strlen (cpu->name) == len && strncmp (cpu->name, to_parse, len) == 0) { - auto isa_temp = cpu->flags; + auto isa_flags = cpu->flags; if (ext != NULL) { /* TO_PARSE string contains at least one extension. */ enum aarch_parse_opt_result ext_res - = aarch64_parse_extension (ext, &isa_temp, invalid_extension); + = aarch64_parse_extension (ext, &isa_flags, invalid_extension); if (ext_res != AARCH_PARSE_OK) return ext_res; } /* Extension parsing was successfull. Confirm the result cpu and ISA flags. */ - *res = cpu; - *isa_flags = isa_temp; + *res_cpu = cpu->ident; + *res_flags = isa_flags; return AARCH_PARSE_OK; } } @@ -18328,12 +18328,12 @@ aarch64_parse_cpu (const char *to_parse, const struct processor **res, return AARCH_PARSE_INVALID_ARG; } -/* Parse the TO_PARSE string and put the cpu it selects into RES. +/* Parse the TO_PARSE string and put the cpu it selects into RES_CPU. Return an aarch_parse_opt_result describing the parse result. - If the parsing fails the RES does not change. */ + If the parsing fails then RES_CPU does not change. */ static enum aarch_parse_opt_result -aarch64_parse_tune (const char *to_parse, const struct processor **res) +aarch64_parse_tune (const char *to_parse, aarch64_cpu *res_cpu) { const struct processor *cpu; @@ -18342,7 +18342,7 @@ aarch64_parse_tune (const char *to_parse, const struct processor **res) { if (strcmp (cpu->name, to_parse) == 0) { - *res = cpu; + *res_cpu = cpu->ident; return AARCH_PARSE_OK; } } @@ -18937,12 +18937,12 @@ aarch64_print_hint_for_arch (const char *str) that most closely resembles what the user passed in STR. */ void -aarch64_print_hint_for_extensions (const std::string &str) +aarch64_print_hint_for_extensions (const char *str) { auto_vec candidates; aarch64_get_all_extension_candidates (&candidates); char *s; - const char *hint = candidates_list_and_hint (str.c_str (), s, candidates); + const char *hint = candidates_list_and_hint (str, s, candidates); if (hint) inform (input_location, "valid arguments are: %s;" " did you mean %qs?", s, hint); @@ -18954,16 +18954,16 @@ aarch64_print_hint_for_extensions (const std::string &str) /* Validate a command-line -mcpu option. Parse the cpu and extensions (if any) specified in STR and throw errors if appropriate. Put the results if - they are valid in RES and ISA_FLAGS. Return whether the option is + they are valid in RES_CPU and RES_FLAGS. Return whether the option is valid. */ static bool -aarch64_validate_mcpu (const char *str, const struct processor **res, - aarch64_feature_flags *isa_flags) +aarch64_validate_mcpu (const char *str, aarch64_cpu *res_cpu, + aarch64_feature_flags *res_flags) { std::string invalid_extension; enum aarch_parse_opt_result parse_res - = aarch64_parse_cpu (str, res, isa_flags, &invalid_extension); + = aarch64_parse_cpu (str, res_cpu, res_flags, &invalid_extension); if (parse_res == AARCH_PARSE_OK) return true; @@ -18974,19 +18974,24 @@ aarch64_validate_mcpu (const char *str, const struct processor **res, error ("missing cpu name in %<-mcpu=%s%>", str); break; case AARCH_PARSE_INVALID_ARG: - error ("unknown value %qs for %<-mcpu%>", str); - aarch64_print_hint_for_core (str); - /* A common user error is confusing -march and -mcpu. - If the -mcpu string matches a known architecture then suggest - -march=. */ - parse_res = aarch64_parse_arch (str, res, isa_flags, &invalid_extension); - if (parse_res == AARCH_PARSE_OK) - inform (input_location, "did you mean %<-march=%s%>?", str); - break; + { + error ("unknown value %qs for %<-mcpu%>", str); + aarch64_print_hint_for_core (str); + /* A common user error is confusing -march and -mcpu. + If the -mcpu string matches a known architecture then suggest + -march=. */ + aarch64_arch temp_arch; + aarch64_feature_flags temp_flags; + parse_res = aarch64_parse_arch (str, &temp_arch, &temp_flags, + &invalid_extension); + if (parse_res == AARCH_PARSE_OK) + inform (input_location, "did you mean %<-march=%s%>?", str); + break; + } case AARCH_PARSE_INVALID_FEATURE: error ("invalid feature modifier %qs in %<-mcpu=%s%>", invalid_extension.c_str (), str); - aarch64_print_hint_for_extensions (invalid_extension); + aarch64_print_hint_for_extensions (invalid_extension.c_str ()); break; default: gcc_unreachable (); @@ -19070,16 +19075,16 @@ aarch64_validate_sls_mitigation (const char *const_str) /* Validate a command-line -march option. Parse the arch and extensions (if any) specified in STR and throw errors if appropriate. Put the - results, if they are valid, in RES and ISA_FLAGS. Return whether the + results, if they are valid, in RES_ARCH and RES_FLAGS. Return whether the option is valid. */ static bool -aarch64_validate_march (const char *str, const struct processor **res, - aarch64_feature_flags *isa_flags) +aarch64_validate_march (const char *str, aarch64_arch *res_arch, + aarch64_feature_flags *res_flags) { std::string invalid_extension; enum aarch_parse_opt_result parse_res - = aarch64_parse_arch (str, res, isa_flags, &invalid_extension); + = aarch64_parse_arch (str, res_arch, res_flags, &invalid_extension); if (parse_res == AARCH_PARSE_OK) return true; @@ -19090,18 +19095,23 @@ aarch64_validate_march (const char *str, const struct processor **res, error ("missing arch name in %<-march=%s%>", str); break; case AARCH_PARSE_INVALID_ARG: - error ("unknown value %qs for %<-march%>", str); - aarch64_print_hint_for_arch (str); - /* A common user error is confusing -march and -mcpu. - If the -march string matches a known CPU suggest -mcpu. */ - parse_res = aarch64_parse_cpu (str, res, isa_flags, &invalid_extension); - if (parse_res == AARCH_PARSE_OK) - inform (input_location, "did you mean %<-mcpu=%s%>?", str); - break; + { + error ("unknown value %qs for %<-march%>", str); + aarch64_print_hint_for_arch (str); + /* A common user error is confusing -march and -mcpu. + If the -march string matches a known CPU suggest -mcpu. */ + aarch64_cpu temp_cpu; + aarch64_feature_flags temp_flags; + parse_res = aarch64_parse_cpu (str, &temp_cpu, &temp_flags, + &invalid_extension); + if (parse_res == AARCH_PARSE_OK) + inform (input_location, "did you mean %<-mcpu=%s%>?", str); + break; + } case AARCH_PARSE_INVALID_FEATURE: error ("invalid feature modifier %qs in %<-march=%s%>", invalid_extension.c_str (), str); - aarch64_print_hint_for_extensions (invalid_extension); + aarch64_print_hint_for_extensions (invalid_extension.c_str ()); break; default: gcc_unreachable (); @@ -19112,14 +19122,14 @@ aarch64_validate_march (const char *str, const struct processor **res, /* Validate a command-line -mtune option. Parse the cpu specified in STR and throw errors if appropriate. Put the - result, if it is valid, in RES. Return whether the option is + result, if it is valid, in RES_CPU. Return whether the option is valid. */ static bool -aarch64_validate_mtune (const char *str, const struct processor **res) +aarch64_validate_mtune (const char *str, aarch64_cpu *res_cpu) { enum aarch_parse_opt_result parse_res - = aarch64_parse_tune (str, res); + = aarch64_parse_tune (str, res_cpu); if (parse_res == AARCH_PARSE_OK) return true; @@ -19247,9 +19257,9 @@ aarch64_override_options (void) aarch64_feature_flags arch_isa = 0; aarch64_set_asm_isa_flags (0); - const struct processor *cpu = NULL; - const struct processor *arch = NULL; - const struct processor *tune = NULL; + aarch64_cpu cpu = aarch64_no_cpu; + aarch64_arch arch = aarch64_no_arch; + aarch64_cpu tune = aarch64_no_cpu; if (aarch64_harden_sls_string) aarch64_validate_sls_mitigation (aarch64_harden_sls_string); @@ -19275,7 +19285,7 @@ aarch64_override_options (void) SUBTARGET_OVERRIDE_OPTIONS; #endif - if (cpu && arch) + if (cpu != aarch64_no_cpu && arch != aarch64_no_arch) { /* If both -mcpu and -march are specified, warn if they are not feature compatible. feature compatible means that the inclusion of the @@ -19293,29 +19303,31 @@ aarch64_override_options (void) ext_diff.c_str ()); } - selected_arch = arch->arch; + selected_arch = arch; aarch64_set_asm_isa_flags (arch_isa | AARCH64_FL_DEFAULT_ISA_MODE); } - else if (cpu) + else if (cpu != aarch64_no_cpu) { - selected_arch = cpu->arch; + selected_arch = aarch64_get_tune_cpu (cpu)->arch; aarch64_set_asm_isa_flags (cpu_isa | AARCH64_FL_DEFAULT_ISA_MODE); } - else if (arch) + else if (arch != aarch64_no_arch) { - cpu = &all_cores[arch->ident]; - selected_arch = arch->arch; + cpu = aarch64_get_arch (arch)->ident; + selected_arch = arch; aarch64_set_asm_isa_flags (arch_isa | AARCH64_FL_DEFAULT_ISA_MODE); } else { /* No -mcpu or -march specified, so use the default CPU. */ - cpu = &all_cores[TARGET_CPU_DEFAULT]; - selected_arch = cpu->arch; - aarch64_set_asm_isa_flags (cpu->flags | AARCH64_FL_DEFAULT_ISA_MODE); + cpu = TARGET_CPU_DEFAULT; + const processor *cpu_info = aarch64_get_tune_cpu (cpu); + selected_arch = cpu_info->arch; + aarch64_set_asm_isa_flags (cpu_info->flags + | AARCH64_FL_DEFAULT_ISA_MODE); } - selected_tune = tune ? tune->ident : cpu->ident; + selected_tune = (tune != aarch64_no_cpu) ? tune : cpu; if (aarch_enable_bti == 2) { @@ -19619,7 +19631,7 @@ struct aarch64_attribute_info static bool aarch64_handle_attr_arch (const char *str) { - const struct processor *tmp_arch = NULL; + aarch64_arch tmp_arch = aarch64_no_arch; std::string invalid_extension; aarch64_feature_flags tmp_flags; enum aarch_parse_opt_result parse_res @@ -19627,8 +19639,8 @@ aarch64_handle_attr_arch (const char *str) if (parse_res == AARCH_PARSE_OK) { - gcc_assert (tmp_arch); - selected_arch = tmp_arch->arch; + gcc_assert (tmp_arch != aarch64_no_arch); + selected_arch = tmp_arch; aarch64_set_asm_isa_flags (tmp_flags | (aarch64_asm_isa_flags & AARCH64_FL_ISA_MODES)); return true; @@ -19646,7 +19658,7 @@ aarch64_handle_attr_arch (const char *str) case AARCH_PARSE_INVALID_FEATURE: error ("invalid feature modifier %s of value %qs in " "% pragma or attribute", invalid_extension.c_str (), str); - aarch64_print_hint_for_extensions (invalid_extension); + aarch64_print_hint_for_extensions (invalid_extension.c_str ()); break; default: gcc_unreachable (); @@ -19660,7 +19672,7 @@ aarch64_handle_attr_arch (const char *str) static bool aarch64_handle_attr_cpu (const char *str) { - const struct processor *tmp_cpu = NULL; + aarch64_cpu tmp_cpu = aarch64_no_cpu; std::string invalid_extension; aarch64_feature_flags tmp_flags; enum aarch_parse_opt_result parse_res @@ -19668,9 +19680,9 @@ aarch64_handle_attr_cpu (const char *str) if (parse_res == AARCH_PARSE_OK) { - gcc_assert (tmp_cpu); - selected_tune = tmp_cpu->ident; - selected_arch = tmp_cpu->arch; + gcc_assert (tmp_cpu != aarch64_no_cpu); + selected_tune = tmp_cpu; + selected_arch = aarch64_get_tune_cpu (tmp_cpu)->arch; aarch64_set_asm_isa_flags (tmp_flags | (aarch64_asm_isa_flags & AARCH64_FL_ISA_MODES)); return true; @@ -19688,7 +19700,7 @@ aarch64_handle_attr_cpu (const char *str) case AARCH_PARSE_INVALID_FEATURE: error ("invalid feature modifier %qs of value %qs in " "% pragma or attribute", invalid_extension.c_str (), str); - aarch64_print_hint_for_extensions (invalid_extension); + aarch64_print_hint_for_extensions (invalid_extension.c_str ()); break; default: gcc_unreachable (); @@ -19711,14 +19723,14 @@ aarch64_handle_attr_branch_protection (const char* str) static bool aarch64_handle_attr_tune (const char *str) { - const struct processor *tmp_tune = NULL; + aarch64_cpu tmp_tune = aarch64_no_cpu; enum aarch_parse_opt_result parse_res = aarch64_parse_tune (str, &tmp_tune); if (parse_res == AARCH_PARSE_OK) { - gcc_assert (tmp_tune); - selected_tune = tmp_tune->ident; + gcc_assert (tmp_tune != aarch64_no_cpu); + selected_tune = tmp_tune; return true; } From patchwork Fri Jan 10 17:23:37 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Carlotti X-Patchwork-Id: 104515 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 1C6F9385829B for ; Fri, 10 Jan 2025 17:33:44 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 1C6F9385829B Authentication-Results: sourceware.org; dkim=pass (1024-bit key, unprotected) header.d=arm.com header.i=@arm.com header.a=rsa-sha256 header.s=selector1 header.b=mwcPovz7 X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05on2062c.outbound.protection.outlook.com [IPv6:2a01:111:f403:2614::62c]) by sourceware.org (Postfix) with ESMTPS id D6B723857013 for ; Fri, 10 Jan 2025 17:23:46 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org D6B723857013 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=arm.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org D6B723857013 Authentication-Results: server2.sourceware.org; arc=pass smtp.remote-ip=2a01:111:f403:2614::62c ARC-Seal: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1736529827; cv=pass; b=UfQXIKOlfPZd5045fqIC+kwBnYwnJhrnUVT3Gs/PaeCDI71jSABif/B7OJJKRd5PovA70DZ3SsVbrdulapqWVNkqJrUeKHbLL+T29HN4LJ1ExcSmGUhzz4cb93IZ9b7LA8W3WT0yKzKl206uTYwa+QivjaTWDy/+RNurFxv9ZrA= ARC-Message-Signature: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1736529827; c=relaxed/simple; bh=65YXNOcJiuggWCcsMvQBquKyj5VOLp20vUMZ2dMcIVc=; h=DKIM-Signature:Date:From:To:Subject:Message-ID:MIME-Version; b=bdE0X83MRw4mIV26MYBJzsFkevzGUU1r9Wyzv4L4Jmig6tMUkNPVnnJ1A4YqhjgYNXJnk9flhBGxBol5vEcZ0GtMbMdxtzB9oGXj+KXjzbdehht8wguqvE580mhgfgbfwtwlY72KvnPe9q3uZ9PXrpeOtQPY1nxxPzeEtLs7v2Y= ARC-Authentication-Results: i=2; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D6B723857013 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=o6LVcOaVC8TCXE/hHRfkVCTbqwxFCIO21EYQHW9srOyFXOlH5byxFGD2AjjWvA2ldWuZIHXU/elLALZS5UgQPIh9vBazXtLnNiSjMT1YzfEHfwBj1qnSc/KC/3Ra0MDR4J7OQcP+B4gi7Qr8OZUuGASJdPUxZ8tBXtpG+ZXTu+d2jWN8xV7s5ukUy5xowqblUYw0Bt9wFz7lSP1832Z9/spFsHFcmhTyKDvTOCRYO/W19ke2aKN70ktqW5ViJgV1kByy8pqCUnFTo45D9QfcdHk8zy7bpTimuEMc8Z2Cia3iv5FkXJNMKP7UKm+FV+jpnGNvrhx/3RaL1++Rs5zWyQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=7zyVmyPBm2FvnE9B+iUaegBjFUnN3nRohllIQXt3miQ=; b=qtNnBmC1kmx13KB0KJUGnCk5u4WQy/ARE8m+9Q3/znu+y9tNpdZTj1I8mKgyTiF/JMRdoVtJogxkIcGxuehthwuJovO4mTJ9SJ4O14yMGgkq48SXk09CJ7f5KYgk2BsI8lINiM46thlgE53EKT8hVsnwfv0as6H1x2D8aRwHVFd/UDdOf5Yy2Uz6noxFxaTQkXpuP2RrSyWyU5+FexS5FQB5lSFXy4DMZROXeM6lkxuEFA5g+K/QbEMWsE/xGQX05d3EdHp+DKxqIPv0WD7wsPA9pNZ39DPt0RWxJSaR4CETey0MExxVNJvSs7XZ/yB7i4DxKzy5DzoXOBb1KcKsxQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arm.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=7zyVmyPBm2FvnE9B+iUaegBjFUnN3nRohllIQXt3miQ=; b=mwcPovz7WRzlspAIW9FykR0LwLLGYOH5TYIwFq4mPf8NPKonF34HogDDist1rkUVzu48XuBRwrb6SEjKpwsq5eHwEJUBlFA4W49Q7P1/rErhpPRpPAEWxPsqGK+0BysCeS7BTsCgBcoEQgtn2krYJCckq1zAAw44WeIGS3ybH44= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com; Received: from DU0PR08MB8255.eurprd08.prod.outlook.com (2603:10a6:10:411::9) by PA4PR08MB7457.eurprd08.prod.outlook.com (2603:10a6:102:2a4::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8335.14; Fri, 10 Jan 2025 17:23:39 +0000 Received: from DU0PR08MB8255.eurprd08.prod.outlook.com ([fe80::cbc8:c020:6a1b:d27a]) by DU0PR08MB8255.eurprd08.prod.outlook.com ([fe80::cbc8:c020:6a1b:d27a%3]) with mapi id 15.20.8335.011; Fri, 10 Jan 2025 17:23:39 +0000 Date: Fri, 10 Jan 2025 17:23:37 +0000 From: Andrew Carlotti To: gcc-patches@gcc.gnu.org Cc: Richard Sandiford , Kyrylo Tkachov Subject: [PATCH 06/11] aarch64: Inline aarch64_print_hint_for_core_or_arch Message-ID: References: Content-Disposition: inline In-Reply-To: X-ClientProxiedBy: LO4P123CA0249.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:1a7::20) To DU0PR08MB8255.eurprd08.prod.outlook.com (2603:10a6:10:411::9) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DU0PR08MB8255:EE_|PA4PR08MB7457:EE_ X-MS-Office365-Filtering-Correlation-Id: b34fd1ef-9c40-400c-eeca-08dd319b862f x-checkrecipientrouted: true NoDisclaimer: true X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|366016|1800799024|376014; X-Microsoft-Antispam-Message-Info: fuZSFRClgXgS96w+URQKjY1M5EsMLCldA1TfCiFzEzn3KK2awYXHUGzd13USmvkJblwmLGu6ehsvW5rUk83J/21UIfaajLK26dK694E7kZl35iCfVbSLIoocX9fui32STr5aTxcECpkKG/NIa99tguLVFk+LeW+nSW0W4eXBvgpUT5KqOwWdOHRP2X6gMS1OJUVUrPePKFoMCnKavcb3UDwJWyoKXgCCiKQQlSRcY/NXF26y0D/ffLMou8rRHuJ9KbRM8r2IXxBx76bz7LSCZ5v9RIjugGGV6gQzDPdvKTqI6zAc2Xt3W1FQRLPx/PA7KZJf00Pc1Hrr/XuJy1QUI8arYSNZIsOThSQgJW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:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DU0PR08MB8255.eurprd08.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(366016)(1800799024)(376014); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: Ofar29ahNhtscaXudj0lozHeiBtt1r4nCpY9IgdfUI8GGxqi1fVyZsdebqMPuz+6B/mv0WLeCBi5t9duhY8du/673wAPC0MRJ5bLCfod1yoIFm0BB83fIwwFlHG9Hx84CmPHOj4jtEpcPaj65hWcxgffzYtyMV2Yx3QBnSaOUjbg3v0y+tgIr7SiEZBdTiM5jDXXr7zpl54jZmQ6q/Nrs8ZB9S3F3MsFpUSaPyQ3RfCfla54UGrDCmlYmdT3VK0xHJo60wZwmBHngUlvvRuyudHHz2KBrUvfxa0PrDRPfdwAU1keZkOPUCFR+b+/o24RZOzQ8EvL+4TQ4A3XE/V/KFRUkCDAKJJd3KY2kYLiN0MtxJxo7aB7TzNdjCFw5SOjcWX+/kDtzSJ0+L4BPBeqDvfn+ycIFgf2FxRgsJY2bJtsOmj5/09FNTAjcaMBWD4HWQNOxxT1stdIwWxVsPYRwyxghdsKCF9qbPBZHA+uLNkV2H+XEpA4L2wsaZkYDJ7641SuEJI8NBzNvvxca1kw8Qo7Mav/duPSXbmJkY37VUMAMer4hSTt1F296LDSOrrXRTXMuXaVV0HPgGuM6JCGJDLGYm6IKsXQKne8ktSmsym42TN0SIZMxvBavnvxbr9QHoxEEuyasmQLQk8KDimVNw+CzPraVHK083ijAAmdLpJ690yvNmIukCT/LLjJdN9HVCJGmzFU7WW+Hy8pmyfb90BxEbbP708xMiQ+ymJRGudnGqQsEvFoi9+nmUzrlcpEe5xxOsWKkT8hxYWZ8vIDrjzL2gV3BEl7zLJT8mVKKfthpuTPXMfJETiqeSeRbl0j3N6+RvSdKRo59AaVYc8i5w2TL8mwaSQwcXbnrYOu1demvbnJGQypHWQpZ8rAyUg1qFbDyD0/pUOfxZt4jkzugWDBTvGMCeLbdmeFaHrxKHoLvSqQ+TshM85CuwqomaC7vRq9sqIxWl7VGZR1SFNyS1sX9h2fthF3nsjRllm+LXik0ZIvIuCAV5LxD3JPIXU8fhdZmU0pBGJCntJYEqywRuyFTkWmNiNg/wIXGdVc1kXCFK4TRcR1IVliKkAmKOnvUCP7+9QUTw9VyYG1Nytr9iyIaH0vOxzgvJ6UxXYHp5D+Kaz1S7u0llvZ4EfUsmIy0IZBEloWdbZ56n4CTBwa/kGRCZzn4aUZgYmFPOgmNSqDojKp6g3vpYGB069zuLNhovLW9FV3ZzFoV9rTmdQLcybrp4c1yZfROcqnPeNQyPv9bCtRvnH381xO9SzqhPI2etwG/ai1pYCX79GQVV7HL68j6KuDgcXXGaeut1f9ZsuLjHYaV36PDLGwDISKBxdIiHqdb+RkSTXb0sdKbQhBUDqS3+qFChiyFTLCNy+bSpc4W0p++jmrII2z1U7OLhPotvkAHjg94MZDzV76kUdzbxrzN7q0sTm7aP+sqZvuHooxxA0BeSzBAE3lQwYzPEUx3qSu+eGld6k9ZHIM0ftHgkDgk1d3ngknRfjbU2D3kw8u4GU+lvOpG5xe61RcqLBiV5RpIO2tBijltLhSxWooaBvqump7VGDy2PaW5ayB2209aC2+qxNzCNXfc8mPfSdarsbrDdeGjBpxYMD2eML02Q== X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-Network-Message-Id: b34fd1ef-9c40-400c-eeca-08dd319b862f X-MS-Exchange-CrossTenant-AuthSource: DU0PR08MB8255.eurprd08.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Jan 2025 17:23:39.8263 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 45u/j5b/pzRjVzSCA72DJezVRtd8g/N+6cG6WRfR8wHzBADYo1OmDwnHRtfnSStmAVkYUX1AfxE0HDHOkjFkUQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PA4PR08MB7457 X-Spam-Status: No, score=-11.7 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FORGED_SPF_HELO, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_PASS, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces~patchwork=sourceware.org@gcc.gnu.org It seems odd that we add "native" to the list for -march but not for -mcpu. This is probably a bug, but for now we'll preserve the existing behaviour. gcc/ChangeLog: * config/aarch64/aarch64.cc (aarch64_print_hint_for_core_or_arch): Inline into... (aarch64_print_hint_for_core): ...here... (aarch64_print_hint_for_arch): ...and here. diff --git a/gcc/config/aarch64/aarch64.cc b/gcc/config/aarch64/aarch64.cc index 9b44d08f3e5fe6b4a7aa8f040e7001e3070b362d..f33034cbb205eb52b5ee5965b8b972cedf6f4927 100644 --- a/gcc/config/aarch64/aarch64.cc +++ b/gcc/config/aarch64/aarch64.cc @@ -18884,25 +18884,17 @@ aarch64_override_options_internal (struct gcc_options *opts) aarch64_override_options_after_change_1 (opts); } -/* Print a hint with a suggestion for a core or architecture name that - most closely resembles what the user passed in STR. ARCH is true if - the user is asking for an architecture name. ARCH is false if the user - is asking for a core name. */ +/* Print a hint with a suggestion for a core name that most closely resembles + what the user passed in STR. */ -static void -aarch64_print_hint_for_core_or_arch (const char *str, bool arch) +inline static void +aarch64_print_hint_for_core (const char *str) { auto_vec candidates; - const struct processor *entry = arch ? all_architectures : all_cores; + const struct processor *entry = all_cores; for (; entry->name != NULL; entry++) candidates.safe_push (entry->name); -#ifdef HAVE_LOCAL_CPU_DETECT - /* Add also "native" as possible value. */ - if (arch) - candidates.safe_push ("native"); -#endif - char *s; const char *hint = candidates_list_and_hint (str, s, candidates); if (hint) @@ -18914,22 +18906,31 @@ aarch64_print_hint_for_core_or_arch (const char *str, bool arch) XDELETEVEC (s); } -/* Print a hint with a suggestion for a core name that most closely resembles - what the user passed in STR. */ - -inline static void -aarch64_print_hint_for_core (const char *str) -{ - aarch64_print_hint_for_core_or_arch (str, false); -} - /* Print a hint with a suggestion for an architecture name that most closely resembles what the user passed in STR. */ inline static void aarch64_print_hint_for_arch (const char *str) { - aarch64_print_hint_for_core_or_arch (str, true); + auto_vec candidates; + const struct processor *entry = all_architectures; + for (; entry->name != NULL; entry++) + candidates.safe_push (entry->name); + +#ifdef HAVE_LOCAL_CPU_DETECT + /* Add also "native" as possible value. */ + candidates.safe_push ("native"); +#endif + + char *s; + const char *hint = candidates_list_and_hint (str, s, candidates); + if (hint) + inform (input_location, "valid arguments are: %s;" + " did you mean %qs?", s, hint); + else + inform (input_location, "valid arguments are: %s", s); + + XDELETEVEC (s); } From patchwork Fri Jan 10 17:23:54 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Carlotti X-Patchwork-Id: 104510 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 59313385AC19 for ; Fri, 10 Jan 2025 17:25:27 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on20616.outbound.protection.outlook.com [IPv6:2a01:111:f403:2612::616]) by sourceware.org (Postfix) with ESMTPS id B51AE385AC26 for ; Fri, 10 Jan 2025 17:23:58 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org B51AE385AC26 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=arm.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org B51AE385AC26 Authentication-Results: server2.sourceware.org; arc=pass smtp.remote-ip=2a01:111:f403:2612::616 ARC-Seal: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1736529838; cv=pass; b=hL5GOGTHh6hPlpNmXNiXFSSdb4Otb6whYVfBYbjTN+s4kOqmPdwXumqBn1CMCISaqc1xxXgvCurb3H5GthwOLuC4RK2zuoXc0s4kxae3Ad6/CKN8EgMvuVhPV7OylBEikdKVzOFSpg77cHD1xMN1C8AELBJGTvtQj/Efmmeyfjo= ARC-Message-Signature: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1736529838; c=relaxed/simple; bh=sAI3cR2AaGRviR4mXZo6DRT2u1qaAZCpCpJJyDLbbBg=; h=DKIM-Signature:Date:From:To:Subject:Message-ID:MIME-Version; b=JEc3CA7A0+4yCvX90z1YD4bSQplAyBFgjZCqSXa1o3Ya/L5x2Muuc3NJHRqdbIVirOLD4AaT/l92d7/Gd/5mLvTSsPI7INQeiil4L0s+3SmaCEDXxxwPluk5NXLLRAaXF+OfjvsR4e8J/u9KLdNom3EIlNIikdSTfwVWUSByNX8= ARC-Authentication-Results: i=2; server2.sourceware.org ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=TL48wORJWzRxPoZW9Q26DJEJQDvdKVsh9dT9fMKutIF4KkiDe18Cq430urY5NruMsBcohPpUt/OxZrz+t3XNmAcTt1p7arVnvbRiYAnCgc1CM0pwZS4lSmRm8hm1cR6h2WJSAYgBkm0Maf4sB9C5wbEyfjhloDzZ99ZT5B04pF3W75Z4apknJC7bvgBv/N0Jh5imiXb6yV/P/TywIkw8/LgZlMFdH7b02OSmaSbbzfS6LnImfjoPzOE/Jcjoq/RGwtds+PIkdfS4YSYPTnMD2lmjMMZ8HC2+NC3MOg/LeeJMm/Ec5rrorH+Lc8azodx8fMbiBxO7YJ63ADLlfN9a8g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=iCG2dYNTInGQ2W30FYjyZcFADHCAhOudsd7gUFjbHCw=; b=Flb2SE6SyKb7c0uSQKPwdRG+C6QJZ0NkML0QHsLcOJ/s2UkTxxt7o+2ehFLNpDJJGT9gCQPc2cRuJoylntZZKhsrXZ2cPSQhOl9y++AeorVXLHERD94kf2GzuX5c+AA8m/x3zvNQrnyiPObOz1uq1UoBEyccPUZTTxVTjySTjnSTFN9QPqEkLvn6yoi7WxwIfOZvg8Y+cj7y8VkhkMVvu/JzsbbgBcTsObt1mcp7M9thUjikaBmLCAXmSxnR9bu9LEzyeuaH1eNjoKlnd3J9ozXs5uC8pkYvy5f6TDdG/X3TzSvlWqeenO6cic/OCm1fCB/iZuNxXEVbR/Ss54yOLg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arm.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=iCG2dYNTInGQ2W30FYjyZcFADHCAhOudsd7gUFjbHCw=; b=LfVtHc6ZVewVmlJhgPUpwLkkM6pelG4bbdvhGq6PcyW0lhAm5IRwG1X1uF169TCkzEdBO0QvIUSl3GQb2OB4iXiXeWH4RopIFuYnWzVjeiKcUlDY9a9oBMXqmay++6GQaV2LeZ27H5J4qktslshy2qAbsIOryiWMlX2mtDSg4HU= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com; Received: from DU0PR08MB8255.eurprd08.prod.outlook.com (2603:10a6:10:411::9) by PA4PR08MB7457.eurprd08.prod.outlook.com (2603:10a6:102:2a4::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8335.14; Fri, 10 Jan 2025 17:23:56 +0000 Received: from DU0PR08MB8255.eurprd08.prod.outlook.com ([fe80::cbc8:c020:6a1b:d27a]) by DU0PR08MB8255.eurprd08.prod.outlook.com ([fe80::cbc8:c020:6a1b:d27a%3]) with mapi id 15.20.8335.011; Fri, 10 Jan 2025 17:23:56 +0000 Date: Fri, 10 Jan 2025 17:23:54 +0000 From: Andrew Carlotti To: gcc-patches@gcc.gnu.org Cc: Richard Sandiford , Kyrylo Tkachov Subject: [PATCH 07/11] aarch64: Move arch/cpu parsing to aarch64-common.cc Message-ID: <0ff2bf8c-a557-5b90-8e2e-d10885e277bf@e124511.cambridge.arm.com> References: Content-Disposition: inline In-Reply-To: X-ClientProxiedBy: LO2P265CA0385.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:f::13) To DU0PR08MB8255.eurprd08.prod.outlook.com (2603:10a6:10:411::9) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DU0PR08MB8255:EE_|PA4PR08MB7457:EE_ X-MS-Office365-Filtering-Correlation-Id: ae2c67c2-b21a-4fa1-70c9-08dd319b8fcd x-checkrecipientrouted: true NoDisclaimer: true X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|366016|1800799024|376014; X-Microsoft-Antispam-Message-Info: qR1A9XfADI85sm1SaVXCnmteyYVD3PORgsVwtq41xZx9F4qvwclztZ+Ly2yIUGeZ/cv4PvDSU7I8VCm2JmziNKPOgz1ZpbQuhuZlauTWb/aOFKAT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XmPWAbE/BnTKfHDbUMq7wAkap44f4LQ+UqCQDTr0N0/bP8UV7UPokqDBg0T5+k8XDx35y9UZQw2HEKav+KQsjIqsEXb5ibhHbYCW0RDk0pQf/7wR1Q35uImlKDOB3YLBmI0zxTwGaK9yXgZsvIppfYQzcvzHnqTwoVIjMjycUgOE+nJwsmCEEBYXIFvWKCSIpQMASX47dykgUtrRg02GdYlFa1SJboRNt3H9+zg6bWTFg7q X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DU0PR08MB8255.eurprd08.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(366016)(1800799024)(376014); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: x8N89FJQ4K9msp/aXmLloa1jmWG75hrZp5CUe2SWJREfQvQi661UgiZsDHT0oOEdWfgqLPLvUGJdoxVIUqYalHMRNpfOWVeYR+9hV46Zwsz/katpjpIakHZhJEeLmvSZwPSvKKmdyR5H5vpegb43bDVEK/QY9rLhSOqaolhabV1xaeR1xMuB+OZrl6x2L9zyQddpk8y4OH6zH3TnMSdC2yv8AiYv9Qz8BrajAdVs78XrzCBPUXppydJXIdZdE0KRmDyvXIQ3XMHROWySacP9rHneHltH4D5BHCktAFNDg+voqqTZiqMI/2P3wujAXFDdyZnUkVWe9FOK4S5c0bxwfQCvqbTHdKwYzo0BAI/XalFmS1kt5NqsI/xNCidIiUpoacM2OIWEyO8jmJ9SlXr4uIE+ndlwRtx1dnspH9QEbbIMOhUFfwJ5NDgcbJXWIP5HpzTu6tW15GS/xWH70Wbk7atiim2zPZxkKFw/tDTd7/BygXq11i/Ci7U4KkZI2ESYRdPmbIaMJgsVNNHoBJzUrzJ9gmbuVqiFe8D4qk+WQT1Qay2SYF37hi02Sd5laPo7AndfGU7LNnvt1u1AcByPrzUWrqmtKH10NLbm1DfBb284abYmGD6v3j5Z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ant-AuthSource: DU0PR08MB8255.eurprd08.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Jan 2025 17:23:55.9965 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: risKqEa9Tjl2MyBhCKzHE4BmnO3FXPmNeb3ngzdZVLATl34NuHf0yW3Vc7IYv8uLi6b+b2UuZdRjtFaTKLufoA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PA4PR08MB7457 X-Spam-Status: No, score=-11.6 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FORGED_SPF_HELO, GIT_PATCH_0, KAM_LOTSOFHASH, RCVD_IN_DNSWL_NONE, SPF_HELO_PASS, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces~patchwork=sourceware.org@gcc.gnu.org Aside from moving the functions, the only changes are to make them non-static, and to use the existing info arrays within aarch64-common.cc instead of the info arrays remaining in aarch64.cc. gcc/ChangeLog: * common/config/aarch64/aarch64-common.cc (aarch64_get_all_extension_candidates): Move within file. (aarch64_print_hint_for_extensions): Move from aarch64.cc. (aarch64_print_hint_for_arch): Ditto. (aarch64_print_hint_for_core): Ditto. (enum aarch_parse_opt_result): Ditto. (aarch64_parse_arch): Ditto. (aarch64_parse_cpu): Ditto. (aarch64_parse_tune): Ditto. (aarch64_validate_march): Ditto. (aarch64_validate_mcpu): Ditto. (aarch64_validate_mtune): Ditto. * config/aarch64/aarch64-protos.h (aarch64_rewrite_selected_cpu): Move within file. (aarch64_print_hint_for_extensions): Share function prototype. (aarch64_print_hint_for_arch): Ditto. (aarch64_print_hint_for_core): Ditto. (enum aarch_parse_opt_result): Ditto. (aarch64_validate_march): Ditto. (aarch64_validate_mcpu): Ditto. (aarch64_validate_mtune): Ditto. (aarch64_get_all_extension_candidates): Unshare prototype. * config/aarch64/aarch64.cc (aarch64_parse_arch): Move to aarch64-common.cc. (aarch64_parse_cpu): Ditto. (aarch64_parse_tune): Ditto. (aarch64_print_hint_for_core): Ditto. (aarch64_print_hint_for_arch): Ditto. (aarch64_print_hint_for_extensions): Ditto. (aarch64_validate_mcpu): Ditto. (aarch64_validate_march): Ditto. (aarch64_validate_mtune): Ditto. diff --git a/gcc/common/config/aarch64/aarch64-common.cc b/gcc/common/config/aarch64/aarch64-common.cc index 4f4e363539b7b9311bfcb7a8b30b706000e50352..5cc00cd3b72807ec439c9c72af297d1ff5b2b679 100644 --- a/gcc/common/config/aarch64/aarch64-common.cc +++ b/gcc/common/config/aarch64/aarch64-common.cc @@ -205,6 +205,85 @@ static constexpr processor_info all_cores[] = }; +/* Append all architecture extension candidates to the CANDIDATES vector. */ + +void +aarch64_get_all_extension_candidates (auto_vec *candidates) +{ + const struct extension_info *opt; + for (opt = all_extensions; opt->name != NULL; opt++) + candidates->safe_push (opt->name); +} + +/* Print a hint with a suggestion for an extension name + that most closely resembles what the user passed in STR. */ + +void +aarch64_print_hint_for_extensions (const char *str) +{ + auto_vec candidates; + aarch64_get_all_extension_candidates (&candidates); + char *s; + const char *hint = candidates_list_and_hint (str, s, candidates); + if (hint) + inform (input_location, "valid arguments are: %s;" + " did you mean %qs?", s, hint); + else + inform (input_location, "valid arguments are: %s", s); + + XDELETEVEC (s); +} + +/* Print a hint with a suggestion for an architecture name that most closely + resembles what the user passed in STR. */ + +void +aarch64_print_hint_for_arch (const char *str) +{ + auto_vec candidates; + const struct arch_info *entry = all_architectures; + for (; entry->name != NULL; entry++) + candidates.safe_push (entry->name); + +#ifdef HAVE_LOCAL_CPU_DETECT + /* Add also "native" as possible value. */ + candidates.safe_push ("native"); +#endif + + char *s; + const char *hint = candidates_list_and_hint (str, s, candidates); + if (hint) + inform (input_location, "valid arguments are: %s;" + " did you mean %qs?", s, hint); + else + inform (input_location, "valid arguments are: %s", s); + + XDELETEVEC (s); +} + +/* Print a hint with a suggestion for a core name that most closely resembles + what the user passed in STR. */ + +void +aarch64_print_hint_for_core (const char *str) +{ + auto_vec candidates; + const struct processor_info *entry = all_cores; + for (; entry->name != NULL; entry++) + candidates.safe_push (entry->name); + + char *s; + const char *hint = candidates_list_and_hint (str, s, candidates); + if (hint) + inform (input_location, "valid arguments are: %s;" + " did you mean %qs?", s, hint); + else + inform (input_location, "valid arguments are: %s", s); + + XDELETEVEC (s); +} + + /* Parse the architecture extension string STR and update ISA_FLAGS with the architecture features turned on or off. Return a aarch_parse_opt_result describing the result. @@ -275,16 +354,266 @@ aarch64_parse_extension (const char *str, aarch64_feature_flags *isa_flags, return AARCH_PARSE_OK; } -/* Append all architecture extension candidates to the CANDIDATES vector. */ +/* Parse the TO_PARSE string and put the architecture that it + selects into RES_ARCH and the architectural features into RES_FLAGS. + Return an aarch_parse_opt_result describing the parse result. + If there is an error parsing, RES_ARCH and RES_FLAGS are left unchanged. + When the TO_PARSE string contains an invalid extension, + a copy of the string is created and stored to INVALID_EXTENSION. */ -void -aarch64_get_all_extension_candidates (auto_vec *candidates) +enum aarch_parse_opt_result +aarch64_parse_arch (const char *to_parse, aarch64_arch *res_arch, + aarch64_feature_flags *res_flags, + std::string *invalid_extension) { - const struct extension_info *opt; - for (opt = all_extensions; opt->name != NULL; opt++) - candidates->safe_push (opt->name); + const char *ext; + const struct arch_info *arch; + size_t len; + + ext = strchr (to_parse, '+'); + + if (ext != NULL) + len = ext - to_parse; + else + len = strlen (to_parse); + + if (len == 0) + return AARCH_PARSE_MISSING_ARG; + + + /* Loop through the list of supported ARCHes to find a match. */ + for (arch = all_architectures; arch->name != NULL; arch++) + { + if (strlen (arch->name) == len + && strncmp (arch->name, to_parse, len) == 0) + { + auto isa_flags = arch->flags; + + if (ext != NULL) + { + /* TO_PARSE string contains at least one extension. */ + enum aarch_parse_opt_result ext_res + = aarch64_parse_extension (ext, &isa_flags, invalid_extension); + + if (ext_res != AARCH_PARSE_OK) + return ext_res; + } + /* Extension parsing was successful. Confirm the result + arch and ISA flags. */ + *res_arch = arch->arch; + *res_flags = isa_flags; + return AARCH_PARSE_OK; + } + } + + /* ARCH name not found in list. */ + return AARCH_PARSE_INVALID_ARG; +} + +/* Parse the TO_PARSE string and put the result tuning in RES_CPU and the + architecture flags in RES_FLAGS. Return an aarch_parse_opt_result + describing the parse result. If there is an error parsing, RES_CPU and + RES_FLAGS are left unchanged. + When the TO_PARSE string contains an invalid extension, + a copy of the string is created and stored to INVALID_EXTENSION. */ + +enum aarch_parse_opt_result +aarch64_parse_cpu (const char *to_parse, aarch64_cpu *res_cpu, + aarch64_feature_flags *res_flags, + std::string *invalid_extension) +{ + const char *ext; + const struct processor_info *cpu; + size_t len; + + ext = strchr (to_parse, '+'); + + if (ext != NULL) + len = ext - to_parse; + else + len = strlen (to_parse); + + if (len == 0) + return AARCH_PARSE_MISSING_ARG; + + + /* Loop through the list of supported CPUs to find a match. */ + for (cpu = all_cores; cpu->name != NULL; cpu++) + { + if (strlen (cpu->name) == len && strncmp (cpu->name, to_parse, len) == 0) + { + auto isa_flags = cpu->flags; + + if (ext != NULL) + { + /* TO_PARSE string contains at least one extension. */ + enum aarch_parse_opt_result ext_res + = aarch64_parse_extension (ext, &isa_flags, invalid_extension); + + if (ext_res != AARCH_PARSE_OK) + return ext_res; + } + /* Extension parsing was successfull. Confirm the result + cpu and ISA flags. */ + *res_cpu = cpu->processor; + *res_flags = isa_flags; + return AARCH_PARSE_OK; + } + } + + /* CPU name not found in list. */ + return AARCH_PARSE_INVALID_ARG; } +/* Parse the TO_PARSE string and put the cpu it selects into RES_CPU. + Return an aarch_parse_opt_result describing the parse result. + If the parsing fails then RES_CPU does not change. */ + +enum aarch_parse_opt_result +aarch64_parse_tune (const char *to_parse, aarch64_cpu *res_cpu) +{ + const struct processor_info *cpu; + + /* Loop through the list of supported CPUs to find a match. */ + for (cpu = all_cores; cpu->name != NULL; cpu++) + { + if (strcmp (cpu->name, to_parse) == 0) + { + *res_cpu = cpu->processor; + return AARCH_PARSE_OK; + } + } + + /* CPU name not found in list. */ + return AARCH_PARSE_INVALID_ARG; +} + + +/* Validate a command-line -march option. Parse the arch and extensions + (if any) specified in STR and throw errors if appropriate. Put the + results, if they are valid, in RES_ARCH and RES_FLAGS. Return whether the + option is valid. */ + +bool +aarch64_validate_march (const char *str, aarch64_arch *res_arch, + aarch64_feature_flags *res_flags) +{ + std::string invalid_extension; + enum aarch_parse_opt_result parse_res + = aarch64_parse_arch (str, res_arch, res_flags, &invalid_extension); + + if (parse_res == AARCH_PARSE_OK) + return true; + + switch (parse_res) + { + case AARCH_PARSE_MISSING_ARG: + error ("missing arch name in %<-march=%s%>", str); + break; + case AARCH_PARSE_INVALID_ARG: + { + error ("unknown value %qs for %<-march%>", str); + aarch64_print_hint_for_arch (str); + /* A common user error is confusing -march and -mcpu. + If the -march string matches a known CPU suggest -mcpu. */ + aarch64_cpu temp_cpu; + aarch64_feature_flags temp_flags; + parse_res = aarch64_parse_cpu (str, &temp_cpu, &temp_flags, + &invalid_extension); + if (parse_res == AARCH_PARSE_OK) + inform (input_location, "did you mean %<-mcpu=%s%>?", str); + break; + } + case AARCH_PARSE_INVALID_FEATURE: + error ("invalid feature modifier %qs in %<-march=%s%>", + invalid_extension.c_str (), str); + aarch64_print_hint_for_extensions (invalid_extension.c_str ()); + break; + default: + gcc_unreachable (); + } + + return false; +} + +/* Validate a command-line -mcpu option. Parse the cpu and extensions (if any) + specified in STR and throw errors if appropriate. Put the results if + they are valid in RES_CPU and RES_FLAGS. Return whether the option is + valid. */ + +bool +aarch64_validate_mcpu (const char *str, aarch64_cpu *res_cpu, + aarch64_feature_flags *res_flags) +{ + std::string invalid_extension; + enum aarch_parse_opt_result parse_res + = aarch64_parse_cpu (str, res_cpu, res_flags, &invalid_extension); + + if (parse_res == AARCH_PARSE_OK) + return true; + + switch (parse_res) + { + case AARCH_PARSE_MISSING_ARG: + error ("missing cpu name in %<-mcpu=%s%>", str); + break; + case AARCH_PARSE_INVALID_ARG: + { + error ("unknown value %qs for %<-mcpu%>", str); + aarch64_print_hint_for_core (str); + /* A common user error is confusing -march and -mcpu. + If the -mcpu string matches a known architecture then suggest + -march=. */ + aarch64_arch temp_arch; + aarch64_feature_flags temp_flags; + parse_res = aarch64_parse_arch (str, &temp_arch, &temp_flags, + &invalid_extension); + if (parse_res == AARCH_PARSE_OK) + inform (input_location, "did you mean %<-march=%s%>?", str); + break; + } + case AARCH_PARSE_INVALID_FEATURE: + error ("invalid feature modifier %qs in %<-mcpu=%s%>", + invalid_extension.c_str (), str); + aarch64_print_hint_for_extensions (invalid_extension.c_str ()); + break; + default: + gcc_unreachable (); + } + + return false; +} + +/* Validate a command-line -mtune option. Parse the cpu + specified in STR and throw errors if appropriate. Put the + result, if it is valid, in RES_CPU. Return whether the option is + valid. */ + +bool +aarch64_validate_mtune (const char *str, aarch64_cpu *res_cpu) +{ + enum aarch_parse_opt_result parse_res + = aarch64_parse_tune (str, res_cpu); + + if (parse_res == AARCH_PARSE_OK) + return true; + + switch (parse_res) + { + case AARCH_PARSE_MISSING_ARG: + error ("missing cpu name in %<-mtune=%s%>", str); + break; + case AARCH_PARSE_INVALID_ARG: + error ("unknown value %qs for %<-mtune%>", str); + aarch64_print_hint_for_core (str); + break; + default: + gcc_unreachable (); + } + return false; +} + + /* Return a string representation of ISA_FLAGS. DEFAULT_ARCH_FLAGS gives the default set of flags which are implied by whatever -march we'd put out. Our job is to figure out the minimal set of "+" and diff --git a/gcc/config/aarch64/aarch64-protos.h b/gcc/config/aarch64/aarch64-protos.h index fa7bc8029be04f6530d2aee2ead4d754ba3b2550..4114fc9b3b7645b8781257f6f775ddfe7e8c339e 100644 --- a/gcc/config/aarch64/aarch64-protos.h +++ b/gcc/config/aarch64/aarch64-protos.h @@ -1190,11 +1190,27 @@ void aarch64_set_asm_isa_flags (aarch64_feature_flags); void aarch64_set_asm_isa_flags (gcc_options *, aarch64_feature_flags); bool aarch64_handle_option (struct gcc_options *, struct gcc_options *, const struct cl_decoded_option *, location_t); -const char *aarch64_rewrite_selected_cpu (const char *name); +void aarch64_print_hint_for_extensions (const char *); +void aarch64_print_hint_for_arch (const char *); +void aarch64_print_hint_for_core (const char *); enum aarch_parse_opt_result aarch64_parse_extension (const char *, aarch64_feature_flags *, std::string *); -void aarch64_get_all_extension_candidates (auto_vec *candidates); +enum aarch_parse_opt_result aarch64_parse_arch (const char *, + aarch64_arch *, + aarch64_feature_flags *, + std::string *); +enum aarch_parse_opt_result aarch64_parse_cpu (const char *, + aarch64_cpu *, + aarch64_feature_flags *, + std::string *); +enum aarch_parse_opt_result aarch64_parse_tune (const char *, aarch64_cpu *); +bool aarch64_validate_march (const char *, aarch64_arch *, + aarch64_feature_flags *); +bool aarch64_validate_mcpu (const char *, aarch64_cpu *, + aarch64_feature_flags *); +bool aarch64_validate_mtune (const char *, aarch64_cpu *); +const char *aarch64_rewrite_selected_cpu (const char *name); std::string aarch64_get_extension_string_for_isa_flags (aarch64_feature_flags, aarch64_feature_flags); diff --git a/gcc/config/aarch64/aarch64.cc b/gcc/config/aarch64/aarch64.cc index f33034cbb205eb52b5ee5965b8b972cedf6f4927..75ba66a979c979fd01948b0a2066a15371df9bfa 100644 --- a/gcc/config/aarch64/aarch64.cc +++ b/gcc/config/aarch64/aarch64.cc @@ -18217,140 +18217,6 @@ better_main_loop_than_p (const vector_costs *uncast_other) const static void initialize_aarch64_code_model (struct gcc_options *); -/* Parse the TO_PARSE string and put the architecture that it - selects into RES_ARCH and the architectural features into RES_FLAGS. - Return an aarch_parse_opt_result describing the parse result. - If there is an error parsing, RES_ARCH and RES_FLAGS are left unchanged. - When the TO_PARSE string contains an invalid extension, - a copy of the string is created and stored to INVALID_EXTENSION. */ - -static enum aarch_parse_opt_result -aarch64_parse_arch (const char *to_parse, aarch64_arch *res_arch, - aarch64_feature_flags *res_flags, - std::string *invalid_extension) -{ - const char *ext; - const struct processor *arch; - size_t len; - - ext = strchr (to_parse, '+'); - - if (ext != NULL) - len = ext - to_parse; - else - len = strlen (to_parse); - - if (len == 0) - return AARCH_PARSE_MISSING_ARG; - - - /* Loop through the list of supported ARCHes to find a match. */ - for (arch = all_architectures; arch->name != NULL; arch++) - { - if (strlen (arch->name) == len - && strncmp (arch->name, to_parse, len) == 0) - { - auto isa_flags = arch->flags; - - if (ext != NULL) - { - /* TO_PARSE string contains at least one extension. */ - enum aarch_parse_opt_result ext_res - = aarch64_parse_extension (ext, &isa_flags, invalid_extension); - - if (ext_res != AARCH_PARSE_OK) - return ext_res; - } - /* Extension parsing was successful. Confirm the result - arch and ISA flags. */ - *res_arch = arch->arch; - *res_flags = isa_flags; - return AARCH_PARSE_OK; - } - } - - /* ARCH name not found in list. */ - return AARCH_PARSE_INVALID_ARG; -} - -/* Parse the TO_PARSE string and put the result tuning in RES_CPU and the - architecture flags in RES_FLAGS. Return an aarch_parse_opt_result - describing the parse result. If there is an error parsing, RES_CPU and - RES_FLAGS are left unchanged. - When the TO_PARSE string contains an invalid extension, - a copy of the string is created and stored to INVALID_EXTENSION. */ - -static enum aarch_parse_opt_result -aarch64_parse_cpu (const char *to_parse, aarch64_cpu *res_cpu, - aarch64_feature_flags *res_flags, - std::string *invalid_extension) -{ - const char *ext; - const struct processor *cpu; - size_t len; - - ext = strchr (to_parse, '+'); - - if (ext != NULL) - len = ext - to_parse; - else - len = strlen (to_parse); - - if (len == 0) - return AARCH_PARSE_MISSING_ARG; - - - /* Loop through the list of supported CPUs to find a match. */ - for (cpu = all_cores; cpu->name != NULL; cpu++) - { - if (strlen (cpu->name) == len && strncmp (cpu->name, to_parse, len) == 0) - { - auto isa_flags = cpu->flags; - - if (ext != NULL) - { - /* TO_PARSE string contains at least one extension. */ - enum aarch_parse_opt_result ext_res - = aarch64_parse_extension (ext, &isa_flags, invalid_extension); - - if (ext_res != AARCH_PARSE_OK) - return ext_res; - } - /* Extension parsing was successfull. Confirm the result - cpu and ISA flags. */ - *res_cpu = cpu->ident; - *res_flags = isa_flags; - return AARCH_PARSE_OK; - } - } - - /* CPU name not found in list. */ - return AARCH_PARSE_INVALID_ARG; -} - -/* Parse the TO_PARSE string and put the cpu it selects into RES_CPU. - Return an aarch_parse_opt_result describing the parse result. - If the parsing fails then RES_CPU does not change. */ - -static enum aarch_parse_opt_result -aarch64_parse_tune (const char *to_parse, aarch64_cpu *res_cpu) -{ - const struct processor *cpu; - - /* Loop through the list of supported CPUs to find a match. */ - for (cpu = all_cores; cpu->name != NULL; cpu++) - { - if (strcmp (cpu->name, to_parse) == 0) - { - *res_cpu = cpu->ident; - return AARCH_PARSE_OK; - } - } - - /* CPU name not found in list. */ - return AARCH_PARSE_INVALID_ARG; -} - /* Parse TOKEN, which has length LENGTH to see if it is an option described in FLAG. If it is, return the index bit for that fusion type. If not, error (printing OPTION_NAME) and return zero. */ @@ -18884,123 +18750,6 @@ aarch64_override_options_internal (struct gcc_options *opts) aarch64_override_options_after_change_1 (opts); } -/* Print a hint with a suggestion for a core name that most closely resembles - what the user passed in STR. */ - -inline static void -aarch64_print_hint_for_core (const char *str) -{ - auto_vec candidates; - const struct processor *entry = all_cores; - for (; entry->name != NULL; entry++) - candidates.safe_push (entry->name); - - char *s; - const char *hint = candidates_list_and_hint (str, s, candidates); - if (hint) - inform (input_location, "valid arguments are: %s;" - " did you mean %qs?", s, hint); - else - inform (input_location, "valid arguments are: %s", s); - - XDELETEVEC (s); -} - -/* Print a hint with a suggestion for an architecture name that most closely - resembles what the user passed in STR. */ - -inline static void -aarch64_print_hint_for_arch (const char *str) -{ - auto_vec candidates; - const struct processor *entry = all_architectures; - for (; entry->name != NULL; entry++) - candidates.safe_push (entry->name); - -#ifdef HAVE_LOCAL_CPU_DETECT - /* Add also "native" as possible value. */ - candidates.safe_push ("native"); -#endif - - char *s; - const char *hint = candidates_list_and_hint (str, s, candidates); - if (hint) - inform (input_location, "valid arguments are: %s;" - " did you mean %qs?", s, hint); - else - inform (input_location, "valid arguments are: %s", s); - - XDELETEVEC (s); -} - - -/* Print a hint with a suggestion for an extension name - that most closely resembles what the user passed in STR. */ - -void -aarch64_print_hint_for_extensions (const char *str) -{ - auto_vec candidates; - aarch64_get_all_extension_candidates (&candidates); - char *s; - const char *hint = candidates_list_and_hint (str, s, candidates); - if (hint) - inform (input_location, "valid arguments are: %s;" - " did you mean %qs?", s, hint); - else - inform (input_location, "valid arguments are: %s", s); - - XDELETEVEC (s); -} - -/* Validate a command-line -mcpu option. Parse the cpu and extensions (if any) - specified in STR and throw errors if appropriate. Put the results if - they are valid in RES_CPU and RES_FLAGS. Return whether the option is - valid. */ - -static bool -aarch64_validate_mcpu (const char *str, aarch64_cpu *res_cpu, - aarch64_feature_flags *res_flags) -{ - std::string invalid_extension; - enum aarch_parse_opt_result parse_res - = aarch64_parse_cpu (str, res_cpu, res_flags, &invalid_extension); - - if (parse_res == AARCH_PARSE_OK) - return true; - - switch (parse_res) - { - case AARCH_PARSE_MISSING_ARG: - error ("missing cpu name in %<-mcpu=%s%>", str); - break; - case AARCH_PARSE_INVALID_ARG: - { - error ("unknown value %qs for %<-mcpu%>", str); - aarch64_print_hint_for_core (str); - /* A common user error is confusing -march and -mcpu. - If the -mcpu string matches a known architecture then suggest - -march=. */ - aarch64_arch temp_arch; - aarch64_feature_flags temp_flags; - parse_res = aarch64_parse_arch (str, &temp_arch, &temp_flags, - &invalid_extension); - if (parse_res == AARCH_PARSE_OK) - inform (input_location, "did you mean %<-march=%s%>?", str); - break; - } - case AARCH_PARSE_INVALID_FEATURE: - error ("invalid feature modifier %qs in %<-mcpu=%s%>", - invalid_extension.c_str (), str); - aarch64_print_hint_for_extensions (invalid_extension.c_str ()); - break; - default: - gcc_unreachable (); - } - - return false; -} - /* Straight line speculation indicators. */ enum aarch64_sls_hardening_type { @@ -19074,82 +18823,6 @@ aarch64_validate_sls_mitigation (const char *const_str) free (str_root); } -/* Validate a command-line -march option. Parse the arch and extensions - (if any) specified in STR and throw errors if appropriate. Put the - results, if they are valid, in RES_ARCH and RES_FLAGS. Return whether the - option is valid. */ - -static bool -aarch64_validate_march (const char *str, aarch64_arch *res_arch, - aarch64_feature_flags *res_flags) -{ - std::string invalid_extension; - enum aarch_parse_opt_result parse_res - = aarch64_parse_arch (str, res_arch, res_flags, &invalid_extension); - - if (parse_res == AARCH_PARSE_OK) - return true; - - switch (parse_res) - { - case AARCH_PARSE_MISSING_ARG: - error ("missing arch name in %<-march=%s%>", str); - break; - case AARCH_PARSE_INVALID_ARG: - { - error ("unknown value %qs for %<-march%>", str); - aarch64_print_hint_for_arch (str); - /* A common user error is confusing -march and -mcpu. - If the -march string matches a known CPU suggest -mcpu. */ - aarch64_cpu temp_cpu; - aarch64_feature_flags temp_flags; - parse_res = aarch64_parse_cpu (str, &temp_cpu, &temp_flags, - &invalid_extension); - if (parse_res == AARCH_PARSE_OK) - inform (input_location, "did you mean %<-mcpu=%s%>?", str); - break; - } - case AARCH_PARSE_INVALID_FEATURE: - error ("invalid feature modifier %qs in %<-march=%s%>", - invalid_extension.c_str (), str); - aarch64_print_hint_for_extensions (invalid_extension.c_str ()); - break; - default: - gcc_unreachable (); - } - - return false; -} - -/* Validate a command-line -mtune option. Parse the cpu - specified in STR and throw errors if appropriate. Put the - result, if it is valid, in RES_CPU. Return whether the option is - valid. */ - -static bool -aarch64_validate_mtune (const char *str, aarch64_cpu *res_cpu) -{ - enum aarch_parse_opt_result parse_res - = aarch64_parse_tune (str, res_cpu); - - if (parse_res == AARCH_PARSE_OK) - return true; - - switch (parse_res) - { - case AARCH_PARSE_MISSING_ARG: - error ("missing cpu name in %<-mtune=%s%>", str); - break; - case AARCH_PARSE_INVALID_ARG: - error ("unknown value %qs for %<-mtune%>", str); - aarch64_print_hint_for_core (str); - break; - default: - gcc_unreachable (); - } - return false; -} - /* Return the VG value associated with -msve-vector-bits= value VALUE. */ static poly_uint16 From patchwork Fri Jan 10 17:24:10 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Carlotti X-Patchwork-Id: 104508 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 0DCEB385771E for ; Fri, 10 Jan 2025 17:24:54 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on20622.outbound.protection.outlook.com [IPv6:2a01:111:f403:2612::622]) by sourceware.org (Postfix) with ESMTPS id 138CC3857032 for ; Fri, 10 Jan 2025 17:24:15 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 138CC3857032 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=arm.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 138CC3857032 Authentication-Results: server2.sourceware.org; arc=pass smtp.remote-ip=2a01:111:f403:2612::622 ARC-Seal: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1736529855; cv=pass; b=hw7cLh7tVePtA6HVhl/8kstGswQPTYl/htjfkPQehUW7ff53dZnlNNDwKGPWjmDhnonCx9alN4b4axguuhofRte79ZW6MyzK+nBK1gcHUi2IOdh0KbtzxnOgoi8ju/j2K0HjRB+frbENRimgNIBldjFJZMKc+/J9bMHI6M6rK9g= ARC-Message-Signature: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1736529855; c=relaxed/simple; bh=1WGouIl8r5YN66A7MuwIVHXIiC9FfwpogZQGtD2uGLY=; h=DKIM-Signature:Date:From:To:Subject:Message-ID:MIME-Version; b=vVkwa9Ww7B8OUeBlilFYSDpLJ9Z7jLbIwUwDeZJ7O85lm0bTRBJn3HHawr1eJ8nWAymq2grKumsp6jcb6a1DaFFlruOGQ5FeWzC5diazJBiSJt8/9k3lFkAVvf2vnEM8r6LfnxWcKW39MpLVhUIbcUaI2wVlpDf58Oy8yFn60hY= ARC-Authentication-Results: i=2; server2.sourceware.org ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=eVTTe+C1t1d3+1tVxt5ZR9wsYiXTh6xkwrGFdCMW3ZjiH244bQFQfWTXBVXQ4TXPFWrdMKmcwuw5i+T5m+aqElQNM3C7gT8I9eyF8o6vL2eiow/CI32/qzxxX5Jz0/B91VfGvRqJalQQTvdjIQpVedHDawZdZohxZRomIEyU+RZwo9liLDMY/8y2ijbW9cRQvkpg8EGL3rj7/OIUNwC2A4F/BYH89TuKh5DmQ5R7okuwrGjCKXoDwnQeLLhB0fl2VzogMnMfkFjLvh4twXbo901Jdp/yBT4DAOjXI3xIcU37k+0nV6JaC/xs2cp+om38zEeaOgDsm81Rn4IVsSnGpw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=K5QZftEcRGLx/920OOhM8Suz3ogyumkcev3xNwLXpvQ=; b=CypETGS7jGhPH5vUlVV0qpoyd3aUAxRI30v7YMwUIhwkbbiDC4PQUMMFIfYxomIGm+D0nrfNQRey2EcMzF5hql98W4Na3xjyrV9SwFUq6N94bItf8SVw8Qme4MgK0DY9zw6mIoL7FlFTYjAbrPZt+D9riZ0XZCEaKz/VfsKmql2CTrpeiOS3ODS+knuLHeWn2F8KED0+QZixCiZfxLohZNXYvrW/T/QW8XcirMfgh1t7+DT43smV4G/+wHopoXf6u7B9ybui5Mh0Q5bK7A2ZW/TxESgojlJNxXQwCKXbveAjzo7zLSC5B2CpR71aOxjjMHB4Sl+EWWzK9kpCORydiQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arm.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=K5QZftEcRGLx/920OOhM8Suz3ogyumkcev3xNwLXpvQ=; b=oTK5beHy0+CFCUrdGSyPGigmlyZfR4qh7+1KFF1OpEQN/UusnS9TxERzGcSB+cK81SYS0Y7jxJCEWxxlkmsL310lK2mjF/RO63FrVlyUxM0PA5JF8hnQdAf6NUEyFT8OCVKH6K8QptlUj0GdTBDG0+zuM86SJK4dVi1Nm24kA3I= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com; Received: from DU0PR08MB8255.eurprd08.prod.outlook.com (2603:10a6:10:411::9) by PA4PR08MB7457.eurprd08.prod.outlook.com (2603:10a6:102:2a4::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8335.14; Fri, 10 Jan 2025 17:24:13 +0000 Received: from DU0PR08MB8255.eurprd08.prod.outlook.com ([fe80::cbc8:c020:6a1b:d27a]) by DU0PR08MB8255.eurprd08.prod.outlook.com ([fe80::cbc8:c020:6a1b:d27a%3]) with mapi id 15.20.8335.011; Fri, 10 Jan 2025 17:24:13 +0000 Date: Fri, 10 Jan 2025 17:24:10 +0000 From: Andrew Carlotti To: gcc-patches@gcc.gnu.org Cc: Richard Sandiford , Kyrylo Tkachov Subject: [PATCH 08/11] aarch64: Inline aarch64_get_all_extension_candidates Message-ID: <9e36d5f2-ab4f-ac79-0285-5871d7df21d2@e124511.cambridge.arm.com> References: Content-Disposition: inline In-Reply-To: X-ClientProxiedBy: LO2P265CA0070.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:60::34) To DU0PR08MB8255.eurprd08.prod.outlook.com (2603:10a6:10:411::9) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DU0PR08MB8255:EE_|PA4PR08MB7457:EE_ X-MS-Office365-Filtering-Correlation-Id: 3b92ee19-2c97-4340-ebff-08dd319b9a2e x-checkrecipientrouted: true NoDisclaimer: true X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|366016|1800799024|376014; X-Microsoft-Antispam-Message-Info: 27nK77C2gEivmKd2BtVht1DGzY2FwfkFHiGyfohOiC7zqLI6tStAhO+oMHcgzr8wYOZF0AdUGpUaToN+wtacPnjKvhgiWx4Rz9uVuU+S4d/YVz7Rs4NMHh8wlaUAzuf/uzZRT2G9BAC2Gvo3sbNjiv65nhFHjc6agUmYCh788sEMiuurh/0aeHg6TeLOT7EdChW9vGZEGjcqSh7/9f/Jr6KAgHrUKrb3+c4+R98xn+sptqgY+fY/mIFvQFFCHUT1AAhals3WNgtSqAGOwiYKXAEnX+3I/EpLH6nu9jiA5No28KX0B8Gz2reQSiLIswxx5kYyvGZpt26WJ4HuWavXCggrXfH7/ulPPxG/MzSYauumR2E8dpXxIr6+GPYoAQcVjLW3uXm4era/4BtvffjzWL5dPwf4JEM4lqS6wE5j5ar1Cp2JGZwxHrTuuLug2DDGhbl6UPe91GghslZqRdoAaUK4MoLzErkkEWSQ0946Cl31MQxQUmjCo3xVOwi/RbUtBSem5+c3sqMRby3HKZm3tatQaeweHbZy3u6py29olSI64Lh3N65tDg+gxrRfu9McRbWTiu43+sRbSgCQ1YdrTnzx/7yU+0jQR5+w4JkeImAu3B9Ha5bqjqo8AMGGPoJs0DnkkCuFFlh2fikr0APr7yuQF4ti3jxzUrC4xEqoSEVzaG4+B9dq5PGg71kbIX61SYWv6mAxuxhH0P8hKUxfGKdb6CGopGCvdpUjrQMwA5grbhJsCWWSR4Y0DnQ9k5jqsNiY8SpWuzkT1ON3DQYrTr5jn9Pw/tf99R+fb2l5NxuGrWt+1KskkJJdcs9x6yxl5Hb++qyLAoAKXhXnXf/b6McKZFq4RBD6PHXiLeyUPnj70dGL3fYKwgWL48voocn/W80bZnMJl8KrLTfq4OCHNYtQH5ipLInLaOwaFb3q8eOSB43fBuqwYxl5BLM11VZymq9TlyEwaew7m7iCs9gPvEfh2yYisFGamClEWV5C9mnPVF425A1nyFARKT+IF4e7q9WA+W/fNmdLcsHJ2EDUqayq9cBRL/j4ql+uia6WEx9aTFJF9bhpeCX2LDZEf29R6mEAO1/azVitDk6I8eFVBlgHWTuFvScAJsT7hL5tpkREZjklLzxiXhjQBr9MhmmdORMa4b4Wo2ltB8VSRtwZOdpM68eGOAHtSCveVALTqXEb5/wkijcliY83wzvcEzwuWEjmvc1/0HeJrZdU9QfNrLS/Qn/UQzcGMZA8Jj6qjlye2i6EAWSFXFMrBrNIqBF5PsAz/CiLAYuScQ1Dpbrn5qkylDxvu7EFE84AH7V5K0R0kTY8mMZQ4V8uxEPsKX43RBeL0xmmdhy9IHiw6VsKG5UVWyysCWjVlY4rdcu0oEoLNyvhiEWXGZYSTuKzSxCi X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DU0PR08MB8255.eurprd08.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(366016)(1800799024)(376014); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: tTBueRTTxlWM9tsdF2Pb7LSIZUEjaXtBjv12ZkvsH0+B56EbtoLdldYIeg7PP2yd/oAiGC+2C5SJCqY/a1OkQXMfUw/Yw3CMhsDj4zpRl57LuKcCPp84VutsubD9oCdCuJ8H0FvhuyRK3X/yj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lfvnhwxJSLlOM63s4se7wXbMAYcNgZQK2o+OLKcBjJ1eQmSgTzC1fr+QS+JgcZpvZ8/9poFhllEsOqDixzz4+cKHOxXkWCrXo9pXq/p6p3IjWtHfQJ1bGGq3Bx1ZT/HnDWG9ZIiCNp3FdN+iaHqGlyocJ2qYYiqrO6o4QcSg5PJVEOnZv8D3wtQphGF7KqbRu+Yj3kxPEJ39N337rCgTOLX9BMVIllYRgATFGguwERV9pplyUVXk7vjVrlGQK9Xx/zmXbYQ0uYwnVZbMsifwwgtRBOQ1RJgKP+5JolhtBUbH0t2fxbCnx0eY6TnlxQ1Fkqzq4jIV7V2yrUKsZfHd0ikv3Vb9ZkV4WiB+f5WSPfug16hXnd8D4gFLPya3JV69yq9jU6/LYmDA== X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-Network-Message-Id: 3b92ee19-2c97-4340-ebff-08dd319b9a2e X-MS-Exchange-CrossTenant-AuthSource: DU0PR08MB8255.eurprd08.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Jan 2025 17:24:13.3668 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: X4VFa1p6wllDdCd6gzCSIXVEaUSu/V4x7YdopBIJ07/O/sytNSPXYidsosuFnZobaeiGI+cFG5RsH5A3DLemrw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PA4PR08MB7457 X-Spam-Status: No, score=-11.7 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FORGED_SPF_HELO, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_PASS, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces~patchwork=sourceware.org@gcc.gnu.org gcc/ChangeLog: * common/config/aarch64/aarch64-common.cc (aarch64_get_all_extension_candidates): Inline into... (aarch64_print_hint_for_extensions): ...this. diff --git a/gcc/common/config/aarch64/aarch64-common.cc b/gcc/common/config/aarch64/aarch64-common.cc index 5cc00cd3b72807ec439c9c72af297d1ff5b2b679..0d0502a72687cb50e1dd66d9e4312386ee6096fe 100644 --- a/gcc/common/config/aarch64/aarch64-common.cc +++ b/gcc/common/config/aarch64/aarch64-common.cc @@ -205,16 +205,6 @@ static constexpr processor_info all_cores[] = }; -/* Append all architecture extension candidates to the CANDIDATES vector. */ - -void -aarch64_get_all_extension_candidates (auto_vec *candidates) -{ - const struct extension_info *opt; - for (opt = all_extensions; opt->name != NULL; opt++) - candidates->safe_push (opt->name); -} - /* Print a hint with a suggestion for an extension name that most closely resembles what the user passed in STR. */ @@ -222,7 +212,10 @@ void aarch64_print_hint_for_extensions (const char *str) { auto_vec candidates; - aarch64_get_all_extension_candidates (&candidates); + const struct extension_info *opt; + for (opt = all_extensions; opt->name != NULL; opt++) + candidates.safe_push (opt->name); + char *s; const char *hint = candidates_list_and_hint (str, s, candidates); if (hint) From patchwork Fri Jan 10 17:24:26 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Carlotti X-Patchwork-Id: 104511 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id B31DF3858C35 for ; Fri, 10 Jan 2025 17:26:08 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05on20610.outbound.protection.outlook.com [IPv6:2a01:111:f403:2613::610]) by sourceware.org (Postfix) with ESMTPS id E467A3857039 for ; Fri, 10 Jan 2025 17:24:35 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org E467A3857039 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=arm.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org E467A3857039 Authentication-Results: server2.sourceware.org; arc=pass smtp.remote-ip=2a01:111:f403:2613::610 ARC-Seal: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1736529876; cv=pass; b=cc7uwKmT1UVK+orugnS8ypcMi9+ieYY2RPxmF1oHel1rBEBdOYn+jkg4aUDA2SpC+5qcXPQtmZPp0jhG8lNNyyTdNSX1dOgTj27xFkykAukRqQl85JM2Od+nj5g8crDSNAV8v/YsOifVLwty2C2eCywE6RBEKOAjVWj4BeyPzIo= ARC-Message-Signature: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1736529876; c=relaxed/simple; bh=37aMn+CAc3GDXZrcInCgSEArzwB8Awo/6jhNa1GzB3k=; h=DKIM-Signature:Date:From:To:Subject:Message-ID:MIME-Version; b=B0h/zQUzsGzvFi2FR1z5pnHyotpHjMXji0LTVKH38bhCpkSk0AH9MshMu8bKyC1oyNVOZJpE1FENBTNZhRCB0RV/2zytWhmFrd2s+IhF4Ig2d9PuoGDshgzVb1HX5Pr8AUesdPriy4tka5DKj2A5Dd7ntgikIQHo3pmlvoZz0ew= ARC-Authentication-Results: i=2; server2.sourceware.org ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=cQ11C26GWzF1aT2eWqOt+n72Qsu/nCEnOoQdkw9mVzlIG7/XXYI3H/rsrlstLhTv5xfLm9+j+p9l5kHRb7Im2Gf2VfhcGi2Kvc8ZcAOkjsuoXBbG5BK3RLdvaryqRtwYCEPGzBH7AxHlZ6/E2XntJrnICbmCFakhqFopJA5g5S5d080XxWuGnvqWvXNJgC00j4Vv+/s2rse3vMigo7wnvhlfUPRfb3dWClXq8sJEXpyFfrrQs/mkr0/zNUgkG7qvfT9SKvGhb2MkSLnEf83cKgDR+W/a6KEDxngJ2RgqN6JgW6trtWr2pOIRjrwa5KJanEd5JdqTtCquT7U6fTiIPQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=mxzvdsQAv/FkZeZTcw3DDU7xlgFBoztU7giYn/MYCZY=; b=KPgmp7Np0N5L8oxUNVpo6CZsXNlbz5EH0sE9v6hALlEKQKP1UBSFf1wY6HsOPSKH1li6nt8fipMQ2oLa8zWzMJ9pzGQqbiRzTuV0AKvtlrXk6BW5JW6bXAvkBcvUOoIPNAxciC4Aqt+ZSMhD2KOm/QWAYfsGC2c7F8wCa5jz2P1Z7UuDzZATo1OlOfbLkDfH195Ij25tLwLXVn4y01EAu61y/WaeCnarSPd8Qhl7ykdQnjYV3iQ+bqiVFGq3FW28FN1Hl91NpVNse0zcou2HKnqiGyrDjcZZ0/AfOXfxGG6w+dYziBSjlZ1EKCTlk5iYU+LuWJbRKQ/smhA/E529lA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arm.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=mxzvdsQAv/FkZeZTcw3DDU7xlgFBoztU7giYn/MYCZY=; b=QbEv4a8EiZJdGvhq05Dhck0vojrKwcSoxzJnh2sAk5VlXgr+sjoZanE7oB1q9kOFM8PgbSRvHkXJ2DOxkFk+wS1gOa2TBue7E4V8e0GXlMaewubSLjt1A8BTgmxJd8eM6mwW06aTaJNxvs0/saaPwQ9bpE2ITz4coBkNJ101fIg= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com; Received: from DU0PR08MB8255.eurprd08.prod.outlook.com (2603:10a6:10:411::9) by PA4PR08MB7457.eurprd08.prod.outlook.com (2603:10a6:102:2a4::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8335.14; Fri, 10 Jan 2025 17:24:28 +0000 Received: from DU0PR08MB8255.eurprd08.prod.outlook.com ([fe80::cbc8:c020:6a1b:d27a]) by DU0PR08MB8255.eurprd08.prod.outlook.com ([fe80::cbc8:c020:6a1b:d27a%3]) with mapi id 15.20.8335.011; Fri, 10 Jan 2025 17:24:28 +0000 Date: Fri, 10 Jan 2025 17:24:26 +0000 From: Andrew Carlotti To: gcc-patches@gcc.gnu.org Cc: Richard Sandiford , Kyrylo Tkachov Subject: [PATCH 09/11] aarch64: Rewrite architecture strings for assembler Message-ID: <5377019a-ee01-2dc4-ebf1-f1f9f5833d15@e124511.cambridge.arm.com> References: Content-Disposition: inline In-Reply-To: X-ClientProxiedBy: LO2P265CA0493.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:13a::18) To DU0PR08MB8255.eurprd08.prod.outlook.com (2603:10a6:10:411::9) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DU0PR08MB8255:EE_|PA4PR08MB7457:EE_ X-MS-Office365-Filtering-Correlation-Id: 1d0afcfd-0a77-4b9c-7fac-08dd319ba308 x-checkrecipientrouted: true NoDisclaimer: true X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|366016|1800799024|376014; X-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RLiKh31FStGT5eWhQ4jKHyodt1w5Z6SsvorlnblbzbLrze5b35I/cNmxgxO6wUeWTtHqEDTrKDkOGjKXVjASzwOmXi/Cdn7d/D3pcQKGPYCptV8262mV9DsxUWGbXSIwK2WesSpyS9Jo4etY1ae7gZD+78pDmCZd+EDREu1Fho3sfBMLMhPQJLaHz1cdWhJfwe3WXJ6Y4TiFJZjXEbz/eNEJ5r3hwJHX6BCj+6DE9g2KukBUpRpHoXZet/vh1nCiLgRsdGfImFCbe/2ELTWc7QvrB8buK7giDQ0NswAog3atQt7GxJV5nzZDjrFCFjiWYApdi00LmlTJmFAmDQPFONLxwIR0oaiQBnkLmQS X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DU0PR08MB8255.eurprd08.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(366016)(1800799024)(376014); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: TiUE9kWN51TgP0JLulqwjb6KuS3Y8gw5uF+/Vi44MyM2h35YHJsRZK7AFa/pPrfrA327AqmACgsfaRk3jNeZVyx76/2I+RNZs14MlR9rYJceMxq0n9MO9YA8GHiV/e6fG8S4yLkgMexXI5LUaiSmYG6agn+KQahVlVs5+GbdSMtO4lO4sssSzX+CtxzsMTBQfFI+UGFsdfN36l7eG8lx2HmOwqTZppsyGk/s4VZX/qK6NJsvNqPzO+UvgYHxFrzbCT1mjWC8UxN6Ckjqilgeewrs9E1E9tal/Ph8byarCYpk73KXAj31G1UUiEBikVCr12ToBGLJUHBqzyeYjp1rsMJu7YGr+lj2VEN9S+eFgUvCYs3Cq47b0YTF7c3kCW+yMT1bQhaNg0FkrpgXlyB9fLeK5vY/oxCazUcNBC6lgrUtG4OLsq6utLSDOOQ5v15juR3S6Nomeu9p9Efao5JQ24Gs0RBwlU49tHWEKZG/rQoqrn1YqXfmkR/+dC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sADC8FZi/klDTnIF1gUsHiRmfADaPr6FOw== X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1d0afcfd-0a77-4b9c-7fac-08dd319ba308 X-MS-Exchange-CrossTenant-AuthSource: DU0PR08MB8255.eurprd08.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Jan 2025 17:24:28.2255 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: XKGubpn3QFR7aaayzLRAgetoVl1LejLAT4eLmeUvv6wtSUccKerc3CXBmHxB4JE5i2rlElMlEaYFaJk4v71e6Q== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PA4PR08MB7457 X-Spam-Status: No, score=-11.6 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FORGED_SPF_HELO, GIT_PATCH_0, KAM_LOTSOFHASH, RCVD_IN_DNSWL_NONE, SPF_HELO_PASS, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces~patchwork=sourceware.org@gcc.gnu.org Add infrastructure to allow rewriting the architecture strings passed to the assembler (either as -march options or .arch directives). There was already canonicalisation everywhere except for an -march driver option passed directly to the compiler; this patch applies the same canonicalisation there as well. gcc/ChangeLog: * common/config/aarch64/aarch64-common.cc (aarch64_get_arch_string_for_assembler): New. (aarch64_rewrite_march): New. (aarch64_rewrite_selected_cpu): Call new function. * config/aarch64/aarch64-elf.h (ASM_SPEC): Remove identity mapping. * config/aarch64/aarch64-protos.h (aarch64_get_arch_string_for_assembler): New. * config/aarch64/aarch64.cc (aarch64_declare_function_name): Call new function. (aarch64_start_file): Ditto. * config/aarch64/aarch64.h * config/aarch64/aarch64.h (EXTRA_SPEC_FUNCTIONS): Use new macro name. (MCPU_TO_MARCH_SPEC): Rename to... (MARCH_REWRITE_SPEC): ...this, and add new spec rule. (aarch64_rewrite_march): New declaration. (MCPU_TO_MARCH_SPEC_FUNCTIONS): Rename to... (MARCH_REWRITE_SPEC_FUNCTIONS): ...this, and add new function. (ASM_CPU_SPEC): Use new macro name. diff --git a/gcc/common/config/aarch64/aarch64-common.cc b/gcc/common/config/aarch64/aarch64-common.cc index 0d0502a72687cb50e1dd66d9e4312386ee6096fe..297210e3809255d51b1aff4c827501534fae9546 100644 --- a/gcc/common/config/aarch64/aarch64-common.cc +++ b/gcc/common/config/aarch64/aarch64-common.cc @@ -697,6 +697,50 @@ aarch64_get_extension_string_for_isa_flags return outstr; } +/* Generate an arch string to be passed to the assembler. */ + +std::string +aarch64_get_arch_string_for_assembler (aarch64_arch arch, + aarch64_feature_flags flags) +{ + const struct arch_info *entry; + for (entry = all_architectures; entry->arch != aarch64_no_arch; entry++) + { + if (entry->arch == arch) + break; + } + + std::string outstr = entry->name + + aarch64_get_extension_string_for_isa_flags (flags, entry->flags); + + return outstr; +} + +/* Called by the driver to rewrite a name passed to the -march + argument in preparation to be passed to the assembler. The + names passed from the commend line will be in ARGV, we want + to use the right-most argument, which should be in + ARGV[ARGC - 1]. ARGC should always be greater than 0. */ + +const char * +aarch64_rewrite_march (int argc, const char **argv) +{ + gcc_assert (argc); + const char *name = argv[argc - 1]; + aarch64_arch arch; + aarch64_feature_flags flags; + + aarch64_validate_march (name, &arch, &flags); + + std::string outstr = aarch64_get_arch_string_for_assembler (arch, flags); + + /* We are going to memory leak here, nobody elsewhere + in the callchain is going to clean up after us. The alternative is + to allocate a static buffer, and assert that it is big enough for our + modified string, which seems much worse! */ + return xstrdup (outstr.c_str ()); +} + /* Attempt to rewrite NAME, which has been passed on the command line as a -mcpu option to an equivalent -march value. If we can do so, return the new string, otherwise return an error. */ @@ -740,7 +784,7 @@ aarch64_rewrite_selected_cpu (const char *name) break; } - /* We couldn't find that proceesor name, or the processor name we + /* We couldn't find that processor name, or the processor name we found does not map to an architecture we understand. */ if (p_to_a->arch == aarch64_no_arch || a_to_an->arch == aarch64_no_arch) @@ -749,9 +793,8 @@ aarch64_rewrite_selected_cpu (const char *name) aarch64_feature_flags extensions = p_to_a->flags; aarch64_parse_extension (extension_str.c_str (), &extensions, NULL); - std::string outstr = a_to_an->name - + aarch64_get_extension_string_for_isa_flags (extensions, - a_to_an->flags); + std::string outstr = aarch64_get_arch_string_for_assembler (a_to_an->arch, + extensions); /* We are going to memory leak here, nobody elsewhere in the callchain is going to clean up after us. The alternative is diff --git a/gcc/config/aarch64/aarch64-elf.h b/gcc/config/aarch64/aarch64-elf.h index b2f13be2dab5931f19d62fc29febceb98baf6fee..f6ebb723715ad0f092f14f06e733eff2b4fe3a1e 100644 --- a/gcc/config/aarch64/aarch64-elf.h +++ b/gcc/config/aarch64/aarch64-elf.h @@ -136,7 +136,6 @@ #define ASM_SPEC "\ %{mbig-endian:-EB} \ %{mlittle-endian:-EL} \ -%{march=*:-march=%*} \ %(asm_cpu_spec)" \ ASM_MABI_SPEC #endif diff --git a/gcc/config/aarch64/aarch64-protos.h b/gcc/config/aarch64/aarch64-protos.h index 4114fc9b3b7645b8781257f6f775ddfe7e8c339e..b27da1e25720da06712da0eff1d527e23408a59f 100644 --- a/gcc/config/aarch64/aarch64-protos.h +++ b/gcc/config/aarch64/aarch64-protos.h @@ -1213,6 +1213,8 @@ bool aarch64_validate_mtune (const char *, aarch64_cpu *); const char *aarch64_rewrite_selected_cpu (const char *name); std::string aarch64_get_extension_string_for_isa_flags (aarch64_feature_flags, aarch64_feature_flags); +std::string aarch64_get_arch_string_for_assembler (aarch64_arch, + aarch64_feature_flags); rtl_opt_pass *make_pass_aarch64_early_ra (gcc::context *); rtl_opt_pass *make_pass_fma_steering (gcc::context *); diff --git a/gcc/config/aarch64/aarch64.h b/gcc/config/aarch64/aarch64.h index cee1c7f04cefc4789ca4b9f4e5b946ea642c5e47..f138e56bcf8a90193ab83e30d7489f88d6ec9ab6 100644 --- a/gcc/config/aarch64/aarch64.h +++ b/gcc/config/aarch64/aarch64.h @@ -1470,7 +1470,7 @@ extern const char *host_detect_local_cpu (int argc, const char **argv); #define HAVE_LOCAL_CPU_DETECT # define EXTRA_SPEC_FUNCTIONS \ { "local_cpu_detect", host_detect_local_cpu }, \ - MCPU_TO_MARCH_SPEC_FUNCTIONS + MARCH_REWRITE_SPEC_FUNCTIONS /* Rewrite -m{arch,cpu,tune}=native based on the host system information. When rewriting -march=native convert it into an -mcpu option if no other @@ -1487,7 +1487,7 @@ extern const char *host_detect_local_cpu (int argc, const char **argv); { "tune", "%{!mcpu=*:%{!mtune=*:%{!march=native:-mtune=%(VALUE)}}}" }, #else # define MCPU_MTUNE_NATIVE_SPECS "" -# define EXTRA_SPEC_FUNCTIONS MCPU_TO_MARCH_SPEC_FUNCTIONS +# define EXTRA_SPEC_FUNCTIONS MARCH_REWRITE_SPEC_FUNCTIONS # define CONFIG_TUNE_SPEC \ {"tune", "%{!mcpu=*:%{!mtune=*:-mtune=%(VALUE)}}"}, #endif @@ -1502,18 +1502,21 @@ extern const char *host_detect_local_cpu (int argc, const char **argv); {"cpu", "%{!march=*:%{!mcpu=*:-mcpu=%(VALUE)}}" }, \ CONFIG_TUNE_SPEC -#define MCPU_TO_MARCH_SPEC \ - " %{mcpu=*:-march=%:rewrite_mcpu(%{mcpu=*:%*})}" +#define MARCH_REWRITE_SPEC \ + " %{mcpu=*:-march=%:rewrite_mcpu(%{mcpu=*:%*})}" \ + " %{march=*:-march=%:rewrite_march(%{march=*:%*})}" +extern const char *aarch64_rewrite_march (int argc, const char **argv); extern const char *aarch64_rewrite_mcpu (int argc, const char **argv); extern const char *is_host_cpu_not_armv8_base (int argc, const char **argv); -#define MCPU_TO_MARCH_SPEC_FUNCTIONS \ +#define MARCH_REWRITE_SPEC_FUNCTIONS \ + { "rewrite_march", aarch64_rewrite_march }, \ { "rewrite_mcpu", aarch64_rewrite_mcpu }, \ { "is_local_not_armv8_base", is_host_cpu_not_armv8_base }, #define ASM_CPU_SPEC \ - MCPU_TO_MARCH_SPEC + MARCH_REWRITE_SPEC #define EXTRA_SPECS \ { "asm_cpu_spec", ASM_CPU_SPEC } diff --git a/gcc/config/aarch64/aarch64.cc b/gcc/config/aarch64/aarch64.cc index 75ba66a979c979fd01948b0a2066a15371df9bfa..95861c1088052cc60d1e02c654ee970cb8bc3bef 100644 --- a/gcc/config/aarch64/aarch64.cc +++ b/gcc/config/aarch64/aarch64.cc @@ -24831,16 +24831,12 @@ aarch64_declare_function_name (FILE *stream, const char* name, targ_options = TREE_TARGET_OPTION (target_option_current_node); gcc_assert (targ_options); - const struct processor *this_arch - = aarch64_get_arch (targ_options->x_selected_arch); - auto isa_flags = aarch64_get_asm_isa_flags (targ_options); - std::string extension - = aarch64_get_extension_string_for_isa_flags (isa_flags, - this_arch->flags); + aarch64_arch arch = targ_options->x_selected_arch; + std::string to_print + = aarch64_get_arch_string_for_assembler (arch, isa_flags); /* Only update the assembler .arch string if it is distinct from the last such string we printed. */ - std::string to_print = this_arch->name + extension; if (to_print != aarch64_last_printed_arch_string) { asm_fprintf (asm_out_file, "\t.arch %s\n", to_print.c_str ()); @@ -24962,19 +24958,16 @@ aarch64_start_file (void) struct cl_target_option *default_options = TREE_TARGET_OPTION (target_option_default_node); - const struct processor *default_arch - = aarch64_get_arch (default_options->x_selected_arch); + aarch64_arch default_arch = default_options->x_selected_arch; auto default_isa_flags = aarch64_get_asm_isa_flags (default_options); - std::string extension - = aarch64_get_extension_string_for_isa_flags (default_isa_flags, - default_arch->flags); - - aarch64_last_printed_arch_string = default_arch->name + extension; - aarch64_last_printed_tune_string = ""; - asm_fprintf (asm_out_file, "\t.arch %s\n", - aarch64_last_printed_arch_string.c_str ()); - - default_file_start (); + std::string arch_string + = aarch64_get_arch_string_for_assembler (default_arch, default_isa_flags); + aarch64_last_printed_arch_string = arch_string; + aarch64_last_printed_tune_string = ""; + asm_fprintf (asm_out_file, "\t.arch %s\n", + arch_string.c_str ()); + + default_file_start (); } /* Emit load exclusive. */ From patchwork Fri Jan 10 17:24:41 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Carlotti X-Patchwork-Id: 104512 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 3CBE03858427 for ; Fri, 10 Jan 2025 17:27:05 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 3CBE03858427 Authentication-Results: sourceware.org; dkim=pass (1024-bit key, unprotected) header.d=arm.com header.i=@arm.com header.a=rsa-sha256 header.s=selector1 header.b=hxqAkHuo X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on20614.outbound.protection.outlook.com [IPv6:2a01:111:f403:2612::614]) by sourceware.org (Postfix) with ESMTPS id 87D3F385AC2E for ; Fri, 10 Jan 2025 17:24:46 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 87D3F385AC2E Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=arm.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 87D3F385AC2E Authentication-Results: server2.sourceware.org; arc=pass smtp.remote-ip=2a01:111:f403:2612::614 ARC-Seal: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1736529886; cv=pass; b=fR4HfaaG/aXUhDVvNr4TeQ4U0s0jYEbf1ZZvwuYgIzcgZgLA+rPGPHliaiWAsMaEA/2ZG3/tzzpqMawKQBQMDLIj+K+sDAs0KLp4wzxVMR8pL7rmQdNA8C6wuh74N7+2zUMBAJhAFw7D54gcPQz2O8wlSogZDC3iT3GhMUF/bsE= ARC-Message-Signature: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1736529886; c=relaxed/simple; bh=F1G4XEWRScXiQWrIrfKcLDDX697Zvx/aMo5DuwhtSAY=; h=DKIM-Signature:Date:From:To:Subject:Message-ID:MIME-Version; b=igPvY8UYfn6csEJ5mRTnWxJ5rrZ4pjeybCR79ZL360n4MmCJ0ytvuP8qdyv1qx9AvvR7oI4Xi+IxOlJgq3qI2v/zHDmjuC/DtCSGx11SDFUo4LnIy5/RR3FWoczULdcejO/9q1cJomDO9Aizah1Pt+gpUi+Ff43g9BrTGHOP1Yw= ARC-Authentication-Results: i=2; server2.sourceware.org ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=VCHHNVEi7jaBS0x8ZRmxQRe4PPY5Tl/Str2JzgZmraM9SAQvLiCXG2sA4MgtaPJbwcwia2i2oBqOvy9zDW+VI93S23LnzKbj1cGqnUc8LpjobYSoXEqLhWXfWqL59xDQjZfpQXCCmA6HfzxZ1AkRqhiLLbqg//fKIuKMOvUecnYL8x/NJp9FOliqTRGWNVahMK8YHv60V9scIbRsM0ZbY5kvsoNVmxj84Hw1pwSazBZosAsqeSkw8hNWTze8h/p3KKm7eC12b4OzRaj8s/+pQu+hcU7971P6Bn334n7q1p6zwJrHqqnvSo2UkNrLBWcqdcQpXwBYG9OpPVD8jEo60w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=mocUXffpJUtIIjf92tf8eZmXi/yet6YX6J9c+OZWId8=; b=nwRByL1tkfFwCd5qNUgHbBHeuxKY0/k8ZkyawxLiwwfwYpmqHehT3sH5phY2laowPCK/43FC6Yms+FnVkh3VhiOhTGPQs7KuLzNI6d08RM79I61PyFb2CNwuINa02Z1Jod7KJucFb2ddJz3IjXnUcHgmrPKex5ZoPOiwq9SMIeEyD7V7FebLdlOhTCd/LzHi9O1CYUpVGUuuP38hZeKq4FaNkeC9/WSCmXJvEFxaWXK8Cw0eO9cecDWNuWWY8+Gh3OikJ4kslhgyjNwwExBcRv8+PLjdUa9iQmm3UrrZtQI20IdmtnxV7bq342JpzYi6U/78Lo15hgVvOzAVgSXDkg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arm.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=mocUXffpJUtIIjf92tf8eZmXi/yet6YX6J9c+OZWId8=; b=hxqAkHuoSaQDqy6lqK8ggXIv0k6GHNLLE8yw1C8V8EnKYVwhceWhFYmv+7UD6vdTrgtWGI8o6mQ6rJHWHhNDXKSzqaOc08OZ5EoKM6Kmixl7xkc3JP5hzfEWUATm0pM7KgVaSVSI7/dA/b+VSJEY6c8/IsSsx61jUW6Thj1SlxM= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com; Received: from DU0PR08MB8255.eurprd08.prod.outlook.com (2603:10a6:10:411::9) by PA4PR08MB7457.eurprd08.prod.outlook.com (2603:10a6:102:2a4::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8335.14; Fri, 10 Jan 2025 17:24:44 +0000 Received: from DU0PR08MB8255.eurprd08.prod.outlook.com ([fe80::cbc8:c020:6a1b:d27a]) by DU0PR08MB8255.eurprd08.prod.outlook.com ([fe80::cbc8:c020:6a1b:d27a%3]) with mapi id 15.20.8335.011; Fri, 10 Jan 2025 17:24:43 +0000 Date: Fri, 10 Jan 2025 17:24:41 +0000 From: Andrew Carlotti To: gcc-patches@gcc.gnu.org Cc: Richard Sandiford , Kyrylo Tkachov Subject: [PATCH 10/11] aarch64: Refactor aarch64_rewrite_mcpu Message-ID: <0260e863-c9a5-67a3-d371-e5882d15fca7@e124511.cambridge.arm.com> References: Content-Disposition: inline In-Reply-To: X-ClientProxiedBy: LO4P123CA0263.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:194::16) To DU0PR08MB8255.eurprd08.prod.outlook.com (2603:10a6:10:411::9) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DU0PR08MB8255:EE_|PA4PR08MB7457:EE_ X-MS-Office365-Filtering-Correlation-Id: 400a62a3-5439-4066-f328-08dd319bac21 x-checkrecipientrouted: true NoDisclaimer: true X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|366016|1800799024|376014; X-Microsoft-Antispam-Message-Info: 0ZhQxYl5I+fHRr86a/oPSfZEmdhwq9DPdkdVrVr/xrkU+t9A9fdz4agafau0aRrZHkwZ7MAOYzEAVWPc29RLGkJi5OfDwfVyVIdyZzOB/barPiFExjkFdA78NHQPk0WIKMU7ZJBCfMo7YmLbhn/drYCh/hrQoPzO7Bm3KxFsFA6lbdSUwgfFAmbhsP5+djV0PqM1o8/6gIeUEE2pycBG/LXwBUnpIUaMTuwNsGNCWJLIeab6eEo7DFMDZJFgzQdW2Xu62LcTeaYjixrZDLwrOAqnDK+nMYBHW/jco0lWNcyFz/NsbX101MNDxLH5Qrjhi28AZEaW5JWJoQorhKd7CK+3R0P/j9to9LnPqqX6xMmyY7vWpfo7XcWC8uacA1eumJQ7oe/n1TL5BRzAErZe45PsFcUpSs9kWZgu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prd08.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(366016)(1800799024)(376014); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: UOU/8jk4GLEOquWwhzFiM3bijfpTnOUJma0BmDYVdhhgmQ6u2Ss99HXbgQsHLNXh1+TxtwSgviSAbcj5d7aDH+mqs21B5ybg4hT9YRM/160iRnS7gRDeoDwiFePnbKK40gPKHCzsMIfheLzfseRU1WhvWWKmh3mLFgNBEtPYSyU57+LP4W8OuMIDdh7v0cDY3p0ss29Nr6abKSjFG/3nft7cFe/YYptE4kxYnPzzBrWUxg6nQfBu4I1PXZZUXJDyUtYgUy+Mg/oZG7M1bOE6+eqM18sxjSbxjiRUTRwBaNplsfSNCvwmZm0FRteNg+rc1mwuHl3XXa+Nc1Lbjq+/vMRwgm98UI+bjL+c2RwLlt8nrrPMWBszKeu9rSx0/RgHqlfY7YRTTcGOJRr+jjW5cEfiN7EirYYao3aC89bz9m5khm31VGP7QI+nzfYsWv1NPb6rDCzUinimFGH0eAtQjz7mCVRe4wQfoKWn/d8UNzSlmcYgxTsZ3duznggl/ROyqSUdktbSrvDIDZEFAnCSTap7x70LbFUA1E4+V87j3grWFIZz9Fx3fc1uFKi8yDrAM/sWsALINLzdB1Ue9Dk31daXqEsuosA6Mmo1exFkQGhSbDpkAkT6F5XTS246sWo2rphGB8mB3XUwuOsew649XptpMT78TWU5nIxkpreTxmiF87lyNmEjEE8lbW2dk42x7NZy9Hdga2Auy32tjfqB4QR/yJTLtyFeAgeiRw4AZVHRcm7iUabv55uu6UhRPHG9J+RgMKtvjIcjov6W45BmabAxAThXxi/cCCdp1HIKhkVvOpLSIy2WH29e4FrjF7dQqW96W8Ap8zllQf8ir3e5QJgNtH9RsQrTBQMS9eUJwGvvj0fPDy/6mJJarxclmkP435p8Spp9UoSpnTTO0xa2uWztK79jtXqenDfwSv5adplyBMtgAUD2Uxvi4Aaha8oLQ9bNV5VzG11KktWYBKBp1i4CcZqfst7hGRypHI8CbXx0KjTg748xggypZlwzvDZ/YQ0zvEqW3me6RMetOvnR4kOI9U999B5mxuqupGHQqPTipK+UXnnnVUwPSoDAVL9RBQ6CecdOl2pjOn09nCcKKXLM60N4is6zpHq1JRk8X6FBOvQDsvHPlBVcrgpYfC+9ea/p53Hw5F9yUteb14lF4BES7d8rjGziKStGGJxFIlXfbGAGBop/0XCAwWjMV4uCxMjKBGmC1UTWXlwX7gNEVg70ETXPBJsXuQ28uKvcWOm7wz19E4w8ZZNCIJ+zzN0eA8+ZACoxyJLUjBN3XosFnNhEKDZBXDQZoa6AjFB3Won49WXklV78TOMZ5aUDi+zRM7l4Fg+KIB12yO7+g4WHAJ3wmrQk0NpE1IE41L1UfB3VYGRLLKNOe5axRoUQrmmOd+bJgOJWDm2iyJ2MBT5sURdYX8+LWeU3MR6Dr/sMpZR/0lCBwW1uxZWkE6TkaEpWN+9vUc7lKrt8qI3l/j5mp6X9Pkt7e3fOrn7+EHnHMCbJ9EGNm/MhdsmVBsmOHJMN9IY3SgnaLzd7oG+y92Uyz/50HRz5CDwJzkT3JihKR6g1A0XbaoGcEsGloS8MwemI765ilXk5T8+3BUlmeV2VTA== X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-Network-Message-Id: 400a62a3-5439-4066-f328-08dd319bac21 X-MS-Exchange-CrossTenant-AuthSource: DU0PR08MB8255.eurprd08.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Jan 2025 17:24:43.4937 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: aOQOnnHfQAh26hMaC5UFM0OWHSQfcggzdVFEy5m9aW5YIz7lsugkDJh+j60mY8O2F6pP2Zp+0N6AzpeSDaLW9A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PA4PR08MB7457 X-Spam-Status: No, score=-11.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FORGED_SPF_HELO, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_PASS, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces~patchwork=sourceware.org@gcc.gnu.org Use aarch64_validate_cpu instead of the existing duplicate (and worse) version of the -mcpu parsing code. The original code used fatal_error; I'm guessing that using error instead should be ok. gcc/ChangeLog: * common/config/aarch64/aarch64-common.cc (aarch64_rewrite_selected_cpu): Refactor and inline into... (aarch64_rewrite_mcpu): this. * config/aarch64/aarch64-protos.h (aarch64_rewrite_selected_cpu): Delete. diff --git a/gcc/common/config/aarch64/aarch64-common.cc b/gcc/common/config/aarch64/aarch64-common.cc index 297210e3809255d51b1aff4c827501534fae9546..1848d31c2c23e053535458044e0fcfd38b8f659b 100644 --- a/gcc/common/config/aarch64/aarch64-common.cc +++ b/gcc/common/config/aarch64/aarch64-common.cc @@ -741,60 +741,29 @@ aarch64_rewrite_march (int argc, const char **argv) return xstrdup (outstr.c_str ()); } -/* Attempt to rewrite NAME, which has been passed on the command line - as a -mcpu option to an equivalent -march value. If we can do so, - return the new string, otherwise return an error. */ +/* Called by the driver to rewrite a name passed to the -mcpu argument + to an equivalent -march value to be passed to the assembler. The + names passed from the commend line will be in ARGV, we want + to use the right-most argument, which should be in + ARGV[ARGC - 1]. ARGC should always be greater than 0. */ const char * -aarch64_rewrite_selected_cpu (const char *name) +aarch64_rewrite_mcpu (int argc, const char **argv) { - std::string original_string (name); - std::string extension_str; - std::string processor; - size_t extension_pos = original_string.find_first_of ('+'); - - /* Strip and save the extension string. */ - if (extension_pos != std::string::npos) - { - processor = original_string.substr (0, extension_pos); - extension_str = original_string.substr (extension_pos, - std::string::npos); - } - else - { - /* No extensions. */ - processor = original_string; - } - - const struct processor_info* p_to_a; - for (p_to_a = all_cores; - p_to_a->arch != aarch64_no_arch; - p_to_a++) - { - if (p_to_a->name == processor) - break; - } - - const struct arch_info* a_to_an; - for (a_to_an = all_architectures; - a_to_an->arch != aarch64_no_arch; - a_to_an++) - { - if (a_to_an->arch == p_to_a->arch) - break; - } + gcc_assert (argc); + const char *name = argv[argc - 1]; + aarch64_cpu cpu; + aarch64_feature_flags flags; - /* We couldn't find that processor name, or the processor name we - found does not map to an architecture we understand. */ - if (p_to_a->arch == aarch64_no_arch - || a_to_an->arch == aarch64_no_arch) - fatal_error (input_location, "unknown value %qs for %<-mcpu%>", name); + aarch64_validate_mcpu (name, &cpu, &flags); - aarch64_feature_flags extensions = p_to_a->flags; - aarch64_parse_extension (extension_str.c_str (), &extensions, NULL); + const struct processor_info *entry; + for (entry = all_cores; entry->processor != aarch64_no_cpu; entry++) + if (entry->processor == cpu) + break; - std::string outstr = aarch64_get_arch_string_for_assembler (a_to_an->arch, - extensions); + std::string outstr = aarch64_get_arch_string_for_assembler (entry->arch, + flags); /* We are going to memory leak here, nobody elsewhere in the callchain is going to clean up after us. The alternative is @@ -803,19 +772,6 @@ aarch64_rewrite_selected_cpu (const char *name) return xstrdup (outstr.c_str ()); } -/* Called by the driver to rewrite a name passed to the -mcpu - argument in preparation to be passed to the assembler. The - names passed from the commend line will be in ARGV, we want - to use the right-most argument, which should be in - ARGV[ARGC - 1]. ARGC should always be greater than 0. */ - -const char * -aarch64_rewrite_mcpu (int argc, const char **argv) -{ - gcc_assert (argc); - return aarch64_rewrite_selected_cpu (argv[argc - 1]); -} - /* Checks to see if the host CPU may not be Cortex-A53 or an unknown Armv8-a baseline CPU. */ diff --git a/gcc/config/aarch64/aarch64-protos.h b/gcc/config/aarch64/aarch64-protos.h index b27da1e25720da06712da0eff1d527e23408a59f..4235f4a0ca51af49c2852a420f1056727b24f345 100644 --- a/gcc/config/aarch64/aarch64-protos.h +++ b/gcc/config/aarch64/aarch64-protos.h @@ -1210,7 +1210,6 @@ bool aarch64_validate_march (const char *, aarch64_arch *, bool aarch64_validate_mcpu (const char *, aarch64_cpu *, aarch64_feature_flags *); bool aarch64_validate_mtune (const char *, aarch64_cpu *); -const char *aarch64_rewrite_selected_cpu (const char *name); std::string aarch64_get_extension_string_for_isa_flags (aarch64_feature_flags, aarch64_feature_flags); std::string aarch64_get_arch_string_for_assembler (aarch64_arch, From patchwork Fri Jan 10 17:24:59 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Carlotti X-Patchwork-Id: 104514 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 2C41A385843B for ; Fri, 10 Jan 2025 17:30:06 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 2C41A385843B Authentication-Results: sourceware.org; dkim=pass (1024-bit key, unprotected) header.d=arm.com header.i=@arm.com header.a=rsa-sha256 header.s=selector1 header.b=j8tlsshT X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on20624.outbound.protection.outlook.com [IPv6:2a01:111:f403:2612::624]) by sourceware.org (Postfix) with ESMTPS id 8BD36385771E for ; Fri, 10 Jan 2025 17:25:07 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 8BD36385771E Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=arm.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 8BD36385771E Authentication-Results: server2.sourceware.org; arc=pass smtp.remote-ip=2a01:111:f403:2612::624 ARC-Seal: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1736529907; cv=pass; b=BsIOeo5I55MbRa9BA1nRTZKnch1gv1ZtS5TZ2Ee+cqKjrF/nHStYA71cU5tmXy1gneFE5a31cHWCedz0yOZpcxV9sTLcaWOMvQh+3nBIxYGbBfNjetsgIR2yuKtSBThor6xjrjHHAsE1CDV8w3yoE97b7Ic5cwvZbUDDrZT1CPo= ARC-Message-Signature: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1736529907; c=relaxed/simple; bh=RIOdj4s1xqKMl4Kv2QWUnIFte3JCIgVt3fdHgnNKDEo=; h=DKIM-Signature:Date:From:To:Subject:Message-ID:MIME-Version; b=MCMBP9hsrmeKS5AHfEKZ9GmbfOPKdU5BYmYXToqBJo+d2uuNceDGV/r/o9xc9Ue3ooQo42tnuMUIXO9Rp7dGEaakjwpwnKkKbUS91KwrqPTILXuGd8cqBFQFMXWB+mEnWROyVtsR32giAoyUOVCUmymPG2bKvwhVzpL+5HjfEw4= ARC-Authentication-Results: i=2; server2.sourceware.org ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=auu7tPbt3CmiqXcjbLqs9AtDsnUijZYkHtDjsmTaAfJTG8ezArf4WQIZI3p3PGpX4wHg4+fImHNpVjsDi7qV5OnHV7FzhrP1P3na9CMKMxp9qlnFYReFVYgLC+OVqR/eCKxpO6Ds5kSGkzZoRmFN8SBTnZCOOWOKDLQJR3Q/gpmS/xHPzYwBJxLT1lNoT0PWFWcgY0/7WZXcxtCYB2j5+olzGJVH9FJo/C1xC6ujjmI+Z+3aWukwe5xB9HVIV92WB9PL9m3z3Pbaz6fDvdvm0xpLisheYo12Pe99gMEtIRjwXoOCdaH9JpEuUhGducFQ6DzPf75vB+qx50w3hokQLw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=K35rxMeobf5mBEXZOy/BHZa5sN1X0F5FwDkpz38GdpE=; b=Xj8Ugz+Y393+We05oRMEN8wdxiWIs0c6rosQKp4pi1Q5UrCeeIgygBH+AT5ASfaGn/kKxjUyNBVqzkAxPoPc7WOobECxsZ45MwWgFQD6KD22RrnO0wvWu9kzc+rdh1WKG+Buv982NyezI3pSZPiMwqV0fg0O5/HhLHyKQbrgD0+2EXdUhMlxeqYQNyWZWvWuB6iP5gxjpzT5yM+tmol25TfNLktNWa9TNHKVYutqmGcZSO1n6yqaQGUlnwXW5HYXl4rgTgWdnY/HqhKa9EG3/MJPWB5Mv3oD6J0UlSGCQGMyOmisBd0OEtqYQ97Chaonozprm2dFnJa+ea9THSBh8g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arm.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=K35rxMeobf5mBEXZOy/BHZa5sN1X0F5FwDkpz38GdpE=; b=j8tlsshT7m1M2nFbIXq0KgxW58pKoD8rO6zoIwfmpcsmyLvNxKEAjHsghE7LNKnW4gfNJHMgB+TvkP0bT0O8+2LEIu22Pz+bb5gjyfVaf2ZlzCSnTG7huFLtDBmdPLvk6NZHaSmIbmShSkeamxPcmWN5NhfzmN3LVu20+MFWqmQ= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com; Received: from DU0PR08MB8255.eurprd08.prod.outlook.com (2603:10a6:10:411::9) by PA4PR08MB7457.eurprd08.prod.outlook.com (2603:10a6:102:2a4::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8335.14; Fri, 10 Jan 2025 17:25:01 +0000 Received: from DU0PR08MB8255.eurprd08.prod.outlook.com ([fe80::cbc8:c020:6a1b:d27a]) by DU0PR08MB8255.eurprd08.prod.outlook.com ([fe80::cbc8:c020:6a1b:d27a%3]) with mapi id 15.20.8335.011; Fri, 10 Jan 2025 17:25:01 +0000 Date: Fri, 10 Jan 2025 17:24:59 +0000 From: Andrew Carlotti To: gcc-patches@gcc.gnu.org Cc: Richard Sandiford , Kyrylo Tkachov Subject: [PATCH 11/11] aarch64: Make AARCH64_FL_CRYPTO always unset Message-ID: References: Content-Disposition: inline In-Reply-To: X-ClientProxiedBy: LO4P123CA0383.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:18f::10) To DU0PR08MB8255.eurprd08.prod.outlook.com (2603:10a6:10:411::9) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DU0PR08MB8255:EE_|PA4PR08MB7457:EE_ X-MS-Office365-Filtering-Correlation-Id: 2a5365d3-c4b8-483e-1ea6-08dd319bb6fc x-checkrecipientrouted: true NoDisclaimer: true X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|366016|1800799024|376014; X-Microsoft-Antispam-Message-Info: fd1icNF4Sj+C6/GXtxEDsi8ENNa1P9MDYTPGfoBtHaPIqhIr6nW069y4Q6ddGAVTzlAeEmdGXNdrNmwHJaaYZHfDrgm8UKj+8UgDDynmPgFAYFP++mqVb0gysQ7FBBwwx0qzKJuvq9Q6+vNp41LeJLFuljJzROiKztZsEICM5q4l9L3anfl9nra2jhzwDuFS415r4826vdwQXVlp6lvvp/F1WgC4gneDb5xvc1SkLg5kO8NtlBGjJ3HPc7AvZEi1+NVKAIFrgWKRP9f1E3nMwaRcT58I5JyjPwgnhJ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am-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DU0PR08MB8255.eurprd08.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(366016)(1800799024)(376014); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: FsfCrQtQN2+N91Qv8CdOHCrJMQvJ1kObokaPXfHYgESFrR1t8aj7ouRcUtfP2OrxSsApvjPlX8zbpH57BGLUjsso3FhxMNQzwbjEUcOOT980KtxTPKFNLvoMl97nbdsvW4yn06a/vLEzA2k3liJPtIz4FFfApUIVTGHPixrbfm6nXVMKKPoQKBQSma8lVqyfRCiVD8FpialUXK+vgRB0Jj7WAuN78c5d0Wdrf+czPZAy7MEUqJLXjUwRwU0DstfxoicGkplyPxo8QU6LepgCVz8Fi2sDIflqon2ORTmwMhU5RHgt/pupz3KK/SmYpHTVpPiHlBbknxJc3jt4ENEHRcdRRG8OOp82qLq/lt26b+ZWehi0w+Ccb/mlDAZqiyaNuwBpsqtzfLYGJKjrDjD2aoCbbehnXVbh8KUg1hq2EzQiMH6YkLeNhvtO5QcNwHtjjKtG34CE3MKYIxF1kkrwH+oAh75YMs8qSXsXilpHtNlZtAL1bsWVzXbT+LhwlUanKaAYEAaHt5DqUw/MjG8qPNWUPGYCTTBSijejELMzHESBFS1p80NxDJMe3gCSJKvqQs7V7Ns6iVXsDTDFE7ptYr3qCHVAx9+FcD/KUfLzC2m5wXEKeQrS3s15BUE5vawDG8lPRYko6tBKPn2RmfOjWep4DWICQfJ/fvFrMTzSrQuV1DLu8nV/PuSCGJqJ8nqDfiUNS0omDeYwYG4mBtOxOIZw4qjDM/ZZmAWAEaDGwuafVPeYlQg+l9Et7I/Rit/Vywj8pshvFhWeHlo9lcirwWSqm8pZc9LcH+E4CPqqBkvEwgycAe/vsI/6NO897SI4Hb7Ykx96WFleYGhLDe8GXIR6j1q3sd2as0vvS2q58KCIDFQ+Q/GuoVweRoedniGq8kmdWUubYINM/pzf9l2Sdxf6E5ODso1TKDvfjr8Q5+/U2Pg8Hs+IGK20xIxpTqGb35VnQ/AX1qNhCA/eD+RErNkB2rYNt9m3Ap+akrH8tbsLvTsffMIowWy9NziMlWQrPbI39KUBuJmD1K25m9ohJ4mXdS5h3Qzon7TEAddzH84h+UxPN+/GQQMD4GXjz+Tz+yA44mzA+zM96EGxR7VwI4P1YJO0XFIEoKaK5mvtovlI5Agcs9buUzefN/xWQ/Fc1gV7pTNBCavce4o+MxIE+ipFqfLO5poqj7QinoLm7XeviCI5Q2PeN+5bY5x5VGWOOaEyJm8e2SSt5WfLQvdilJSbc0LcVYPwFgdxdivz41FLYg3+EdOxHgf1EHt3JHFW353KhMEUShSh67Q52Cais4YYT99IhQi7qwhonLtNQ4ZO4R6QqXP5/KaJvG7W0XZNIumGmRrD5Yno/03Umkosp27Yrq+k+qOpI9DfXC53q7/BbefiHOxQ99fp6LvArpyIGrMdTi0c4u+nj2me++QtYnZIdMQ7C2pY83wXkOVb6fj4N2PPr9KnITWS3xnVTZpZCEUTb9wrkzDwq2vPpI/xOoijTRNv0JMVVui+j3407Flym0MFSpOXq1H//abenvT15/+od3cHX0ZvmgwWrwH7DbRMTxm4AhIymgiUwfbAzCwbErNDc1zh2klnas+roAeC5TXegUYMTgpMXads+5f+gA== X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2a5365d3-c4b8-483e-1ea6-08dd319bb6fc X-MS-Exchange-CrossTenant-AuthSource: DU0PR08MB8255.eurprd08.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Jan 2025 17:25:01.7014 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: iMSD0L8kw+UfbjSVzQPhSUG73iWeZqdn8F1Tyh/eWjzje/PXSorLD3iOuEf1RktbKY1gITTMz1S9BKx8EUok3w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PA4PR08MB7457 X-Spam-Status: No, score=-11.6 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FORGED_SPF_HELO, GIT_PATCH_0, KAM_LOTSOFHASH, KAM_SHORT, RCVD_IN_DNSWL_NONE, SPF_HELO_PASS, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces~patchwork=sourceware.org@gcc.gnu.org This feature flag bit only exists to support the +crypto alias. Outside of option processing this bit needs to be set or unset consistently. This patch goes with the latter option. gcc/ChangeLog: * common/config/aarch64/aarch64-common.cc: Assert that CRYPTO bit is not set. * config/aarch64/aarch64-feature-deps.h (info.explicit_on): Unset CRYPTO bit. (cpu_##CORE_IDENT): Ditto. gcc/testsuite/ChangeLog: * gcc.target/aarch64/crypto-alias-1.c: New test. diff --git a/gcc/common/config/aarch64/aarch64-common.cc b/gcc/common/config/aarch64/aarch64-common.cc index 1848d31c2c23e053535458044e0fcfd38b8f659b..8af3aa71be8a8d56ea3654e194dc58e81345178f 100644 --- a/gcc/common/config/aarch64/aarch64-common.cc +++ b/gcc/common/config/aarch64/aarch64-common.cc @@ -620,6 +620,10 @@ aarch64_get_extension_string_for_isa_flags { std::string outstr = ""; + /* The CRYPTO bit should only be used to support the +crypto alias + during option processing, and should be cleared at all other times. + Verify this property for the supplied flags bitmask. */ + gcc_assert (!(AARCH64_FL_CRYPTO & aarch64_isa_flags)); aarch64_feature_flags current_flags = default_arch_flags; /* As a special case, do not assume that the assembler will enable CRC diff --git a/gcc/config/aarch64/aarch64-feature-deps.h b/gcc/config/aarch64/aarch64-feature-deps.h index 67c3a5da8aa3f59607b9eb20fb329c6fdef2d46f..55a0dbfae6107388d97528b637f9120cc6b933a1 100644 --- a/gcc/config/aarch64/aarch64-feature-deps.h +++ b/gcc/config/aarch64/aarch64-feature-deps.h @@ -56,7 +56,8 @@ get_enable (T1 i, Ts... args) - explicit_on: the transitive closure of the features that an explicit +FEATURE enables, including FLAG itself. This is - always a superset of ENABLE + always a superset of ENABLE, except that the CRYPTO alias bit is + explicitly unset for consistency. Also define a function FEATURE () that returns an info (which is an empty structure, since all members are static). @@ -69,7 +70,8 @@ template struct info; template<> struct info { \ static constexpr auto flag = AARCH64_FL_##IDENT; \ static constexpr auto enable = flag | get_enable REQUIRES; \ - static constexpr auto explicit_on = enable | get_enable EXPLICIT_ON; \ + static constexpr auto explicit_on \ + = (enable | get_enable EXPLICIT_ON) & ~AARCH64_FL_CRYPTO; \ }; \ constexpr aarch64_feature_flags info::flag; \ constexpr aarch64_feature_flags info::enable; \ @@ -114,9 +116,11 @@ get_flags_off (aarch64_feature_flags mask) #include "config/aarch64/aarch64-option-extensions.def" /* Define cpu_ variables for each CPU, giving the transitive - closure of all the features that the CPU supports. */ + closure of all the features that the CPU supports. The CRYPTO bit is just + an alias, so explicitly unset it for consistency. */ #define AARCH64_CORE(A, CORE_IDENT, C, ARCH_IDENT, FEATURES, F, G, H, I) \ - constexpr auto cpu_##CORE_IDENT = ARCH_IDENT ().enable | get_enable FEATURES; + constexpr auto cpu_##CORE_IDENT \ + = (ARCH_IDENT ().enable | get_enable FEATURES) & ~AARCH64_FL_CRYPTO; #include "config/aarch64/aarch64-cores.def" /* Define fmv_deps_ variables for each FMV feature, giving the transitive diff --git a/gcc/testsuite/gcc.target/aarch64/crypto-alias-1.c b/gcc/testsuite/gcc.target/aarch64/crypto-alias-1.c new file mode 100644 index 0000000000000000000000000000000000000000..e2662b44e2db0b26f30c44e62c4b873a12a37972 --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/crypto-alias-1.c @@ -0,0 +1,14 @@ +/* { dg-do compile } */ +/* { dg-options "-mcpu=ampere1" } */ + +__attribute__ ((__always_inline__)) +__attribute__ ((target ("arch=armv8-a+crypto"))) +inline int bar() +{ + return 5; +} + +int foo() +{ + return bar(); +}