From patchwork Thu Aug 1 09:36:14 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Saurabh Jha X-Patchwork-Id: 1967566 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=arm.com header.i=@arm.com header.a=rsa-sha256 header.s=selector1 header.b=AL8Fl1Je; dkim=pass (1024-bit key) header.d=arm.com header.i=@arm.com header.a=rsa-sha256 header.s=selector1 header.b=AL8Fl1Je; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=server2.sourceware.org; envelope-from=gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=patchwork.ozlabs.org) Received: from server2.sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4WZPFG0LcJz1ybV for ; Thu, 1 Aug 2024 19:44:34 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 48E18385DDD3 for ; Thu, 1 Aug 2024 09:44:32 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from EUR02-DB5-obe.outbound.protection.outlook.com (mail-db5eur02on20601.outbound.protection.outlook.com [IPv6:2a01:111:f403:2608::601]) by sourceware.org (Postfix) with ESMTPS id 0ECC6385C6C1 for ; Thu, 1 Aug 2024 09:36:44 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 0ECC6385C6C1 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 0ECC6385C6C1 Authentication-Results: server2.sourceware.org; arc=pass smtp.remote-ip=2a01:111:f403:2608::601 ARC-Seal: i=3; a=rsa-sha256; d=sourceware.org; s=key; t=1722505008; cv=pass; b=jMotIe1Eq9/0sLGbtT5XiCONw+ka6ps/x+pQCFVoHC9OB+C40dlxeeF06h/TdC+peS4idiERDmW1rQs5RDIzZvx99SQOygh/JI9xqUkKyH+2me3IoGF/HLnQ87M/AELrvGYznU8/h9AImvF4WJEFfLv9pVtcmchkHnXqKqBNDWI= ARC-Message-Signature: i=3; a=rsa-sha256; d=sourceware.org; s=key; t=1722505008; c=relaxed/simple; bh=Hnlur6Jrk2x+7fgkC5qIak8/VAyDy+TFpKwkQd81ZOs=; h=DKIM-Signature:DKIM-Signature:From:To:Subject:Date:Message-ID: MIME-Version; b=PL43mouCARvV3sAWcQWNrplo0CauGk1GdpP6QdhYcDo1ZRvacXmS0oaDPFF0YcMH1R1wbh0rJARP5EKL2rihJpG7a/hxjNdGFUEk2zWPi26o+Snes2tQ5exWmk/LfeIGzntjuw+5b3f1GNP59PBdrl5tFcxhvPW2Lh3t5UlFzfM= ARC-Authentication-Results: i=3; server2.sourceware.org ARC-Seal: i=2; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=pass; b=uv+9G0h1sgp8f/m2kpucJ1p7xYGOFlLJPSkFTvRMbWDPp59qECB/nkdlL5Nh3EVEIp6yn0EqTzJT5nQ5Lepz/Ino2tip3xyf2JvJorPAgezugGHF2KcOdTbFkhC68HeIKgHtAT/6wleyElrHL9AIQgLQSPBaltPiGuYhlcyXbJlUP3Xyd3Iqf0dzsRIMS9CphVmcc9mTHFpBPcbc6WJ6uYI19irHWYX3zSdM/SMrkd7nDagheAdbe80yT7oV6WZaYpOCAlANlv84nalw/yF6N1zvolFKl7HUq0juOE+jxzjyY7OiulwBduzzSPGVG0inl3ic/jWMKNEAwWAJEfTYEA== 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=GUS5B+ROOy91G9ADERpy+uPA18zc96IP5dDlLn/kWU4=; b=CZv89TXOrICNEPZbPoMFQuAJ7WanjnbYuuWfDE7rctgBkPiwxD2kWNQ7EknesfpcwPd2ZnVYcXT9xzrSBpK61ykkOG6udOngfEV2dqZDUu0hsDbUqBDjDrVY/z24Zwa6lkpY7j2k3PkDL/NLGs9XieH897Q7mZbgZ+4oCMll6DIW7hZV65ZXM1ae6NHBXsWNWn+QqYbN/irRRbZtJNENxreQhv0ibOnSP+IS7EfVSN6SgmV7lrXb+OzeAPCWjijgA5XrKgadu9D7Z/bIdIlsaD9mDQNpRY0gqcpDIcZShWvAgl2E+Lg3FbaS5J/jg9kIfhMjHBLCTDtyRsUBxPXveg== 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=GUS5B+ROOy91G9ADERpy+uPA18zc96IP5dDlLn/kWU4=; b=AL8Fl1JeWxemIvfdUd7hYoQejwU7tZY2ifphd0f8IKqD+C7cLDKHS3DA8obxXJQcBByNHFOGz44I3VKSrlUWFekzOJB3q+OrGV++6ioeIgDUYoRKpWLdncud93w0ooav93r9o/Nrc+QkbeIGKHUEeZc7jvbK181fnbvx9IsiRf4= Received: from DB7PR05CA0015.eurprd05.prod.outlook.com (2603:10a6:10:36::28) by GV1PR08MB8403.eurprd08.prod.outlook.com (2603:10a6:150:8a::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7807.28; Thu, 1 Aug 2024 09:36:37 +0000 Received: from DB1PEPF00039234.eurprd03.prod.outlook.com (2603:10a6:10:36:cafe::77) by DB7PR05CA0015.outlook.office365.com (2603:10a6:10:36::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7784.34 via Frontend Transport; Thu, 1 Aug 2024 09:36:37 +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 DB1PEPF00039234.mail.protection.outlook.com (10.167.8.107) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.7828.19 via Frontend Transport; Thu, 1 Aug 2024 09:36:37 +0000 Received: ("Tessian outbound de9676d3a70f:v365"); Thu, 01 Aug 2024 09:36:37 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 523053b851df8722 X-CR-MTA-TID: 64aa7808 Received: from Lb6ff1cf1ca13.2 by 64aa7808-outbound-1.mta.getcheckrecipient.com id E4FEFD57-7022-4A36-98A9-D57421D3837F.1; Thu, 01 Aug 2024 09:36:30 +0000 Received: from EUR02-AM0-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id Lb6ff1cf1ca13.2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Thu, 01 Aug 2024 09:36:30 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=aDwebDraijUQgP3ioe9yguMi8QuCjEpfZlijz0zycjqWAKGU/eR4k2nJ5DXI/3yt5hRuvToakiXBHVriWrMst8eQ4Lqhes7YfaeryW3y4Vod92fb40AnrH0/spj4UiDcgTmaHt9lzjYZ9QPj0shP75nqE5nOrlEEWpkNrRWPvcVhWbHq3w4RSv/RtHq4tngYAyz6cmzkzGtXD0kRDXcfLk6k5MMzbQpD7pGwVlW1v2oQAmv9zPzYaoEvlrui3oEwKrU26yqY+J3Yw5xRqe2+CyTB942urO5j0frG/hRY0TfwA/yI3YKObamcAkFy562/OBmAHeYYXuTHsDD3TM68kg== 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=GUS5B+ROOy91G9ADERpy+uPA18zc96IP5dDlLn/kWU4=; b=hhQ8aF0GsI/YY+3Rn3EhluwBWU+Qlys4wxDQJV0l4OkuX6w8Wh6vz3396eCOhKzGDWrv3EjiDYT9x7M5kaG8nRVi704twI2jcZT2+FiKgXiJnf5kFZaegC0EAI9jMLuRl+//6bCY4/X4zquEt4ABOHYpc/EYL6hcyRSSczVoxvobz58dJ7F0eKa0m+ZDlZAz/gesYGoac6R+R1ZPGE0UYXffm6uiBn87verhFEI5IgA3mbTBM58dLCtNo58hqXr6qtFjABDhHBSTPV0NCeMlnKoS2neXsdVWB8aDLHq5Mcq+d/P4nYPufEqCpU6cC3MxxfCtSo3YeJb+h1Cg+FxE+g== 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=GUS5B+ROOy91G9ADERpy+uPA18zc96IP5dDlLn/kWU4=; b=AL8Fl1JeWxemIvfdUd7hYoQejwU7tZY2ifphd0f8IKqD+C7cLDKHS3DA8obxXJQcBByNHFOGz44I3VKSrlUWFekzOJB3q+OrGV++6ioeIgDUYoRKpWLdncud93w0ooav93r9o/Nrc+QkbeIGKHUEeZc7jvbK181fnbvx9IsiRf4= Received: from DUZPR01CA0104.eurprd01.prod.exchangelabs.com (2603:10a6:10:4bb::17) by AS8PR08MB9907.eurprd08.prod.outlook.com (2603:10a6:20b:563::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7828.21; Thu, 1 Aug 2024 09:36:26 +0000 Received: from DB5PEPF00014B8A.eurprd02.prod.outlook.com (2603:10a6:10:4bb:cafe::c3) by DUZPR01CA0104.outlook.office365.com (2603:10a6:10:4bb::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7828.22 via Frontend Transport; Thu, 1 Aug 2024 09:36:26 +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 DB5PEPF00014B8A.mail.protection.outlook.com (10.167.8.198) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7828.19 via Frontend Transport; Thu, 1 Aug 2024 09:36:26 +0000 Received: from AZ-NEU-EX03.Arm.com (10.251.24.31) by AZ-NEU-EX03.Arm.com (10.251.24.31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Thu, 1 Aug 2024 09:36:19 +0000 Received: from e130340.cambridge.arm.com (10.2.80.47) by mail.arm.com (10.251.24.31) with Microsoft SMTP Server id 15.1.2507.39 via Frontend Transport; Thu, 1 Aug 2024 09:36:19 +0000 From: To: CC: , , Saurabh Jha Subject: [PATCH] aarch64: Add support for AdvSIMD faminmax Date: Thu, 1 Aug 2024 10:36:14 +0100 Message-ID: <20240801093614.2467577-1-saurabh.jha@arm.com> X-Mailer: git-send-email 2.43.2 MIME-Version: 1.0 X-EOPAttributedMessage: 1 X-MS-TrafficTypeDiagnostic: DB5PEPF00014B8A:EE_|AS8PR08MB9907:EE_|DB1PEPF00039234:EE_|GV1PR08MB8403:EE_ X-MS-Office365-Filtering-Correlation-Id: 0b8b0408-7b4f-4828-077f-08dcb20d7091 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|376014|1800799024|36860700013; X-Microsoft-Antispam-Message-Info-Original: oCDJhXjTb+s01eors5xpcBewRlMZ1FHrD2Cc2Ba6+OpKH6yPPUylvWmDSdc7GR7D6uB99idr46jgXhm/BRDF2Zxah6ohsT5ZQ4A1kbgBF7K0DD7CyjBY41ui2NgssYrkyHAWpXVIV4xCMNtEH2b6gyUnMk1Wl4YtYNjvjW6evYj6FwtuKTXgM4f2u6KSI2UJRJipFeo58mDidXSKJcQi7tL48e9b77wh6xIjsarCIkT8F+yjqmyFyP5GsArT8uKFA/zAadYXOUSnUzU/2yOsuCj4km/bUAlLPFE2+shPe1R/+rcy7J8RuCW3J8HZtoLYwJVpo56v4BMOZOiJTSj20msai2p1tndE7dxZ17FbzTLMql5phv/vsi79ckm8wDt0G9wQU8fMJ422bCRPBpq7Ye8vSTfShAaMiASkjQ3EsDwoaq8piUY3gYbQ30qvg0y3Bk5FqQ/Opa0YngC+8gHbbnE2bpsArRUelSl3TcKnV6XaJVf45sNNPHIOlGxlVjhdr8yma6Tp0TeuMeZI51lf0RLfM9T3RgvqzPDYsiwHj0dBhfkL/TGAABjaIitv5QUIr6Z0sfsJ9iTr0tOrbL4NdyI15AP/O8ZnG9+NXEnkRdiKRksiA5t+7Hs2wjzM4T33569AyqYP6EY09XNhK438xj/dOjT9UPFYfOzewukGaQ09ldnZc//kxeFJY35arCnBql0WD66xP/Jn1/Y2TGPS+N8tQ8dmBY/iQ3QYR39IJtzxuBgrHvrffrDZBrCMWOe4x8m2oyLdPV0C222i3Z592sNlH256+/fEygtpF7iVWPck0LOh97zV8Wb7CNAQP8Uq0fUgEjpTGFKzppaKm4TGkALenOS8dF+EwaXTeEamD5M94vjRkUygWmOzj0WfOig0Ho1GTcLldthBF8c/Wqpbf3WcGvfm8XO2/INM5glWNUmzC3i5cCjg2ZPdwDZ/NMG+YjV6rTEOb0ELFuodBQ1Nyk/fyqpkHaIbqDtyIxVd299baPhYQIFiMuUtwzUHUE3JMMrHUX2bKjZ4NJUJDCx/CqvUkJ7ppOIB5hYglJDdg0ZIhcDcmz1zLVyBH9jvBos4MWXYq1/+4sTDc+muAlFznFg+0/lLvqaBXBHgnKimOPnHjH5NngUXIpu0H7feMtKP/L2SvLTbf7rRiPh197MeKz8VjWRZE3r8ERZfLcdAqVlYsbtm9qfDn7GVwr0goyaAZXhCgqS1NeidOxFCLDlY5AaLwWX4dzSdO0wlxlBM0CchuTBWKb+4JAU3JtjF3agCkfm81T220q/xhBJMcMIR/TcyJgMruNkPUhhmzwfC4PWLTEpIvqQ/v4c5cJYFQvWSzq7WTGY50gaBvt+oMgQEBsD1sM9ZQqHKOb9O1THS0iUw847UhasRP/RcPfvH7yd7G7fwjNIJT+8208++K4kZ8Q== 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)(376014)(1800799024)(36860700013); DIR:OUT; SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR08MB9907 X-MS-Exchange-SkipListedInternetSender: ip=[2603:10a6:10:4bb::17]; domain=DUZPR01CA0104.eurprd01.prod.exchangelabs.com X-MS-Exchange-Transport-CrossTenantHeadersStripped: DB1PEPF00039234.eurprd03.prod.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 47fe2dba-d374-4d99-6103-08dcb20d6a06 X-Microsoft-Antispam: BCL:0; ARA:13230040|35042699022|1800799024|36860700013|82310400026|376014; X-Microsoft-Antispam-Message-Info: =?utf-8?q?s0TQ7qYUXQ/1r00mkMnAtouf0KFp09n?= =?utf-8?q?8qnBTnkmCoVGzS57VoMdLyuJWpWsuepDn+1PEIoG9Mea9+uRpZRW+jBj2mg6pzm+x?= =?utf-8?q?rva8rdEIwRUqJZjs+hpQ+mq3le3XHCjRmnXfwCHZPHStaMvQEhHefGOr35bIi0ijm?= =?utf-8?q?6KxJj1dX7WkSltuU+aJvKtRMYa9pSeuqA8r8Y3oIvUQaoIiUGBBhGeLeB7ekMIMrj?= =?utf-8?q?fougnnuLKl0AgyhcNrhacODdwpE+nhSuIelwA2A5Hc5cHvNTuqEpfsLDN9A746H1I?= =?utf-8?q?tMuIsMu3yKFe8sK57xizmRwlKddlYIPKsHYO6lLn2PJnC+a7zFA+zKY95/kOHPdLJ?= =?utf-8?q?BGkiAYvqytuKlNLt3GJu8omMO5KJiEcTokRYR6xRdnHTNPdpcZ7spFd6kuKxa5xFG?= =?utf-8?q?TlF6NQbBUklfjEiVNLDah8rIovX+0GAESXlK0TVxXkAYBDrEIe1sxm+QHsZYKWcTT?= =?utf-8?q?ocvg9Bgs+wh1HCVhIqPjoeu907S3h1OZrQ/T5UgKEsp8cMQMWexJUbK1Ed7iWHBcP?= =?utf-8?q?xbO/YKdla+mkcllXgqhZjtaUSUGFIaFgi/ga4+11uFVpXxlQlQIjx8iI1gdd7IyjX?= =?utf-8?q?XHXzwxNVuq+G02RLbj+lpy9v0H74qm55Nv2+/e3aRqJPAz9u8dceDPfe59OOj5yyz?= =?utf-8?q?G6EyCsfqZRtpSrnItzzKpTr2TKEx+L+rr3SOHjZ6QZwQhcof8WbVdg4d5Zi/vPUJM?= =?utf-8?q?Mcx6daoNwks/lAFghwN+wTfhiYxd1b8Cqhi+tJv9wR5rF28n50prA0IEMEu3NQ1Zv?= =?utf-8?q?0bod8q4xWGZpGCO3spUzpGnXH/zcDap+AXCoUs7MDtgscsGkFYnpegxhyC2mIOL8t?= =?utf-8?q?PJq13AjDqlVQO+FO4rZAClXaEN0YXyEzzPqZZqHMIX/FZHR3Co5AcTPNVbnTioj2r?= =?utf-8?q?ZbA9JAezOnr4pyfG30dkoyRARXvkO+HX/p9wdqBOs+MLOYiuaF78NTgAXP7uqCjNd?= =?utf-8?q?eDsHEAv0eecZOt0QqVSZQ/4UdslkC516Q2HTEOqdIlogwIZ4kofTpjaC6XcZNXDrO?= =?utf-8?q?oc2okoi+a+kmpGX5rj5ASbg8flm3DLnVTKUjKos+z9JF7NNRpxbP9DyTQfQatr6wq?= =?utf-8?q?A7ggcBAZhbjJeLTxYFAc+ZFGobeBYOcHkXuH5123elj27lG7YsdTnVmeZhacG2iZp?= =?utf-8?q?P2Mx0GTFMo/9hEF75HnXdlDMSfStECCUdfmBhV3MrYGbFpXwioZ5sfXOlOShjjlXS?= =?utf-8?q?mLwjz8sfY2rJ3sDP399Ts4hNblQMDM4Pb4C5KapWwGl3J+6gNa5/oyiFsHqF7VGAP?= =?utf-8?q?yMcr60rWfVATAYak1JmGFp/2jqh9QOPURzVXw2x3ZnjkneaM4OIajNWCyRTNb4TjN?= =?utf-8?q?c7kEMdwBYWUTDqzbNmipLGQwG8REJIcfWg=3D=3D?= 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)(36860700013)(82310400026)(376014); DIR:OUT; SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Aug 2024 09:36:37.2639 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 0b8b0408-7b4f-4828-077f-08dcb20d7091 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: DB1PEPF00039234.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: GV1PR08MB8403 X-Spam-Status: No, score=-12.0 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~incoming=patchwork.ozlabs.org@gcc.gnu.org The AArch64 FEAT_FAMINMAX extension is optional from Armv9.2-a and mandatory from Armv9.5-a. It introduces instructions for computing the floating point absolute maximum and minimum of the two vectors element-wise. This patch does three things: 1. Introduces AdvSIMD faminmax intrinsics. 2. Adds code generation support for famax and famin in terms of the existing operators. 3. Move report_missing_extension and reported_missing_extension_p to make it more usable. The intrinsics of this extension are implemented as the following builtin functions: * vamax_f16 * vamaxq_f16 * vamax_f32 * vamaxq_f32 * vamaxq_f64 * vamin_f16 * vaminq_f16 * vamin_f32 * vaminq_f32 * vaminq_f64 For code generation, famax/famin is equivalent to first taking fabs of the operands and then taking fmax/fmin of the results of fabs. famax/famin (a, b) = fmax/fmin (fabs (a), fabs (b)) This is correct because NaN/Inf handling of famax/famin and fmax/fmin are same. We cannot use fmaxnm/fminnm here as Nan/Inf are handled differently in them. We moved the definition of `report_missing_extension` from gcc/config/aarch64/aarch64-sve-builtins.cc to gcc/config/aarch64/aarch64-builtins.cc and its declaration to gcc/config/aarch64/aarch64-builtins.h. We also moved the declaration of `reported_missing_extension_p` from gcc/config/aarch64/aarch64-sve-builtins.cc to gcc/config/aarch64/aarch64-builtins.cc, closer to the definition of `report_missing_extension`. In the exsiting code structure, this leads to `report_missing_extension` being usable from both normal builtins and sve builtins. gcc/ChangeLog: * config/aarch64/aarch64-builtins.cc (enum aarch64_builtins): New enum values for faminmax builtins. (aarch64_init_faminmax_builtins): New function to declare new builtins. (handle_arm_neon_h): Modify to call aarch64_init_faminmax_builtins. (aarch64_general_check_builtin_call): Modify to check whether +faminmax flag is being used and printing error message if not being used. (aarch64_expand_builtin_faminmax): New function to emit instructions of this extension. (aarch64_general_expand_builtin): Modify to call aarch64_expand_builtin_faminmax. (report_missing_extension): Move from config/aarch64/aarch64-sve-builtins.cc. * config/aarch64/aarch64-builtins.h (report_missing_extension): Declaration for this function so that it can be used wherever this header is included. (reported_missing_extension_p): Move from config/aarch64/aarch64-sve-builtins.cc * config/aarch64/aarch64-option-extensions.def (AARCH64_OPT_EXTENSION): Introduce new flag for this extension. * config/aarch64/aarch64-simd.md (aarch64_): Introduce instruction pattern for this extension. * config/aarch64/aarch64-sve-builtins.cc (reported_missing_extension_p): Move to config/aarch64/aarch64-builtins.cc (report_missing_extension): Move to config/aarch64/aarch64-builtins.cc. * config/aarch64/aarch64.h (TARGET_FAMINMAX): Introduce new flag for this extension. * config/aarch64/iterators.md: Introduce new iterators for this extension. * config/arm/types.md: Introduce neon_fp_aminmax attributes. * doc/invoke.texi: Document extension in AArch64 Options. gcc/testsuite/ChangeLog: * gcc.target/aarch64/simd/faminmax-builtins-no-flag.c: New test. * gcc.target/aarch64/simd/faminmax-builtins.c: New test. * gcc.target/aarch64/simd/faminmax-codegen-no-flag.c: New test. * gcc.target/aarch64/simd/faminmax-codegen.c: New test. --- Hi, Regression tested for aarch64-none-linux-gnu and found no regressions. This patch is a revised version of an earlier patch https://gcc.gnu.org/pipermail/gcc-patches/2024-July/657914.html but has more scope than that. That's why I didn't add "v2" in the subject line. Ok for master? I don't have commit access so can someone please commit on my behalf? Regards, Saurabh --- gcc/config/aarch64/aarch64-builtins.cc | 173 +++++++++++++++++- gcc/config/aarch64/aarch64-builtins.h | 5 +- .../aarch64/aarch64-option-extensions.def | 2 + gcc/config/aarch64/aarch64-simd.md | 12 ++ gcc/config/aarch64/aarch64-sve-builtins.cc | 22 --- gcc/config/aarch64/aarch64.h | 4 + gcc/config/aarch64/iterators.md | 8 + gcc/config/arm/types.md | 6 + gcc/doc/invoke.texi | 2 + .../aarch64/simd/faminmax-builtins-no-flag.c | 10 + .../aarch64/simd/faminmax-builtins.c | 75 ++++++++ .../aarch64/simd/faminmax-codegen-no-flag.c | 54 ++++++ .../aarch64/simd/faminmax-codegen.c | 104 +++++++++++ 13 files changed, 445 insertions(+), 32 deletions(-) create mode 100644 gcc/testsuite/gcc.target/aarch64/simd/faminmax-builtins-no-flag.c create mode 100644 gcc/testsuite/gcc.target/aarch64/simd/faminmax-builtins.c create mode 100644 gcc/testsuite/gcc.target/aarch64/simd/faminmax-codegen-no-flag.c create mode 100644 gcc/testsuite/gcc.target/aarch64/simd/faminmax-codegen.c diff --git a/gcc/config/aarch64/aarch64-builtins.cc b/gcc/config/aarch64/aarch64-builtins.cc index 30669f8aa18..cd590186f22 100644 --- a/gcc/config/aarch64/aarch64-builtins.cc +++ b/gcc/config/aarch64/aarch64-builtins.cc @@ -829,6 +829,17 @@ enum aarch64_builtins AARCH64_RBIT, AARCH64_RBITL, AARCH64_RBITLL, + /* FAMINMAX builtins. */ + AARCH64_FAMINMAX_BUILTIN_FAMAX4H, + AARCH64_FAMINMAX_BUILTIN_FAMAX8H, + AARCH64_FAMINMAX_BUILTIN_FAMAX2S, + AARCH64_FAMINMAX_BUILTIN_FAMAX4S, + AARCH64_FAMINMAX_BUILTIN_FAMAX2D, + AARCH64_FAMINMAX_BUILTIN_FAMIN4H, + AARCH64_FAMINMAX_BUILTIN_FAMIN8H, + AARCH64_FAMINMAX_BUILTIN_FAMIN2S, + AARCH64_FAMINMAX_BUILTIN_FAMIN4S, + AARCH64_FAMINMAX_BUILTIN_FAMIN2D, /* System register builtins. */ AARCH64_RSR, AARCH64_RSRP, @@ -1547,6 +1558,66 @@ aarch64_init_simd_builtin_functions (bool called_from_pragma) } } +/* Initialize the absolute maximum/minimum (FAMINMAX) builtins. */ + +typedef struct +{ + const char *name; + unsigned int code; + tree eltype; + machine_mode mode; +} faminmax_builtins_data; + +static void +aarch64_init_faminmax_builtins () +{ + faminmax_builtins_data data[] = { + /* Absolute maximum. */ + {"vamax_f16", AARCH64_FAMINMAX_BUILTIN_FAMAX4H, + aarch64_simd_types[Float16x4_t].eltype, + aarch64_simd_types[Float16x4_t].mode}, + {"vamaxq_f16", AARCH64_FAMINMAX_BUILTIN_FAMAX8H, + aarch64_simd_types[Float16x8_t].eltype, + aarch64_simd_types[Float16x8_t].mode}, + {"vamax_f32", AARCH64_FAMINMAX_BUILTIN_FAMAX2S, + aarch64_simd_types[Float32x2_t].eltype, + aarch64_simd_types[Float32x2_t].mode}, + {"vamaxq_f32", AARCH64_FAMINMAX_BUILTIN_FAMAX4S, + aarch64_simd_types[Float32x4_t].eltype, + aarch64_simd_types[Float32x4_t].mode}, + {"vamaxq_f64", AARCH64_FAMINMAX_BUILTIN_FAMAX2D, + aarch64_simd_types[Float64x2_t].eltype, + aarch64_simd_types[Float64x2_t].mode}, + /* Absolute minimum. */ + {"vamin_f16", AARCH64_FAMINMAX_BUILTIN_FAMIN4H, + aarch64_simd_types[Float16x4_t].eltype, + aarch64_simd_types[Float16x4_t].mode}, + {"vaminq_f16", AARCH64_FAMINMAX_BUILTIN_FAMIN8H, + aarch64_simd_types[Float16x8_t].eltype, + aarch64_simd_types[Float16x8_t].mode}, + {"vamin_f32", AARCH64_FAMINMAX_BUILTIN_FAMIN2S, + aarch64_simd_types[Float32x2_t].eltype, + aarch64_simd_types[Float32x2_t].mode}, + {"vaminq_f32", AARCH64_FAMINMAX_BUILTIN_FAMIN4S, + aarch64_simd_types[Float32x4_t].eltype, + aarch64_simd_types[Float32x4_t].mode}, + {"vaminq_f64", AARCH64_FAMINMAX_BUILTIN_FAMIN2D, + aarch64_simd_types[Float64x2_t].eltype, + aarch64_simd_types[Float64x2_t].mode}, + }; + + for (size_t i = 0; i < ARRAY_SIZE (data); ++i) + { + tree type + = build_vector_type (data[i].eltype, GET_MODE_NUNITS (data[i].mode)); + tree fntype = build_function_type_list (type, type, type, NULL_TREE); + unsigned int code = data[i].code; + const char *name = data[i].name; + aarch64_builtin_decls[code] + = aarch64_general_simulate_builtin (name, fntype, code); + } +} + /* Register the tuple type that contains NUM_VECTORS of the AdvSIMD type indexed by TYPE_INDEX. */ static void @@ -1640,6 +1711,7 @@ handle_arm_neon_h (void) aarch64_init_simd_builtin_functions (true); aarch64_init_simd_intrinsics (); + aarch64_init_faminmax_builtins (); } static void @@ -2197,15 +2269,35 @@ aarch64_general_check_builtin_call (location_t location, vec, case AARCH64_WSR64: case AARCH64_WSRF: case AARCH64_WSRF64: - tree addr = STRIP_NOPS (args[0]); - if (TREE_CODE (TREE_TYPE (addr)) != POINTER_TYPE - || TREE_CODE (addr) != ADDR_EXPR - || TREE_CODE (TREE_OPERAND (addr, 0)) != STRING_CST) - { - error_at (location, "first argument to %qD must be a string literal", - fndecl); - return false; - } + { + tree addr = STRIP_NOPS (args[0]); + if (TREE_CODE (TREE_TYPE (addr)) != POINTER_TYPE + || TREE_CODE (addr) != ADDR_EXPR + || TREE_CODE (TREE_OPERAND (addr, 0)) != STRING_CST) + { + error_at (location, + "first argument to %qD must be a string literal", + fndecl); + return false; + } + } + case AARCH64_FAMINMAX_BUILTIN_FAMAX4H: + case AARCH64_FAMINMAX_BUILTIN_FAMAX8H: + case AARCH64_FAMINMAX_BUILTIN_FAMAX2S: + case AARCH64_FAMINMAX_BUILTIN_FAMAX4S: + case AARCH64_FAMINMAX_BUILTIN_FAMAX2D: + case AARCH64_FAMINMAX_BUILTIN_FAMIN4H: + case AARCH64_FAMINMAX_BUILTIN_FAMIN8H: + case AARCH64_FAMINMAX_BUILTIN_FAMIN2S: + case AARCH64_FAMINMAX_BUILTIN_FAMIN4S: + case AARCH64_FAMINMAX_BUILTIN_FAMIN2D: + { + if (!TARGET_FAMINMAX) + { + report_missing_extension (location, fndecl, "faminmax"); + return false; + } + } } /* Default behavior. */ return true; @@ -3071,6 +3163,44 @@ aarch64_expand_builtin_data_intrinsic (unsigned int fcode, tree exp, rtx target) return ops[0].value; } +static rtx +aarch64_expand_builtin_faminmax (unsigned int fcode, tree exp, rtx target) +{ + machine_mode mode = TYPE_MODE (TREE_TYPE (exp)); + rtx op0 = force_reg (mode, expand_normal (CALL_EXPR_ARG (exp, 0))); + rtx op1 = force_reg (mode, expand_normal (CALL_EXPR_ARG (exp, 1))); + + enum insn_code icode; + if (fcode == AARCH64_FAMINMAX_BUILTIN_FAMAX4H) + icode = CODE_FOR_aarch64_famaxv4hf; + else if (fcode == AARCH64_FAMINMAX_BUILTIN_FAMAX8H) + icode = CODE_FOR_aarch64_famaxv8hf; + else if (fcode == AARCH64_FAMINMAX_BUILTIN_FAMAX2S) + icode = CODE_FOR_aarch64_famaxv2sf; + else if (fcode == AARCH64_FAMINMAX_BUILTIN_FAMAX4S) + icode = CODE_FOR_aarch64_famaxv4sf; + else if (fcode == AARCH64_FAMINMAX_BUILTIN_FAMAX2D) + icode = CODE_FOR_aarch64_famaxv2df; + else if (fcode == AARCH64_FAMINMAX_BUILTIN_FAMIN4H) + icode = CODE_FOR_aarch64_faminv4hf; + else if (fcode == AARCH64_FAMINMAX_BUILTIN_FAMIN8H) + icode = CODE_FOR_aarch64_faminv8hf; + else if (fcode == AARCH64_FAMINMAX_BUILTIN_FAMIN2S) + icode = CODE_FOR_aarch64_faminv2sf; + else if (fcode == AARCH64_FAMINMAX_BUILTIN_FAMIN4S) + icode = CODE_FOR_aarch64_faminv4sf; + else if (fcode == AARCH64_FAMINMAX_BUILTIN_FAMIN2D) + icode = CODE_FOR_aarch64_faminv2df; + else + gcc_unreachable (); + + rtx pat = GEN_FCN (icode) (target, op0, op1); + + emit_insn (pat); + + return target; +} + /* Expand an expression EXP as fpsr or fpcr setter (depending on UNSPEC) using MODE. */ static void @@ -3250,6 +3380,9 @@ aarch64_general_expand_builtin (unsigned int fcode, tree exp, rtx target, if (fcode >= AARCH64_REV16 && fcode <= AARCH64_RBITLL) return aarch64_expand_builtin_data_intrinsic (fcode, exp, target); + if (fcode >= AARCH64_FAMINMAX_BUILTIN_FAMAX4H + && fcode <= AARCH64_FAMINMAX_BUILTIN_FAMIN2D) + return aarch64_expand_builtin_faminmax (fcode, exp, target); gcc_unreachable (); } @@ -3794,6 +3927,28 @@ aarch64_atomic_assign_expand_fenv (tree *hold, tree *clear, tree *update) reload_fenv, restore_fnenv), update_call); } +/* True if we've already complained about attempts to use functions + when the required extension is disabled. */ +static bool reported_missing_extension_p; + +/* Report an error against LOCATION that the user has tried to use + function FNDECL when extension EXTENSION is disabled. */ +void +report_missing_extension (location_t location, tree fndecl, + const char *extension) +{ + /* Avoid reporting a slew of messages for a single oversight. */ + if (reported_missing_extension_p) + return; + + error_at (location, "ACLE function %qD requires ISA extension %qs", + fndecl, extension); + inform (location, "you can enable %qs using the command-line" + " option %<-march%>, or by using the %" + " attribute or pragma", extension); + reported_missing_extension_p = true; +} + /* Resolve overloaded MEMTAG build-in functions. */ #define AARCH64_BUILTIN_SUBCODE(F) \ (DECL_MD_FUNCTION_CODE (F) >> AARCH64_BUILTIN_SHIFT) diff --git a/gcc/config/aarch64/aarch64-builtins.h b/gcc/config/aarch64/aarch64-builtins.h index e326fe66676..93e31a30ec6 100644 --- a/gcc/config/aarch64/aarch64-builtins.h +++ b/gcc/config/aarch64/aarch64-builtins.h @@ -96,4 +96,7 @@ struct GTY(()) aarch64_simd_type_info extern aarch64_simd_type_info aarch64_simd_types[]; -#endif \ No newline at end of file +void report_missing_extension (location_t location, tree fndecl, + const char *extension); + +#endif diff --git a/gcc/config/aarch64/aarch64-option-extensions.def b/gcc/config/aarch64/aarch64-option-extensions.def index 42ec0eec31e..e95bd70893a 100644 --- a/gcc/config/aarch64/aarch64-option-extensions.def +++ b/gcc/config/aarch64/aarch64-option-extensions.def @@ -232,6 +232,8 @@ AARCH64_OPT_EXTENSION("the", THE, (), (), (), "the") AARCH64_OPT_EXTENSION("gcs", GCS, (), (), (), "gcs") +AARCH64_OPT_EXTENSION("faminmax", FAMINMAX, (SIMD), (), (), "faminmax") + #undef AARCH64_OPT_FMV_EXTENSION #undef AARCH64_OPT_EXTENSION #undef AARCH64_FMV_FEATURE diff --git a/gcc/config/aarch64/aarch64-simd.md b/gcc/config/aarch64/aarch64-simd.md index bbeee221f37..6fab2f5a976 100644 --- a/gcc/config/aarch64/aarch64-simd.md +++ b/gcc/config/aarch64/aarch64-simd.md @@ -9881,3 +9881,15 @@ "shl\\t%d0, %d1, #16" [(set_attr "type" "neon_shift_imm")] ) + +;; faminmax +(define_insn "aarch64_" + [(set (match_operand:VHSDF 0 "register_operand" "=w") + (unspec:VHSDF + [(abs:VHSDF (match_operand:VHSDF 1 "register_operand" "w")) + (abs:VHSDF (match_operand:VHSDF 2 "register_operand" "w"))] + FMAXMIN_ONLY_UNS))] + "TARGET_FAMINMAX" + "\t%0., %1., %2." + [(set_attr "type" "neon_fp_aminmax")] +) diff --git a/gcc/config/aarch64/aarch64-sve-builtins.cc b/gcc/config/aarch64/aarch64-sve-builtins.cc index f3983a123e3..58c780b9464 100644 --- a/gcc/config/aarch64/aarch64-sve-builtins.cc +++ b/gcc/config/aarch64/aarch64-sve-builtins.cc @@ -947,10 +947,6 @@ static hash_table *function_table; are IDENTIFIER_NODEs. */ static GTY(()) hash_map *overload_names[2]; -/* True if we've already complained about attempts to use functions - when the required extension is disabled. */ -static bool reported_missing_extension_p; - /* True if we've already complained about attempts to use functions which require registers that are missing. */ static bool reported_missing_registers_p; @@ -1076,24 +1072,6 @@ lookup_fndecl (tree fndecl) return &(*registered_functions)[subcode]->instance; } -/* Report an error against LOCATION that the user has tried to use - function FNDECL when extension EXTENSION is disabled. */ -static void -report_missing_extension (location_t location, tree fndecl, - const char *extension) -{ - /* Avoid reporting a slew of messages for a single oversight. */ - if (reported_missing_extension_p) - return; - - error_at (location, "ACLE function %qD requires ISA extension %qs", - fndecl, extension); - inform (location, "you can enable %qs using the command-line" - " option %<-march%>, or by using the %" - " attribute or pragma", extension); - reported_missing_extension_p = true; -} - /* Check whether the registers required by SVE function fndecl are available. Report an error against LOCATION and return false if not. */ static bool diff --git a/gcc/config/aarch64/aarch64.h b/gcc/config/aarch64/aarch64.h index 8056c337957..c6773f64745 100644 --- a/gcc/config/aarch64/aarch64.h +++ b/gcc/config/aarch64/aarch64.h @@ -456,6 +456,10 @@ constexpr auto AARCH64_FL_DEFAULT_ISA_MODE ATTRIBUTE_UNUSED enabled through +gcs. */ #define TARGET_GCS AARCH64_HAVE_ISA (GCS) +/* Floating Point Absolute Maximum/Minimum extension instructions are + enabled through +faminmax. */ +#define TARGET_FAMINMAX AARCH64_HAVE_ISA (FAMINMAX) + /* Prefer different predicate registers for the output of a predicated operation over re-using an existing input predicate. */ #define TARGET_SVE_PRED_CLOBBER (TARGET_SVE \ diff --git a/gcc/config/aarch64/iterators.md b/gcc/config/aarch64/iterators.md index 95fe8f070f4..8e144c8ee4e 100644 --- a/gcc/config/aarch64/iterators.md +++ b/gcc/config/aarch64/iterators.md @@ -4457,3 +4457,11 @@ (UNSPECV_SET_FPCR "fpcr")]) (define_int_attr bits_etype [(8 "b") (16 "h") (32 "s") (64 "d")]) + +;; Iterators and attributes for faminmax + +(define_int_iterator FMAXMIN_ONLY_UNS [UNSPEC_FMAX UNSPEC_FMIN]) +(define_int_attr faminmax + [(UNSPEC_FMAX "famax") (UNSPEC_FMIN "famin")]) + + diff --git a/gcc/config/arm/types.md b/gcc/config/arm/types.md index 9527bdb9e87..d8de9dbc9d1 100644 --- a/gcc/config/arm/types.md +++ b/gcc/config/arm/types.md @@ -492,6 +492,8 @@ ; neon_fp_reduc_minmax_s_q ; neon_fp_reduc_minmax_d ; neon_fp_reduc_minmax_d_q +; neon_fp_aminmax +; neon_fp_aminmax_q ; neon_fp_cvt_narrow_s_q ; neon_fp_cvt_narrow_d_q ; neon_fp_cvt_widen_h @@ -1044,6 +1046,8 @@ neon_fp_reduc_minmax_d,\ neon_fp_reduc_minmax_d_q,\ \ + neon_fp_aminmax,\ + neon_fp_aminmax_q,\ neon_fp_cvt_narrow_s_q,\ neon_fp_cvt_narrow_d_q,\ neon_fp_cvt_widen_h,\ @@ -1264,6 +1268,8 @@ neon_fp_reduc_add_d_q, neon_fp_reduc_minmax_s, neon_fp_reduc_minmax_s_q, neon_fp_reduc_minmax_d,\ neon_fp_reduc_minmax_d_q,\ + neon_fp_aminmax, neon_fp_aminmax_q,\ + neon_fp_aminmax, neon_fp_aminmax_q,\ neon_fp_cvt_narrow_s_q, neon_fp_cvt_narrow_d_q,\ neon_fp_cvt_widen_h, neon_fp_cvt_widen_s, neon_fp_to_int_s,\ neon_fp_to_int_s_q, neon_int_to_fp_s, neon_int_to_fp_s_q,\ diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi index 4850c7379bf..d48516f4f60 100644 --- a/gcc/doc/invoke.texi +++ b/gcc/doc/invoke.texi @@ -21777,6 +21777,8 @@ Enable support for Armv9.4-a Guarded Control Stack extension. Enable support for Armv8.9-a/9.4-a translation hardening extension. @item rcpc3 Enable the RCpc3 (Release Consistency) extension. +@item faminmax +Enable the Floating Point Absolute Maximum/Minimum extension. @end table diff --git a/gcc/testsuite/gcc.target/aarch64/simd/faminmax-builtins-no-flag.c b/gcc/testsuite/gcc.target/aarch64/simd/faminmax-builtins-no-flag.c new file mode 100644 index 00000000000..63ed1508c23 --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/simd/faminmax-builtins-no-flag.c @@ -0,0 +1,10 @@ +/* { dg-do assemble} */ +/* { dg-additional-options "-march=armv9-a" } */ + +#include "arm_neon.h" + +void +test (float32x4_t a, float32x4_t b) +{ + vamaxq_f32 (a, b); /* { dg-error {ACLE function 'vamaxq_f32' requires ISA extension 'faminmax'} } */ +} diff --git a/gcc/testsuite/gcc.target/aarch64/simd/faminmax-builtins.c b/gcc/testsuite/gcc.target/aarch64/simd/faminmax-builtins.c new file mode 100644 index 00000000000..f2b5bafb81c --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/simd/faminmax-builtins.c @@ -0,0 +1,75 @@ +/* { dg-do assemble} */ +/* { dg-additional-options "-march=armv9-a+faminmax" } */ + +#include "arm_neon.h" + +float16x4_t +test_vamax_f16 (float16x4_t a, float16x4_t b) +{ + return vamax_f16 (a, b); +} + +float16x8_t +test_vamaxq_f16 (float16x8_t a, float16x8_t b) +{ + return vamaxq_f16 (a, b); +} + +float32x2_t +test_vamax_f32 (float32x2_t a, float32x2_t b) +{ + return vamax_f32 (a, b); +} + +float32x4_t +test_vamaxq_f32 (float32x4_t a, float32x4_t b) +{ + return vamaxq_f32 (a, b); +} + +float64x2_t +test_vamaxq_f64 (float64x2_t a, float64x2_t b) +{ + return vamaxq_f64 (a, b); +} + +float16x4_t +test_vamin_f16 (float16x4_t a, float16x4_t b) +{ + return vamin_f16 (a, b); +} + +float16x8_t +test_vaminq_f16 (float16x8_t a, float16x8_t b) +{ + return vaminq_f16 (a, b); +} + +float32x2_t +test_vamin_f32 (float32x2_t a, float32x2_t b) +{ + return vamin_f32 (a, b); +} + +float32x4_t +test_vaminq_f32 (float32x4_t a, float32x4_t b) +{ + return vaminq_f32 (a, b); +} + +float64x2_t +test_vaminq_f64 (float64x2_t a, float64x2_t b) +{ + return vaminq_f64 (a, b); +} + +/* { dg-final { scan-assembler-times {\tfamax\tv[0-9]+.4h, v[0-9]+.4h, v[0-9]+.4h} 1 } } */ +/* { dg-final { scan-assembler-times {\tfamax\tv[0-9]+.8h, v[0-9]+.8h, v[0-9]+.8h} 1 } } */ +/* { dg-final { scan-assembler-times {\tfamax\tv[0-9]+.2s, v[0-9]+.2s, v[0-9]+.2s} 1 } } */ +/* { dg-final { scan-assembler-times {\tfamax\tv[0-9]+.4s, v[0-9]+.4s, v[0-9]+.4s} 1 } } */ +/* { dg-final { scan-assembler-times {\tfamax\tv[0-9]+.2d, v[0-9]+.2d, v[0-9]+.2d} 1 } } */ +/* { dg-final { scan-assembler-times {\tfamin\tv[0-9]+.4h, v[0-9]+.4h, v[0-9]+.4h} 1 } } */ +/* { dg-final { scan-assembler-times {\tfamin\tv[0-9]+.8h, v[0-9]+.8h, v[0-9]+.8h} 1 } } */ +/* { dg-final { scan-assembler-times {\tfamin\tv[0-9]+.2s, v[0-9]+.2s, v[0-9]+.2s} 1 } } */ +/* { dg-final { scan-assembler-times {\tfamin\tv[0-9]+.4s, v[0-9]+.4s, v[0-9]+.4s} 1 } } */ +/* { dg-final { scan-assembler-times {\tfamin\tv[0-9]+.2d, v[0-9]+.2d, v[0-9]+.2d} 1 } } */ diff --git a/gcc/testsuite/gcc.target/aarch64/simd/faminmax-codegen-no-flag.c b/gcc/testsuite/gcc.target/aarch64/simd/faminmax-codegen-no-flag.c new file mode 100644 index 00000000000..545a9468fdc --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/simd/faminmax-codegen-no-flag.c @@ -0,0 +1,54 @@ +/* { dg-do assemble} */ +/* { dg-additional-options "-O -march=armv9-a" } */ + +#include "arm_neon.h" + +float16x4_t +test_vamax_f16 (float16x4_t a, float16x4_t b) +{ + return vmax_f16 (vabs_f16 (a), vabs_f16 (b)); +} + +/* { dg-final { scan-assembler-times {\tfamax\tv[0-9]+.4h, v[0-9]+.4h, v[0-9]+.4h} 0 } } */ +/* { dg-final { scan-assembler-times {\tfmax\tv[0-9]+.4h, v[0-9]+.4h, v[0-9]+.4h} 1 } } */ +/* { dg-final { scan-assembler-times {\tfabs\tv[0-9]+.4h, v[0-9]+.4h} 2 } } */ + +float16x8_t +test_vamaxq_f16 (float16x8_t a, float16x8_t b) +{ + return vmaxq_f16 (vabsq_f16 (a), vabsq_f16 (b)); +} + +/* { dg-final { scan-assembler-times {\tfamax\tv[0-9]+.8h, v[0-9]+.8h, v[0-9]+.8h} 0 } } */ +/* { dg-final { scan-assembler-times {\tfmax\tv[0-9]+.8h, v[0-9]+.8h, v[0-9]+.8h} 1 } } */ +/* { dg-final { scan-assembler-times {\tfabs\tv[0-9]+.8h, v[0-9]+.8h} 2 } } */ + +float32x2_t +test_vamax_f32 (float32x2_t a, float32x2_t b) +{ + return vmax_f32 (vabs_f32 (a), vabs_f32 (b)); +} + +/* { dg-final { scan-assembler-times {\tfamax\tv[0-9]+.2s, v[0-9]+.2s, v[0-9]+.2s} 0 } } */ +/* { dg-final { scan-assembler-times {\tfmax\tv[0-9]+.2s, v[0-9]+.2s, v[0-9]+.2s} 1 } } */ +/* { dg-final { scan-assembler-times {\tfabs\tv[0-9]+.2s, v[0-9]+.2s} 2 } } */ + +float32x4_t +test_vamaxq_f32 (float32x4_t a, float32x4_t b) +{ + return vmaxq_f32 (vabsq_f32 (a), vabsq_f32 (b)); +} + +/* { dg-final { scan-assembler-times {\tfamax\tv[0-9]+.4s, v[0-9]+.4s, v[0-9]+.4s} 0 } } */ +/* { dg-final { scan-assembler-times {\tfmax\tv[0-9]+.4s, v[0-9]+.4s, v[0-9]+.4s} 1 } } */ +/* { dg-final { scan-assembler-times {\tfabs\tv[0-9]+.4s, v[0-9]+.4s} 2 } } */ + +float64x2_t +test_vamaxq_f64 (float64x2_t a, float64x2_t b) +{ + return vmaxq_f64 (vabsq_f64 (a), vabsq_f64 (b)); +} + +/* { dg-final { scan-assembler-times {\tfamax\tv[0-9]+.2d, v[0-9]+.2d, v[0-9]+.2d} 0 } } */ +/* { dg-final { scan-assembler-times {\tfmax\tv[0-9]+.2d, v[0-9]+.2d, v[0-9]+.2d} 1 } } */ +/* { dg-final { scan-assembler-times {\tfabs\tv[0-9]+.2d, v[0-9]+.2d} 2 } } */ diff --git a/gcc/testsuite/gcc.target/aarch64/simd/faminmax-codegen.c b/gcc/testsuite/gcc.target/aarch64/simd/faminmax-codegen.c new file mode 100644 index 00000000000..e4e079a6f9e --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/simd/faminmax-codegen.c @@ -0,0 +1,104 @@ +/* { dg-do assemble} */ +/* { dg-additional-options "-O -march=armv9-a+faminmax" } */ + +#include "arm_neon.h" + +float16x4_t +test_vamax_f16 (float16x4_t a, float16x4_t b) +{ + return vmax_f16 (vabs_f16 (a), vabs_f16 (b)); +} + +/* { dg-final { scan-assembler-times {\tfamax\tv[0-9]+.4h, v[0-9]+.4h, v[0-9]+.4h} 1 } } */ +/* { dg-final { scan-assembler-times {\tfmax\tv[0-9]+.4h, v[0-9]+.4h, v[0-9]+.4h} 0 } } */ +/* { dg-final { scan-assembler-times {\tfabs\tv[0-9]+.4h, v[0-9]+.4h} 0 } } */ + +float16x8_t +test_vamaxq_f16 (float16x8_t a, float16x8_t b) +{ + return vmaxq_f16 (vabsq_f16 (a), vabsq_f16 (b)); +} + +/* { dg-final { scan-assembler-times {\tfamax\tv[0-9]+.8h, v[0-9]+.8h, v[0-9]+.8h} 1 } } */ +/* { dg-final { scan-assembler-times {\tfmax\tv[0-9]+.8h, v[0-9]+.8h, v[0-9]+.8h} 0 } } */ +/* { dg-final { scan-assembler-times {\tfabs\tv[0-9]+.8h, v[0-9]+.8h} 0 } } */ + +float32x2_t +test_vamax_f32 (float32x2_t a, float32x2_t b) +{ + return vmax_f32 (vabs_f32 (a), vabs_f32 (b)); +} + +/* { dg-final { scan-assembler-times {\tfamax\tv[0-9]+.2s, v[0-9]+.2s, v[0-9]+.2s} 1 } } */ +/* { dg-final { scan-assembler-times {\tfmax\tv[0-9]+.2s, v[0-9]+.2s, v[0-9]+.2s} 0 } } */ +/* { dg-final { scan-assembler-times {\tfabs\tv[0-9]+.2s, v[0-9]+.2s} 0 } } */ + +float32x4_t +test_vamaxq_f32 (float32x4_t a, float32x4_t b) +{ + return vmaxq_f32 (vabsq_f32 (a), vabsq_f32 (b)); +} + +/* { dg-final { scan-assembler-times {\tfamax\tv[0-9]+.4s, v[0-9]+.4s, v[0-9]+.4s} 1 } } */ +/* { dg-final { scan-assembler-times {\tfmax\tv[0-9]+.4s, v[0-9]+.4s, v[0-9]+.4s} 0 } } */ +/* { dg-final { scan-assembler-times {\tfabs\tv[0-9]+.4s, v[0-9]+.4s} 0 } } */ + +float64x2_t +test_vamaxq_f64 (float64x2_t a, float64x2_t b) +{ + return vmaxq_f64 (vabsq_f64 (a), vabsq_f64 (b)); +} + +/* { dg-final { scan-assembler-times {\tfamax\tv[0-9]+.2d, v[0-9]+.2d, v[0-9]+.2d} 1 } } */ +/* { dg-final { scan-assembler-times {\tfmax\tv[0-9]+.2d, v[0-9]+.2d, v[0-9]+.2d} 0 } } */ +/* { dg-final { scan-assembler-times {\tfabs\tv[0-9]+.2d, v[0-9]+.2d} 0 } } */ + +float16x4_t +test_vamin_f16 (float16x4_t a, float16x4_t b) +{ + return vmin_f16 (vabs_f16 (a), vabs_f16 (b)); +} + +/* { dg-final { scan-assembler-times {\tfamin\tv[0-9]+.4h, v[0-9]+.4h, v[0-9]+.4h} 1 } } */ +/* { dg-final { scan-assembler-times {\tfmin\tv[0-9]+.4h, v[0-9]+.4h, v[0-9]+.4h} 0 } } */ +/* { dg-final { scan-assembler-times {\tfabs\tv[0-9]+.4h, v[0-9]+.4h} 0 } } */ + +float16x8_t +test_vaminq_f16 (float16x8_t a, float16x8_t b) +{ + return vminq_f16 (vabsq_f16 (a), vabsq_f16 (b)); +} + +/* { dg-final { scan-assembler-times {\tfamin\tv[0-9]+.8h, v[0-9]+.8h, v[0-9]+.8h} 1 } } */ +/* { dg-final { scan-assembler-times {\tfmin\tv[0-9]+.8h, v[0-9]+.8h, v[0-9]+.8h} 0 } } */ +/* { dg-final { scan-assembler-times {\tfabs\tv[0-9]+.8h, v[0-9]+.8h} 0 } } */ + +float32x2_t +test_vamin_f32 (float32x2_t a, float32x2_t b) +{ + return vmin_f32 (vabs_f32 (a), vabs_f32 (b)); +} + +/* { dg-final { scan-assembler-times {\tfamin\tv[0-9]+.2s, v[0-9]+.2s, v[0-9]+.2s} 1 } } */ +/* { dg-final { scan-assembler-times {\tfmin\tv[0-9]+.2s, v[0-9]+.2s, v[0-9]+.2s} 0 } } */ +/* { dg-final { scan-assembler-times {\tfabs\tv[0-9]+.2s, v[0-9]+.2s} 0 } } */ + +float32x4_t +test_vaminq_f32 (float32x4_t a, float32x4_t b) +{ + return vminq_f32 (vabsq_f32 (a), vabsq_f32 (b)); +} + +/* { dg-final { scan-assembler-times {\tfamin\tv[0-9]+.4s, v[0-9]+.4s, v[0-9]+.4s} 1 } } */ +/* { dg-final { scan-assembler-times {\tfmin\tv[0-9]+.4s, v[0-9]+.4s, v[0-9]+.4s} 0 } } */ +/* { dg-final { scan-assembler-times {\tfabs\tv[0-9]+.4s, v[0-9]+.4s} 0 } } */ + +float64x2_t +test_vaminq_f64 (float64x2_t a, float64x2_t b) +{ + return vminq_f64 (vabsq_f64 (a), vabsq_f64 (b)); +} + +/* { dg-final { scan-assembler-times {\tfamin\tv[0-9]+.2d, v[0-9]+.2d, v[0-9]+.2d} 1 } } */ +/* { dg-final { scan-assembler-times {\tfmin\tv[0-9]+.2d, v[0-9]+.2d, v[0-9]+.2d} 0 } } */ +/* { dg-final { scan-assembler-times {\tfabs\tv[0-9]+.2d, v[0-9]+.2d} 0 } } */