Message ID | Y2KCrKb019Z1/HgC@arm.com |
---|---|
State | Unresolved |
Headers |
Return-Path: <gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp3663716wru; Wed, 2 Nov 2022 07:47:23 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4byj1cD3IK7NZzOI08RcjChklKurCMxA77PVaGIY7NoqxzRJWETfLbNudI0E1jKxRFU1j0 X-Received: by 2002:a17:907:25c9:b0:77b:a343:bd62 with SMTP id ae9-20020a17090725c900b0077ba343bd62mr25576730ejc.660.1667400443657; Wed, 02 Nov 2022 07:47:23 -0700 (PDT) Received: from sourceware.org (server2.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id qw35-20020a1709066a2300b0079b9f472d85si17367727ejc.698.2022.11.02.07.47.23 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Nov 2022 07:47:23 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=Ui98btvv; arc=fail (signature failed); spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id ECB273857839 for <ouuuleilei@gmail.com>; Wed, 2 Nov 2022 14:47:21 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org ECB273857839 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1667400442; bh=upYqq6hdZxS50VVUIT+f6ZnB+lCfc1Fixp7tTrXyL6o=; h=Date:To:Subject:In-Reply-To:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From:Reply-To:Cc:From; b=Ui98btvvc28XYsrSx1xdga522Ge77CpmehGR5wBfNQuvDf4P8QfbFq3RVZifF7sHw zrewHQDN7vF1cShfqW8icXcm6ILlEZWl0eVykAO3wXdjhoKgqr9h5HdaXEvjurYzRK SLcTOnVF1h/7hUOOUdb5G4P3CM08iygKGk/dFhaQ= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on2074.outbound.protection.outlook.com [40.107.22.74]) by sourceware.org (Postfix) with ESMTPS id DAA7A385768B for <gcc-patches@gcc.gnu.org>; Wed, 2 Nov 2022 14:46:27 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org DAA7A385768B ARC-Seal: i=2; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=pass; b=lycL2dGHUiJKlXJDFkPmqpcE0Mb6iqLNWBIVQ3VbqwcFcUoKrBvtd8WIKegjQaSGygAxjeVL0f1eoGWJQ0NNam/PQP7eOV8VqS/HXf3LMmf6amXKoROREqaVQ+gjqRuLnreQpPp/ZC4UUQNBBm9RqTem8L2r8DL31NbpOv21YLtyaVCkZpUW/1RPxm1ckUxJQDYN4VdRK59R1cYFDk7tFPKHubOkEHTogfVUXsK+nsg/YqUhQKLycrciKFLCIMj0uTiXIhYNmPMaZj4652NLQmosMMvE7zWYqwheE/1alnJDMUBGpLF6CUNkyh1fHGV84Up7TngMy1d/fK2kegLNHA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=upYqq6hdZxS50VVUIT+f6ZnB+lCfc1Fixp7tTrXyL6o=; b=UFSfnE0WASzzsfUHxZ9BKF+lJw0073wG9QkLqhSPGw19bWOgKfIyLtHMGVbqCUBLD2aR2fl+M4FesN9zQwuoQJg8SnjJanbKhfbY6/+TOmMbgFcL91I/3aKZdvyOqPWOV2d8wOodvJhnGUpq+SLHXupeeJShBpeA//rlnsqHAwdxWzjE0lzXPRr/JTBErMokJnOe0KVHG+oX+OsZLKWTJKbVju5bVqCgcJo9L4EQUTPCTCTldZ1SPM7wE4Ty+tv6spcKE0+ugMUafQkk6g3dcfeS9ojxxAzBY1WCKXyH/MHNvpH1e0yc/qI0vvfYS1rQ0ftizcvlWnt+W/uj+iqWbQ== ARC-Authentication-Results: i=2; mx.microsoft.com 1; spf=pass (sender ip is 63.35.35.123) smtp.rcpttodomain=gcc.gnu.org smtp.mailfrom=arm.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com; arc=pass (0 oda=1 ltdi=1 spf=[1,1,smtp.mailfrom=arm.com] dkim=[1,1,header.d=arm.com] dmarc=[1,1,header.from=arm.com]) Received: from AS8PR07CA0047.eurprd07.prod.outlook.com (2603:10a6:20b:459::35) by DU2PR08MB10304.eurprd08.prod.outlook.com (2603:10a6:10:49b::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5769.15; Wed, 2 Nov 2022 14:46:25 +0000 Received: from VI1EUR03FT007.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:459:cafe::5a) by AS8PR07CA0047.outlook.office365.com (2603:10a6:20b:459::35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5791.21 via Frontend Transport; Wed, 2 Nov 2022 14:46:24 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 63.35.35.123 as permitted sender) receiver=protection.outlook.com; client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com; pr=C Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by VI1EUR03FT007.mail.protection.outlook.com (100.127.144.86) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5791.20 via Frontend Transport; Wed, 2 Nov 2022 14:46:24 +0000 Received: ("Tessian outbound 58faf9791229:v130"); Wed, 02 Nov 2022 14:46:23 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: b2887962e4c37664 X-CR-MTA-TID: 64aa7808 Received: from 04a24258cee6.2 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 6F8D8064-2A74-4E24-A648-257B255EA1A5.1; Wed, 02 Nov 2022 14:46:17 +0000 Received: from EUR04-HE1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 04a24258cee6.2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Wed, 02 Nov 2022 14:46:17 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Mb2fHXIFE6rFpLCJzXG/p6AjGNdRoLq/QRKw6YxZuTf0Ilxhjwo/9T4SxCcCOucu9fdsWdVlErPaAOBu0qFelW64BWY4D1QOrDePwN3hT4vzgDnpqEnmzXK6i19DmFV1Vy39nigdAcMaelIoF2i99blSclq8s5fKmEU+55TDCl2PhTa4Eh77YtIaG9I/9crJbb5iAdOaLkYOBOvlXGLPclnpv2en5kjMuDMwonqBczM5nIKZ1T1hQhRp9dJYGxuXfqrhVaLmwgZBUlvOlRLVABHCQAAnqx0O6ayuUFNpsEiZ5WbhP0mUGG6drjOSLJ8lgQ+qdtSZLZlk+jYNwRJAIg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=upYqq6hdZxS50VVUIT+f6ZnB+lCfc1Fixp7tTrXyL6o=; b=XUrJc6+nyMJJV5POYD2Fx2erl/5c96uD7Eq6pdcX6MlkZVG92+gezZ6X7TwEJJj/FpOHLrH1QEBzdIrtV8hqVmBfxZJa7sp+BYOjco8y742uOnWtzU4El4mrePdX4upUOJscyb7mlkIe4lbCKv8hpL8cV2h41LozJmmqUDQxDpdJVXUVXyWrfaIaSNTO/nyx/5bY+s9JZMjCRohkpOEgDNj8Fr1zu54JQxi/zAu292X3q7fbLdHG0axi3sNK9uXof2alYnn3G5CfuR8HEAYIQM891n9RN4tVzEuFonjLJZ6Btkq6PzDkRKKXLEAtwTZsYu9E7ovpguEoupOVl1YPlg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none Authentication-Results-Original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com; Received: from VI1PR08MB5325.eurprd08.prod.outlook.com (2603:10a6:803:13e::17) by AS2PR08MB9476.eurprd08.prod.outlook.com (2603:10a6:20b:60f::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5769.21; Wed, 2 Nov 2022 14:46:14 +0000 Received: from VI1PR08MB5325.eurprd08.prod.outlook.com ([fe80::c57d:50c2:3502:a52]) by VI1PR08MB5325.eurprd08.prod.outlook.com ([fe80::c57d:50c2:3502:a52%4]) with mapi id 15.20.5769.021; Wed, 2 Nov 2022 14:46:14 +0000 Date: Wed, 2 Nov 2022 14:46:04 +0000 To: gcc-patches@gcc.gnu.org Subject: [PATCH 2/2]AArch64 Add implementation for vector cbranch. Message-ID: <Y2KCrKb019Z1/HgC@arm.com> Content-Type: multipart/mixed; boundary="pcRic79BbJZ4B+dD" Content-Disposition: inline In-Reply-To: <patch-16498-tamar@arm.com> X-ClientProxiedBy: SA9PR10CA0024.namprd10.prod.outlook.com (2603:10b6:806:a7::29) To VI1PR08MB5325.eurprd08.prod.outlook.com (2603:10a6:803:13e::17) MIME-Version: 1.0 X-MS-TrafficTypeDiagnostic: VI1PR08MB5325:EE_|AS2PR08MB9476:EE_|VI1EUR03FT007:EE_|DU2PR08MB10304:EE_ X-MS-Office365-Filtering-Correlation-Id: e8322580-9c8b-4d01-4902-08dabce103d4 x-checkrecipientrouted: true NoDisclaimer: true X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: SVUZR/PJ/CfeluwWa1lU5dbsy7brEZVkU3o07/4lPnPEvZIaTgWodSZwhIAlNSyHpVZ1r3MFifMoAipiiRdTsVTrMnBsjnKDXpSgDS2ZRogF4NeN33Iloet3DTi+6foCrOmy20E0pdqJLo9uUdAYixaXUOBk95EnzGguAz8OCtIlN6jMmRWGVpQ5WaLlN/MrsuE81QZ4fBttqAzVNx4JbGKWeTN15Cfx0jLiRdjBQHzmlkA9E1MK6CxnXbeulWWuIQXk3BLc1u9nz7Z8hOcanfc+oHKRPOWEST+45xrpyyCqOY1OtqyeZ+hkLqMOcis9wuHvYi7Fsq13uiwyfmaMT+3LUh/VeaiLoPKownSF4NFiuEHljGnWeupFJcuH1s7gkdK14ncK1SCDCKJsIGQ91WPcVJxRxDgDI1CHU0/Z4h1tVvHBuqbMEj6+Foh56xx/dKi7mFm6CtSaiXxXBjO29mIbFtE+P3RAudFmtwCzIjUBPZ5vffJpmFPfVhpxwXNG3eEZOeLDCn7R4Sv3nokPEeZS3g7kseWZZHFJhsb8ePWtmPrl2T6VFaXLpKxuOHOcwPALmWLFlTSOFPxMLA42oq8m8rvrC/5iKZmPFd93FVU6A9zaEUr9IwxcgzlGfk29ds8Q1GCq8zrTFixe/E1e69ahHpuW5OXA1eqgfZ1kKGqE9jWVNhbK3JXBQRMQfPVa88Y8D2AqtcJQyOd3yjqJh9X+3KYU99ChsttV4VxTDfuhuIJN6UQeQJ5QeSiUb4q2scLJWrjhBl0nY884cRZWdA== X-Forefront-Antispam-Report-Untrusted: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:VI1PR08MB5325.eurprd08.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230022)(4636009)(366004)(396003)(39860400002)(376002)(346002)(136003)(451199015)(6916009)(478600001)(44832011)(2616005)(66946007)(6506007)(66556008)(66476007)(44144004)(33964004)(6486002)(6512007)(186003)(41300700001)(4743002)(4326008)(26005)(8676002)(235185007)(5660300002)(8936002)(2906002)(86362001)(36756003)(316002)(6666004)(38100700002)(2700100001); DIR:OUT; SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS2PR08MB9476 Original-Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com; X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: VI1EUR03FT007.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 08181355-5cb1-4c25-82ff-08dabce0fc58 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ATvJbG7x3UAIn7Tr965OKbdyF3qPFF4xaPoxVtRnOx7k+/DmPj80i/e/fWVxatHM3phSxYWLYyQPlCrdZ6bOVrdn8S1zrQCxbt5rCR+xOgeb1a5H8zFuQ77h0fJa/PiuOwBYknBsw6H46CnhdFifRVmOmvRdKFGFCAHXhMuox/5uhi2ZGTWrfO5WKw8lB7m0LqJdrv+GBDa3IKXU0MvRMQerXRmuXOzmX62PM2aFVdc2MtkOIjsdvxM7Aij18eJKZlynevuhqKRnSrIVMDVdM/8XKPhfn1fq8YTOcpC+gVV8s/g6gKY5QdxE/4nm0wQBUTWW3O1dwCWFCO1BwueopQBv5tNmID0qlGQI+a/9jguaBawbzs1/8mdRGMhqiDRfFzjVhzqo+aWLK/U2RxfLcLCjV042BpuTZAU5zZHxmtm+HTgfadoqf9vh6gVR4EQK8YI+W+bcUDKjBfNazJZRDn6mERh2JV3yUemP+h+xTH002LAsYm+m5dG0r8A0WRlsayNVAC6Thi938OtFG+c330M2uDfsMkHqe806lx4kuN/Fe4Fj73zhH+000Tr8E2ICJlrMSXLFljSWC0REoQiHZnJmDkk2v5YUxbO3JGcJANVKT+s1hzbUeCIeYkM8aBqyvWYppAYek81YKJXXqCFnoAELLxnIKjNfhM+DYhLHQ3rBeider4mLRXsF9DRFrpeCrOHq7Fbh6nnZjVGkeZ2i65X6rbT3QEH5op+DG6FaM6lT3z8BdUYmbtg170ySa8nyfu5iXqSWnjtU98oKMjLlzerMQBR7UOstZJ98sJz2um84sfij40H5+9bW9Pe2Hv5R 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:(13230022)(4636009)(396003)(39860400002)(346002)(136003)(376002)(451199015)(46966006)(36840700001)(40470700004)(235185007)(2906002)(5660300002)(82310400005)(86362001)(40460700003)(44832011)(6486002)(47076005)(70206006)(478600001)(36860700001)(36756003)(336012)(356005)(6666004)(82740400003)(81166007)(41300700001)(186003)(70586007)(8676002)(4326008)(33964004)(6512007)(26005)(40480700001)(8936002)(4743002)(6916009)(316002)(44144004)(2616005)(6506007)(2700100001); DIR:OUT; SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Nov 2022 14:46:24.2847 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: e8322580-9c8b-4d01-4902-08dabce103d4 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: VI1EUR03FT007.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU2PR08MB10304 X-Spam-Status: No, score=-12.5 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, FORGED_SPF_HELO, GIT_PATCH_0, KAM_DMARC_NONE, KAM_LOTSOFHASH, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_PASS, SPF_NONE, TXREP, UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list <gcc-patches.gcc.gnu.org> List-Unsubscribe: <https://gcc.gnu.org/mailman/options/gcc-patches>, <mailto:gcc-patches-request@gcc.gnu.org?subject=unsubscribe> List-Archive: <https://gcc.gnu.org/pipermail/gcc-patches/> List-Post: <mailto:gcc-patches@gcc.gnu.org> List-Help: <mailto:gcc-patches-request@gcc.gnu.org?subject=help> List-Subscribe: <https://gcc.gnu.org/mailman/listinfo/gcc-patches>, <mailto:gcc-patches-request@gcc.gnu.org?subject=subscribe> From: Tamar Christina via Gcc-patches <gcc-patches@gcc.gnu.org> Reply-To: Tamar Christina <tamar.christina@arm.com> Cc: Richard.Earnshaw@arm.com, nd@arm.com, richard.sandiford@arm.com, Marcus.Shawcroft@arm.com Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" <gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org> X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1748396087727212914?= X-GMAIL-MSGID: =?utf-8?q?1748396087727212914?= |
Series |
[1/2] middle-end: Support early break/return auto-vectorization.
|
|
Checks
Context | Check | Description |
---|---|---|
snail/gcc-patch-check | warning | Git am fail log |
Commit Message
Tamar Christina
Nov. 2, 2022, 2:46 p.m. UTC
Hi All, This adds an implementation for conditional branch optab for AArch64. For 128-bit vectors we generate: cmhi v1.4s, v1.4s, v0.4s umaxp v1.4s, v1.4s, v1.4s fmov x3, d1 cbnz x3, .L8 and of 64-bit vector we can omit the compression: cmhi v1.2s, v1.2s, v0.2s fmov x2, d1 cbz x2, .L13 I did also want to provide a version that mixes SVE and NEON so I can use the SVE CMHI instructions with a NEON register. So concretely for a 128-bit vector you'd get: ptrue p0.s, vl4 .L3: ... cmplo p2.s, p0/z, z0.s, z2.s b.any .L6 ... cmp w2, 200 bne .L3 However I ran into an issue where cbranch is not the thing that does the comparison. And if I use combine to do it then the resulting ptrue wouldn't be floated outside the loop. Is there a way to currently do this? or does a mid-end pass need to be changed for this? Bootstrapped Regtested on aarch64-none-linux-gnu and no issues. Ok for master? Thanks, Tamar gcc/ChangeLog: * config/aarch64/aarch64-simd.md (cbranch<mode>4): New. gcc/testsuite/ChangeLog: * lib/target-supports.exp: Enable AArch64 generically. --- inline copy of patch -- diff --git a/gcc/config/aarch64/aarch64-simd.md b/gcc/config/aarch64/aarch64-simd.md index 5386043739a9b2e328bfb2fc9067da8feeac1a92..e53d339ea20492812a3faa7c20ed945255321b11 100644 -- diff --git a/gcc/config/aarch64/aarch64-simd.md b/gcc/config/aarch64/aarch64-simd.md index 5386043739a9b2e328bfb2fc9067da8feeac1a92..e53d339ea20492812a3faa7c20ed945255321b11 100644 --- a/gcc/config/aarch64/aarch64-simd.md +++ b/gcc/config/aarch64/aarch64-simd.md @@ -3795,6 +3795,41 @@ (define_expand "vcond_mask_<mode><v_int_equiv>" DONE; }) +;; Patterns comparing two vectors to produce a sets flagsi. + +(define_expand "cbranch<mode>4" + [(set (pc) + (if_then_else + (match_operator 0 "aarch64_equality_operator" + [(match_operand:VDQ_BHSI 1 "register_operand") + (match_operand:VDQ_BHSI 2 "aarch64_simd_reg_or_zero")]) + (label_ref (match_operand 3 "")) + (pc)))] + "TARGET_SIMD" +{ + rtx tmp = gen_reg_rtx (<MODE>mode); + + /* For 64-bit vectors we need no reductions. */ + if (known_eq (128, GET_MODE_BITSIZE (<MODE>mode))) + { + /* Always reduce using a V4SI. */ + rtx reduc = simplify_gen_subreg (V4SImode, operands[1], <MODE>mode, 0); + rtx res = gen_reg_rtx (V4SImode); + emit_insn (gen_aarch64_umaxpv4si (res, reduc, reduc)); + emit_move_insn (tmp, simplify_gen_subreg (<MODE>mode, res, V4SImode, 0)); + } + else + tmp = operands[1]; + + rtx val = gen_reg_rtx (DImode); + emit_move_insn (val, simplify_gen_subreg (DImode, tmp, <MODE>mode, 0)); + + rtx cc_reg = aarch64_gen_compare_reg (NE, val, const0_rtx); + rtx cmp_rtx = gen_rtx_fmt_ee (NE, DImode, cc_reg, operands[2]); + emit_jump_insn (gen_condjump (cmp_rtx, cc_reg, operands[3])); + DONE; +}) + ;; Patterns comparing two vectors to produce a mask. (define_expand "vec_cmp<mode><mode>" diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp index 5cbf54bd2a23dfdc5dc7b148b0dc6ed4c63814ae..8964cbd6610a718711546d312e89cee937d210e8 100644 --- a/gcc/testsuite/lib/target-supports.exp +++ b/gcc/testsuite/lib/target-supports.exp @@ -3653,8 +3653,7 @@ proc check_effective_target_vect_int { } { proc check_effective_target_vect_early_break { } { return [check_cached_effective_target_indexed vect_early_break { expr { - ([istarget aarch64*-*-*] - && [check_effective_target_aarch64_sve]) + [istarget aarch64*-*-*] }}] } # Return 1 if the target supports hardware vectorization of complex additions of
--- a/gcc/config/aarch64/aarch64-simd.md +++ b/gcc/config/aarch64/aarch64-simd.md @@ -3795,6 +3795,41 @@ (define_expand "vcond_mask_<mode><v_int_equiv>" DONE; }) +;; Patterns comparing two vectors to produce a sets flagsi. + +(define_expand "cbranch<mode>4" + [(set (pc) + (if_then_else + (match_operator 0 "aarch64_equality_operator" + [(match_operand:VDQ_BHSI 1 "register_operand") + (match_operand:VDQ_BHSI 2 "aarch64_simd_reg_or_zero")]) + (label_ref (match_operand 3 "")) + (pc)))] + "TARGET_SIMD" +{ + rtx tmp = gen_reg_rtx (<MODE>mode); + + /* For 64-bit vectors we need no reductions. */ + if (known_eq (128, GET_MODE_BITSIZE (<MODE>mode))) + { + /* Always reduce using a V4SI. */ + rtx reduc = simplify_gen_subreg (V4SImode, operands[1], <MODE>mode, 0); + rtx res = gen_reg_rtx (V4SImode); + emit_insn (gen_aarch64_umaxpv4si (res, reduc, reduc)); + emit_move_insn (tmp, simplify_gen_subreg (<MODE>mode, res, V4SImode, 0)); + } + else + tmp = operands[1]; + + rtx val = gen_reg_rtx (DImode); + emit_move_insn (val, simplify_gen_subreg (DImode, tmp, <MODE>mode, 0)); + + rtx cc_reg = aarch64_gen_compare_reg (NE, val, const0_rtx); + rtx cmp_rtx = gen_rtx_fmt_ee (NE, DImode, cc_reg, operands[2]); + emit_jump_insn (gen_condjump (cmp_rtx, cc_reg, operands[3])); + DONE; +}) + ;; Patterns comparing two vectors to produce a mask. (define_expand "vec_cmp<mode><mode>" diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp index 5cbf54bd2a23dfdc5dc7b148b0dc6ed4c63814ae..8964cbd6610a718711546d312e89cee937d210e8 100644 --- a/gcc/testsuite/lib/target-supports.exp +++ b/gcc/testsuite/lib/target-supports.exp @@ -3653,8 +3653,7 @@ proc check_effective_target_vect_int { } { proc check_effective_target_vect_early_break { } { return [check_cached_effective_target_indexed vect_early_break { expr { - ([istarget aarch64*-*-*] - && [check_effective_target_aarch64_sve]) + [istarget aarch64*-*-*] }}] } # Return 1 if the target supports hardware vectorization of complex additions of