From patchwork Tue Oct 11 11:02:02 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Stubbs X-Patchwork-Id: 55 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4ac7:0:0:0:0:0 with SMTP id y7csp2030443wrs; Tue, 11 Oct 2022 04:03:53 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6C8LIMQzGPVa2DvL2p950BC6BjrwxWP0fxwT8d3bUJKwWRg8W/4MnLOQUbwxt2Ouov9SXf X-Received: by 2002:a17:907:60c6:b0:787:bacc:97c1 with SMTP id hv6-20020a17090760c600b00787bacc97c1mr17534415ejc.578.1665486232630; Tue, 11 Oct 2022 04:03:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665486232; cv=none; d=google.com; s=arc-20160816; b=aM3nKN0lk9PVumbJBBW7c/F0hGASF6+Ri4tq4R2Sczbiv15gxEgHqFZIxYYew0xjTf 4OVCHsyNesSF2F0C3pUhYP9SOJzr3aRu/psXic4K3jmgVOSJS0LopzI+ox55tVClGtgl Ii/XYBhOWlwqPwOxnUCN+lx3hf3a2u2/9ZkRJOK+iJFSijW85D7at550JGyG1XFULN4S xLRp2hCiL84WmO3INtpKXdcRfGEesnAqMX2mrdLyOo2EnNo3HbAvC/RVF59blCOnXx9m QuE6ISata+fw9Pc8eGeTg70jZUWU9zvQeLyAKwuR9AtuwYj+GWFW5k22fE7l9ikNoG4P zWhQ== 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:content-transfer-encoding :mime-version:message-id:date:subject:to:from:ironport-sdr :dmarc-filter:delivered-to; bh=d2m0lrYClhDzTBZSxTmDYDrKYto6sO6ARqykE93QJco=; b=AYHGlBorp/N4wTlpx58wY2IvAOO8b/qomRe9qd/6xDMXqsyvxPSQWFTI0LB09dgqd1 2GMkQfjsSUCSxSGTgsX/jjrh1tdjISWpllHjoOX4nCnAM11i74HW1ZeK8j5ziaLhuymn bd7Vgn5Fct5tiYNty7j+AK8ubfsdwA1/YvuwYa9uyArPqt3Foc7jLScVNjgfz6Nrgta3 AzjnPgsbuKJ93fn5yjoVvEEaFQ9HTImtbN4G6Nc8NQSSp6zblKHHBdQjmcv4TVhDIiqS 6aMmECM099n/V99Fzssn23r04QiYr0BFPPO+r36HIOHmL2sELRfDgKjr/cN2xLodBdlF 82WQ== 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 hz5-20020a1709072ce500b007824b741e7asi13017838ejc.236.2022.10.11.04.03.52 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Oct 2022 04:03:52 -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 813523860755 for ; Tue, 11 Oct 2022 11:02:59 +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 1F6313858C20 for ; Tue, 11 Oct 2022 11:02:33 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 1F6313858C20 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.95,176,1661846400"; d="scan'208";a="87280545" Received: from orw-gwy-01-in.mentorg.com ([192.94.38.165]) by esa1.mentor.iphmx.com with ESMTP; 11 Oct 2022 03:02:31 -0800 IronPort-SDR: +F1pE7JiYK6grrU5yJG/eb8YteHKFFWms5J84OK9VhIDNeAdBIVjYZrAP1PHqKSxOxVelKafIf dPzISdEDyKnzPxshlfNpg551VVsZIRcbCtQ/QOOO/gwlrPLFf3dOiII7VPmR5/CfRdQtgQ+ien Mmi+2GpreUMxUnK0UHzSPvk6Eg4kpI9O0giigOb0xKMknvaLc3LRO6cmLMUy9woZ4WKhD0m2qL TQO1zSiIoRKQthbclocxXhNaoWoJ/l69HBw3M+Nb2/FC5vyqrVqRC8Bq32E19AfYa87VSVVR4V ruQ= From: Andrew Stubbs To: Subject: [committed 0/6] amdgcn: Add V32, V16, V8, V4, and V2 vectors Date: Tue, 11 Oct 2022 12:02:02 +0100 Message-ID: X-Mailer: git-send-email 2.37.0 MIME-Version: 1.0 X-Originating-IP: [137.202.0.90] X-ClientProxiedBy: svr-ies-mbx-14.mgc.mentorg.com (139.181.222.14) To svr-ies-mbx-11.mgc.mentorg.com (139.181.222.11) X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS, KAM_DMARC_STATUS, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=no 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?1746388892305906186?= X-GMAIL-MSGID: =?utf-8?q?1746388892305906186?= This patch series adds additional vector sizes for the amdgcn backend. The hardware supports any arbitrary vector length up to 64-lanes via masking, but GCC cannot (yet) make full use of them due to middle-end limitations. Adding smaller "virtual" vector sizes increases the complexity of the backend a little, but opens up optimization opportunities for the current middle-end implementation somewhat. In particular, it enables many more cases of SLP optimization. The patchset gives aproximately 100 addtional test PASS and a few extra FAIL. However, the failures are not new issues, but rather existing problems that did not show up because the code did not previously vectorize. Expanding the testcase to allow 64-lane vectors shows the same problems there. I shall backport these patches to the OG12 branch shortly. Andrew Andrew Stubbs (6): amdgcn: add multiple vector sizes amdgcn: Resolve insn conditions at compile time amdgcn: Add vec_extract for partial vectors amdgcn: vec_init for multiple vector sizes amdgcn: Add vector integer negate insn amdgcn: vector testsuite tweaks gcc/config/gcn/gcn-modes.def | 82 ++ gcc/config/gcn/gcn-protos.h | 24 +- gcc/config/gcn/gcn-valu.md | 399 +++++-- gcc/config/gcn/gcn.cc | 1063 +++++++++++------ gcc/config/gcn/gcn.h | 24 + gcc/testsuite/gcc.dg/pr104464.c | 2 + gcc/testsuite/gcc.dg/signbit-2.c | 5 +- gcc/testsuite/gcc.dg/signbit-5.c | 1 + gcc/testsuite/gcc.dg/vect/bb-slp-68.c | 5 +- gcc/testsuite/gcc.dg/vect/bb-slp-cond-1.c | 3 +- .../gcc.dg/vect/bb-slp-subgroups-3.c | 5 +- .../gcc.dg/vect/no-vfa-vect-depend-2.c | 3 +- gcc/testsuite/gcc.dg/vect/pr33953.c | 3 +- gcc/testsuite/gcc.dg/vect/pr65947-12.c | 3 +- gcc/testsuite/gcc.dg/vect/pr65947-13.c | 3 +- gcc/testsuite/gcc.dg/vect/pr80631-2.c | 3 +- gcc/testsuite/gcc.dg/vect/slp-reduc-4.c | 3 +- .../gcc.dg/vect/trapv-vect-reduc-4.c | 3 +- gcc/testsuite/lib/target-supports.exp | 3 +- 19 files changed, 1183 insertions(+), 454 deletions(-)