From patchwork Mon Nov 6 07:41:58 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tamar Christina X-Patchwork-Id: 161910 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:8f47:0:b0:403:3b70:6f57 with SMTP id j7csp2539504vqu; Mon, 6 Nov 2023 01:34:12 -0800 (PST) X-Google-Smtp-Source: AGHT+IEnvJOY+38QfgvmopVtl7HtCtK5kmR2VZ8YvGr6h6gOGBSa4jGCAge6wblJ5kAuTWZtl+tm X-Received: by 2002:a25:89:0:b0:da0:4201:6365 with SMTP id 131-20020a250089000000b00da042016365mr22968116yba.3.1699263252003; Mon, 06 Nov 2023 01:34:12 -0800 (PST) ARC-Seal: i=4; a=rsa-sha256; t=1699263251; cv=pass; d=google.com; s=arc-20160816; b=MtRqrwH+Wioc81HPoWRwZ3DP6lNMy+SXD3CmPWEABpspRxMrrl7JcUOeDQUSni7RA/ xS5zEEZysJJIpRP6NZ8L71C0nAzyLDMbMwV8VaiSRXnDmrF+IsYkM0RkfAwI9faHvSi1 l8f55DZsq5iuk+AKUD1d4AciTZAiGjc8OgmInP/fCl37pSmIi6NNxXKD0O6w7YxO8WNi 5PYFUjhULSm6OdAEtEPmjJRaKnTnwbQkksXI2lc50hoXAq2/A+GC2vYVjonmdwGA00ut R3XWnnTqP1jOU/oP4wpzyHuGNsad476fhtQLv7+Aq/sLFgZhuk2uQLYZ1VG8Uoyri2cd MMmw== ARC-Message-Signature: i=4; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:original-authentication-results :nodisclaimer:mime-version:in-reply-to:content-disposition :message-id:subject:cc:to:from:date:authentication-results-original :dkim-signature:dkim-signature:arc-filter:dmarc-filter:delivered-to; bh=AGNu/bHNKbrpqnJyTN/F66umkhoZ2NCQLLRKeDm2nZA=; fh=A1gjXEMUlzxnxUbUxlff6kC1EuQ8Y+iSE/p7rbwCbIM=; b=DL48kgNIVXILw83w7vcDTPVY1azutCq8CVPWEQ+eEztiv4O8YJ4PQJ8EFgMQFMy77m bUemCdhzpfBnYuJKr1PHzyJXjnUgdzDbCYxnk6sasUPTx3vhNA0E97Sb1VUcq9JDlr9F M87rb2MhBQPYxtRARAHOF8Fl0OFUgERMv0rmtTMWciKx2EogTdRzenq9a7JfLLyN8cCF DZyaBJ8GAdOvcefXLs/4xVYSOzbo3PWlBQXp1ZV3iYSLRlWEXFaWf0fyzQciUsOZCh3o ote5IXoqTkBxlMFglzY56eU0FKqEln5CAgI+kHduu4W+kwyuKJtSeNJ+nwTX2zIcQfyv 9qug== ARC-Authentication-Results: i=4; mx.google.com; dkim=pass header.i=@armh.onmicrosoft.com header.s=selector2-armh-onmicrosoft-com header.b=VhL5Z2OE; dkim=pass header.i=@armh.onmicrosoft.com header.s=selector2-armh-onmicrosoft-com header.b=VhL5Z2OE; arc=pass (i=3); spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: from server2.sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id cx6-20020a056214188600b00656340f901fsi5609302qvb.56.2023.11.06.01.34.11 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Nov 2023 01:34:11 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; dkim=pass header.i=@armh.onmicrosoft.com header.s=selector2-armh-onmicrosoft-com header.b=VhL5Z2OE; dkim=pass header.i=@armh.onmicrosoft.com header.s=selector2-armh-onmicrosoft-com header.b=VhL5Z2OE; arc=pass (i=3); spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id CB34B387541F for ; Mon, 6 Nov 2023 07:42:44 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from EUR04-DB3-obe.outbound.protection.outlook.com (mail-db3eur04on2059.outbound.protection.outlook.com [40.107.6.59]) by sourceware.org (Postfix) with ESMTPS id 469873831397 for ; Mon, 6 Nov 2023 07:42:15 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 469873831397 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 469873831397 Authentication-Results: server2.sourceware.org; arc=pass smtp.remote-ip=40.107.6.59 ARC-Seal: i=3; a=rsa-sha256; d=sourceware.org; s=key; t=1699256537; cv=pass; b=T+2nLIUdI9j5XMecXwnnQRWa5LraH+3MWolaxIgvZu7BY/2ixcaBxZGj/yPTx1vACXpf0KpIxg79QzHEAjXvCDcx3kLOLggHKkBPPBZsSk7fS9AEzepes9hWMy2LtlMiZeIU35tvW2OopBduGS5iBHm6mC/gI3tuZuFp6vyY61w= ARC-Message-Signature: i=3; a=rsa-sha256; d=sourceware.org; s=key; t=1699256537; c=relaxed/simple; bh=+g/JncQlWRTxw4qWUmQocfCiixwS2S1R5APi/OT6YFE=; h=DKIM-Signature:DKIM-Signature:Date:From:To:Subject:Message-ID: MIME-Version; b=WlLZgLxDXXsayszfpdl9pJPNXv1fNGK2kWxXmA91UmAVZnUZRLfxdsoC27b8amyupK3mtsY0euMG5fcq+VyM2I0PGxN5XPz38r3pua/2XWg/kv6/cu/wFTWFu7cw8RgdVHL4M87CPAgcTFo9yBHY0VQ7rZfrzsy8HBeFDVRc2Tg= ARC-Authentication-Results: i=3; server2.sourceware.org ARC-Seal: i=2; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=pass; b=dfCQmcynW8wH05gScB4MMxk8ZE3/7oaTgz9dypVXPtLcBMnUQx+kOqJ+SWUWiy6OzDTqxQtYBehB9eKut8XBrI7gTv8lpxya5+PYWzrpYfagXsNS98TwKcq6Xxf+Bq5wzqJ20gsVd2+8JGiktsb3d8WPU1DYqZ4qne8zHvX0I98MntSUMW39LfH2s9Xnpap/8xRMPLwM2rHd8/oX8RP6EJESpgLWmvWwtHeIDtKbFfEXbbA1oDSboRKpP2w8k6seJCL8Q54keWg3RTgdGD1/RVcPRB1fNSJz+ge+e2VmavcTAkCvorlCaUmp1wtsbEDz+aWoxOSryjsMIn6XyhPkBQ== 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=AGNu/bHNKbrpqnJyTN/F66umkhoZ2NCQLLRKeDm2nZA=; b=HC0CK/McofEcJEVlyT3Twpp3UMrBCePEAD3CXjI2LlHfjAcmq+RX0gvGZ8KnJ8mbOyT0BHBzGYv4QTA/GT9cuR3fXmHvkKPaTwfrpexDj3V7QMXmi24BDV+DnOHEz50HMA4UWaXFHKyIFunG/vxZi00XtM/RqQUxqQ1AfDx1eSBOpxtWNsvWv53wrqjYfEWAIB1SSzCJWoZ1GgqDg3c2zi5ns3SY4+JP3D/Q8LuAlQ0JtU5p/VY2BkClS+SzXaPohVd1Cx2HAndNCNJy+vuBBxeKB9/X9t4zH8BeEml9HZCqk9KyYhuN9QaKXZ8QzFkpGz8MrJeL/CVeaoCipOJ9hw== ARC-Authentication-Results: i=2; mx.microsoft.com 1; spf=pass (sender ip is 63.35.35.123) smtp.rcpttodomain=gcc.gnu.org smtp.mailfrom=arm.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com; arc=pass (0 oda=1 ltdi=1 spf=[1,1,smtp.mailfrom=arm.com] dkim=[1,1,header.d=arm.com] dmarc=[1,1,header.from=arm.com]) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=AGNu/bHNKbrpqnJyTN/F66umkhoZ2NCQLLRKeDm2nZA=; b=VhL5Z2OEuPajZPBEhGg5k1lCWbDoeHQkrHLBe+Wu8sUXGEsOezSPubp53TqOQ/6g229kj1CSuTsOJxtX3vFLeFwb6oUXyZXINTZy5K/y5sXnyQHuh1oWXWFoD7u47OCLpDPa/SK9qnSkjBXsnDSK03lAc+4pj7zTxQU3DqJ05mc= Received: from AS9PR06CA0024.eurprd06.prod.outlook.com (2603:10a6:20b:462::32) by VI1PR08MB9958.eurprd08.prod.outlook.com (2603:10a6:800:1c0::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6954.27; Mon, 6 Nov 2023 07:42:11 +0000 Received: from AMS0EPF000001A9.eurprd05.prod.outlook.com (2603:10a6:20b:462:cafe::17) by AS9PR06CA0024.outlook.office365.com (2603:10a6:20b:462::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6954.28 via Frontend Transport; Mon, 6 Nov 2023 07:42:10 +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 AMS0EPF000001A9.mail.protection.outlook.com (10.167.16.149) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6977.16 via Frontend Transport; Mon, 6 Nov 2023 07:42:10 +0000 Received: ("Tessian outbound 20615a7e7970:v228"); Mon, 06 Nov 2023 07:42:10 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 590a3e6c6026c452 X-CR-MTA-TID: 64aa7808 Received: from 637b82038aeb.2 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 5A6CCF01-D8E9-4728-A0BD-6777C0C8811B.1; Mon, 06 Nov 2023 07:42:04 +0000 Received: from EUR05-AM6-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 637b82038aeb.2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Mon, 06 Nov 2023 07:42:04 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=l7bSqMGX9IhY8zQpp5y40VdGnSzk7JErg5ThriOZUKPCnioZ/lGR3C39y1ESqZhYpEED7HBykvsKzymsUyP/tXRozmMVN7/+sZ426+Dgm9jtc91umfNcMMq3+RZ4yoEfLBeC+qeVq+/n3UmwBKTdcvZjgLaS602g034Zma0RMJtNZmuat5thaRn/ZlidYzS8N+jyonhAzhgsj2mveMpI/4LClH0PTMYnFdoCxfPvmnPtqmcq0TmdZkRN15a/YPZlvHtN5lLrMWnY9uf30BEScMMkJaoTgHMY7t+OudIklH1j8oeYqECEMb8yoFsxGUcRflcon21f8zHVmyX3FkbDUw== 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=AGNu/bHNKbrpqnJyTN/F66umkhoZ2NCQLLRKeDm2nZA=; b=c0ERDeQ5Gy/dKPXyqiOvGYP+EIhBFU1neNlwjNwA7KLYd6wzJv+ma+jBPy/cU4D/1VXxn2By/hKo4mz8jUIB5ZuE459DI9+NjE09/8FATAjHNBBBzVt9us15RHVQXkh3Dffq8SCYRXzKKZIspFhp4YXp9CUCjCQGBn2sTZay44Hc+3ewR3ri7CHNNaKgjHoZxIfY/efVkjTHjaAgpgb6n3/eOztylMiwH+SuIB9JoDlZq5YybBvFR4jp60KR+VP+gc5yXzXW6jG8H4rWNziyHyIRsF8oL1+nfQZu3dEf62xdLu1yAPcl/lKiD5AdFZgNFjTv+dhd+EK+s7jw9vvqaw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=AGNu/bHNKbrpqnJyTN/F66umkhoZ2NCQLLRKeDm2nZA=; b=VhL5Z2OEuPajZPBEhGg5k1lCWbDoeHQkrHLBe+Wu8sUXGEsOezSPubp53TqOQ/6g229kj1CSuTsOJxtX3vFLeFwb6oUXyZXINTZy5K/y5sXnyQHuh1oWXWFoD7u47OCLpDPa/SK9qnSkjBXsnDSK03lAc+4pj7zTxQU3DqJ05mc= 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 AS8PR08MB6694.eurprd08.prod.outlook.com (2603:10a6:20b:39e::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6954.28; Mon, 6 Nov 2023 07:42:01 +0000 Received: from VI1PR08MB5325.eurprd08.prod.outlook.com ([fe80::26aa:efdd:a74a:27d0]) by VI1PR08MB5325.eurprd08.prod.outlook.com ([fe80::26aa:efdd:a74a:27d0%5]) with mapi id 15.20.6954.028; Mon, 6 Nov 2023 07:42:01 +0000 Date: Mon, 6 Nov 2023 07:41:58 +0000 From: Tamar Christina To: gcc-patches@gcc.gnu.org Cc: nd@arm.com, Richard.Earnshaw@arm.com, Marcus.Shawcroft@arm.com, Kyrylo.Tkachov@arm.com, richard.sandiford@arm.com Subject: [PATCH 17/21]AArch64: Add implementation for vector cbranch for Advanced SIMD Message-ID: Content-Disposition: inline In-Reply-To: X-ClientProxiedBy: LO4P265CA0275.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:37a::11) To VI1PR08MB5325.eurprd08.prod.outlook.com (2603:10a6:803:13e::17) MIME-Version: 1.0 X-MS-TrafficTypeDiagnostic: VI1PR08MB5325:EE_|AS8PR08MB6694:EE_|AMS0EPF000001A9:EE_|VI1PR08MB9958:EE_ X-MS-Office365-Filtering-Correlation-Id: 997af14d-4f14-4bd2-4da8-08dbde9be2b1 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: yX0Ez8KG7bADtQ091fdtGjbnQj+N8ImDieb9yg6qd0BNR/CMlkZdO8KQDXX2TV5VMLvxbgvEqaZZubHScNsTnCRyovYzr+iq75kd+iLcoO44NHg7pCMaSXZLxg3JZtFR6r1uf+bCk/Me4RAWzmxscgZ79+IdWU+SdtXb1AI8eFA1IHyX3RJmci4ZsqeThZ31INAdvp3vOZvklnBM/FlYE6odmTTeLHXzEvMZ2y2uenhD57QPg7LfmohxTsQnab7EQzl24E5Gzd3bPZ9/aB0j+bbqNdy+FpIKF8qiMqR0t2WCGYJBoL8h2zAV9LJ7+Iov4jA1sU1rVtzoPpi1+Oqo5IWtooyRCoDAk5Hr69wo2RoKH0Ta3zER5qtlzp1Yn5E4mv1n+I89BbLHHjI3jyOLDL5MnGrUOrYaDJgRuq58aZyJxUEbAdJLBZgvU981SShqNfGKDqOO5Ch/hwN0Ov80pXhMJ6+PJYPdsWRVcWMP97XHubtT2KZhTnYktbGpe2+eROjjPzfdj+xlWssBHMdFhZviZfnXu9WD7QLoIfrJY28Sysq5DAst4FhJdukJ/GIMKelBMaxPehV9DU848WORACBWe6kPWjnibSJ4zX1Zs+g= 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:(13230031)(39860400002)(366004)(396003)(376002)(136003)(346002)(230922051799003)(64100799003)(451199024)(186009)(1800799009)(2906002)(38100700002)(4326008)(8676002)(8936002)(41300700001)(84970400001)(5660300002)(86362001)(235185007)(4743002)(44832011)(6512007)(2616005)(316002)(66556008)(66476007)(66946007)(6916009)(6506007)(33964004)(44144004)(6666004)(26005)(6486002)(478600001)(36756003)(2700100001); DIR:OUT; SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR08MB6694 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: AMS0EPF000001A9.eurprd05.prod.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 50a1c32b-d08e-4042-a744-08dbde9bdcf0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: oGxcuHlVJ9mw2ihaEf0l8uD5xq7Jbd9lTw1L+34PCZnjIDUKqtC0VBPjNL1yZ/jK7D3b+JjEF3bTDaDexzR146yZBKz3pii99vB4iaEnkxDykKSRyk2LA3z6+Jwu6fg/8Pk/EiOkWVxrhtFpRLa6GI9o9oy1hR/1xZ5bkAMZzHrYX86WPfLrGIqlKdwk6Sw4jcggXQucZfyUgMMoNdJVhiJmyEw3IHD+kamjGqL1vbu/4/rL1Xsd3atg8K0Je4LwRL1q67CiENiIUIKoXObt8jYcGHdWmY3ArYRMWRKXUgavaFb7D0TreYRu2OM4DzKfPLC+kgwAmjMbDbH94B0c9DoxSa3yjI/OYUbl3ldE36eZdcWiPheTBEh2BT/+kwxAuICxSwoxw9AlDi7F27TbNEwyQCA1hVsqoS5JKOzUQ+sUAnyqXdv3ULgAeIxkNeSH0fZOUMsYq20peoSwNhQUax6uxruLwA1hzKEKynuQWbRALDiJkYtZ3PrxQW/FnAKWFluHkNvNc0N9rzrQLnjKPlqEiDz/UzvPb/sldFg1rP2aXR7wpULEzMj9AuaF+y8zmbSgaRASGjUdnqoIA9ksWB1zzYbuAk8KWUkFyZDMFqY8tlp9F/5P246VbwU5jmhtFLwAU7bMkzg3o1ovUhe5PN6aPOjgSfhxhFrQgaW/MGgScMUKSLCaA7wqa1yZBqj8AE2hO/FNx+vqAVCjaN716NREsbjGEZpIgyjqkUjjHk4= X-Forefront-Antispam-Report: CIP:63.35.35.123; CTRY:IE; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:64aa7808-outbound-1.mta.getcheckrecipient.com; PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com; CAT:NONE; SFS:(13230031)(4636009)(376002)(39850400004)(136003)(396003)(346002)(230922051799003)(1800799009)(451199024)(64100799003)(186009)(82310400011)(36840700001)(46966006)(44832011)(2616005)(6512007)(336012)(4743002)(5660300002)(70586007)(82740400003)(26005)(6486002)(478600001)(36756003)(6916009)(70206006)(316002)(6666004)(44144004)(6506007)(33964004)(8936002)(8676002)(4326008)(40480700001)(2906002)(47076005)(41300700001)(36860700001)(84970400001)(86362001)(81166007)(235185007)(356005)(2700100001); DIR:OUT; SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Nov 2023 07:42:10.6999 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 997af14d-4f14-4bd2-4da8-08dbde9be2b1 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: AMS0EPF000001A9.eurprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR08MB9958 X-Spam-Status: No, score=-12.0 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, FORGED_SPF_HELO, GIT_PATCH_0, KAM_DMARC_NONE, KAM_LOTSOFHASH, KAM_SHORT, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_PASS, SPF_NONE, TXREP, T_SCC_BODY_TEXT_LINE, 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+ouuuleilei=gmail.com@gcc.gnu.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1769954921760512341 X-GMAIL-MSGID: 1781806663888895705 Hi All, This adds an implementation for conditional branch optab for AArch64. For e.g. void f1 () { for (int i = 0; i < N; i++) { b[i] += a[i]; if (a[i] > 0) break; } } For 128-bit vectors we generate: cmgt v1.4s, v1.4s, #0 umaxp v1.4s, v1.4s, v1.4s fmov x3, d1 cbnz x3, .L8 and of 64-bit vector we can omit the compression: cmgt v1.2s, v1.2s, #0 fmov x2, d1 cbz x2, .L13 Bootstrapped Regtested on aarch64-none-linux-gnu and no issues. Ok for master? Thanks, Tamar gcc/ChangeLog: * config/aarch64/aarch64-simd.md (cbranch4): New. gcc/testsuite/ChangeLog: * gcc.target/aarch64/vect-early-break-cbranch.c: New test. --- inline copy of patch -- diff --git a/gcc/config/aarch64/aarch64-simd.md b/gcc/config/aarch64/aarch64-simd.md index 90118c6348e9614bef580d1dc94c0c1841dd5204..cd5ec35c3f53028f14828bd70a92924f62524c15 100644 --- diff --git a/gcc/config/aarch64/aarch64-simd.md b/gcc/config/aarch64/aarch64-simd.md index 90118c6348e9614bef580d1dc94c0c1841dd5204..cd5ec35c3f53028f14828bd70a92924f62524c15 100644 --- a/gcc/config/aarch64/aarch64-simd.md +++ b/gcc/config/aarch64/aarch64-simd.md @@ -3830,6 +3830,46 @@ (define_expand "vcond_mask_" DONE; }) +;; Patterns comparing two vectors and conditionally jump + +(define_expand "cbranch4" + [(set (pc) + (if_then_else + (match_operator 0 "aarch64_equality_operator" + [(match_operand:VDQ_I 1 "register_operand") + (match_operand:VDQ_I 2 "aarch64_simd_reg_or_zero")]) + (label_ref (match_operand 3 "")) + (pc)))] + "TARGET_SIMD" +{ + auto code = GET_CODE (operands[0]); + rtx tmp = operands[1]; + + /* If comparing against a non-zero vector we have to do a comparison first + so we can have a != 0 comparison with the result. */ + if (operands[2] != CONST0_RTX (mode)) + emit_insn (gen_vec_cmp (tmp, operands[0], operands[1], + operands[2])); + + /* For 64-bit vectors we need no reductions. */ + if (known_eq (128, GET_MODE_BITSIZE (mode))) + { + /* Always reduce using a V4SI. */ + rtx reduc = gen_lowpart (V4SImode, tmp); + rtx res = gen_reg_rtx (V4SImode); + emit_insn (gen_aarch64_umaxpv4si (res, reduc, reduc)); + emit_move_insn (tmp, gen_lowpart (mode, res)); + } + + rtx val = gen_reg_rtx (DImode); + emit_move_insn (val, gen_lowpart (DImode, tmp)); + + rtx cc_reg = aarch64_gen_compare_reg (code, val, const0_rtx); + rtx cmp_rtx = gen_rtx_fmt_ee (code, DImode, cc_reg, const0_rtx); + emit_jump_insn (gen_condjump (cmp_rtx, cc_reg, operands[3])); + DONE; +}) + ;; Patterns comparing two vectors to produce a mask. (define_expand "vec_cmp" diff --git a/gcc/testsuite/gcc.target/aarch64/vect-early-break-cbranch.c b/gcc/testsuite/gcc.target/aarch64/vect-early-break-cbranch.c new file mode 100644 index 0000000000000000000000000000000000000000..c0363c3787270507d7902bb2ac0e39faef63a852 --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/vect-early-break-cbranch.c @@ -0,0 +1,124 @@ +/* { dg-do compile } */ +/* { dg-options "-O3" } */ +/* { dg-final { check-function-bodies "**" "" "" { target lp64 } } } */ + +#pragma GCC target "+nosve" + +#define N 640 +int a[N] = {0}; +int b[N] = {0}; + + +/* +** f1: +** ... +** cmgt v[0-9]+.4s, v[0-9]+.4s, #0 +** umaxp v[0-9]+.4s, v[0-9]+.4s, v[0-9]+.4s +** fmov x[0-9]+, d[0-9]+ +** cbnz x[0-9]+, \.L[0-9]+ +** ... +*/ +void f1 () +{ + for (int i = 0; i < N; i++) + { + b[i] += a[i]; + if (a[i] > 0) + break; + } +} + +/* +** f2: +** ... +** cmge v[0-9]+.4s, v[0-9]+.4s, #0 +** umaxp v[0-9]+.4s, v[0-9]+.4s, v[0-9]+.4s +** fmov x[0-9]+, d[0-9]+ +** cbnz x[0-9]+, \.L[0-9]+ +** ... +*/ +void f2 () +{ + for (int i = 0; i < N; i++) + { + b[i] += a[i]; + if (a[i] >= 0) + break; + } +} + +/* +** f3: +** ... +** cmeq v[0-9]+.4s, v[0-9]+.4s, #0 +** umaxp v[0-9]+.4s, v[0-9]+.4s, v[0-9]+.4s +** fmov x[0-9]+, d[0-9]+ +** cbnz x[0-9]+, \.L[0-9]+ +** ... +*/ +void f3 () +{ + for (int i = 0; i < N; i++) + { + b[i] += a[i]; + if (a[i] == 0) + break; + } +} + +/* +** f4: +** ... +** cmtst v[0-9]+.4s, v[0-9]+.4s, v[0-9]+.4s +** umaxp v[0-9]+.4s, v[0-9]+.4s, v[0-9]+.4s +** fmov x[0-9]+, d[0-9]+ +** cbnz x[0-9]+, \.L[0-9]+ +** ... +*/ +void f4 () +{ + for (int i = 0; i < N; i++) + { + b[i] += a[i]; + if (a[i] != 0) + break; + } +} + +/* +** f5: +** ... +** cmlt v[0-9]+.4s, v[0-9]+.4s, #0 +** umaxp v[0-9]+.4s, v[0-9]+.4s, v[0-9]+.4s +** fmov x[0-9]+, d[0-9]+ +** cbnz x[0-9]+, \.L[0-9]+ +** ... +*/ +void f5 () +{ + for (int i = 0; i < N; i++) + { + b[i] += a[i]; + if (a[i] < 0) + break; + } +} + +/* +** f6: +** ... +** cmle v[0-9]+.4s, v[0-9]+.4s, #0 +** umaxp v[0-9]+.4s, v[0-9]+.4s, v[0-9]+.4s +** fmov x[0-9]+, d[0-9]+ +** cbnz x[0-9]+, \.L[0-9]+ +** ... +*/ +void f6 () +{ + for (int i = 0; i < N; i++) + { + b[i] += a[i]; + if (a[i] <= 0) + break; + } +} --- a/gcc/config/aarch64/aarch64-simd.md +++ b/gcc/config/aarch64/aarch64-simd.md @@ -3830,6 +3830,46 @@ (define_expand "vcond_mask_" DONE; }) +;; Patterns comparing two vectors and conditionally jump + +(define_expand "cbranch4" + [(set (pc) + (if_then_else + (match_operator 0 "aarch64_equality_operator" + [(match_operand:VDQ_I 1 "register_operand") + (match_operand:VDQ_I 2 "aarch64_simd_reg_or_zero")]) + (label_ref (match_operand 3 "")) + (pc)))] + "TARGET_SIMD" +{ + auto code = GET_CODE (operands[0]); + rtx tmp = operands[1]; + + /* If comparing against a non-zero vector we have to do a comparison first + so we can have a != 0 comparison with the result. */ + if (operands[2] != CONST0_RTX (mode)) + emit_insn (gen_vec_cmp (tmp, operands[0], operands[1], + operands[2])); + + /* For 64-bit vectors we need no reductions. */ + if (known_eq (128, GET_MODE_BITSIZE (mode))) + { + /* Always reduce using a V4SI. */ + rtx reduc = gen_lowpart (V4SImode, tmp); + rtx res = gen_reg_rtx (V4SImode); + emit_insn (gen_aarch64_umaxpv4si (res, reduc, reduc)); + emit_move_insn (tmp, gen_lowpart (mode, res)); + } + + rtx val = gen_reg_rtx (DImode); + emit_move_insn (val, gen_lowpart (DImode, tmp)); + + rtx cc_reg = aarch64_gen_compare_reg (code, val, const0_rtx); + rtx cmp_rtx = gen_rtx_fmt_ee (code, DImode, cc_reg, const0_rtx); + emit_jump_insn (gen_condjump (cmp_rtx, cc_reg, operands[3])); + DONE; +}) + ;; Patterns comparing two vectors to produce a mask. (define_expand "vec_cmp" diff --git a/gcc/testsuite/gcc.target/aarch64/vect-early-break-cbranch.c b/gcc/testsuite/gcc.target/aarch64/vect-early-break-cbranch.c new file mode 100644 index 0000000000000000000000000000000000000000..c0363c3787270507d7902bb2ac0e39faef63a852 --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/vect-early-break-cbranch.c @@ -0,0 +1,124 @@ +/* { dg-do compile } */ +/* { dg-options "-O3" } */ +/* { dg-final { check-function-bodies "**" "" "" { target lp64 } } } */ + +#pragma GCC target "+nosve" + +#define N 640 +int a[N] = {0}; +int b[N] = {0}; + + +/* +** f1: +** ... +** cmgt v[0-9]+.4s, v[0-9]+.4s, #0 +** umaxp v[0-9]+.4s, v[0-9]+.4s, v[0-9]+.4s +** fmov x[0-9]+, d[0-9]+ +** cbnz x[0-9]+, \.L[0-9]+ +** ... +*/ +void f1 () +{ + for (int i = 0; i < N; i++) + { + b[i] += a[i]; + if (a[i] > 0) + break; + } +} + +/* +** f2: +** ... +** cmge v[0-9]+.4s, v[0-9]+.4s, #0 +** umaxp v[0-9]+.4s, v[0-9]+.4s, v[0-9]+.4s +** fmov x[0-9]+, d[0-9]+ +** cbnz x[0-9]+, \.L[0-9]+ +** ... +*/ +void f2 () +{ + for (int i = 0; i < N; i++) + { + b[i] += a[i]; + if (a[i] >= 0) + break; + } +} + +/* +** f3: +** ... +** cmeq v[0-9]+.4s, v[0-9]+.4s, #0 +** umaxp v[0-9]+.4s, v[0-9]+.4s, v[0-9]+.4s +** fmov x[0-9]+, d[0-9]+ +** cbnz x[0-9]+, \.L[0-9]+ +** ... +*/ +void f3 () +{ + for (int i = 0; i < N; i++) + { + b[i] += a[i]; + if (a[i] == 0) + break; + } +} + +/* +** f4: +** ... +** cmtst v[0-9]+.4s, v[0-9]+.4s, v[0-9]+.4s +** umaxp v[0-9]+.4s, v[0-9]+.4s, v[0-9]+.4s +** fmov x[0-9]+, d[0-9]+ +** cbnz x[0-9]+, \.L[0-9]+ +** ... +*/ +void f4 () +{ + for (int i = 0; i < N; i++) + { + b[i] += a[i]; + if (a[i] != 0) + break; + } +} + +/* +** f5: +** ... +** cmlt v[0-9]+.4s, v[0-9]+.4s, #0 +** umaxp v[0-9]+.4s, v[0-9]+.4s, v[0-9]+.4s +** fmov x[0-9]+, d[0-9]+ +** cbnz x[0-9]+, \.L[0-9]+ +** ... +*/ +void f5 () +{ + for (int i = 0; i < N; i++) + { + b[i] += a[i]; + if (a[i] < 0) + break; + } +} + +/* +** f6: +** ... +** cmle v[0-9]+.4s, v[0-9]+.4s, #0 +** umaxp v[0-9]+.4s, v[0-9]+.4s, v[0-9]+.4s +** fmov x[0-9]+, d[0-9]+ +** cbnz x[0-9]+, \.L[0-9]+ +** ... +*/ +void f6 () +{ + for (int i = 0; i < N; i++) + { + b[i] += a[i]; + if (a[i] <= 0) + break; + } +}