From patchwork Thu Oct 24 12:54:48 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alfie Richards X-Patchwork-Id: 99488 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 8C7B6385840E for ; Thu, 24 Oct 2024 12:56:30 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from EUR02-AM0-obe.outbound.protection.outlook.com (mail-am0eur02on20617.outbound.protection.outlook.com [IPv6:2a01:111:f403:2606::617]) by sourceware.org (Postfix) with ESMTPS id AB9EB3858C33 for ; Thu, 24 Oct 2024 12:55:39 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org AB9EB3858C33 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 AB9EB3858C33 Authentication-Results: server2.sourceware.org; arc=pass smtp.remote-ip=2a01:111:f403:2606::617 ARC-Seal: i=3; a=rsa-sha256; d=sourceware.org; s=key; t=1729774545; cv=pass; b=REr24mDCppHz68FlyaE46yAcigjUedMbfawGND6/zqh/tzW/7cw43JWDzz834JivfIvwEE1GvoBdiubhBf6u/BMeZhy2dmEOve76GbxWL5MynvlaNpw3a0CN3JV446fyzW1C5C4Gt53jNa3WbddpDgs0xwX++Or7B+ywxz/YWss= ARC-Message-Signature: i=3; a=rsa-sha256; d=sourceware.org; s=key; t=1729774545; c=relaxed/simple; bh=9zxAH0eTLvIvbWw6qFArAbBgtPk53PI6tjVrLLqSrDw=; h=DKIM-Signature:DKIM-Signature:From:To:Subject:Date:Message-ID: MIME-Version; b=CUuFZbyrWHj/4voEjQZsPftg1lcqUFYoUUK+bU5XoJ5LiDpKgagWbEn24m+Hym/uSxbBTwN4QTTAITBvEF5hlrRivkbjFz5YpaPcyTSiL35fqIPai/6mKMcGxdixxtYkqo5YOFYlwcB5CjsVSs1Lvr0MwQKmjXtZiMHJTnRMfnI= ARC-Authentication-Results: i=3; server2.sourceware.org ARC-Seal: i=2; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=pass; b=YwNcRH+FbsnIl5LhK4oRat2KCxXrDZ9XiTUU9WbjTeejy1ybOf483BFHsAO4wIFtnmK6zA1rALVov+APBaTf+UH0aOWfpBiuXQh972IcyYKdTpkF8Rd7PUG4EpCSOyjRqdjg+TKat6cs7l+FiZa1RttKrjCyMamlpFIlsy9G66KTrxPSv1I7cudPgrx9YagUkx/vnPaa5F4SEdkSGOomSrMiKCSLUsY8t3NLjEIWMhUrhwKU/E90DTg56VQ1ouxpA4+5TIVNyXSX66LWvvi/tvFpYUO2rXWYBPP9xb8h/N9ekkCklLCX1OpDCapyIQ9FqoS/a6xnGgcQt7lqXYmb6w== ARC-Message-Signature: i=2; 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=WrLe4N7516h4PXvqS/O5aeT7DVslTof1EOB+sGrOPVI=; b=EtdPgdkRV+yuvOUuRkh1ylmvS28TXtxkG96Fl2oMOAHpVc2jlcK0CR3Y1ICXwbZMpMKb8CQenr5JOf2Vu7qkShlYX24t/hE4Vywlxy813wf/J59ZLo49r48tZm6Q0DJsjb37CjKnQcV0gTO+MupTp52R0I8KNG7pK8qRE6yO+eDbDPZhHpS6mhoS1Bz5VNsGAdx0Oe9LRnL9MFkOu4hWDehJxXq+tRshNFGqcPKHJCw9gfALHnA5StBMPUOckjbUSJXx8AOEq1e/TrTxU8VXgm1HG1WfuVvrr6BV4nsCaifHPMm8Y5yb8xw10R4g4AMa2tszyXuOr8/EN4CQU5YVUQ== 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=arm.com; arc=pass (0 oda=1 ltdi=1 spf=[1,1,smtp.mailfrom=arm.com] dmarc=[1,1,header.from=arm.com]) 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=WrLe4N7516h4PXvqS/O5aeT7DVslTof1EOB+sGrOPVI=; b=no2pp7zRiaIN9EtMM+dpJh+8IHfToqcAZ/MrGKrw+G7V5r+Dntt0OBYFIFBSicXwaug8x17wr9VRpLMJ5bwtz6gA67aWd809O+iGi9KG1W+3d6tkN5zuTBtbo8WxYGRLqwwuzDJxV54F8fvfJL6Ec12Ekm40h4teo0RfayEC+aE= Received: from AS9PR06CA0477.eurprd06.prod.outlook.com (2603:10a6:20b:49a::32) by PA4PR08MB7385.eurprd08.prod.outlook.com (2603:10a6:102:2a0::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8093.20; Thu, 24 Oct 2024 12:55:32 +0000 Received: from AMS0EPF00000194.eurprd05.prod.outlook.com (2603:10a6:20b:49a:cafe::e) by AS9PR06CA0477.outlook.office365.com (2603:10a6:20b:49a::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8005.23 via Frontend Transport; Thu, 24 Oct 2024 12:55:32 +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=arm.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 AMS0EPF00000194.mail.protection.outlook.com (10.167.16.214) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.8093.14 via Frontend Transport; Thu, 24 Oct 2024 12:55:30 +0000 Received: ("Tessian outbound 4f9bb016c0c5:v490"); Thu, 24 Oct 2024 12:55:30 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 3881650b25618e81 X-TessianGatewayMetadata: IiNC7CWtipiKWLku3gqCvmP4DTL/zpA777HW4O1k5B8ST/W/DcW9MmSOqIzGY7LacGg3MumLTtl+USkaC1mzfN33jFdDbJMbjZP6PezT6lUEJ9MPrZ3OVWyLTKABXPrDiYK9xeYSqszE5/MBRrvowqOb4rZy7C19iU3KcCLxCJ8= X-CR-MTA-TID: 64aa7808 Received: from Lda27a6499955.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 8E7B9B72-1941-4681-B7CB-9F096CD5B299.1; Thu, 24 Oct 2024 12:55:19 +0000 Received: from EUR05-AM6-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id Lda27a6499955.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Thu, 24 Oct 2024 12:55:19 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=nQ1nGn3rlgVWflNGe/8WzarsGB1EyXo9yBO4TehdIh8ch4zMFz6ET97mNzqhNvycTGmB7hZ693fCC+6Kk0WiumwqyfEd3Yu6w8eHTkOpYN9/ZFHWE8SD0Z8auH8PUPzgJhbj15p6lBNDcvQIJ4ejf6PLY9QfmtHgNNwhgbdpJkmTzFO5obJZgxPRJOBZAxCUjn3rEcaqNlXsUdawixaSrZ8gSyPqcpHwjylapMrh+xYsbJUr7fMOLKiStuZsPZg1Z/OegPSzL7LJM+3cBoBR5vPhCqgEFIpaw0w+ErfIsu67slVGDE6raox6of/R5verMkbogWOEZTEgzws1mYpXKg== 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=WrLe4N7516h4PXvqS/O5aeT7DVslTof1EOB+sGrOPVI=; b=i81RKFQafoxzzv2r66c5y+sMVkTnIY55/Kew1ts8tMtL6kGeg59YYGupCX3arJzoF4q3deu064TMvC7QcABUyPDOy8aXIh4hx2jvUKp7mamZ0BNpxEv/ykuvqWLu5gp68+UAFaF7xYRWVJOC4q3Sw7WscmwdHyjDocGAcQ3W/PSSMNSso1c/66s4Ar7OlkPxNlbLmcLl0bwCAkeU4C8cmsRhE+gZD6XI/8NZ5DLo1bRXq5mtl5BEZ7XpSVopF+aQ99ieXYhXU8tM7FsSAx2iUExmE4xpdpHketCsYbvzXXt9nm4hHtjO9PCozET0YRP7gbg0OKtT+2y6SsUx8Yi8TA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 40.67.248.234) smtp.rcpttodomain=gcc.gnu.org smtp.mailfrom=arm.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=none (message not signed); arc=none (0) 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=WrLe4N7516h4PXvqS/O5aeT7DVslTof1EOB+sGrOPVI=; b=no2pp7zRiaIN9EtMM+dpJh+8IHfToqcAZ/MrGKrw+G7V5r+Dntt0OBYFIFBSicXwaug8x17wr9VRpLMJ5bwtz6gA67aWd809O+iGi9KG1W+3d6tkN5zuTBtbo8WxYGRLqwwuzDJxV54F8fvfJL6Ec12Ekm40h4teo0RfayEC+aE= Received: from DU6P191CA0063.EURP191.PROD.OUTLOOK.COM (2603:10a6:10:53e::19) by AM8PR08MB6403.eurprd08.prod.outlook.com (2603:10a6:20b:355::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8093.20; Thu, 24 Oct 2024 12:55:16 +0000 Received: from DB1PEPF000509E7.eurprd03.prod.outlook.com (2603:10a6:10:53e:cafe::93) by DU6P191CA0063.outlook.office365.com (2603:10a6:10:53e::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8093.18 via Frontend Transport; Thu, 24 Oct 2024 12:55:16 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 40.67.248.234) smtp.mailfrom=arm.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 40.67.248.234 as permitted sender) receiver=protection.outlook.com; client-ip=40.67.248.234; helo=nebula.arm.com; pr=C Received: from nebula.arm.com (40.67.248.234) by DB1PEPF000509E7.mail.protection.outlook.com (10.167.242.57) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.8093.14 via Frontend Transport; Thu, 24 Oct 2024 12:55:16 +0000 Received: from AZ-NEU-EXJ01.Arm.com (10.240.25.132) by AZ-NEU-EX04.Arm.com (10.251.24.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Thu, 24 Oct 2024 12:55:15 +0000 Received: from AZ-NEU-EX04.Arm.com (10.251.24.32) by AZ-NEU-EXJ01.Arm.com (10.240.25.132) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Thu, 24 Oct 2024 12:55:14 +0000 Received: from ip-10-248-139-135.eu-west-1.compute.internal (10.252.78.54) by AZ-NEU-EX04.Arm.com (10.251.24.32) with Microsoft SMTP Server id 15.1.2507.39 via Frontend Transport; Thu, 24 Oct 2024 12:55:14 +0000 From: To: CC: , , Alfie Richards Subject: [PATCH v2 1/1] C: Support Function multiversionsing in the C front end Date: Thu, 24 Oct 2024 12:54:48 +0000 Message-ID: <20241024125448.4426-2-alfie.richards@arm.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241024125448.4426-1-alfie.richards@arm.com> References: <20241024125448.4426-1-alfie.richards@arm.com> MIME-Version: 1.0 X-EOPAttributedMessage: 1 X-MS-TrafficTypeDiagnostic: DB1PEPF000509E7:EE_|AM8PR08MB6403:EE_|AMS0EPF00000194:EE_|PA4PR08MB7385:EE_ X-MS-Office365-Filtering-Correlation-Id: 33b9a9d8-4705-4f96-63f4-08dcf42b2418 x-checkrecipientrouted: true NoDisclaimer: true X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; ARA:13230040|82310400026|36860700013|1800799024|376014; X-Microsoft-Antispam-Message-Info-Original: R25AzM6NQmnkH58RBZPh91VzEw3t8+Lo4MsYW/T/Ch+Zqp12NaWgTiUA1f3y7q6Cl+c0g2jJMPWEGwABe7LCBdvQbwQEc7RPXXEfCG/LiQqT9EVt9VHVJRDEHULNHATw0VDht3Q/YfUZqMU+vhXFLcOAxl8aqcPOv11p8vuNY/1RD5Kfe0hve2dpy7vd8DYnDovyB02RbfOP3KCO0Ux1ltgsPKiNxChOWNl38YYtg0AVJemBSxNSD29Gs9hjKDERVMfIpPC7UEUzGy5LcCud3D1LuCzTT1u5bSWXgLpKRbcTywr7NWg8PY1j4maYjPBlHvJdkKnAEMJzbtiihQUTxmViLrmSutQZ8iUPwgwcI3KFD4h6KW/BsBD/x7kMd6TySDtWmtJfFRg7YoYxpk1g/nSV4Qg9TikEyXWKh+Ov6iFy0CJPfoTdX0U4/Hit5E93EjBxQqaQprcaV50KfdahZg/48HJYxbuCM3L2FpiksZJQLeOQfUgrmdxSk5I/Ev147EMSAPe3lPAFfXCQl+QQGZd7p7ExAHumJKIxZWykHuFEnzyjbtjfvbCPLWV9IjRM7ylx84+Cyp17i2wK8baXovu0BHG2QCs8buINML3QrN5X7yd1uqJATjkMbHC8C8JY/aPLwXS55c1n0ljZc91J+b+Xl7S7Rh8k1fPo6Oqxsu4SaH66+0U564mCSNTFpHXNjt5bndXeJ70MkP6wPL7PXDXpBA8DeblWaxvtLD3G3wQdg4jdduzOn4jA0XsNqgE2hkoEcvReuRmfvEnC+TPuogbQlTG2zt1s3MB/ZtMt0y63ZeSar5P3xibdne/b+dM/b7dB7yJzMFbZHW1W08R//oThBgD86JGJo+/wo9NZ8xhqI9/g7erZWvNRepTi7F4EKNu/vIZbQ3xm22ep55SXtphqTEuRdd0pjwu4uotApJshYpvj5dOPcBcBTBCRAzKmWcEJ08YsMcV6bSkkgwijRoHT69f0sV+N8ySU9RIy9j1nnqWqoxNw7LghkHGvTUJgtOTu8WpjEIm69unLklAXcl36/mHdLiFIkX/sdv9DGAS8xeRthgtLLjJMF4n4WmFTzjrtb8t6A6Ru/5TB9D4T8kLqXcyTU3qWnbNfcxq7xDxMSxq1das6i7CrDIxrg+/H7DNKFXja5Lue4Az+DWFPWjSPi9h5aVKUCMioysAWHu6NWINz64+uhuB9nes3nZLs9j2zscvk7bgfSoykBLqTI8+tbtPHQNq6itxSikMDwSEUDm/KctRQgTyrJ5HMIFJCfseJ2N1uiFJpwVPiVghFYL/z7mUfJPb96XOOlkzLT14at/TTk2UhFOLKNZGSrgrK7mWOQhawJbWRN0idivjJGh+2jSLlPM44CN3u+2hj42R7V4B0enZdJ9SImZx5CuYk X-Forefront-Antispam-Report-Untrusted: CIP:40.67.248.234; CTRY:IE; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:nebula.arm.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230040)(82310400026)(36860700013)(1800799024)(376014); DIR:OUT; SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM8PR08MB6403 X-MS-Exchange-SkipListedInternetSender: ip=[2603:10a6:10:53e::19]; domain=DU6P191CA0063.EURP191.PROD.OUTLOOK.COM X-MS-Exchange-Transport-CrossTenantHeadersStripped: AMS0EPF00000194.eurprd05.prod.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 269c123a-c254-4837-4897-08dcf42b1bbe X-Microsoft-Antispam: BCL:0; ARA:13230040|35042699022|1800799024|376014|36860700013|82310400026; X-Microsoft-Antispam-Message-Info: =?utf-8?q?WmfWRyAw0vXbw69czlXwVfjcOl5W5rs?= =?utf-8?q?SqMm0MMc/Kf+GZdGs4nRQn0j2Si9zsyVUmK7EtOTeYZF8hNRHZA9fV5IWZH1Fiiy/?= =?utf-8?q?wZfGyXk4gThyyPuEXZL+5+PL0vQVJTFOQko9Q5O2SIsdF9FW/DynCxGAo57hsAdoC?= =?utf-8?q?H/qRjlI/Ltzp8wu/HFK7n7W9kSpbxMWWJsh1iOv4jbekrf08BUEv9e64oMj4CDF1m?= =?utf-8?q?DZKlmjznuPq0eJ7Ge1q4VFpZhcWU7Jsj6b19CwmqzbmLcWBZr7117sFm8qiDjJcve?= =?utf-8?q?oR/VkAzB7YHP8An7DW/gdQNA6YNkKky5dND1IKTA0yCa8oA28FLbBcnkna8vcPMZY?= =?utf-8?q?oDW8DVit34rjmYEeekhp7TU0UO7IAeG213vm9gLysCIRMSMrAgMlNziaAfFfv0BFF?= =?utf-8?q?yWI4688B2ZauYact96/wia/guSyKrASgNuky4BB4r0FwPC2H87jvDlkpBAhkMej/L?= =?utf-8?q?FI5PYNxFGovzHJXksD9v99WMlhmYYRMNBewamEkvCfx1tlUOndWAIpg6ABzwnnvfj?= =?utf-8?q?8qNZhhXg3Z3aJOm01ZFr88aufQhXMbG1L22sJfYlf6gZbPg5/Tq3k/9kRX9ha3MXw?= =?utf-8?q?hiPyxOjEjIOB/VtX2XyvCG2VQ3gCCFnIo+zs8TlAmCTYR610uw91RnCXHClNxunJm?= =?utf-8?q?9FbvC/u8x31oepe4QfASkv0fSUkSOQ9V/ZLl/9bXusb7+3jV8YhW+zDSLgtEeUefY?= =?utf-8?q?Qwy4XqkP8TC3mU/FcuWCZgUUVVl4gPg0nLC8qJ9LQiDhGZqrGLzUST7xSynIe+MTZ?= =?utf-8?q?5Iww0ctRu7HmdRlL4IgWqBLcJTGVSTz3rb4ivyMNQnSh9GRIP5LzGvWax7+lOvf0k?= =?utf-8?q?Aj3/v+wiATo5K/eE8UyZgrlqGgL54f9QWdJ2OVwJCB5EqcfIy5XMm0dc5vAvROcso?= =?utf-8?q?15f0fOBj8oq0jUhYegpQWsanf/xQGI22eER6mJBaFxLuFcOH2+IyeGI6WZbCN0hPD?= =?utf-8?q?RghS5YuJPEh7Q8cJqOOW2fQUL2I1Pb81mNIOXFVakKKnWqRvVyMM9fwymijfCMfJW?= =?utf-8?q?R5crgpxs5ETPZT2vf3w8gtDe3I/wLzZ9yE/JhTvsFVz5+cqzamLB69Z/eJ1miSSIZ?= =?utf-8?q?bhYYyY/suhQbRsyF25PZMiEQlpmxzkON5zvi1xxuPx9fAI//PHsHo3M8AnFskCwVr?= =?utf-8?q?vu++Cmx30rsWMyNFY1M4xPsjCh+FB+/ki40KexQFX4pE3sdaf9CKHgCDbtRb3ksQh?= =?utf-8?q?RCFBkRziGVYpwcKsPdvc4T2TdREa0+w9obCe9+HnB2kV+5jA6mCxjy7fHTrgLfXaw?= =?utf-8?q?DvVfl5Swr5lBASmcF5LxwOA/bvsTboGQbigd0/BigtZEnoKBxGGI/cFtxHp9ASikR?= =?utf-8?q?yvxm6vG7zTjy?= 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:(13230040)(35042699022)(1800799024)(376014)(36860700013)(82310400026); DIR:OUT; SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Oct 2024 12:55:30.5492 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 33b9a9d8-4705-4f96-63f4-08dcf42b2418 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: AMS0EPF00000194.eurprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PA4PR08MB7385 X-Spam-Status: No, score=-11.4 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FORGED_SPF_HELO, GIT_PATCH_0, KAM_SHORT, 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces~patchwork=sourceware.org@gcc.gnu.org This patch adds support for `target_version` function multiversioning to the C frontend, specifically intended for enabling this for Aarch64 targets. The functionality and behavior matches the CPP frontend. This is likely to need to be changed later down the line for Aarch64 targets to match the updated ACLE details but that is future work. Note, in particular this adds a call to process_same_body_aliases to the C frontend. this function is seems to be intended to be used in the CPP and D frontends. However, not calling this function was meaning cpp_implicit_aliases_done was false for the C cgraph nodes and then references to the dispatched symbol were not being resolved resulting in the nodes getting deleted and a segfault later. I experimented with this patch on X86 and found that the assembler produces a duplicate symbol error. I would like input from relevant teams if there is interest in supporting this for their backends. gcc/c-family/ChangeLog: * c-gimplify.cc (c_gimplify_expr): Process calls to FMV functions. gcc/c/ChangeLog: * c-decl.cc (maybe_mark_function_versioned): New function. (diagnose_mismatched_decls): Add logic for target_version functions. (duplicate_decls): Add logic to differentiate target_version functions. (c_parse_final_cleanups): Add call to process_same_body_aliases. gcc/ChangeLog: * calls.cc (get_c_function_version_dispatcher): New function. * calls.h (get_c_function_version_dispatcher): New function. gcc/testsuite/ChangeLog: * g++.target/aarch64/mv-symbols6.C: New test. * gcc.target/aarch64/mv-1.c: New test. * gcc.target/aarch64/mv-symbols1.c: New test. * gcc.target/aarch64/mv-symbols2.c: New test. * gcc.target/aarch64/mv-symbols3.c: New test. * gcc.target/aarch64/mv-symbols4.c: New test. * gcc.target/aarch64/mv-symbols5.c: New test. * gcc.target/aarch64/mv-symbols6.c: New test. * gcc.target/aarch64/mvc-symbols1.c: New test. * gcc.target/aarch64/mvc-symbols2.c: New test. * gcc.target/aarch64/mvc-symbols3.c: New test. * gcc.target/aarch64/mvc-symbols4.c: New test. This has been reg tested on Aarch64 and X86, and bootstrapped for aarch64-none-linux-gnu and x86_64-unknown-linux-gnu. OK for master? --- gcc/c-family/c-gimplify.cc | 11 ++++ gcc/c/c-decl.cc | 63 ++++++++++++++++++- gcc/calls.cc | 23 +++++++ gcc/calls.h | 1 + .../g++.target/aarch64/mv-symbols6.C | 16 +++++ gcc/testsuite/gcc.target/aarch64/mv-1.c | 39 ++++++++++++ .../gcc.target/aarch64/mv-symbols1.c | 37 +++++++++++ .../gcc.target/aarch64/mv-symbols2.c | 28 +++++++++ .../gcc.target/aarch64/mv-symbols3.c | 26 ++++++++ .../gcc.target/aarch64/mv-symbols4.c | 29 +++++++++ .../gcc.target/aarch64/mv-symbols5.c | 35 +++++++++++ .../gcc.target/aarch64/mv-symbols6.c | 17 +++++ .../gcc.target/aarch64/mvc-symbols1.c | 25 ++++++++ .../gcc.target/aarch64/mvc-symbols2.c | 16 +++++ .../gcc.target/aarch64/mvc-symbols3.c | 19 ++++++ .../gcc.target/aarch64/mvc-symbols4.c | 12 ++++ 16 files changed, 396 insertions(+), 1 deletion(-) create mode 100644 gcc/testsuite/g++.target/aarch64/mv-symbols6.C create mode 100644 gcc/testsuite/gcc.target/aarch64/mv-1.c create mode 100644 gcc/testsuite/gcc.target/aarch64/mv-symbols1.c create mode 100644 gcc/testsuite/gcc.target/aarch64/mv-symbols2.c create mode 100644 gcc/testsuite/gcc.target/aarch64/mv-symbols3.c create mode 100644 gcc/testsuite/gcc.target/aarch64/mv-symbols4.c create mode 100644 gcc/testsuite/gcc.target/aarch64/mv-symbols5.c create mode 100644 gcc/testsuite/gcc.target/aarch64/mv-symbols6.c create mode 100644 gcc/testsuite/gcc.target/aarch64/mvc-symbols1.c create mode 100644 gcc/testsuite/gcc.target/aarch64/mvc-symbols2.c create mode 100644 gcc/testsuite/gcc.target/aarch64/mvc-symbols3.c create mode 100644 gcc/testsuite/gcc.target/aarch64/mvc-symbols4.c diff --git a/gcc/c-family/c-gimplify.cc b/gcc/c-family/c-gimplify.cc index 09ea1b79159..d288303d118 100644 --- a/gcc/c-family/c-gimplify.cc +++ b/gcc/c-family/c-gimplify.cc @@ -43,6 +43,7 @@ along with GCC; see the file COPYING3. If not see #include "context.h" #include "tree-pass.h" #include "internal-fn.h" +#include "calls.h" /* The gimplification pass converts the language-dependent trees (ld-trees) emitted by the parser into language-independent trees @@ -904,6 +905,16 @@ c_gimplify_expr (tree *expr_p, gimple_seq *pre_p ATTRIBUTE_UNUSED, case CALL_EXPR: { tree fndecl = get_callee_fndecl (*expr_p); + + /* Change any calls to a multiversioned function to instead + * be a call to the dispatched symbol. */ + if (fndecl && DECL_FUNCTION_VERSIONED (fndecl)) + if (tree dis = get_c_function_version_dispatcher (fndecl)) + { + dis = build_fold_addr_expr_loc (EXPR_LOCATION (dis), dis); + CALL_EXPR_FN (*expr_p) = dis; + } + if (fndecl && fndecl_built_in_p (fndecl, BUILT_IN_CLZG, BUILT_IN_CTZG) && call_expr_nargs (*expr_p) == 2 diff --git a/gcc/c/c-decl.cc b/gcc/c/c-decl.cc index 1827bbf0646..686283cced6 100644 --- a/gcc/c/c-decl.cc +++ b/gcc/c/c-decl.cc @@ -62,6 +62,7 @@ along with GCC; see the file COPYING3. If not see #include "omp-general.h" #include "omp-offload.h" /* For offload_vars. */ #include "c-parser.h" +#include "tree.h" #include "tree-pretty-print.h" @@ -2098,6 +2099,22 @@ previous_tag (tree type) return NULL_TREE; } +/* Subroutine to mark functions as versioned when using the attribute + 'target_version'. */ + +static void +maybe_mark_function_versioned (tree decl) +{ + if (!DECL_FUNCTION_VERSIONED (decl)) + { + DECL_FUNCTION_VERSIONED (decl) = true; + + tree mangled_name + = targetm.mangle_decl_assembler_name (decl, DECL_NAME (decl)); + SET_DECL_ASSEMBLER_NAME (decl, mangled_name); + } +} + /* Subroutine of duplicate_decls. Compare NEWDECL to OLDDECL. Returns true if the caller should proceed to merge the two, false if OLDDECL should simply be discarded. As a side effect, issues @@ -2418,7 +2435,39 @@ diagnose_mismatched_decls (tree newdecl, tree olddecl, } } - if (DECL_INITIAL (newdecl)) + if ((DECL_INITIAL (newdecl) || DECL_EXTERNAL (newdecl)) + && (DECL_INITIAL (olddecl) || DECL_EXTERNAL (olddecl)) + && targetm.target_option.function_versions (newdecl, olddecl)) + { + /* Check if we are dealing with Function Multi Versioning using + the 'target_version' attribute. */ + tree olddecl_args = TYPE_ARG_TYPES (TREE_TYPE (olddecl)); + tree newdecl_args = TYPE_ARG_TYPES (TREE_TYPE (newdecl)); + /* Function Multi Versioned functions need to have the same + prototype and the target must support these too, otherwise + error. + TODO: should we be checking any other properties? */ + if (!comptypes (TREE_TYPE (olddecl), TREE_TYPE (newdecl)) + || !comptypes (olddecl_args, newdecl_args)) + { + auto_diagnostic_group d; + error ("redefinition of %q+D", newdecl); + locate_old_decl (olddecl); + return false; + } + /* Only record if we are seeing either of these for the first + time. */ + bool record = (!DECL_FUNCTION_VERSIONED (newdecl) + || !DECL_FUNCTION_VERSIONED (olddecl)); + + maybe_mark_function_versioned (newdecl); + maybe_mark_function_versioned (olddecl); + + if (record) + cgraph_node::record_function_versions (olddecl, newdecl); + } + + else if (DECL_INITIAL (newdecl)) { if (DECL_INITIAL (olddecl)) { @@ -3191,6 +3240,14 @@ duplicate_decls (tree newdecl, tree olddecl) return false; } + /* If both new and old are Function Multi Versioned functions then they are + not duplicates. */ + if (TREE_CODE (newdecl) == FUNCTION_DECL + && TREE_CODE (olddecl) == FUNCTION_DECL + && DECL_FUNCTION_VERSIONED (newdecl) + && DECL_FUNCTION_VERSIONED (olddecl)) + return false; + merge_decls (newdecl, olddecl, newtype, oldtype); /* The NEWDECL will no longer be needed. @@ -13686,6 +13743,10 @@ c_parse_final_cleanups (void) c_write_global_declarations_1 (BLOCK_VARS (DECL_INITIAL (t))); c_write_global_declarations_1 (BLOCK_VARS (ext_block)); + /* Call this to set cpp_implicit_aliases_done on all nodes. This is + important for function multiversioning aliases to get resolved. */ + symtab->process_same_body_aliases (); + if (!in_lto_p) free_attr_access_data (); diff --git a/gcc/calls.cc b/gcc/calls.cc index c5c26f65280..09676a40fc8 100644 --- a/gcc/calls.cc +++ b/gcc/calls.cc @@ -5386,3 +5386,26 @@ cxx17_empty_base_field_p (const_tree field) && RECORD_OR_UNION_TYPE_P (TREE_TYPE (field)) && !lookup_attribute ("no_unique_address", DECL_ATTRIBUTES (field))); } + +/* Returns the decl of the dispatcher function if FN is a function version. */ + +tree +get_c_function_version_dispatcher (tree fn) +{ + tree dispatcher_decl = NULL; + + gcc_assert (TREE_CODE (fn) == FUNCTION_DECL + && DECL_FUNCTION_VERSIONED (fn)); + + gcc_assert (targetm.get_function_versions_dispatcher); + dispatcher_decl = targetm.get_function_versions_dispatcher (fn); + + if (dispatcher_decl == NULL) + { + error_at (input_location, "use of multiversioned function " + "without a default"); + return NULL; + } + + return dispatcher_decl; +} diff --git a/gcc/calls.h b/gcc/calls.h index 464a4e34e33..aa46853ba63 100644 --- a/gcc/calls.h +++ b/gcc/calls.h @@ -134,5 +134,6 @@ extern void maybe_complain_about_tail_call (tree, const char *); extern rtx rtx_for_static_chain (const_tree, bool); extern bool cxx17_empty_base_field_p (const_tree); +extern tree get_c_function_version_dispatcher (tree fn); #endif // GCC_CALLS_H diff --git a/gcc/testsuite/g++.target/aarch64/mv-symbols6.C b/gcc/testsuite/g++.target/aarch64/mv-symbols6.C new file mode 100644 index 00000000000..52105449e4a --- /dev/null +++ b/gcc/testsuite/g++.target/aarch64/mv-symbols6.C @@ -0,0 +1,16 @@ +/* { dg-do compile } */ +/* { dg-options "-O0" } */ + +__attribute__((target_version("default"))) +int foo () +{ + return 1; +} + +/* It is not overly clear what the correct behaviour is in this case. + This test serves more as a test of consistency for this case rather + than a test of correctness. */ + +/* { dg-final { scan-assembler-times "\n_Z3foov:\n" 1 } } */ +/* { dg-final { scan-assembler-times "\n_Z3foov\.default:\n" 0 } } */ +/* { dg-final { scan-assembler-times "\n_Z3foov\.resolver:\n" 0 } } */ diff --git a/gcc/testsuite/gcc.target/aarch64/mv-1.c b/gcc/testsuite/gcc.target/aarch64/mv-1.c new file mode 100644 index 00000000000..60d4985fec3 --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/mv-1.c @@ -0,0 +1,39 @@ +/* { dg-do compile } */ +/* { dg-options "-O0" } */ + +__attribute__((target_version("default"))) +int foo () +{ + return 1; +} + +__attribute__((target_version("rng"))) +int foo () +{ + return 1; +} + +__attribute__((target_version("flagm"))) +int foo () +{ + return 1; +} + +__attribute__((target_version("rng+flagm"))) +int foo () +{ + return 1; +} + +int bar() +{ + return foo (); +} + +/* Check usage of the first two FMV features, in case of off-by-one errors. */ +/* { dg-final { scan-assembler-times "\nfoo\.default:\n" 1 } } */ +/* { dg-final { scan-assembler-times "\nfoo\._Mrng:\n" 1 } } */ +/* { dg-final { scan-assembler-times "\nfoo\._MrngMflagm:\n" 1 } } */ +/* { dg-final { scan-assembler-times "\nfoo\._Mflagm:\n" 1 } } */ + +/* { dg-final { scan-assembler-times "\nfoo\.resolver:\n" 1 } } */ diff --git a/gcc/testsuite/gcc.target/aarch64/mv-symbols1.c b/gcc/testsuite/gcc.target/aarch64/mv-symbols1.c new file mode 100644 index 00000000000..b7a7bc2147a --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/mv-symbols1.c @@ -0,0 +1,37 @@ +/* { dg-do compile } */ +/* { dg-options "-O0" } */ + +// Basic case of fmv correctness with all functions and use in one TU. + +__attribute__((target_version("default"))) +int foo () +{ + return 1; +} + +__attribute__((target_version("dotprod"))) +int foo () +{ + return 3; +} +__attribute__((target_version("sve+sve2"))) +int foo () +{ + return 5; +} + +int bar() +{ + return foo (); +} + +/* When updating any of the symbol names in these tests, make sure to also + update any tests for their absence in mv-symbolsN.C */ + +/* { dg-final { scan-assembler-times "\nfoo\.default:\n" 1 } } */ +/* { dg-final { scan-assembler-times "\nfoo\._Mdotprod:\n" 1 } } */ +/* { dg-final { scan-assembler-times "\nfoo\._MsveMsve2:\n" 1 } } */ +/* { dg-final { scan-assembler-times "\nfoo\.resolver:\n" 1 } } */ +/* { dg-final { scan-assembler-times "\n\tbl\tfoo\n" 1 } } */ +/* { dg-final { scan-assembler-times "\n\t\.type\tfoo, %gnu_indirect_function\n" 1 } } */ +/* { dg-final { scan-assembler-times "\n\t\.set\tfoo,foo\.resolver\n" 1 } } */ diff --git a/gcc/testsuite/gcc.target/aarch64/mv-symbols2.c b/gcc/testsuite/gcc.target/aarch64/mv-symbols2.c new file mode 100644 index 00000000000..dfa9570da65 --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/mv-symbols2.c @@ -0,0 +1,28 @@ +/* { dg-do compile } */ +/* { dg-options "-O0" } */ + +// FMV correctness with definitions but no call + +__attribute__((target_version("default"))) +int foo () +{ + return 1; +} + +__attribute__((target_version("dotprod"))) +int foo () +{ + return 3; +} +__attribute__((target_version("sve+sve2"))) +int foo () +{ + return 5; +} + +/* { dg-final { scan-assembler-times "\nfoo\.default:\n" 1 } } */ +/* { dg-final { scan-assembler-times "\nfoo\._Mdotprod:\n" 1 } } */ +/* { dg-final { scan-assembler-times "\nfoo\._MsveMsve2:\n" 1 } } */ +/* { dg-final { scan-assembler-times "\nfoo\.resolver:\n" 0 } } */ +/* { dg-final { scan-assembler-times "\n\t\.type\tfoo, %gnu_indirect_function\n" 0 } } */ +/* { dg-final { scan-assembler-times "\n\t\.set\tfoo,foo\.resolver\n" 0 } } */ diff --git a/gcc/testsuite/gcc.target/aarch64/mv-symbols3.c b/gcc/testsuite/gcc.target/aarch64/mv-symbols3.c new file mode 100644 index 00000000000..c94610ab2da --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/mv-symbols3.c @@ -0,0 +1,26 @@ +/* { dg-do compile } */ +/* { dg-options "-O0" } */ + +// FMV correctness with declarations but no implementation + +__attribute__((target_version("default"))) +int foo (); + +__attribute__((target_version("dotprod"))) +int foo (); + +__attribute__((target_version("sve+sve2"))) +int foo (); + +int bar() +{ + return foo (); +} + +/* { dg-final { scan-assembler-times "\nfoo\.default:\n" 0 } } */ +/* { dg-final { scan-assembler-times "\nfoo\._Mdotprod:\n" 0 } } */ +/* { dg-final { scan-assembler-times "\nfoo\._MsveMsve2:\n" 0 } } */ +/* { dg-final { scan-assembler-times "\nfoo\.resolver:\n" 1 } } */ +/* { dg-final { scan-assembler-times "\n\tbl\tfoo\n" 1 } } */ +/* { dg-final { scan-assembler-times "\n\t\.type\tfoo, %gnu_indirect_function\n" 1 } } */ +/* { dg-final { scan-assembler-times "\n\t\.set\tfoo,foo\.resolver\n" 1 } } */ diff --git a/gcc/testsuite/gcc.target/aarch64/mv-symbols4.c b/gcc/testsuite/gcc.target/aarch64/mv-symbols4.c new file mode 100644 index 00000000000..25469d20c18 --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/mv-symbols4.c @@ -0,0 +1,29 @@ +/* { dg-do compile } */ +/* { dg-options "-O0" } */ + +// FMV correctness with a default implementation and declarations of other versions + +__attribute__((target_version("default"))) +int foo () +{ + return 1; +} + +__attribute__((target_version("dotprod"))) +int foo (); + +__attribute__((target_version("sve+sve2"))) +int foo (); + +int bar() +{ + return foo (); +} + +/* { dg-final { scan-assembler-times "\nfoo\.default:\n" 1 } } */ +/* { dg-final { scan-assembler-times "\nfoo\._Mdotprod:\n" 0 } } */ +/* { dg-final { scan-assembler-times "\nfoo\._MsveMsve2:\n" 0 } } */ +/* { dg-final { scan-assembler-times "\nfoo\.resolver:\n" 1 } } */ +/* { dg-final { scan-assembler-times "\n\tbl\tfoo\n" 1 } } */ +/* { dg-final { scan-assembler-times "\n\t\.type\tfoo, %gnu_indirect_function\n" 1 } } */ +/* { dg-final { scan-assembler-times "\n\t\.set\tfoo,foo\.resolver\n" 1 } } */ diff --git a/gcc/testsuite/gcc.target/aarch64/mv-symbols5.c b/gcc/testsuite/gcc.target/aarch64/mv-symbols5.c new file mode 100644 index 00000000000..95fa72583bb --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/mv-symbols5.c @@ -0,0 +1,35 @@ +/* { dg-do compile } */ +/* { dg-options "-O0" } */ + +// FMV correctness with default declaration, and implementations of other +// versions. + +__attribute__((target_version("default"))) +int foo (); + +__attribute__((target_version("dotprod"))) +int foo () +{ + return 3; +} +__attribute__((target_version("sve+sve2"))) +int foo () +{ + return 5; +} + +int bar() +{ + return foo (); +} + +/* When updating any of the symbol names in these tests, make sure to also + update any tests for their absence in mvc-symbolsN.C */ + +/* { dg-final { scan-assembler-times "\nfoo\.default:\n" 0 } } */ +/* { dg-final { scan-assembler-times "\nfoo\._Mdotprod:\n" 1 } } */ +/* { dg-final { scan-assembler-times "\nfoo\._MsveMsve2:\n" 1 } } */ +/* { dg-final { scan-assembler-times "\nfoo\.resolver:\n" 1 } } */ +/* { dg-final { scan-assembler-times "\n\tbl\tfoo\n" 1 } } */ +/* { dg-final { scan-assembler-times "\n\t\.type\tfoo, %gnu_indirect_function\n" 1 } } */ +/* { dg-final { scan-assembler-times "\n\t\.set\tfoo,foo\.resolver\n" 1 } } */ diff --git a/gcc/testsuite/gcc.target/aarch64/mv-symbols6.c b/gcc/testsuite/gcc.target/aarch64/mv-symbols6.c new file mode 100644 index 00000000000..8080502a4a4 --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/mv-symbols6.c @@ -0,0 +1,17 @@ +/* { dg-do compile } */ +/* { dg-options "-O0" } */ + +__attribute__((target_version("default"))) +int foo () +{ + return 1; +} + + +/* It is not overly clear what the correct behaviour is in this case. + This test serves more as a test of consistency for this case rather + than a test of correctness. */ + +/* { dg-final { scan-assembler-times "\nfoo:\n" 1 } } */ +/* { dg-final { scan-assembler-times "\nfoo\.default:\n" 0 } } */ +/* { dg-final { scan-assembler-times "\nfoo\.resolver:\n" 0 } } */ diff --git a/gcc/testsuite/gcc.target/aarch64/mvc-symbols1.c b/gcc/testsuite/gcc.target/aarch64/mvc-symbols1.c new file mode 100644 index 00000000000..4662fbbef57 --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/mvc-symbols1.c @@ -0,0 +1,25 @@ +/* { dg-do compile } */ +/* { dg-options "-O0" } */ + +__attribute__((target_clones("default", "dotprod", "sve+sve2"))) +int foo () +{ + return 1; +} + +int bar() +{ + return foo (); +} + + +/* When updating any of the symbol names in these tests, make sure to also + update any tests for their absence in mvc-symbolsN.C */ + +/* { dg-final { scan-assembler-times "\nfoo\.default:\n" 1 } } */ +/* { dg-final { scan-assembler-times "\nfoo\._Mdotprod:\n" 1 } } */ +/* { dg-final { scan-assembler-times "\nfoo\._MsveMsve2:\n" 1 } } */ +/* { dg-final { scan-assembler-times "\nfoo\.resolver:\n" 1 } } */ +/* { dg-final { scan-assembler-times "\n\tbl\tfoo\n" 1 } } */ +/* { dg-final { scan-assembler-times "\n\t\.type\tfoo, %gnu_indirect_function\n" 1 } } */ +/* { dg-final { scan-assembler-times "\n\t\.set\tfoo,foo\.resolver\n" 1 } } */ diff --git a/gcc/testsuite/gcc.target/aarch64/mvc-symbols2.c b/gcc/testsuite/gcc.target/aarch64/mvc-symbols2.c new file mode 100644 index 00000000000..112a350e2f7 --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/mvc-symbols2.c @@ -0,0 +1,16 @@ +/* { dg-do compile } */ +/* { dg-options "-O0" } */ + +__attribute__((target_clones("default", "dotprod", "sve+sve2"))) +int foo () +{ + return 1; +} + + +/* { dg-final { scan-assembler-times "\nfoo\.default:\n" 1 } } */ +/* { dg-final { scan-assembler-times "\nfoo\._Mdotprod:\n" 1 } } */ +/* { dg-final { scan-assembler-times "\nfoo\._MsveMsve2:\n" 1 } } */ +/* { dg-final { scan-assembler-times "\nfoo\.resolver:\n" 1 } } */ +/* { dg-final { scan-assembler-times "\n\t\.type\tfoo, %gnu_indirect_function\n" 1 } } */ +/* { dg-final { scan-assembler-times "\n\t\.set\tfoo,foo\.resolver\n" 1 } } */ diff --git a/gcc/testsuite/gcc.target/aarch64/mvc-symbols3.c b/gcc/testsuite/gcc.target/aarch64/mvc-symbols3.c new file mode 100644 index 00000000000..c681fb5b0a6 --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/mvc-symbols3.c @@ -0,0 +1,19 @@ +/* { dg-do compile } */ +/* { dg-options "-O0" } */ + +__attribute__((target_clones("default", "dotprod", "sve+sve2"))) +int foo (); + +int bar() +{ + return foo (); +} + +/* { dg-final { scan-assembler-times "\nfoo\.default:\n" 0 } } */ +/* { dg-final { scan-assembler-times "\nfoo\._Mdotprod:\n" 0 } } */ +/* { dg-final { scan-assembler-times "\nfoo\._MsveMsve2:\n" 0 } } */ +/* { dg-final { scan-assembler-times "\nfoo\.resolver:\n" 1 } } */ +/* { dg-final { scan-assembler-times "\n\tbl\tfoo\n" 1 } } */ +/* { dg-final { scan-assembler-times "\n\t\.type\tfoo, %gnu_indirect_function\n" 1 } } */ +/* { dg-final { scan-assembler-times "\n\t\.set\tfoo,foo\.resolver\n" 1 } } */ + diff --git a/gcc/testsuite/gcc.target/aarch64/mvc-symbols4.c b/gcc/testsuite/gcc.target/aarch64/mvc-symbols4.c new file mode 100644 index 00000000000..81707552ee3 --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/mvc-symbols4.c @@ -0,0 +1,12 @@ +/* { dg-do compile } */ +/* { dg-options "-O0" } */ + +__attribute__((target_clones("default", "dotprod", "sve+sve2"))) +int foo (); + +/* { dg-final { scan-assembler-times "\nfoo\.default:\n" 0 } } */ +/* { dg-final { scan-assembler-times "\nfoo\._Mdotprod:\n" 0 } } */ +/* { dg-final { scan-assembler-times "\nfoo\._MsveMsve2:\n" 0 } } */ +/* { dg-final { scan-assembler-times "\nfoo\.resolver:\n" 0 } } */ +/* { dg-final { scan-assembler-times "\n\t\.type\tfoo, %gnu_indirect_function\n" 0 } } */ +/* { dg-final { scan-assembler-times "\n\t\.set\tfoo,foo\.resolver\n" 0 } } */