From patchwork Wed Sep 18 13:01:48 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Saurabh Jha X-Patchwork-Id: 97642 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 823F4385C6D1 for ; Wed, 18 Sep 2024 13:03:22 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from EUR02-VI1-obe.outbound.protection.outlook.com (mail-vi1eur02on20606.outbound.protection.outlook.com [IPv6:2a01:111:f403:2607::606]) by sourceware.org (Postfix) with ESMTPS id 25B033858435 for ; Wed, 18 Sep 2024 13:02:44 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 25B033858435 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 25B033858435 Authentication-Results: server2.sourceware.org; arc=pass smtp.remote-ip=2a01:111:f403:2607::606 ARC-Seal: i=3; a=rsa-sha256; d=sourceware.org; s=key; t=1726664567; cv=pass; b=mzPYUaXeMs29qwlmQTuRys47Iyic+DrJXFo9VuxqbHWlyvl61pynNzbYcP9HVp1F3pmiofVCh8o/J7qiXSQFAcwUqkp/GygxTGRa5TCoX8PbNmGvDUkoAhoVejhfYXsUeN0av5t1p0XSt85/mq4tTM/KT5Rw4a3veb/cadDIEoQ= ARC-Message-Signature: i=3; a=rsa-sha256; d=sourceware.org; s=key; t=1726664567; c=relaxed/simple; bh=aNTdzsujh9KnqXL8AP/2l09VxlVqCLSFhyaPGFM3eV8=; h=DKIM-Signature:DKIM-Signature:From:To:Subject:Date:Message-ID: MIME-Version; b=oWwnFmMqzn27rSVDeRQd/DcMnftZmMQKRLZ49GnqqYuhXeN0wlCt3VQ8bzyuj7R7O4kuYNwVI0EQlaoTwBfZgWLCtBu9ifNX/3+4tD8ROcKwjIIFkCJHLc0yP5L+tk1igJ3Qc4BUlhfYfgyywVC/h0l4Jqb1YWBNIiG9TNy8saY= ARC-Authentication-Results: i=3; server2.sourceware.org ARC-Seal: i=2; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=pass; b=Slzw1W7ITUSGIMbviFuQKv9ekEdz1ebpnGyp8FfceRIqsOTUgoMaqCfClVYyLSTVMpSAvOaal63cPuDfzfJUTJriaFBtRjxVqPBYFbMA9+FSGT4sFVediZi+x0xyX45pXqKTyKDSibMTMq6HnDzVa9dqtTIwnwKphDFDumH2IhZDVJqYLJsNGhdAaRAENlkzLnoN1i65WaQMhJiBRAxKA52qkda0ZGOr3tJrApwomzWQMfojdibbA7LbMisJQpF0YRCt45h0h8yPxdEYrbI+ykugqEDsDkEx8T3QishrASYIgcbkAOmpxPIG6bwNHflVW8g0NrTXKyuUt1hXKf+F8g== 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=VR6Nl4qft3Y95UfbvPA2vJ1vbQmGiih9mhfcSmSugrY=; b=IzdnRTpPTLUu38sS+taWJtkk7wnNl16OB7aIyhw5YQdxtz19uy22HcCKEhiKnKIZc8oA379IMrU7axArvKbTa8u6KKbfacZGQCAqr+af1faH9HeOAadlwGvyXFBN/ZOxXD3dM3l4mV8ZPGQZnDiMBfS1jR4st+XlQuX/1jJ5K5cP+uj7DvYcB3MfI3H0kGv0vsBPyEa108EOdab+PZCVjtr5kgH//2DPYESzH2d2doEMGLNWc7UeZLCagsuj+XrR57YMOEtDyt4EM6aU37AZCKC4V1R8hDRos26F0Lfw9kmI804zBTHDZBWpm+GFc8+Meu2k+yxRbeXjaD8xj/NaeA== 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=VR6Nl4qft3Y95UfbvPA2vJ1vbQmGiih9mhfcSmSugrY=; b=NBgEkHeFNQtarL0EqcqEuPJ/2KkTqpOBMzXxXmN5SXMkNQgjoiNewy+qn7MYYE2Wro2iWR5HR2KLi8xNMUuRevMFPxPX6Zg4UvA//YPBJy9Kk3Rf/YIecKnkljnkpbh2tAZZGEj2JTqgliLBm+8ElcwD+LQyBkb4UpDT1Kv8mRg= Received: from DB3PR06CA0034.eurprd06.prod.outlook.com (2603:10a6:8:1::47) by AM9PR08MB6084.eurprd08.prod.outlook.com (2603:10a6:20b:287::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7982.16; Wed, 18 Sep 2024 13:02:37 +0000 Received: from DB1PEPF000509E9.eurprd03.prod.outlook.com (2603:10a6:8:1:cafe::dc) by DB3PR06CA0034.outlook.office365.com (2603:10a6:8:1::47) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7962.25 via Frontend Transport; Wed, 18 Sep 2024 13:02:34 +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 DB1PEPF000509E9.mail.protection.outlook.com (10.167.242.59) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.7918.13 via Frontend Transport; Wed, 18 Sep 2024 13:02:32 +0000 Received: ("Tessian outbound d89c8a00b6f7:v457"); Wed, 18 Sep 2024 13:02:32 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 3abb60b747985cda X-TessianGatewayMetadata: HRXA7p0ZaaRz+SFRC/UE4XUlTBxsDSpT0C/5TMYOsNFRfPhdcYJWqx53nKDIFttj2fJCsc2c+Rqb55qBjcmMfC9ucjGMdqVRjFTDICuvt60poRgV5x4HW2aFJONmd31r1NjLnIoFD/yJlNfuOP/BLrU+NWqueJGe9tTNs963l7g= X-CR-MTA-TID: 64aa7808 Received: from Lff08cf81d1e6.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 833B7AF5-B85B-48C1-AB1C-CA1ABD98A842.1; Wed, 18 Sep 2024 13:02:20 +0000 Received: from EUR02-VI1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id Lff08cf81d1e6.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Wed, 18 Sep 2024 13:02:20 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=P3Rxzpyd6toW/6QfddKDG+GHtFnbjfLeEk9rNrqe/w1fGr90xNBg8J72EcgTpIuQImgKBXG3WqSAHAHjX2FcHLUTTntiNJYbxM3XZFC201c8ketXIr4Yz/GwuHpyEeeRmQxmHSO9rAZWI57+zrnpCdPwrTJE6A9vK9LFRCGHf9tumvxIkQAVu/8Rc4wR52/7b8Ubs/fnw7PIPFNK5frvi/BRkuSQ6lXDyXlqRGs93sppMl1bHSHvGNgLmBzHWU6hszudERz3rzU14TQcjOh5kPBtBb2etCVHyrjDZeDpwbhxkjf+bIIkBFrYyYqMqPeuKFcx8CtsS15GxxQDyQ13lw== 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=VR6Nl4qft3Y95UfbvPA2vJ1vbQmGiih9mhfcSmSugrY=; b=FH94xQi7Qjr5RDoMe7Hk4G6BE+czEcb+ciWOPoAyaK5atiV8CwL2jJ+3ByR6+rROy+qehhcmURiAM2YmeiZMfLRdc3iKWIgPmuVRwPstjQhp9/xGwY0CwyVw3V3mUY0xTV6FTnsSZ9SrpjDerDjNPwZiRfHXI00tn9a+q0glv1G26l36ey/W/gL4EuVAJMx5ctFxD8lJ3rV9CweLZScKjuxlIsDkkW2pbeqIBXhxbAYPVmJPKlacXuZF8J6+Tf5TAWTTGBJrBDVdads/HOVU0nTfDwHEQAJVrpmOKsaXRBh1Xzg6eCJwzEWoz2jqLo63N57LHqrzqGyobON8ajsmYQ== 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=VR6Nl4qft3Y95UfbvPA2vJ1vbQmGiih9mhfcSmSugrY=; b=NBgEkHeFNQtarL0EqcqEuPJ/2KkTqpOBMzXxXmN5SXMkNQgjoiNewy+qn7MYYE2Wro2iWR5HR2KLi8xNMUuRevMFPxPX6Zg4UvA//YPBJy9Kk3Rf/YIecKnkljnkpbh2tAZZGEj2JTqgliLBm+8ElcwD+LQyBkb4UpDT1Kv8mRg= Received: from AS8PR05CA0019.eurprd05.prod.outlook.com (2603:10a6:20b:311::24) by DB8PR08MB5513.eurprd08.prod.outlook.com (2603:10a6:10:f8::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7982.16; Wed, 18 Sep 2024 13:02:15 +0000 Received: from AMS1EPF00000042.eurprd04.prod.outlook.com (2603:10a6:20b:311:cafe::ad) by AS8PR05CA0019.outlook.office365.com (2603:10a6:20b:311::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7939.30 via Frontend Transport; Wed, 18 Sep 2024 13:02:15 +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 AMS1EPF00000042.mail.protection.outlook.com (10.167.16.39) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7918.13 via Frontend Transport; Wed, 18 Sep 2024 13:02:15 +0000 Received: from AZ-NEU-EX03.Arm.com (10.251.24.31) 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; Wed, 18 Sep 2024 13:02:12 +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; Wed, 18 Sep 2024 13:02:12 +0000 From: To: CC: , , Saurabh Jha Subject: [PATCH v9 1/2] aarch64: Add AdvSIMD faminmax intrinsics Date: Wed, 18 Sep 2024 14:01:48 +0100 Message-ID: <20240918130149.2239226-2-saurabh.jha@arm.com> X-Mailer: git-send-email 2.43.2 In-Reply-To: <20240918130149.2239226-1-saurabh.jha@arm.com> References: <20240918130149.2239226-1-saurabh.jha@arm.com> MIME-Version: 1.0 X-EOPAttributedMessage: 1 X-MS-TrafficTypeDiagnostic: AMS1EPF00000042:EE_|DB8PR08MB5513:EE_|DB1PEPF000509E9:EE_|AM9PR08MB6084:EE_ X-MS-Office365-Filtering-Correlation-Id: 52b3fb3f-1753-4cb4-7b26-08dcd7e228d3 x-checkrecipientrouted: true NoDisclaimer: true X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; ARA:13230040|1800799024|82310400026|36860700013|376014; X-Microsoft-Antispam-Message-Info-Original: kX8IcXvXw86n+1o0LF4zG98vqTLtfixkQEVaqNIJip4iHXmQpW8/xoii6IOsLNrLy+AHoQuIhDPq4WlA+IfkvLHTtsViBiphfjiTWSjLPQiOwssFVAyfqaOzebSv58XGS+iJWQljjeBi21MmLjpoma4BxGPZ9ZQxMrZc7IG4z6XaYu3qJIsRbBdrWWyDBP62yjWW6eUW9dBl5s/HXpglzjY54y+W8eXDdvGGN10GKNXicXvn8udBsAcbKhRXxiws0wKdBuRiTr0/XQVNE1HgdaYsyszTYRRbkcrtzK4swCYqEda/RBi2FCsG5F577BMwv9SE2haKoO3AGIeHMj9A5o2WLjuw6ZwNRdv9Qe08JREoCE8+YYErcgIqoV7AiFQqDh8Mk7KnL3aBSHNOGjdgKr9jlraBuJm0DqOrFIe3+0T335rTpoLdlxCQ/FKslWy2Hr0Ra99b0k+xFEswfkaXzJLCxNQ2ndxhelfPfacQ5dxoXMATDXRqnja7dV4yzPWBXulOBsnu+V8HsNrzdL/QYCmggDpdR4iwSGAsju/PVvtvFOQqXt/KVEXhuaZ23I97THaBirpHhfHA5Lh3l3IulqO6aOWzoi6VwKSCYJDNuXvrAhGZGJwFxgZ0diF44QyqcRZ0rTXs3EJ3BWxNeOS14NLNg3vZiHWc3+j3mRq/BWT6iBdtaPplSWNx4kpUJfMmrHmP1DtrK9dCaCocen/0eYfmwYiOyyiXzdyRGr/ymBJM3F47D7GliB1oTGuTwO0m+9BcuUE3IsbIdjvAL9+EY8F1hhJV9NKcNzDmZsrsvKKkdcUrSbEsZyg11Xm4TMJJxoDJseKERieokL9cUoFhHTdd4oj4OHFEUJGgpz0k25Wb7Aj3SVOVmOUGX+RwiZt9hC2umQEYv7BiRrwakZmQt5X59oV0Tuz5gCVCuddiYsiRORjWbP2CCsTE2pJ3lVuRCH5xmLZrAyADgolQMdSpElS1/owGSpy1ol8MloUcpi6jOjvOEgPMeUMqoimQ8v344ISVTkw1tYDkGa6FY+Ju9DbjZ8LyGgYw7gaPWGZFhiSBN8y+tEcUzaSm2twpC3wjR72y+Hre9j3PtE4GbdD6H85CKsXV39RsJub1c6PsoRQ26M3wjAp4vUuN2vhZIcW99G2jciiKKi1mnUJ1b6rvxmg9H2dKzYGsRJkhZt3vZYwtEAjH+bABPOY9LaFQj1JVUeXqR3Zs4+cGOelNpV2F6gXFF1cI6CioajpXJIEZDEVAQ3IYoYkUACLbSAXypDxkrGoCuvvfz0t9sGkU8t1sc+wvExjo+DqSwP7rQZ8kw6MjcyHlPjdCX/QFh5XkvdAvbsq6twXkHtKf13yDS3XJ2FSMskfaFg9HEl9tECV8SdJQCya1ioEE8Hglf1wwyJUCy+Xt2MpVcOwlrwmSZFlF1Q== 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)(1800799024)(82310400026)(36860700013)(376014); DIR:OUT; SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB8PR08MB5513 X-MS-Exchange-SkipListedInternetSender: ip=[2603:10a6:20b:311::24]; domain=AS8PR05CA0019.eurprd05.prod.outlook.com X-MS-Exchange-Transport-CrossTenantHeadersStripped: DB1PEPF000509E9.eurprd03.prod.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 133c54a9-5036-48ab-45aa-08dcd7e21e5f X-Microsoft-Antispam: BCL:0; ARA:13230040|35042699022|1800799024|82310400026|376014|36860700013; X-Microsoft-Antispam-Message-Info: =?utf-8?q?MKDlDrfGg4cyeyijmk3knu4uJ7JkNsD?= =?utf-8?q?qyoO/A6kemj+Q59otfRoCazQXRoWwg3ajFx1GQDEKWiyuhGsu0N9ILA9C7J7F2cBV?= =?utf-8?q?rnsnDOxJkEc1skt6BQbE2YQsw2NEmdS56t/UF2M7tqauYas0nBzq3GSUHIWI2NZi0?= =?utf-8?q?LKRQ92d/96ELL2wiF48fyub0Uxyrww7A5g2m5kfnQqeHGVytOjAFzaZpn5aqFvbAf?= =?utf-8?q?Wh/2EFYvknk2PPt2ffv31QskNBfisVhWYUpESFvHvNeJKv5ZsXZHl3uYPwuVuhYN1?= =?utf-8?q?JVYpSxKJ64NS/3IsKNnE9j2VLTJgSHbAlnyejbUQV4zV+LbT42SZgn8zX8FAKZWcX?= =?utf-8?q?382h5YfZ5V1UMHbD1zHG7BVm026p7tAX583wEgCV25ASHhtqAUSCIu9+BtmA1EMrp?= =?utf-8?q?6y9/CTYfX1x+XCA2sWQy1WxsEi2svzWF7yJcxOr966kYmpaLyAVicxUy6YUUSDKn3?= =?utf-8?q?rqn1j8Tvktfer338cla6EpWQ+TGu4NcyRFT+sGxa0GBGru8s62dvsjoLhlAj4cGyj?= =?utf-8?q?BtEVTbSSU6aBIR9QQ4MyS1AcP5VT19q96imL8RlZDcjBhUHKwYL6YWvlaURCnlt/y?= =?utf-8?q?LyMmKUSTzLEPgg2f5KcqU7TcyxVijW33WBCz5KSzfS3mIwgj7hgdFb15IkfV7w+28?= =?utf-8?q?AG5Ti4m78jdjO5FT5IjAAwGgGs3IY8PlHBXiAktOIbVaqqAaGFX16b0BDS0UMuJ/C?= =?utf-8?q?Qj5WcwcPfwf8Pn/JC0S7LRcQSOB1pl00jVcYEOcP2d82l81/nU5TcSp43W9xooyjm?= =?utf-8?q?8ppYte1jsxViGXqAEyp8lYSFMoktYAmAtagk8c2nDzM2DZiIpvz/nNNWx/JgfcJVi?= =?utf-8?q?AsHXLAVBmoSY1+NvMEeFDC3tbXdfCY/UJGLkQr0nRrjr+ZuRmrVApB2VxYlYMHUKn?= =?utf-8?q?o5Rwf1SE4fEZJmmM6gsd+s94K06ZxuoOpCvGJS8S+60b8L9+951lF4jbsptIe+Eke?= =?utf-8?q?iXpE+XieYb8WVTpa1dR77m1rkGYsQWq+SQe021Axy7NNXU6eGBfg3Eh5L5pG9DioS?= =?utf-8?q?2e/fbQIYr/jSC2w5wUAqBPz86+1rCj9nyubU0A+E8jncA90xTAgkSrWlJ3f4zjAo8?= =?utf-8?q?Be3q+cTuPoXd37oAXcSjhblwFOTV0QncIHpH0mOtoKWAsc+9GENtixikuLA0EcXgK?= =?utf-8?q?rO12QKErqSWWyctEW30N9UnVAaZjWYUn3radVPHLBoD+ziJh6Lm/nj0D5jUUxtnnQ?= =?utf-8?q?+/2tnGxOZ8OJ3OYRPLsnjUlZ14v3ls2G1qHaUyHEnIzmpDSrdF0TbMlB9nl7g/Ow6?= =?utf-8?q?kWjE+DA68Z5v0JJT1UbQZ+qawIN+H8jCojSTsmkgX1X9u1RzXmfZ/7U/iszajsIqv?= =?utf-8?q?jA0NE/U5BM+o+m5X+Sy/GGYtB1nPlq27DA=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)(82310400026)(376014)(36860700013); DIR:OUT; SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Sep 2024 13:02:32.6828 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 52b3fb3f-1753-4cb4-7b26-08dcd7e228d3 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: DB1PEPF000509E9.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM9PR08MB6084 X-Spam-Status: No, score=-11.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FORGED_SPF_HELO, GIT_PATCH_0, 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 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 introduces AdvSIMD faminmax intrinsics. 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 We are defining a new way to add AArch64 AdvSIMD intrinsics by listing all the intrinsics in a .def file and then using that .def file to initialise various data structures. This would lead to more concise code and easier addition of the new AdvSIMD intrinsics in future. The faminmax intrinsics are defined using the new approach. gcc/ChangeLog: * config/aarch64/aarch64-builtins.cc (ENTRY): Macro to parse the contents of aarch64-simd-pragma-builtins.def. (ENTRY_VHSDF): Macro to parse the contents of aarch64-simd-pragma-builtins.def. (enum aarch64_builtins): New enum values for faminmax builtins via aarch64-simd-pragma-builtins.def. (enum class aarch64_builtin_signatures): Enum class to specify the number of operands a builtin will take. (struct aarch64_pragma_builtins_data): Struct to hold data from aarch64-simd-pragma-builtins.def. (aarch64_fntype): New function to define function types of intrinsics given an object of type aarch64_pragma_builtins_data. (aarch64_init_pragma_builtins): New function to define pragma builtins. (aarch64_get_pragma_builtin): New function to get a row of aarch64_pragma_builtins, given code. (handle_arm_neon_h): Modify to call aarch64_init_pragma_builtins. (aarch64_general_check_builtin_call): Modify to check whether required flag is being used for pragma builtins. (aarch64_expand_pragma_builtin): New function to emit instructions of pragma_builtin. (aarch64_general_expand_builtin): Modify to call aarch64_expand_pragma_builtin. * config/aarch64/aarch64-option-extensions.def (AARCH64_OPT_EXTENSION): Introduce new flag for this extension. * config/aarch64/aarch64-simd.md (@aarch64_): Instruction pattern for faminmax intrinsics. * config/aarch64/aarch64.h (TARGET_FAMINMAX): Introduce new flag for this extension. * config/aarch64/iterators.md: New iterators and unspecs. * doc/invoke.texi: Document extension in AArch64 Options. * config/aarch64/aarch64-simd-pragma-builtins.def: New file to list pragma builtins. gcc/testsuite/ChangeLog: * gcc.target/aarch64/simd/faminmax-builtins-no-flag.c: New test. * gcc.target/aarch64/simd/faminmax-builtins.c: New test. --- gcc/config/aarch64/aarch64-builtins.cc | 119 ++++++++++++++++++ .../aarch64/aarch64-option-extensions.def | 2 + .../aarch64/aarch64-simd-pragma-builtins.def | 23 ++++ gcc/config/aarch64/aarch64-simd.md | 10 ++ gcc/config/aarch64/aarch64.h | 4 + gcc/config/aarch64/iterators.md | 9 ++ gcc/doc/invoke.texi | 2 + .../aarch64/simd/faminmax-builtins-no-flag.c | 10 ++ .../aarch64/simd/faminmax-builtins.c | 115 +++++++++++++++++ 9 files changed, 294 insertions(+) create mode 100644 gcc/config/aarch64/aarch64-simd-pragma-builtins.def 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 diff --git a/gcc/config/aarch64/aarch64-builtins.cc b/gcc/config/aarch64/aarch64-builtins.cc index eb878b933fe..6266bea3b39 100644 --- a/gcc/config/aarch64/aarch64-builtins.cc +++ b/gcc/config/aarch64/aarch64-builtins.cc @@ -757,6 +757,18 @@ typedef struct #define VAR1(T, N, MAP, FLAG, A) \ AARCH64_SIMD_BUILTIN_##T##_##N##A, +#undef ENTRY +#define ENTRY(N, S, M, U, F) \ + AARCH64_##N, + +#undef ENTRY_VHSDF +#define ENTRY_VHSDF(NAME, SIGNATURE, UNSPEC, EXTENSIONS) \ + AARCH64_##NAME##_f16, \ + AARCH64_##NAME##q_f16, \ + AARCH64_##NAME##_f32, \ + AARCH64_##NAME##q_f32, \ + AARCH64_##NAME##q_f64, + enum aarch64_builtins { AARCH64_BUILTIN_MIN, @@ -829,6 +841,10 @@ enum aarch64_builtins AARCH64_RBIT, AARCH64_RBITL, AARCH64_RBITLL, + /* Pragma builtins. */ + AARCH64_PRAGMA_BUILTIN_START, +#include "aarch64-simd-pragma-builtins.def" + AARCH64_PRAGMA_BUILTIN_END, /* System register builtins. */ AARCH64_RSR, AARCH64_RSRP, @@ -947,6 +963,7 @@ const char *aarch64_scalar_builtin_types[] = { extern GTY(()) aarch64_simd_type_info aarch64_simd_types[]; +#undef ENTRY #define ENTRY(E, M, Q, G) \ {E, "__" #E, #G "__" #E, NULL_TREE, NULL_TREE, E_##M##mode, qualifier_##Q}, struct aarch64_simd_type_info aarch64_simd_types [] = { @@ -1547,6 +1564,78 @@ aarch64_init_simd_builtin_functions (bool called_from_pragma) } } +enum class aarch64_builtin_signatures +{ + binary, +}; + +#undef ENTRY +#define ENTRY(N, S, M, U, F) \ + {#N, aarch64_builtin_signatures::S, E_##M##mode, U, F}, + +#undef ENTRY_VHSDF +#define ENTRY_VHSDF(NAME, SIGNATURE, UNSPEC, EXTENSIONS) \ + ENTRY (NAME##_f16, SIGNATURE, V4HF, UNSPEC, EXTENSIONS) \ + ENTRY (NAME##q_f16, SIGNATURE, V8HF, UNSPEC, EXTENSIONS) \ + ENTRY (NAME##_f32, SIGNATURE, V2SF, UNSPEC, EXTENSIONS) \ + ENTRY (NAME##q_f32, SIGNATURE, V4SF, UNSPEC, EXTENSIONS) \ + ENTRY (NAME##q_f64, SIGNATURE, V2DF, UNSPEC, EXTENSIONS) + +/* Initialize pragma builtins. */ + +struct aarch64_pragma_builtins_data +{ + const char *name; + aarch64_builtin_signatures signature; + machine_mode mode; + int unspec; + aarch64_feature_flags required_extensions; +}; + +static aarch64_pragma_builtins_data aarch64_pragma_builtins[] = { +#include "aarch64-simd-pragma-builtins.def" +}; + +static tree +aarch64_fntype (const aarch64_pragma_builtins_data &builtin_data) +{ + auto type = aarch64_simd_builtin_type (builtin_data.mode, qualifier_none); + switch (builtin_data.signature) + { + case aarch64_builtin_signatures::binary: + return build_function_type_list (type, type, type, NULL_TREE); + default: + gcc_unreachable (); + } +} + +static void +aarch64_init_pragma_builtins () +{ + for (size_t i = 0; i < ARRAY_SIZE (aarch64_pragma_builtins); ++i) + { + auto data = aarch64_pragma_builtins[i]; + auto fntype = aarch64_fntype (data); + auto code = AARCH64_PRAGMA_BUILTIN_START + i + 1; + aarch64_builtin_decls[code] + = aarch64_general_simulate_builtin (data.name, fntype, code); + } +} + +/* If the builtin function with code CODE has an entry in + aarch64_pragma_builtins, return its entry, otherwise return null. */ + +static const aarch64_pragma_builtins_data* +aarch64_get_pragma_builtin (int code) +{ + if (!(code > AARCH64_PRAGMA_BUILTIN_START + && code < AARCH64_PRAGMA_BUILTIN_END)) + return NULL; + + auto idx = code - (AARCH64_PRAGMA_BUILTIN_START + 1); + return &aarch64_pragma_builtins[idx]; +} + /* Register the tuple type that contains NUM_VECTORS of the AdvSIMD type indexed by TYPE_INDEX. */ static void @@ -1640,6 +1729,7 @@ handle_arm_neon_h (void) aarch64_init_simd_builtin_functions (true); aarch64_init_simd_intrinsics (); + aarch64_init_pragma_builtins (); } static void @@ -2326,6 +2416,12 @@ aarch64_general_check_builtin_call (location_t location, vec, return aarch64_check_required_extensions (location, decl, AARCH64_FL_MEMTAG); + if (auto builtin_data = aarch64_get_pragma_builtin (code)) + { + auto flags = builtin_data->required_extensions; + return aarch64_check_required_extensions (location, decl, flags); + } + return true; } @@ -3189,6 +3285,25 @@ aarch64_expand_builtin_data_intrinsic (unsigned int fcode, tree exp, rtx target) return ops[0].value; } +static rtx +aarch64_expand_pragma_builtin (tree exp, rtx target, + const aarch64_pragma_builtins_data *builtin_data) +{ + expand_operand ops[3]; + auto mode = builtin_data->mode; + auto op1 = expand_normal (CALL_EXPR_ARG (exp, 0)); + auto op2 = expand_normal (CALL_EXPR_ARG (exp, 1)); + create_output_operand (&ops[0], target, mode); + create_input_operand (&ops[1], op1, mode); + create_input_operand (&ops[2], op2, mode); + + auto unspec = builtin_data->unspec; + auto icode = code_for_aarch64 (unspec, mode); + expand_insn (icode, 3, ops); + + return target; +} + /* Expand an expression EXP as fpsr or fpcr setter (depending on UNSPEC) using MODE. */ static void @@ -3369,6 +3484,9 @@ aarch64_general_expand_builtin (unsigned int fcode, tree exp, rtx target, && fcode <= AARCH64_RBITLL) return aarch64_expand_builtin_data_intrinsic (fcode, exp, target); + if (auto builtin_data = aarch64_get_pragma_builtin (fcode)) + return aarch64_expand_pragma_builtin (exp, target, builtin_data); + gcc_unreachable (); } @@ -4021,6 +4139,7 @@ aarch64_resolve_overloaded_builtin_general (location_t loc, tree function, #undef CF3 #undef CF4 #undef CF10 +#undef ENTRY_VHSDF #undef VAR1 #undef VAR2 #undef VAR3 diff --git a/gcc/config/aarch64/aarch64-option-extensions.def b/gcc/config/aarch64/aarch64-option-extensions.def index 6998627f377..8279f5a76ea 100644 --- a/gcc/config/aarch64/aarch64-option-extensions.def +++ b/gcc/config/aarch64/aarch64-option-extensions.def @@ -234,6 +234,8 @@ AARCH64_OPT_EXTENSION("gcs", GCS, (), (), (), "gcs") AARCH64_OPT_EXTENSION("fp8", FP8, (SIMD), (), (), "fp8") +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-pragma-builtins.def b/gcc/config/aarch64/aarch64-simd-pragma-builtins.def new file mode 100644 index 00000000000..f432185be46 --- /dev/null +++ b/gcc/config/aarch64/aarch64-simd-pragma-builtins.def @@ -0,0 +1,23 @@ +/* AArch64 SIMD pragma builtins + Copyright (C) 2024 Free Software Foundation, Inc. + Contributed by ARM Ltd. + + This file is part of GCC. + + GCC is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3, or (at your option) + any later version. + + GCC is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GCC; see the file COPYING3. If not see + . */ + +// faminmax +ENTRY_VHSDF (vamax, binary, UNSPEC_FAMAX, AARCH64_FL_FAMINMAX) +ENTRY_VHSDF (vamin, binary, UNSPEC_FAMIN, AARCH64_FL_FAMINMAX) diff --git a/gcc/config/aarch64/aarch64-simd.md b/gcc/config/aarch64/aarch64-simd.md index 23c03a96371..67f0fe26f93 100644 --- a/gcc/config/aarch64/aarch64-simd.md +++ b/gcc/config/aarch64/aarch64-simd.md @@ -9910,3 +9910,13 @@ "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 [(match_operand:VHSDF 1 "register_operand" "w") + (match_operand:VHSDF 2 "register_operand" "w")] + FAMINMAX_UNS))] + "TARGET_FAMINMAX" + "\t%0., %1., %2." +) diff --git a/gcc/config/aarch64/aarch64.h b/gcc/config/aarch64/aarch64.h index 2dfb999bea5..e754c4ea748 100644 --- a/gcc/config/aarch64/aarch64.h +++ b/gcc/config/aarch64/aarch64.h @@ -457,6 +457,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 20a318e023b..17ac5e073aa 100644 --- a/gcc/config/aarch64/iterators.md +++ b/gcc/config/aarch64/iterators.md @@ -1057,6 +1057,8 @@ UNSPEC_BFCVTN2 ; Used in aarch64-simd.md. UNSPEC_BFCVT ; Used in aarch64-simd.md. UNSPEC_FCVTXN ; Used in aarch64-simd.md. + UNSPEC_FAMAX ; Used in aarch64-simd.md. + UNSPEC_FAMIN ; Used in aarch64-simd.md. ;; All used in aarch64-sve2.md UNSPEC_FCVTN @@ -4463,3 +4465,10 @@ (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 FAMINMAX_UNS [UNSPEC_FAMAX UNSPEC_FAMIN]) + +(define_int_attr faminmax_uns_op + [(UNSPEC_FAMAX "famax") (UNSPEC_FAMIN "famin")]) diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi index 511b8c8d311..e005d9bbfb0 100644 --- a/gcc/doc/invoke.texi +++ b/gcc/doc/invoke.texi @@ -21865,6 +21865,8 @@ Enable support for Armv8.9-a/9.4-a translation hardening extension. Enable the RCpc3 (Release Consistency) extension. @item fp8 Enable the fp8 (8-bit floating point) 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..7e4f3eba81a --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/simd/faminmax-builtins.c @@ -0,0 +1,115 @@ +/* { dg-do assemble} */ +/* { dg-additional-options "-O3 -march=armv9-a+faminmax" } */ +/* { dg-final { check-function-bodies "**" "" } } */ + +#include "arm_neon.h" + +/* +** test_vamax_f16: +** famax v0.4h, v0.4h, v1.4h +** ret +*/ +float16x4_t +test_vamax_f16 (float16x4_t a, float16x4_t b) +{ + return vamax_f16 (a, b); +} + +/* +** test_vamaxq_f16: +** famax v0.8h, v0.8h, v1.8h +** ret +*/ +float16x8_t +test_vamaxq_f16 (float16x8_t a, float16x8_t b) +{ + return vamaxq_f16 (a, b); +} + +/* +** test_vamax_f32: +** famax v0.2s, v0.2s, v1.2s +** ret +*/ +float32x2_t +test_vamax_f32 (float32x2_t a, float32x2_t b) +{ + return vamax_f32 (a, b); +} + +/* +** test_vamaxq_f32: +** famax v0.4s, v0.4s, v1.4s +** ret +*/ +float32x4_t +test_vamaxq_f32 (float32x4_t a, float32x4_t b) +{ + return vamaxq_f32 (a, b); +} + +/* +** test_vamaxq_f64: +** famax v0.2d, v0.2d, v1.2d +** ret +*/ +float64x2_t +test_vamaxq_f64 (float64x2_t a, float64x2_t b) +{ + return vamaxq_f64 (a, b); +} + +/* +** test_vamin_f16: +** famin v0.4h, v0.4h, v1.4h +** ret +*/ +float16x4_t +test_vamin_f16 (float16x4_t a, float16x4_t b) +{ + return vamin_f16 (a, b); +} + +/* +** test_vaminq_f16: +** famin v0.8h, v0.8h, v1.8h +** ret +*/ +float16x8_t +test_vaminq_f16 (float16x8_t a, float16x8_t b) +{ + return vaminq_f16 (a, b); +} + +/* +** test_vamin_f32: +** famin v0.2s, v0.2s, v1.2s +** ret +*/ +float32x2_t +test_vamin_f32 (float32x2_t a, float32x2_t b) +{ + return vamin_f32 (a, b); +} + +/* +** test_vaminq_f32: +** famin v0.4s, v0.4s, v1.4s +** ret +*/ +float32x4_t +test_vaminq_f32 (float32x4_t a, float32x4_t b) +{ + return vaminq_f32 (a, b); +} + +/* +** test_vaminq_f64: +** famin v0.2d, v0.2d, v1.2d +** ret +*/ +float64x2_t +test_vaminq_f64 (float64x2_t a, float64x2_t b) +{ + return vaminq_f64 (a, b); +} From patchwork Wed Sep 18 13:01:49 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Saurabh Jha X-Patchwork-Id: 97643 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 B029B385DDC2 for ; Wed, 18 Sep 2024 13:03:42 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05on20628.outbound.protection.outlook.com [IPv6:2a01:111:f400:7e1a::628]) by sourceware.org (Postfix) with ESMTPS id A4E08385AC29 for ; Wed, 18 Sep 2024 13:03:07 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org A4E08385AC29 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 A4E08385AC29 Authentication-Results: server2.sourceware.org; arc=pass smtp.remote-ip=2a01:111:f400:7e1a::628 ARC-Seal: i=3; a=rsa-sha256; d=sourceware.org; s=key; t=1726664590; cv=pass; b=IXnYnuFF8CWPoSYcyGnqk82iI2m+wgyS41LgR3qEcE5ZWHnG+7Lzqg4hYHpqF7Np7381usXu7C4nrGqU2ZFEfh+szjDS44zUm7h/VIN6YzWUINnQckTyi2iyrssZDdo44oRrWhtXehcGx0EVLrGJEj5VxAggA3dHOj+5wfPvHPM= ARC-Message-Signature: i=3; a=rsa-sha256; d=sourceware.org; s=key; t=1726664590; c=relaxed/simple; bh=0jxHjbho0tbL/XPPheZJQ8bCqpFblmhq6aYI4VFFDUA=; h=DKIM-Signature:DKIM-Signature:From:To:Subject:Date:Message-ID: MIME-Version; b=qW6l+AlJDgMFNakY7jv9+SB263Y3uThwZ+FRLuJEMnsSLkGvfFrFEBvEnvdv22N4WG+/3GBblCDK3/k9ccz4vQJHdyeEEkc3OHfAofHkdOJEpWQBMxykW1f991Tsm6NsmFWgFx8zIl36qIjnQyS4jORfi2s6HTMBgMTSrOEIIxg= ARC-Authentication-Results: i=3; server2.sourceware.org ARC-Seal: i=2; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=pass; b=iPXja1mTYnbCVwThk5LUybA28vr6XcIW3j+C9dmBVdV2m/HpIWklE2MpYEumciq+aux4uYQb0F49/EJDofCin/C0ugsam831LzNMxcQlN2e2KNo/RtFdkigodYM4IOXOqRoj2OuU+rWFOSCqwt8428DeSAJYUAzVpM/vVMLT+CAySbevLBjlzmV2ON+GrLVAPJq04Af8iYAxsHN05sSh5DfeleaRzGfo26o1L0Ea3g1h7/vc6KOZkqqrx68PM0rMHZuw/hkSP94r/AYQX8mGL94WVI5XvTfZK3ALIRCvV0vQmEqr/YcgezV38GGb9lgrvkPKThQZFDt4CSbCVlm8cA== 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=RbQCjsZqlbWpkmDZAhKISESaGjBpkrCAKOZJMtvAExQ=; b=r4prHjaVd0DQGhKifJ+OMSpEBM7z0B/8FDIp5GMW8Jbx0cmakEnlF+5HmLgZCVizQKncY9HVkNuhIS6UFIiRMxP5yv20IcHxybIMbBJA8xUbWQLwfWpk8Qv6xZ1H8SV7uIgcLnPZwDH9WJl9wEU++sfzYHE88QVZ5JokbX5vdLBSdrV1wTd+Nd2w9MChBXT86mlMvQ/aToXp/SSVyIdj2tSVeG4pnRuZ3fJLkTsqN701o804E5o6O+HbjFiW5mKSn+JgjySjZXFIujYeTFev0kuvCwSdGveeGbcu7d8n8u93NrTBHwSTZMXicLwIK7saetZj5s9nbJANvc8HakIvYQ== 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=RbQCjsZqlbWpkmDZAhKISESaGjBpkrCAKOZJMtvAExQ=; b=pAmFXH9czr5gd3XXML6Lj5jLO1ytTyDqp5s/Qh8PgqT4ZlDcA99CPz0TgUaNgQMelxDgLo8+/HkZ03qxXLyyno/xWCBUj5i6V5jcJ+6C3psnbX36umrcsg2KpYPrGP4PAAGQmLy0l5dU34oznV4Wb+tW0pbTexS9G4Sarf2cbgo= Received: from DU7P250CA0029.EURP250.PROD.OUTLOOK.COM (2603:10a6:10:54f::18) by PAXPR08MB6718.eurprd08.prod.outlook.com (2603:10a6:102:134::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7982.15; Wed, 18 Sep 2024 13:02:59 +0000 Received: from DU2PEPF00028D08.eurprd03.prod.outlook.com (2603:10a6:10:54f:cafe::1e) by DU7P250CA0029.outlook.office365.com (2603:10a6:10:54f::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7939.30 via Frontend Transport; Wed, 18 Sep 2024 13:02:59 +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 DU2PEPF00028D08.mail.protection.outlook.com (10.167.242.168) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.7918.13 via Frontend Transport; Wed, 18 Sep 2024 13:02:58 +0000 Received: ("Tessian outbound c0ee0b3b99fe:v457"); Wed, 18 Sep 2024 13:02:57 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 7a32b8e680b6bbc2 X-TessianGatewayMetadata: O+VoZUzFZv4tUYzHM9h+wIoF2JvyWPbU8jwgeNpJ/n45R8JLChUFT/+tLqTR9kWsShYT2zc+mvVUG5mz4p5csWyO6q2MccYSkZGqxf6/neSDHWXZkOyJuHD7EFglfcQPx8cbHWcfMmxgFTf5eXVhkHM3USzarK/jrwKp/DI7ZHk= X-CR-MTA-TID: 64aa7808 Received: from Lb208ef44b3fa.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id FE66A91F-5B7F-4894-8E35-6108479170A2.1; Wed, 18 Sep 2024 13:02:50 +0000 Received: from EUR03-DBA-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id Lb208ef44b3fa.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Wed, 18 Sep 2024 13:02:50 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=Ms4MXaAraQooqTVdIRyE1h5cNw6r21+Gm8yE2jmRPNg9gcSrcUXySOvQhgsa8lq+4AobNgzfPMekLlCbIqiL2UyIfCg/NrjmPxPzTqwxB0jR85u/yy+lukDeDeX9EsixuV6D40JMLoDgP96xxe3u9NZ6tTizBjrBr3ZMgfR18Bs5qoyAUMCBvOLR4YZOpXo5niG23P25hPYCEqWbFevl3GCYoga8Dtr/Uj6fBkSaf8tZbop++YaFLyO2BVOLpNIcZo79HQl5NQsIa6F2zT1v/KxmVFXmAsAsB7aZYFd3eQajPBQYXeltAbVWL1CabvlmM57OmnLlm+wb8YjOKkLriQ== 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=RbQCjsZqlbWpkmDZAhKISESaGjBpkrCAKOZJMtvAExQ=; b=pcucZjJWJgeDtp8YFKGl6bBgXLUQHlxIR5rlKr1k40dmGzGEU4Jsi9202Zq79dmpJSN2TZOmZxAtYCoHCoDQwAm1ysNbjuO5TxV+TWuSlv99GzrZwLub14IH32ddoRGxkssYQ8y9rYcKHYXRB/Ihufh0Z1XV/7sZi8vAhOvG6D4yuy7SA1Zj3In9PZeG2u2UEqe2u20rNd+A4Y89Ah6PdFO7mPxeirZ+cfexb+rQCuQpzD4vfyzqXvtWMNAKwXwpQ76MCWfVpPHX5/keu54LOxlLTlZvxG+vNB989+cY6VqEIvUVyoyNeUyp9z+LY3IvYVAKPiNnJga+BaUSwoUCmg== 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=RbQCjsZqlbWpkmDZAhKISESaGjBpkrCAKOZJMtvAExQ=; b=pAmFXH9czr5gd3XXML6Lj5jLO1ytTyDqp5s/Qh8PgqT4ZlDcA99CPz0TgUaNgQMelxDgLo8+/HkZ03qxXLyyno/xWCBUj5i6V5jcJ+6C3psnbX36umrcsg2KpYPrGP4PAAGQmLy0l5dU34oznV4Wb+tW0pbTexS9G4Sarf2cbgo= Received: from DU2PR04CA0293.eurprd04.prod.outlook.com (2603:10a6:10:28c::28) by PAVPR08MB9577.eurprd08.prod.outlook.com (2603:10a6:102:311::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7982.16; Wed, 18 Sep 2024 13:02:42 +0000 Received: from DU2PEPF00028D0C.eurprd03.prod.outlook.com (2603:10a6:10:28c:cafe::82) by DU2PR04CA0293.outlook.office365.com (2603:10a6:10:28c::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7939.30 via Frontend Transport; Wed, 18 Sep 2024 13:02:42 +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 DU2PEPF00028D0C.mail.protection.outlook.com (10.167.242.20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7918.13 via Frontend Transport; Wed, 18 Sep 2024 13:02:41 +0000 Received: from AZ-NEU-EXJ01.Arm.com (10.240.25.132) 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; Wed, 18 Sep 2024 13:02:37 +0000 Received: from AZ-NEU-EX03.Arm.com (10.251.24.31) 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; Wed, 18 Sep 2024 13:02:26 +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; Wed, 18 Sep 2024 13:02:26 +0000 From: To: CC: , , Saurabh Jha Subject: [PATCH v9 2/2] aarch64: Add codegen support for AdvSIMD faminmax Date: Wed, 18 Sep 2024 14:01:49 +0100 Message-ID: <20240918130149.2239226-3-saurabh.jha@arm.com> X-Mailer: git-send-email 2.43.2 In-Reply-To: <20240918130149.2239226-1-saurabh.jha@arm.com> References: <20240918130149.2239226-1-saurabh.jha@arm.com> MIME-Version: 1.0 X-EOPAttributedMessage: 1 X-MS-TrafficTypeDiagnostic: DU2PEPF00028D0C:EE_|PAVPR08MB9577:EE_|DU2PEPF00028D08:EE_|PAXPR08MB6718:EE_ X-MS-Office365-Filtering-Correlation-Id: db0bfe9f-b070-40c9-8c9d-08dcd7e237fa x-checkrecipientrouted: true NoDisclaimer: true X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; ARA:13230040|36860700013|82310400026|376014|1800799024; X-Microsoft-Antispam-Message-Info-Original: PVtvm+tSFR02MRC8bVGRHcJVkh4zt3HDZYRkRafKwcK3qwMb5YF7DjPbRE34WngQ9zfPJEgvUGSyv3ZF+Vp/H0/IxPfUe9EJ5+7g27jKTFQ7xkdZtSL9X+InN00iVozOFj3GGaHL2VbYoELH+02rYKVt3VePw/VrNKYvXZxmX+/5R+MOWVnOO7wA3jwRfwIJyn8OuxuT0lXeenHkH/6G5FWZOAdS+Ro/OuJ9o+aDlH6ckf1yalJBW0cq9LM0HvjLWZxTqXr8+Lj3sn4W63YJIF6N2f/u+BpQuWy0Bwb49Axm0YJFDWPZpjIhLvulkL0kgqZ1TgIEHSNYQo0I2fL1W77kahLGFc8OSPNaz62s05+I89fdN45O0Fs3GmjhkrOgGnMARwWM0gcKlpIiWdIb0fJlghT+S7iH8VBVkee3dRQGG6WZNOLcUvBkSPP5DDylfeinPIkms+Pmd6TZR5eJEm1gnshXcR74pYCwsupFaNci7Cf5LHrCAYlDvFqncwEynex3C0/DhsJmFP7erZexEe+f//mknr0W9oZaQq0pZutl8xD4icWb3qf661kCY7f5i0B21Vz6N6VXckW6YCKSydPyIN/GvCzrryU32P2/I8bhvv0oj02dgzOwehPyP0hClJDGmgx3isJXnkz0N4ho9ISRFbCNunpHFC87OBTtDX+qQFMAtgJBwXwFRSkz/Dt6IbuwHRSRpmVIyvD5MNrxWuzf+xGKUi9ZRAT6/a9V6ZIZ0nTufcoUS4spWYqkcimiwrgp/s9/3xc1nv3XkFr0KCQdW/RLEnFPCaodrTlQXaFG/UvRj78vd2h6RFor1o9JF5H+TAHb4N9turA1O0IFHP1ayduA10OaW9Of+bY/EddEe/uIgv5+sgoRY0voKbJtgHsIbV4g1Ghxk82bIpOv00BMxsvO2E37qtGI5CaBohBr1oCbDcTk2sPOY72xZSbp5PsNU8ttZtw+zUcJTI79azftGjWsmDXC33WIkiR3iv8cCN4nOherGcC6sQ9Z9S6WPL1Q5MAPFvY1sGcb5kKhql/NpBPrdkZBmztFw9x66m9TxHv+of7YjbcomnCpqn77rcLNvH5LiVuVWgkXCIYUieAKkQoYFOQd4Ko1M0qf2+J2KonkWP+bNkmW+ppMOzqIzea5WwBJdq9rtv/TqXFqF/JH8dWKtI/DCpub8D9XuhQctyJKriZvx0AyLKt4el9peWlxFfmvAVu57g49JDy3LgflwLppYg66/DC2LjkiO6tlnJoF/OxxDLk8Yqyg6vH/HezmmmJ56/zO4iJmx8EuIRPpheJoZVQn4aUlT2XIOzfe2Q5LjewPagv0pwWp8hKNx7RqmbK9dkzqP7ADqXN6BA== 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)(36860700013)(82310400026)(376014)(1800799024); DIR:OUT; SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAVPR08MB9577 X-MS-Exchange-SkipListedInternetSender: ip=[2603:10a6:10:28c::28]; domain=DU2PR04CA0293.eurprd04.prod.outlook.com X-MS-Exchange-Transport-CrossTenantHeadersStripped: DU2PEPF00028D08.eurprd03.prod.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: a55a2b0b-5dab-42d8-e875-08dcd7e22df9 X-Microsoft-Antispam: BCL:0; ARA:13230040|36860700013|82310400026|376014|35042699022|1800799024; X-Microsoft-Antispam-Message-Info: =?utf-8?q?s3mlQHfOWHz8vmFZc0b20dg9sqKHVIP?= =?utf-8?q?tFeh/5mfvlbGHS4Bu5tunXpqnZJi5xmWTUDhOkHhcxDcH3Z/Xe9Y5LNaKu9dxHlJz?= =?utf-8?q?8Eln3VGbb3Ucdm3V7zEQ0oiyKeDDL/Wk/0iPItUFmIvbROk9SThis2f2ifBNGb5Nq?= =?utf-8?q?1dobG36gJ4CS6Wtl5JCHxUaPWaHmAz84spLTY0IHfiDy6ZYVUgUBJkB/9uMfx1n7n?= =?utf-8?q?oLX9hNKkctmiKQRnsQ9fdS+o49Qzv6/8JYsT+NlAgtX7Qo5DpDwyGQNP9sco2si9X?= =?utf-8?q?+c+WKfwEBWzuki+q0iSxfpu06mqFCeCl+45RxQ8T22W7dUgsLDKNfmqwNDQrKmQkW?= =?utf-8?q?SKH1Ch7Hr0+W99neuEZtAiGNw8gUcDUjlLVXM8IWWOGHFEbpUf05boG96oTp3bgrt?= =?utf-8?q?TUnUkE8+79S9BE2ixxSW3qnm5LQkUNMq9uXhjL9wB/bY4p1bpqAIghg3rI5LPirQZ?= =?utf-8?q?Lwy58eOdk/ZaLHKk62WY5ReSvknAsZy53+44TGI9taBmZSDIsjiqQJ41r9df9ajnI?= =?utf-8?q?qQ57VQ2C+lRvqx0OhA1IvLondWpEcUM+Kw1Rgqda554Zc6psjc5Vo9ZZKfXwWD3X5?= =?utf-8?q?Y+skFoe6vJdnTh/9bLZ6Fc80arE16VwrBeDAYdJ4G+cMjamPvXKoQkEONBul8pUZA?= =?utf-8?q?oijOSOi4wsbx9wy8NxpTU4+YWgqefaQjs0YTWClJnU/O3q2uHGLNrRuq72Ytgu2yt?= =?utf-8?q?WwzBBQC81LWJ6XjskUlOcouINAl1AwW242urtQMDXLtzKsXp7gHUM69mm96CSATeZ?= =?utf-8?q?i6ENvUhxoRvCCo5aymDtmFEaUn76UuU2llt7r3/xni/J3GmvWbi+Q5aUrv0vnQ0v2?= =?utf-8?q?m/xim/IbnQnxb/lYOoBsQyoRXm5FSfrS5Drt/iPI64Q7nV4tOwajLBzBEjGc+1pI3?= =?utf-8?q?7XyOJM0EPKfMiMeIs3iCfG5ZsVZJ26Ub03KlMwu5ZwVPgSqVKd5FvTWLrzwg3FDci?= =?utf-8?q?ukxZZRMasbhEjz1t1Gu/30Y7v/A44yQlGHBPop68rMQSzkl8xn+aa3WO36n/fS0XN?= =?utf-8?q?rVCDZwIYz0jXK7GMjySZu8a734Svg24aGFQ+c8tFkrozGLvPTtRdvwlS0Lwuaxx9p?= =?utf-8?q?ASyo2G6mlFMp3S5AXgsaUvLbtjCZzq2KROe72tluou9+h5WxcC3oygEU+xdbm/0/r?= =?utf-8?q?2eBI8e8U+IrjMqbiFIHixYurHZ8qXXknred2/kz7na0xUqRRBtcI6PObnDDDSYRQr?= =?utf-8?q?WoPXJLAH0tF6KP5Zj9sfq5fbNptqWXrt4Licpr1/jz1KU5sSYh78VmleRJI7+WBQm?= =?utf-8?q?ojZDdYR3wGwIVS5Nl0dsDzWv6qre5J6iN1GmUUVqUzb+nFLamE42B5Iau9OT+wSOc?= =?utf-8?q?kZoazZd79TkIkvQgB5215c55DKyfpiLkbA=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)(36860700013)(82310400026)(376014)(35042699022)(1800799024); DIR:OUT; SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Sep 2024 13:02:58.1046 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: db0bfe9f-b070-40c9-8c9d-08dcd7e237fa 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: DU2PEPF00028D08.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR08MB6718 X-Spam-Status: No, score=-11.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FORGED_SPF_HELO, GIT_PATCH_0, KAM_SHORT, RCVD_IN_DNSWL_NONE, 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 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 adds code generation support for famax and famin in terms of existing RTL operators. famax/famin is equivalent to first taking abs of the operands and then taking smax/smin on the results of abs. famax/famin (a, b) = smax/smin (abs (a), abs (b)) This fusion of operators is only possible when -march=armv9-a+faminmax flags are passed. We also need to pass -ffast-math flag; if we don't, then a statement like c[i] = __builtin_fmaxf16 (a[i], b[i]); is RTL expanded to UNSPEC_FMAXNM instead of smax (likewise for smin). This code generation is only available on -O2 or -O3 as that is when auto-vectorization is enabled. gcc/ChangeLog: * config/aarch64/aarch64-simd.md (*aarch64_faminmax_fused): Instruction pattern for faminmax codegen. * config/aarch64/iterators.md: Attribute for faminmax codegen. gcc/testsuite/ChangeLog: * gcc.target/aarch64/simd/faminmax-codegen-no-flag.c: New test. * gcc.target/aarch64/simd/faminmax-codegen.c: New test. * gcc.target/aarch64/simd/faminmax-no-codegen.c: New test. --- gcc/config/aarch64/aarch64-simd.md | 9 + gcc/config/aarch64/iterators.md | 3 + .../aarch64/simd/faminmax-codegen-no-flag.c | 217 ++++++++++++++ .../aarch64/simd/faminmax-codegen.c | 197 +++++++++++++ .../aarch64/simd/faminmax-no-codegen.c | 267 ++++++++++++++++++ 5 files changed, 693 insertions(+) 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 create mode 100644 gcc/testsuite/gcc.target/aarch64/simd/faminmax-no-codegen.c diff --git a/gcc/config/aarch64/aarch64-simd.md b/gcc/config/aarch64/aarch64-simd.md index 67f0fe26f93..2a44aa3fcc3 100644 --- a/gcc/config/aarch64/aarch64-simd.md +++ b/gcc/config/aarch64/aarch64-simd.md @@ -9920,3 +9920,12 @@ "TARGET_FAMINMAX" "\t%0., %1., %2." ) + +(define_insn "*aarch64_faminmax_fused" + [(set (match_operand:VHSDF 0 "register_operand" "=w") + (FMAXMIN:VHSDF + (abs:VHSDF (match_operand:VHSDF 1 "register_operand" "w")) + (abs:VHSDF (match_operand:VHSDF 2 "register_operand" "w"))))] + "TARGET_FAMINMAX" + "\t%0., %1., %2." +) diff --git a/gcc/config/aarch64/iterators.md b/gcc/config/aarch64/iterators.md index 17ac5e073aa..c2fcd18306e 100644 --- a/gcc/config/aarch64/iterators.md +++ b/gcc/config/aarch64/iterators.md @@ -4472,3 +4472,6 @@ (define_int_attr faminmax_uns_op [(UNSPEC_FAMAX "famax") (UNSPEC_FAMIN "famin")]) + +(define_code_attr faminmax_op + [(smax "famax") (smin "famin")]) 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..d77f5a5d19f --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/simd/faminmax-codegen-no-flag.c @@ -0,0 +1,217 @@ +/* { dg-do assemble} */ +/* { dg-additional-options "-O3 -ffast-math -march=armv9-a" } */ +/* { dg-final { check-function-bodies "**" "" } } */ + +#include "arm_neon.h" + +#pragma GCC target "+nosve" + +/* +** test_vamax_f16: +** fabs v1.4h, v1.4h +** fabs v0.4h, v0.4h +** fmaxnm v0.4h, v0.4h, v1.4h +** ret +*/ +float16x4_t +test_vamax_f16 (float16x4_t a, float16x4_t b) +{ + int i; + float16x4_t c; + + for (i = 0; i < 4; ++i) { + a[i] = __builtin_fabsf16 (a[i]); + b[i] = __builtin_fabsf16 (b[i]); + c[i] = __builtin_fmaxf16 (a[i], b[i]); + } + return c; +} + +/* +** test_vamaxq_f16: +** fabs v1.8h, v1.8h +** fabs v0.8h, v0.8h +** fmaxnm v0.8h, v0.8h, v1.8h +** ret +*/ +float16x8_t +test_vamaxq_f16 (float16x8_t a, float16x8_t b) +{ + int i; + float16x8_t c; + + for (i = 0; i < 8; ++i) { + a[i] = __builtin_fabsf16 (a[i]); + b[i] = __builtin_fabsf16 (b[i]); + c[i] = __builtin_fmaxf16 (a[i], b[i]); + } + return c; +} + +/* +** test_vamax_f32: +** fabs v1.2s, v1.2s +** fabs v0.2s, v0.2s +** fmaxnm v0.2s, v0.2s, v1.2s +** ret +*/ +float32x2_t +test_vamax_f32 (float32x2_t a, float32x2_t b) +{ + int i; + float32x2_t c; + + for (i = 0; i < 2; ++i) { + a[i] = __builtin_fabsf32 (a[i]); + b[i] = __builtin_fabsf32 (b[i]); + c[i] = __builtin_fmaxf32 (a[i], b[i]); + } + return c; +} + +/* +** test_vamaxq_f32: +** fabs v1.4s, v1.4s +** fabs v0.4s, v0.4s +** fmaxnm v0.4s, v0.4s, v1.4s +** ret +*/ +float32x4_t +test_vamaxq_f32 (float32x4_t a, float32x4_t b) +{ + int i; + float32x4_t c; + + for (i = 0; i < 4; ++i) { + a[i] = __builtin_fabsf32 (a[i]); + b[i] = __builtin_fabsf32 (b[i]); + c[i] = __builtin_fmaxf32 (a[i], b[i]); + } + return c; +} + +/* +** test_vamaxq_f64: +** fabs v1.2d, v1.2d +** fabs v0.2d, v0.2d +** fmaxnm v0.2d, v0.2d, v1.2d +** ret +*/ +float64x2_t +test_vamaxq_f64 (float64x2_t a, float64x2_t b) +{ + int i; + float64x2_t c; + + for (i = 0; i < 2; ++i) { + a[i] = __builtin_fabsf64 (a[i]); + b[i] = __builtin_fabsf64 (b[i]); + c[i] = __builtin_fmaxf64 (a[i], b[i]); + } + return c; +} + +/* +** test_vamin_f16: +** fabs v1.4h, v1.4h +** fabs v0.4h, v0.4h +** fminnm v0.4h, v0.4h, v1.4h +** ret +*/ +float16x4_t +test_vamin_f16 (float16x4_t a, float16x4_t b) +{ + int i; + float16x4_t c; + + for (i = 0; i < 4; ++i) { + a[i] = __builtin_fabsf16 (a[i]); + b[i] = __builtin_fabsf16 (b[i]); + c[i] = __builtin_fminf16 (a[i], b[i]); + } + return c; +} + +/* +** test_vaminq_f16: +** fabs v1.8h, v1.8h +** fabs v0.8h, v0.8h +** fminnm v0.8h, v0.8h, v1.8h +** ret +*/ +float16x8_t +test_vaminq_f16 (float16x8_t a, float16x8_t b) +{ + int i; + float16x8_t c; + + for (i = 0; i < 8; ++i) { + a[i] = __builtin_fabsf16 (a[i]); + b[i] = __builtin_fabsf16 (b[i]); + c[i] = __builtin_fminf16 (a[i], b[i]); + } + return c; +} + +/* +** test_vamin_f32: +** fabs v1.2s, v1.2s +** fabs v0.2s, v0.2s +** fminnm v0.2s, v0.2s, v1.2s +** ret +*/ +float32x2_t +test_vamin_f32 (float32x2_t a, float32x2_t b) +{ + int i; + float32x2_t c; + + for (i = 0; i < 2; ++i) { + a[i] = __builtin_fabsf32 (a[i]); + b[i] = __builtin_fabsf32 (b[i]); + c[i] = __builtin_fminf32 (a[i], b[i]); + } + return c; +} + +/* +** test_vaminq_f32: +** fabs v1.4s, v1.4s +** fabs v0.4s, v0.4s +** fminnm v0.4s, v0.4s, v1.4s +** ret +*/ +float32x4_t +test_vaminq_f32 (float32x4_t a, float32x4_t b) +{ + int i; + float32x4_t c; + + for (i = 0; i < 4; ++i) { + a[i] = __builtin_fabsf32 (a[i]); + b[i] = __builtin_fabsf32 (b[i]); + c[i] = __builtin_fminf32 (a[i], b[i]); + } + return c; +} + +/* +** test_vaminq_f64: +** fabs v1.2d, v1.2d +** fabs v0.2d, v0.2d +** fminnm v0.2d, v0.2d, v1.2d +** ret +*/ +float64x2_t +test_vaminq_f64 (float64x2_t a, float64x2_t b) +{ + int i; + float64x2_t c; + + for (i = 0; i < 2; ++i) { + a[i] = __builtin_fabsf64 (a[i]); + b[i] = __builtin_fabsf64 (b[i]); + c[i] = __builtin_fminf64 (a[i], b[i]); + } + return c; +} 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..971386c0bf0 --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/simd/faminmax-codegen.c @@ -0,0 +1,197 @@ +/* { dg-do assemble} */ +/* { dg-additional-options "-O2 -ffast-math -march=armv9-a+faminmax" } */ +/* { dg-final { check-function-bodies "**" "" } } */ + +#include "arm_neon.h" + +#pragma GCC target "+nosve" + +/* +** test_vamax_f16: +** famax v0.4h, v1.4h, v0.4h +** ret +*/ +float16x4_t +test_vamax_f16 (float16x4_t a, float16x4_t b) +{ + int i; + float16x4_t c; + + for (i = 0; i < 4; ++i) { + a[i] = __builtin_fabsf16 (a[i]); + b[i] = __builtin_fabsf16 (b[i]); + c[i] = __builtin_fmaxf16 (a[i], b[i]); + } + return c; +} + +/* +** test_vamaxq_f16: +** famax v0.8h, v1.8h, v0.8h +** ret +*/ +float16x8_t +test_vamaxq_f16 (float16x8_t a, float16x8_t b) +{ + int i; + float16x8_t c; + + for (i = 0; i < 8; ++i) { + a[i] = __builtin_fabsf16 (a[i]); + b[i] = __builtin_fabsf16 (b[i]); + c[i] = __builtin_fmaxf16 (a[i], b[i]); + } + return c; +} + +/* +** test_vamax_f32: +** famax v0.2s, v1.2s, v0.2s +** ret +*/ +float32x2_t +test_vamax_f32 (float32x2_t a, float32x2_t b) +{ + int i; + float32x2_t c; + + for (i = 0; i < 2; ++i) { + a[i] = __builtin_fabsf32 (a[i]); + b[i] = __builtin_fabsf32 (b[i]); + c[i] = __builtin_fmaxf32 (a[i], b[i]); + } + return c; +} + +/* +** test_vamaxq_f32: +** famax v0.4s, v1.4s, v0.4s +** ret +*/ +float32x4_t +test_vamaxq_f32 (float32x4_t a, float32x4_t b) +{ + int i; + float32x4_t c; + + for (i = 0; i < 4; ++i) { + a[i] = __builtin_fabsf32 (a[i]); + b[i] = __builtin_fabsf32 (b[i]); + c[i] = __builtin_fmaxf32 (a[i], b[i]); + } + return c; +} + +/* +** test_vamaxq_f64: +** famax v0.2d, v1.2d, v0.2d +** ret +*/ +float64x2_t +test_vamaxq_f64 (float64x2_t a, float64x2_t b) +{ + int i; + float64x2_t c; + + for (i = 0; i < 2; ++i) { + a[i] = __builtin_fabsf64 (a[i]); + b[i] = __builtin_fabsf64 (b[i]); + c[i] = __builtin_fmaxf64 (a[i], b[i]); + } + return c; +} + +/* +** test_vamin_f16: +** famin v0.4h, v1.4h, v0.4h +** ret +*/ +float16x4_t +test_vamin_f16 (float16x4_t a, float16x4_t b) +{ + int i; + float16x4_t c; + + for (i = 0; i < 4; ++i) { + a[i] = __builtin_fabsf16 (a[i]); + b[i] = __builtin_fabsf16 (b[i]); + c[i] = __builtin_fminf16 (a[i], b[i]); + } + return c; +} + +/* +** test_vaminq_f16: +** famin v0.8h, v1.8h, v0.8h +** ret +*/ +float16x8_t +test_vaminq_f16 (float16x8_t a, float16x8_t b) +{ + int i; + float16x8_t c; + + for (i = 0; i < 8; ++i) { + a[i] = __builtin_fabsf16 (a[i]); + b[i] = __builtin_fabsf16 (b[i]); + c[i] = __builtin_fminf16 (a[i], b[i]); + } + return c; +} + +/* +** test_vamin_f32: +** famin v0.2s, v1.2s, v0.2s +** ret +*/ +float32x2_t +test_vamin_f32 (float32x2_t a, float32x2_t b) +{ + int i; + float32x2_t c; + + for (i = 0; i < 2; ++i) { + a[i] = __builtin_fabsf32 (a[i]); + b[i] = __builtin_fabsf32 (b[i]); + c[i] = __builtin_fminf32 (a[i], b[i]); + } + return c; +} + +/* +** test_vaminq_f32: +** famin v0.4s, v1.4s, v0.4s +** ret +*/ +float32x4_t +test_vaminq_f32 (float32x4_t a, float32x4_t b) +{ + int i; + float32x4_t c; + + for (i = 0; i < 4; ++i) { + a[i] = __builtin_fabsf32 (a[i]); + b[i] = __builtin_fabsf32 (b[i]); + c[i] = __builtin_fminf32 (a[i], b[i]); + } + return c; +} + +/* +** test_vaminq_f64: +** famin v0.2d, v1.2d, v0.2d +** ret +*/ +float64x2_t +test_vaminq_f64 (float64x2_t a, float64x2_t b) +{ + int i; + float64x2_t c; + + for (i = 0; i < 2; ++i) { + a[i] = __builtin_fabsf64 (a[i]); + b[i] = __builtin_fabsf64 (b[i]); + c[i] = __builtin_fminf64 (a[i], b[i]); + } + return c; +} diff --git a/gcc/testsuite/gcc.target/aarch64/simd/faminmax-no-codegen.c b/gcc/testsuite/gcc.target/aarch64/simd/faminmax-no-codegen.c new file mode 100644 index 00000000000..952f89bd4e3 --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/simd/faminmax-no-codegen.c @@ -0,0 +1,267 @@ +/* { dg-do assemble} */ +/* { dg-additional-options "-O2 -ffast-math -march=armv9-a+faminmax" } */ +/* { dg-final { check-function-bodies "**" "" } } */ + +#include "arm_neon.h" + +#pragma GCC target "+nosve" + +/* +** test_abs_max_f16: +** fabs v1.4h, v1.4h +** fabs v0.4h, v0.4h +** fmax v0.4h, v0.4h, v1.4h +** ret +*/ +float16x4_t +test_abs_max_f16 (float16x4_t a, float16x4_t b) +{ + return vmax_f16 (vabs_f16 (a), vabs_f16 (b)); +} + +/* +** test_abs_maxnm_f16: +** fabs v1.4h, v1.4h +** fabs v0.4h, v0.4h +** fmaxnm v0.4h, v0.4h, v1.4h +** ret +*/ +float16x4_t +test_abs_maxnm_f16 (float16x4_t a, float16x4_t b) +{ + return vmaxnm_f16 (vabs_f16 (a), vabs_f16 (b)); +} + +/* +** test_abs_maxq_f16: +** fabs v1.8h, v1.8h +** fabs v0.8h, v0.8h +** fmax v0.8h, v0.8h, v1.8h +** ret +*/ +float16x8_t +test_abs_maxq_f16 (float16x8_t a, float16x8_t b) +{ + return vmaxq_f16 (vabsq_f16 (a), vabsq_f16 (b)); +} + +/* +** test_abs_maxnmq_f16: +** fabs v1.8h, v1.8h +** fabs v0.8h, v0.8h +** fmaxnm v0.8h, v0.8h, v1.8h +** ret +*/ +float16x8_t +test_abs_maxnmq_f16 (float16x8_t a, float16x8_t b) +{ + return vmaxnmq_f16 (vabsq_f16 (a), vabsq_f16 (b)); +} + +/* +** test_abs_max_f32: +** fabs v1.2s, v1.2s +** fabs v0.2s, v0.2s +** fmax v0.2s, v0.2s, v1.2s +** ret +*/ +float32x2_t +test_abs_max_f32 (float32x2_t a, float32x2_t b) +{ + return vmax_f32 (vabs_f32 (a), vabs_f32 (b)); +} + +/* +** test_abs_maxnm_f32: +** fabs v1.2s, v1.2s +** fabs v0.2s, v0.2s +** fmaxnm v0.2s, v0.2s, v1.2s +** ret +*/ +float32x2_t +test_abs_maxnm_f32 (float32x2_t a, float32x2_t b) +{ + return vmaxnm_f32 (vabs_f32 (a), vabs_f32 (b)); +} + +/* +** test_abs_maxq_f32: +** fabs v1.4s, v1.4s +** fabs v0.4s, v0.4s +** fmax v0.4s, v0.4s, v1.4s +** ret +*/ +float32x4_t +test_abs_maxq_f32 (float32x4_t a, float32x4_t b) +{ + return vmaxq_f32 (vabsq_f32 (a), vabsq_f32 (b)); +} + +/* +** test_abs_maxnmq_f32: +** fabs v1.4s, v1.4s +** fabs v0.4s, v0.4s +** fmaxnm v0.4s, v0.4s, v1.4s +** ret +*/ +float32x4_t +test_abs_maxnmq_f32 (float32x4_t a, float32x4_t b) +{ + return vmaxnmq_f32 (vabsq_f32 (a), vabsq_f32 (b)); +} + +/* +** test_abs_maxq_f64: +** fabs v1.2d, v1.2d +** fabs v0.2d, v0.2d +** fmax v0.2d, v0.2d, v1.2d +** ret +*/ +float64x2_t +test_abs_maxq_f64 (float64x2_t a, float64x2_t b) +{ + return vmaxq_f64 (vabsq_f64 (a), vabsq_f64 (b)); +} + +/* +** test_abs_maxnmq_f64: +** fabs v1.2d, v1.2d +** fabs v0.2d, v0.2d +** fmaxnm v0.2d, v0.2d, v1.2d +** ret +*/ +float64x2_t +test_abs_maxnmq_f64 (float64x2_t a, float64x2_t b) +{ + return vmaxnmq_f64 (vabsq_f64 (a), vabsq_f64 (b)); +} + +/* +** test_abs_min_f16: +** fabs v1.4h, v1.4h +** fabs v0.4h, v0.4h +** fmin v0.4h, v0.4h, v1.4h +** ret +*/ +float16x4_t +test_abs_min_f16 (float16x4_t a, float16x4_t b) +{ + return vmin_f16 (vabs_f16 (a), vabs_f16 (b)); +} + +/* +** test_abs_minnm_f16: +** fabs v1.4h, v1.4h +** fabs v0.4h, v0.4h +** fminnm v0.4h, v0.4h, v1.4h +** ret +*/ +float16x4_t +test_abs_minnm_f16 (float16x4_t a, float16x4_t b) +{ + return vminnm_f16 (vabs_f16 (a), vabs_f16 (b)); +} + +/* +** test_abs_minq_f16: +** fabs v1.8h, v1.8h +** fabs v0.8h, v0.8h +** fmin v0.8h, v0.8h, v1.8h +** ret +*/ +float16x8_t +test_abs_minq_f16 (float16x8_t a, float16x8_t b) +{ + return vminq_f16 (vabsq_f16 (a), vabsq_f16 (b)); +} + +/* +** test_abs_minnmq_f16: +** fabs v1.8h, v1.8h +** fabs v0.8h, v0.8h +** fminnm v0.8h, v0.8h, v1.8h +** ret +*/ +float16x8_t +test_abs_minnmq_f16 (float16x8_t a, float16x8_t b) +{ + return vminnmq_f16 (vabsq_f16 (a), vabsq_f16 (b)); +} + +/* +** test_abs_min_f32: +** fabs v1.2s, v1.2s +** fabs v0.2s, v0.2s +** fmin v0.2s, v0.2s, v1.2s +** ret +*/ +float32x2_t +test_abs_min_f32 (float32x2_t a, float32x2_t b) +{ + return vmin_f32 (vabs_f32 (a), vabs_f32 (b)); +} + +/* +** test_abs_minnm_f32: +** fabs v1.2s, v1.2s +** fabs v0.2s, v0.2s +** fminnm v0.2s, v0.2s, v1.2s +** ret +*/ +float32x2_t +test_abs_minnm_f32 (float32x2_t a, float32x2_t b) +{ + return vminnm_f32 (vabs_f32 (a), vabs_f32 (b)); +} + +/* +** test_abs_minq_f32: +** fabs v1.4s, v1.4s +** fabs v0.4s, v0.4s +** fmin v0.4s, v0.4s, v1.4s +** ret +*/ +float32x4_t +test_abs_minq_f32 (float32x4_t a, float32x4_t b) +{ + return vminq_f32 (vabsq_f32 (a), vabsq_f32 (b)); +} + +/* +** test_abs_minnmq_f32: +** fabs v1.4s, v1.4s +** fabs v0.4s, v0.4s +** fminnm v0.4s, v0.4s, v1.4s +** ret +*/ +float32x4_t +test_abs_minnmq_f32 (float32x4_t a, float32x4_t b) +{ + return vminnmq_f32 (vabsq_f32 (a), vabsq_f32 (b)); +} + +/* +** test_abs_minq_f64: +** fabs v1.2d, v1.2d +** fabs v0.2d, v0.2d +** fmin v0.2d, v0.2d, v1.2d +** ret +*/ +float64x2_t +test_abs_minq_f64 (float64x2_t a, float64x2_t b) +{ + return vminq_f64 (vabsq_f64 (a), vabsq_f64 (b)); +} + +/* +** test_abs_minnmq_f64: +** fabs v1.2d, v1.2d +** fabs v0.2d, v0.2d +** fminnm v0.2d, v0.2d, v1.2d +** ret +*/ +float64x2_t +test_abs_minnmq_f64 (float64x2_t a, float64x2_t b) +{ + return vminnmq_f64 (vabsq_f64 (a), vabsq_f64 (b)); +}