From patchwork Fri Jul 29 12:11:54 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Stubbs X-Patchwork-Id: 306 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:6a10:b5d6:b0:2b9:3548:2db5 with SMTP id v22csp773261pxt; Fri, 29 Jul 2022 05:12:32 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vpsnFllLb3q1f71Y1cr7hJHqfyBkpV2KLuf0UeigHRoodoaRI+PcBVW7hwQN0VKIlK7gV4 X-Received: by 2002:a17:907:8687:b0:72e:e524:1803 with SMTP id qa7-20020a170907868700b0072ee5241803mr2590776ejc.411.1659096751818; Fri, 29 Jul 2022 05:12:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1659096751; cv=none; d=google.com; s=arc-20160816; b=0nROPsPtkSGfs8dQDT3EVq0d0Qp432gdceTr+N0Ydd3g+YCzkYwQcz3T7/aJEBL8mw dMJ6/C/Rp0iG/RD6TWXZKjdDkTnPva5GCvKHXvtNnWZQB6julvyt7lThs5nhFK5UIlQD kDpMBWXp6Z0Tg5CDbruQBDeWVEdEGUadz3KSPCXUGC+pzth8zzBc0ixHCKfwkc5b+yNi +ICqciXoRYObmIJydKOo+uebkmb/ntSOARdp4hTZF0f1IEySzSMod7tufyfF/seb1wtn WaWP8X7O83o/YmcBSRQ9KDoWsAj9zDfUIJuHpPRRVuC0wAbVZFrzI3Qu9lDWhkONIc79 CDrA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:from:to :content-language:user-agent:mime-version:date:message-id :ironport-sdr:dmarc-filter:delivered-to; bh=XcrUWwgORdk75OZVsRHl8hldEUDjHStUWOAyWK7D7C4=; b=iFIlElkWsvbG1HfZKO8XU990Z1uo++qsAF2H6O4y1rP3CdYSC6Z4LpuXg1OY0GRlvH E3b2XEUFqrnI2JLj5Gdr5QefH2L1Sjukl1Jn+ASXeJxhIxnMkuUhnBpkcTGctLjsxnss p+MKWXyojoU9ZnyDcPzyO/wlQ2VJWU/ZTSLVJGAS7i7efm1fvRMxOgaj6SuofvjK2VU+ at8WbgI2FLBTju4DPKfUgQGXTEiFCkXMMxDriv/NzisK05EJ1lwMoAxqCpC6xplQkY7R ToyhEy+F/fqx6vke+79/TfpfD9jhDzbl3QjTBbmi5PqL6m+45JXTeiBE4W+G+FYiDLCV ljLw== ARC-Authentication-Results: i=1; mx.google.com; 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" Received: from sourceware.org (ip-8-43-85-97.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id p27-20020a1709060e9b00b0072b36dc02dfsi3420812ejf.262.2022.07.29.05.12.31 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Jul 2022 05:12:31 -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; 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" Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 11C89385734E for ; Fri, 29 Jul 2022 12:12:26 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from esa1.mentor.iphmx.com (esa1.mentor.iphmx.com [68.232.129.153]) by sourceware.org (Postfix) with ESMTPS id B85AC3858424 for ; Fri, 29 Jul 2022 12:12:01 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org B85AC3858424 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=codesourcery.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=mentor.com X-IronPort-AV: E=Sophos;i="5.93,201,1654588800"; d="scan'208";a="83197984" Received: from orw-gwy-01-in.mentorg.com ([192.94.38.165]) by esa1.mentor.iphmx.com with ESMTP; 29 Jul 2022 04:11:58 -0800 IronPort-SDR: pAgT+YrB7P42ZZq9eHVa4qaqa8RFnbVdLOBJvXbpmpoFloOvAHTLRySsGQ3YFJWAC9Iirccgzw +/rIGsDG0xAxd+tfFSvFLR7jkhPhD8gAefmzgP6J2wMlMepOppontZH3ao9kbZmKQX5iHNfeQ+ R+cDusu8X1iboZMj52SjdM1n7sxnIdq1mC8hrfYGt9SX9zpxnFsG67KQTahzHZFQsf039UoLMD Bk2MjyOB3Cctc+SZTHS+smAtU7y+vKf2ZVpjRofmQmAUy9XE0yU2Lis6qjnXxOYDSv3m1A6VJs XYw= Message-ID: <92081494-b836-f287-1004-6e62aac5324e@codesourcery.com> Date: Fri, 29 Jul 2022 13:11:54 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.0.3 Content-Language: en-GB To: "gcc-patches@gcc.gnu.org" From: Andrew Stubbs Subject: [committed] amdgcn: 64-bit not X-Originating-IP: [137.202.0.90] X-ClientProxiedBy: svr-ies-mbx-13.mgc.mentorg.com (139.181.222.13) To svr-ies-mbx-11.mgc.mentorg.com (139.181.222.11) X-Spam-Status: No, score=-11.5 required=5.0 tests=BAYES_00, GIT_PATCH_0, HEADER_FROM_DIFFERENT_DOMAINS, KAM_DMARC_STATUS, SPF_HELO_PASS, SPF_PASS, TXREP 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1739689035954731829?= X-GMAIL-MSGID: =?utf-8?q?1739689035954731829?= I've committed this patch to enable DImode one's-complement on amdgcn. The hardware doesn't have 64-bit not, and this isn't needed by expand which is happy to use two SImode operations, but the vectorizer isn't so clever. Vector condition masks are DImode on amdgcn, so this has been causing lots of conditional code to fail to vectorize. Andrew amdgcn: 64-bit not This makes the auto-vectorizer happier when handling masks. gcc/ChangeLog: * config/gcn/gcn.md (one_cmpldi2): New. diff --git a/gcc/config/gcn/gcn.md b/gcc/config/gcn/gcn.md index 033c1708e88..70a769babc4 100644 --- a/gcc/config/gcn/gcn.md +++ b/gcc/config/gcn/gcn.md @@ -1676,6 +1676,26 @@ (define_expand "si3_scc" ;; }}} ;; {{{ ALU: generic 64-bit +(define_insn_and_split "one_cmpldi2" + [(set (match_operand:DI 0 "register_operand" "=Sg, v") + (not:DI (match_operand:DI 1 "gcn_alu_operand" "SgA,vSvDB"))) + (clobber (match_scratch:BI 2 "=cs, X"))] + "" + "#" + "reload_completed" + [(parallel [(set (match_dup 3) (not:SI (match_dup 4))) + (clobber (match_dup 2))]) + (parallel [(set (match_dup 5) (not:SI (match_dup 6))) + (clobber (match_dup 2))])] + { + operands[3] = gcn_operand_part (DImode, operands[0], 0); + operands[4] = gcn_operand_part (DImode, operands[1], 0); + operands[5] = gcn_operand_part (DImode, operands[0], 1); + operands[6] = gcn_operand_part (DImode, operands[1], 1); + } + [(set_attr "type" "mult")] +) + (define_code_iterator vec_and_scalar64_com [and ior xor]) (define_insn_and_split "di3"