Message ID | 4c366314-a9b8-e1ff-9d6c-dc4f11eca41c@e124511.cambridge.arm.com |
---|---|
State | New |
Headers |
Return-Path: <gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org> 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 03F8D384604F for <patchwork@sourceware.org>; Tue, 9 Apr 2024 13:27:17 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from EUR01-DB5-obe.outbound.protection.outlook.com (mail-db5eur01on2057.outbound.protection.outlook.com [40.107.15.57]) by sourceware.org (Postfix) with ESMTPS id 702D23847700 for <gcc-patches@gcc.gnu.org>; Tue, 9 Apr 2024 13:25:34 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 702D23847700 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 702D23847700 Authentication-Results: server2.sourceware.org; arc=pass smtp.remote-ip=40.107.15.57 ARC-Seal: i=3; a=rsa-sha256; d=sourceware.org; s=key; t=1712669136; cv=pass; b=YOzAe/0IVci36rrAyutKWYDiHZqpqehiHsZWZqkv2ROv+C2pVZLQz8MHE052Ft8RJR1CfarGz56QppBaf8eZ/Vn9NI5AQWEQ5txUG2bj/gzeuVje2BqGe0nE4dX8FJ6LwPVvHk3NC4/h/Fd6d/FHycqmTDXDUGIzWFN+VPpRvOA= ARC-Message-Signature: i=3; a=rsa-sha256; d=sourceware.org; s=key; t=1712669136; c=relaxed/simple; bh=hzqjG0eYDYvphsqwEqQ1XZ1fx38ScOvoV7EREmAajJw=; h=DKIM-Signature:DKIM-Signature:Date:From:To:Subject:Message-ID: MIME-Version; b=Hy4N9c5HTXXX3tBUZGjHsWDgCbjf9G4N0plsKIRdeMeZaqNtfSMERB6TKdosHK6n5VegvMeq/VLf6yoZPeraOcDGU3UUJHsPXNyQ3BIf2bfE/dI/sRi0Gz5h6Lnfd7uKp5mcmFuWpTdsAXNJnq//AYDmLpG/lVELwhvYQVUuC4s= ARC-Authentication-Results: i=3; server2.sourceware.org ARC-Seal: i=2; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=pass; b=BQvGmBIF6q1+BF7Q70oHQ4bYqOfX/JYEWDIbt/PiPbb24HdE5eG/9bv5YaUIwi69HmaVhvYBX0u1WPBi1kTzcjxcPHCxFeZB/BrdRNwnvYdurI4Gw0pKOHqL6wQMZNh0WO5MXq/JxI9FpR6rNwyLD02JH9CPrrZ7cUbmQ33/M/8zo6qfeHFyF3eAaQepYYd6M7QdgRQ93D3gN/iQhnBNJSa7+3P3kUGpzk6cLvnJWVVKhtln5ESdPb2arpHS8gOFkyeRHr85UMdbG9YYfNBtms4kOF0jrWHfD+2/JcaE6DAv9x0QvM0EpOzuIq7/L6tUkqfCx0j0jHLCZjLWhR2AkA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=dOWZ2jahzcNTNJgIWXbkg4CpdmVmUnWbwY/EZGSiVyU=; b=JAUE3mUGMPUKO7VoaEfzvZxVgm/lRKTEFcAkEHzbTciyA/cVwuu1SKPdFUifliCw8Gogjd1l792NNcanGYaEXBxA/se82KOseBqEOY/UbIBzLvjmM4KqlFJRUUGHW8I2xJqc3czR9MY4x/i0GNx3mNuqhwaAzYbeUjcJd0+hPWfb2F5q8VdYO67LtAvVnQYjPwQQRv9Q305eNORo1W8hmAAsFYoxXtzkdokM4ERRSRJVvci/mjm6X3SNmPl79XMLiXWVo2OHsL9tKNOP31/SVL7eiUEl7VMsP6/CFeNdP5Hrc4gDbmomdZYgXJJaR+oAFB4hI9Km9geP4itzSIzEmA== ARC-Authentication-Results: i=2; mx.microsoft.com 1; spf=pass (sender ip is 63.35.35.123) smtp.rcpttodomain=gcc.gnu.org smtp.mailfrom=arm.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com; arc=pass (0 oda=1 ltdi=1 spf=[1,1,smtp.mailfrom=arm.com] dkim=[1,1,header.d=arm.com] dmarc=[1,1,header.from=arm.com]) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=dOWZ2jahzcNTNJgIWXbkg4CpdmVmUnWbwY/EZGSiVyU=; b=kgKGxWJehsFbzYIpTGf084sUSMOLxBJYsvfrRI8H9IZu4iXbbfsVCjBPom37Y4Q0vrr6rnvR3LCUe2VptkDfTmakiPwGTdiGGp+Wb2BrSAI/NRtLRVzzFBzuFEjJy62M9bH547Nuc12J6HcS521k9HoUpMksIMss4SdduMhXRCM= Received: from AS9PR01CA0037.eurprd01.prod.exchangelabs.com (2603:10a6:20b:542::25) by AS1PR08MB7612.eurprd08.prod.outlook.com (2603:10a6:20b:477::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7409.46; Tue, 9 Apr 2024 13:25:30 +0000 Received: from AM4PEPF00027A63.eurprd04.prod.outlook.com (2603:10a6:20b:542:cafe::6a) by AS9PR01CA0037.outlook.office365.com (2603:10a6:20b:542::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7452.28 via Frontend Transport; Tue, 9 Apr 2024 13:25:30 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 63.35.35.123 as permitted sender) receiver=protection.outlook.com; client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com; pr=C Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by AM4PEPF00027A63.mail.protection.outlook.com (10.167.16.73) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.7452.22 via Frontend Transport; Tue, 9 Apr 2024 13:25:29 +0000 Received: ("Tessian outbound 5ad6c4395be7:v300"); Tue, 09 Apr 2024 13:25:29 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: e7556d57874e938f X-CR-MTA-TID: 64aa7808 Received: from 2c4166b47fee.2 by 64aa7808-outbound-1.mta.getcheckrecipient.com id D8F48FFF-964C-4F49-A1C6-72630D4DD170.1; Tue, 09 Apr 2024 13:25:22 +0000 Received: from EUR03-DBA-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 2c4166b47fee.2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Tue, 09 Apr 2024 13:25:22 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=l2WwgigWxPGHZ7gmAArq6GCULz8zwughh/dsqcKkWlqTu4voNg0hKo8RJgMLENpHTKIMH0LL9aIzP0K515LdGJnA20grv66wk8MOCFXqq/ju+X6JG3c+keepxpDhbpdJDmPgpFErFo6o8oXncSvqjbntIbVHI1Yuwt5eZZeXp3tfQmTfLc37mKQSSq/oxK1gMhijFNeYU1jFcv1+7FTwi7r576r8ZZ3GkK8B9ziZcSj7dwLNWlWZvFmSBWRXEL+vXl+0VO5C0QicNRFR2YGGiIzm5atAHBIK2gr5iNCbxiuydiCZJ6r0LadBU8nAuDmG4ZqJnVI9Ahj555FP8mY1GQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=dOWZ2jahzcNTNJgIWXbkg4CpdmVmUnWbwY/EZGSiVyU=; b=PDDllT8XSl+Iny9Cbl/HDBUpfLYNvn7+WnsJ82SEYlvEeOCy0AVJEq2GTv3dr3DVXAEJa2b0qdZIfuwsSEpopZ7LCP5vvhol3enMIFjPhS7K2GMibOIp/eClPmOy2kmLeTqnhgImcNPjkI15vhXgwAx5ky+1LARlOLrfhtkM8byXt5tb658O6UFRHXFQrWkN0Ptqz6GPRiCySbC1l8MEcCJ95kOe2Hwsd/y1gwKDf3UDUS0zAyRdPAoO55jq1zeIQJ+U4fVo4NzsSdQ96oXroMg6Zey5oC3Rp5YoYwPhN/VD9nno++kbo3J3zjH8MYa/oka8yh0Qa+8f0NDmNyfDZA== 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=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=dOWZ2jahzcNTNJgIWXbkg4CpdmVmUnWbwY/EZGSiVyU=; b=kgKGxWJehsFbzYIpTGf084sUSMOLxBJYsvfrRI8H9IZu4iXbbfsVCjBPom37Y4Q0vrr6rnvR3LCUe2VptkDfTmakiPwGTdiGGp+Wb2BrSAI/NRtLRVzzFBzuFEjJy62M9bH547Nuc12J6HcS521k9HoUpMksIMss4SdduMhXRCM= Received: from AS8PR08MB6678.eurprd08.prod.outlook.com (2603:10a6:20b:398::8) by AS2PR08MB8502.eurprd08.prod.outlook.com (2603:10a6:20b:55d::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7409.46; Tue, 9 Apr 2024 13:25:21 +0000 Received: from AS8PR08MB6678.eurprd08.prod.outlook.com ([fe80::791b:686b:e7b9:be90]) by AS8PR08MB6678.eurprd08.prod.outlook.com ([fe80::791b:686b:e7b9:be90%5]) with mapi id 15.20.7409.042; Tue, 9 Apr 2024 13:25:21 +0000 Date: Tue, 9 Apr 2024 14:25:17 +0100 From: Andrew Carlotti <andrew.carlotti@arm.com> To: gcc-patches@gcc.gnu.org Cc: Richard Sandiford <richard.sandiford@arm.com>, Richard Earnshaw <richard.earnshaw@arm.com> Subject: [PATCH 2/5] aarch64: Don't use FEAT_MAX as array length Message-ID: <4c366314-a9b8-e1ff-9d6c-dc4f11eca41c@e124511.cambridge.arm.com> References: <33371799-7353-cd99-3f78-9abe31ad24ec@e124511.cambridge.arm.com> Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <33371799-7353-cd99-3f78-9abe31ad24ec@e124511.cambridge.arm.com> X-ClientProxiedBy: LO4P123CA0166.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:18a::9) To AS8PR08MB6678.eurprd08.prod.outlook.com (2603:10a6:20b:398::8) MIME-Version: 1.0 X-MS-TrafficTypeDiagnostic: AS8PR08MB6678:EE_|AS2PR08MB8502:EE_|AM4PEPF00027A63:EE_|AS1PR08MB7612:EE_ x-checkrecipientrouted: true NoDisclaimer: true X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: +G/+IEVR1etrFFfZRcKAcModbbBIKVcqcRbIIu81jgLcwXzRi5wIdtPqVlNznpSUOGv0bhPcbFn4DL9g+6hBL+YUDvt+GzRZCQ9ljMYgYM6NODC9bwPQdmHNdO+kPa+LdrOC1Ng68RGM606WXY7NEUj+z8UbqkDTPtSY+cdt1rpn/CRO3fIAZ9PLIr9Iv5VylkMYEoF/pnLsWNKedS2eRuzGFpIVnA1YJbYuhfXJYKRDzrbpxrixrLITezsir0GdLHWmj1NDMTzB3HfPZZdTvQDYumOYAlAR9jf1+0hdwZDJZ7lqMfLPb2P8TtelwB5GrBEvvcmq9Jq1lWfVpoO8OpVs8zlX0kg29CHd/YSIYihkDUj8JoSYO/Swsy3j+uuUwMEyjqeuHtVgoT8jJqJciipKi6ROIicJ9hnijE9XCrLSv4eUvfq16p/iX4B5/Njo7pGBom4yfiuqgLnXQIYvC913tQ7A6nSYzfwNh+3gJp0DfjBuh3mSa82SRjnm95TUHf/xISsJOf32axW3iQzyJ4wtPgMIlXpvCqPN4VlBK8/qmO0EQ+zuFkNsBNwixvrZH8/ZDRup1h99RZINpTDY5ZUY8+q4U09Zk2Y3DjSkxF7yvpQhRNz6B/FlQN8ssmVq9B9QaKc47jo9pIWEJBQ3nCOBZtliv+nJPqtm+Iz1J6M= X-Forefront-Antispam-Report-Untrusted: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AS8PR08MB6678.eurprd08.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230031)(376005)(1800799015)(366007); DIR:OUT; SFP:1102; X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS2PR08MB8502 X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: AM4PEPF00027A63.eurprd04.prod.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: febf995d-9893-4d5e-77f3-08dc58988695 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: CDVV07rWMrrZ3rZk6m2h3ZWOQFpPGgUqYYlfSgu4Dq4TY07A6rAHUMBu8MiAm0wjRK3MerP8HG8ZSXHhV/8aUbcYlGHZV2R1BdydqO8GsxDeXUYaABx04ikBXlnSIFSMajUpEz/nswYduy3x4+HSUQz1XtY43MPpU1lbymjk2wCMeRmCH5by1tVKm/fKySpn9qCZcKCTgRrppnyVPFP3ZF6+do48Jj7BSHLc5ObiBzqLNqdTPLJgr0rUqxmbOSlTPCI2kM+BfWclXnoUOhlUcsht6Huq6FFIjqUcA1MuIbI9nigvqTyTLE0ycnggIlO1xwMimnPmdaDapiNjfWOIPSSptkFPK6+zDBIOajJZ2hStVv5B1WQoBC7yBD9TI9cmJ8teT/t6AXjdCGtrQLNcrgyc1KxtC0uLAshah+rWvCk/Ux3BFNSFVVjj3A2UxMX+2rgD+nQCs4DO9E++1cBnZz7XhthHJO5ESi24RAPWlcPmvzeNU8n5tjMd2kGym2Rmlke8Iz5e0qWkW2K8xcaRAGn0ZvlDg2ACv6ONQhawLURZhuWCuNxtgBKlyamTQmoGk99wB2v9pGAuWUtujQEv8OZjKh0ozP39NRwbbAaTs9l/C+0dEH3/G2mpDdANPxnzdHXEbW0WU4qJW2fzZbOs9zbBk/waYVeicVNBdS8Weu6YvOwNG5np7iznYlcINyZb0RNuu5kMlDG/6jYRsvr5JUWmdwt5XHkdBlf8XGMMOnUu0FKsTYhDEzxg/OjGOue+ X-Forefront-Antispam-Report: CIP:63.35.35.123; CTRY:IE; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:64aa7808-outbound-1.mta.getcheckrecipient.com; PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com; CAT:NONE; SFS:(13230031)(376005)(82310400014)(1800799015)(36860700004); DIR:OUT; SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Apr 2024 13:25:29.5514 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: febf995d-9893-4d5e-77f3-08dc58988695 X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d; Ip=[63.35.35.123]; Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com] X-MS-Exchange-CrossTenant-AuthSource: AM4PEPF00027A63.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS1PR08MB7612 X-Spam-Status: No, score=-12.0 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, FORGED_SPF_HELO, GIT_PATCH_0, KAM_DMARC_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_PASS, SPF_NONE, TXREP, UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list <gcc-patches.gcc.gnu.org> List-Unsubscribe: <https://gcc.gnu.org/mailman/options/gcc-patches>, <mailto:gcc-patches-request@gcc.gnu.org?subject=unsubscribe> List-Archive: <https://gcc.gnu.org/pipermail/gcc-patches/> List-Post: <mailto:gcc-patches@gcc.gnu.org> List-Help: <mailto:gcc-patches-request@gcc.gnu.org?subject=help> List-Subscribe: <https://gcc.gnu.org/mailman/listinfo/gcc-patches>, <mailto:gcc-patches-request@gcc.gnu.org?subject=subscribe> Errors-To: gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org |
Series | aarch64: FMV feature list fixes | |
Checks
Context | Check | Description |
---|---|---|
linaro-tcwg-bot/tcwg_gcc_build--master-arm | success | Testing passed |
linaro-tcwg-bot/tcwg_gcc_check--master-arm | success | Testing passed |
linaro-tcwg-bot/tcwg_gcc_build--master-aarch64 | success | Testing passed |
Commit Message
Andrew Carlotti
April 9, 2024, 1:25 p.m. UTC
There was an assumption in some places that the aarch64_fmv_feature_data array contained FEAT_MAX elements. While this assumption held up till now, it is safer and more flexible to use the array size directly. gcc/ChangeLog: * config/aarch64/aarch64.cc (compare_feature_masks): Use ARRAY_SIZE to determine iteration bounds. (aarch64_mangle_decl_assembler_name): Ditto.
Comments
Andrew Carlotti <andrew.carlotti@arm.com> writes: > There was an assumption in some places that the aarch64_fmv_feature_data > array contained FEAT_MAX elements. While this assumption held up till > now, it is safer and more flexible to use the array size directly. > > gcc/ChangeLog: > > * config/aarch64/aarch64.cc (compare_feature_masks): > Use ARRAY_SIZE to determine iteration bounds. > (aarch64_mangle_decl_assembler_name): Ditto. > > > diff --git a/gcc/config/aarch64/aarch64.cc b/gcc/config/aarch64/aarch64.cc > index 1ea84c8bd7386e399f6ffa3a5e36408cf8831fc6..5de842fcc212c78beba1fa99639e79562d718579 100644 > --- a/gcc/config/aarch64/aarch64.cc > +++ b/gcc/config/aarch64/aarch64.cc > @@ -19899,7 +19899,8 @@ compare_feature_masks (aarch64_fmv_feature_mask mask1, > auto diff_mask = mask1 ^ mask2; > if (diff_mask == 0ULL) > return 0; > - for (int i = FEAT_MAX - 1; i > 0; i--) > + static const int num_features = ARRAY_SIZE (aarch64_fmv_feature_data); There doesn't seem any need for this to be static (or const). Same for the second hunk. > + for (int i = num_features - 1; i > 0; i--) Pre-existing, but is > 0 rather than >= 0 deliberate? Shouldn't we look at index 0 as well? LGTM otherwise. Thanks, Richard > { > auto bit_mask = aarch64_fmv_feature_data[i].feature_mask; > if (diff_mask & bit_mask) > @@ -19982,7 +19983,8 @@ aarch64_mangle_decl_assembler_name (tree decl, tree id) > > name += "._"; > > - for (int i = 0; i < FEAT_MAX; i++) > + static const int num_features = ARRAY_SIZE (aarch64_fmv_feature_data); > + for (int i = 0; i < num_features; i++) > { > if (feature_mask & aarch64_fmv_feature_data[i].feature_mask) > {
On Tue, Apr 09, 2024 at 04:33:10PM +0100, Richard Sandiford wrote: > Andrew Carlotti <andrew.carlotti@arm.com> writes: > > There was an assumption in some places that the aarch64_fmv_feature_data > > array contained FEAT_MAX elements. While this assumption held up till > > now, it is safer and more flexible to use the array size directly. > > > > gcc/ChangeLog: > > > > * config/aarch64/aarch64.cc (compare_feature_masks): > > Use ARRAY_SIZE to determine iteration bounds. > > (aarch64_mangle_decl_assembler_name): Ditto. > > > > > > diff --git a/gcc/config/aarch64/aarch64.cc b/gcc/config/aarch64/aarch64.cc > > index 1ea84c8bd7386e399f6ffa3a5e36408cf8831fc6..5de842fcc212c78beba1fa99639e79562d718579 100644 > > --- a/gcc/config/aarch64/aarch64.cc > > +++ b/gcc/config/aarch64/aarch64.cc > > @@ -19899,7 +19899,8 @@ compare_feature_masks (aarch64_fmv_feature_mask mask1, > > auto diff_mask = mask1 ^ mask2; > > if (diff_mask == 0ULL) > > return 0; > > - for (int i = FEAT_MAX - 1; i > 0; i--) > > + static const int num_features = ARRAY_SIZE (aarch64_fmv_feature_data); > > There doesn't seem any need for this to be static (or const). Same for > the second hunk. Agreed - I'll fix that, and the other instance I added in a previous patch. I originally copied this pattern from my driver-aarch64.c:252, which was added by Kyrill back in 2015. > > + for (int i = num_features - 1; i > 0; i--) > > Pre-existing, but is > 0 rather than >= 0 deliberate? Shouldn't we look > at index 0 as well? That was probably left over from when "default" was handled as part of the list. I think a different instance of this mistake was mentioned in a previous review. I'll fix this mistake and add a test. > LGTM otherwise. > > Thanks, > Richard > > > { > > auto bit_mask = aarch64_fmv_feature_data[i].feature_mask; > > if (diff_mask & bit_mask) > > @@ -19982,7 +19983,8 @@ aarch64_mangle_decl_assembler_name (tree decl, tree id) > > > > name += "._"; > > > > - for (int i = 0; i < FEAT_MAX; i++) > > + static const int num_features = ARRAY_SIZE (aarch64_fmv_feature_data); > > + for (int i = 0; i < num_features; i++) > > { > > if (feature_mask & aarch64_fmv_feature_data[i].feature_mask) > > {
diff --git a/gcc/config/aarch64/aarch64.cc b/gcc/config/aarch64/aarch64.cc index 1ea84c8bd7386e399f6ffa3a5e36408cf8831fc6..5de842fcc212c78beba1fa99639e79562d718579 100644 --- a/gcc/config/aarch64/aarch64.cc +++ b/gcc/config/aarch64/aarch64.cc @@ -19899,7 +19899,8 @@ compare_feature_masks (aarch64_fmv_feature_mask mask1, auto diff_mask = mask1 ^ mask2; if (diff_mask == 0ULL) return 0; - for (int i = FEAT_MAX - 1; i > 0; i--) + static const int num_features = ARRAY_SIZE (aarch64_fmv_feature_data); + for (int i = num_features - 1; i > 0; i--) { auto bit_mask = aarch64_fmv_feature_data[i].feature_mask; if (diff_mask & bit_mask) @@ -19982,7 +19983,8 @@ aarch64_mangle_decl_assembler_name (tree decl, tree id) name += "._"; - for (int i = 0; i < FEAT_MAX; i++) + static const int num_features = ARRAY_SIZE (aarch64_fmv_feature_data); + for (int i = 0; i < num_features; i++) { if (feature_mask & aarch64_fmv_feature_data[i].feature_mask) {