Message ID | 20220803102039.514517-1-iii@linux.ibm.com |
---|---|
State | New, archived |
Headers |
Return-Path: <gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:6a10:b5d6:b0:2b9:3548:2db5 with SMTP id v22csp245748pxt; Wed, 3 Aug 2022 03:21:35 -0700 (PDT) X-Google-Smtp-Source: AA6agR6gYVH3d4qMz/LSoyC/nr+FRoKR6cno+y2F5jDZ58aAY4tBzuKecrmXLVLqnszmUYrUxSJ6 X-Received: by 2002:a50:ff04:0:b0:43d:67a7:dd2d with SMTP id a4-20020a50ff04000000b0043d67a7dd2dmr18121874edu.11.1659522095326; Wed, 03 Aug 2022 03:21:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1659522095; cv=none; d=google.com; s=arc-20160816; b=wAlI3PFU2DUrGpSkZvbQflkjvI5d4LvF3MZ2tTBSjK3ZPaoGqw4ZY0tqU+z3n5H+sJ 55bL7EWXtwum0zEGuBZvqTgZOesCDCNvl8f0xF1aERO/hgbhsZTknkWip80dpzWX3s5R NOfi22vJnMPFMFhKjcjXIFV1d83pFrGFpSf8OvJ8RCKpxv8BPssBea4rG16sUFxdVX2V hZOUQPGw9/0z4KvvzEDhap6BIZOLDSIRJM1Lu89xUpnz/FrIJE4xV7b4Jd72Xn/FMvN1 twV+VlCa6Dw1XX4lSingPEzAqDD10pbm28vGPLCEHz/PcMZ9NCT50x4Lj/WiLZDhoU5C BV8g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:reply-to:from:list-subscribe:list-help :list-post:list-archive:list-unsubscribe:list-id:precedence :content-transfer-encoding:mime-version:message-id:date:subject:to :dmarc-filter:delivered-to:dkim-signature:dkim-filter; bh=9WMXFxmT05kteBbqPOAcwex7ziCy1KfTiyPRdmYg+C8=; b=Z+pvMlFgcQPwMYmST5SN7MgvYcU7J34z9h94gppM3L46IoWC8EIPCkEUaAEOzWI887 aJnnVbF2hgpFzSpKw/x54FINg4x88twO+XYSGNshFoNPVLSxYSpmKsSskmk7z2zojQ0q yaiAsK6bKHGfjFPI/HqiI6Mt095HNPjeOeTyMRf0D98WIp2wWAabEWTdnCYniX1MXHM9 MofntKsICK4p9SOPfEDO7Lmqck9FSoBBxL7VOYNE7YbVeiFVcr9DQxfRyR4o6feapbxv l/NWUSt+LMfPg0PQdpWC4F9GBfq23w0n9+bz+d6ipw+c/lfzk4rJ2OZDd0yb0RDCAglP YNhA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=V1Zo8+cf; 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 sourceware.org (server2.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id du12-20020a17090772cc00b00730abba4e7asi2221281ejc.577.2022.08.03.03.21.34 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Aug 2022 03:21:35 -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=V1Zo8+cf; 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 E3491385828D for <ouuuleilei@gmail.com>; Wed, 3 Aug 2022 10:21:33 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E3491385828D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1659522093; bh=9WMXFxmT05kteBbqPOAcwex7ziCy1KfTiyPRdmYg+C8=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:Cc:From; b=V1Zo8+cfngLP/GzA0v9F7bpNEb1MO7pcS4rXqtEjvKKdLRxYreyoZrOJRUmZoTvnx WgLOhRWKL15w2hh3Pn4a7xcmcTl6E4ZlsdeMMJfoYA23paULmgkGupq4tBKQjkzTce /C9+wjYRhwqV5k/gWvnDNaRof7QLmWTnaHosmzVQ= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by sourceware.org (Postfix) with ESMTPS id 4B4DD3858CDB; Wed, 3 Aug 2022 10:20:49 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 4B4DD3858CDB Received: from pps.filterd (m0098399.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 273AGppL025733; Wed, 3 Aug 2022 10:20:47 GMT Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3hqq4j8202-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 03 Aug 2022 10:20:47 +0000 Received: from m0098399.ppops.net (m0098399.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 273AHnpc028625; Wed, 3 Aug 2022 10:20:47 GMT Received: from ppma01fra.de.ibm.com (46.49.7a9f.ip4.static.sl-reverse.com [159.122.73.70]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3hqq4j81yd-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 03 Aug 2022 10:20:46 +0000 Received: from pps.filterd (ppma01fra.de.ibm.com [127.0.0.1]) by ppma01fra.de.ibm.com (8.16.1.2/8.16.1.2) with SMTP id 273A5iYd002344; Wed, 3 Aug 2022 10:20:44 GMT Received: from b06cxnps4074.portsmouth.uk.ibm.com (d06relay11.portsmouth.uk.ibm.com [9.149.109.196]) by ppma01fra.de.ibm.com with ESMTP id 3hmv98vmrv-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 03 Aug 2022 10:20:44 +0000 Received: from d06av21.portsmouth.uk.ibm.com (d06av21.portsmouth.uk.ibm.com [9.149.105.232]) by b06cxnps4074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 273AKfH015532518 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 3 Aug 2022 10:20:41 GMT Received: from d06av21.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id E243152051; Wed, 3 Aug 2022 10:20:40 +0000 (GMT) Received: from heavy.lan (unknown [9.171.31.241]) by d06av21.portsmouth.uk.ibm.com (Postfix) with ESMTP id 8CD3B52050; Wed, 3 Aug 2022 10:20:40 +0000 (GMT) To: Andreas Krebbel <krebbel@gcc.gnu.org>, Jakub Jelinek <jakub@redhat.com> Subject: [PATCH] PR106342 - IBM zSystems: Provide vsel for all vector modes Date: Wed, 3 Aug 2022 12:20:39 +0200 Message-Id: <20220803102039.514517-1-iii@linux.ibm.com> X-Mailer: git-send-email 2.35.3 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: ic8EmM-3K0X9vYzAQGCiV5NNs2VMZcXM X-Proofpoint-GUID: 4A-8WMdfxRX9AGluN5F4qUzoAgud8lLk X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.883,Hydra:6.0.517,FMLib:17.11.122.1 definitions=2022-08-03_03,2022-08-02_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 adultscore=0 suspectscore=0 clxscore=1011 mlxlogscore=999 lowpriorityscore=0 impostorscore=0 phishscore=0 spamscore=0 bulkscore=0 priorityscore=1501 mlxscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2206140000 definitions=main-2208030046 X-Spam-Status: No, score=-12.1 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, 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 <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: Ilya Leoshkevich via Gcc-patches <gcc-patches@gcc.gnu.org> Reply-To: Ilya Leoshkevich <iii@linux.ibm.com> Cc: gcc-patches@gcc.gnu.org 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?1740135040402483862?= X-GMAIL-MSGID: =?utf-8?q?1740135040402483862?= |
Series |
PR106342 - IBM zSystems: Provide vsel for all vector modes
|
|
Commit Message
Ilya Leoshkevich
Aug. 3, 2022, 10:20 a.m. UTC
Bootstrapped and regtested on s390x-redhat-linux. Ok for master? dg.exp=pr104612.c fails with an ICE on s390x, because copysignv2sf3 produces an insn that vsel<mode> is supposed to recognize, but can't, because it's not defined for V2SF. Fix by defining it for all vector modes supported by copysign<mode>3. gcc/ChangeLog: * config/s390/vector.md (V_HW_FT): New iterator. * config/s390/vx-builtins.md (vsel<mode>): Use V instead of V_HW. --- gcc/config/s390/vector.md | 6 ++++++ gcc/config/s390/vx-builtins.md | 12 ++++++------ 2 files changed, 12 insertions(+), 6 deletions(-)
Comments
On 8/3/22 12:20, Ilya Leoshkevich wrote: > Bootstrapped and regtested on s390x-redhat-linux. Ok for master? > > > > dg.exp=pr104612.c fails with an ICE on s390x, because copysignv2sf3 > produces an insn that vsel<mode> is supposed to recognize, but can't, > because it's not defined for V2SF. Fix by defining it for all vector > modes supported by copysign<mode>3. > > gcc/ChangeLog: > > * config/s390/vector.md (V_HW_FT): New iterator. > * config/s390/vx-builtins.md (vsel<mode>): Use V instead of > V_HW. Ok. There is a typo in the changelog: "Use *V* instead ..." should probably read "Use V_HW_FT instead ..." Thanks, Andreas > --- > gcc/config/s390/vector.md | 6 ++++++ > gcc/config/s390/vx-builtins.md | 12 ++++++------ > 2 files changed, 12 insertions(+), 6 deletions(-) > > diff --git a/gcc/config/s390/vector.md b/gcc/config/s390/vector.md > index a6c4b4eb974..624729814af 100644 > --- a/gcc/config/s390/vector.md > +++ b/gcc/config/s390/vector.md > @@ -63,6 +63,12 @@ > V1DF V2DF > (V1TF "TARGET_VXE") (TF "TARGET_VXE")]) > > +; All modes present in V_HW and VFT. > +(define_mode_iterator V_HW_FT [V16QI V8HI V4SI V2DI (V1TI "TARGET_VXE") V1DF > + V2DF (V1SF "TARGET_VXE") (V2SF "TARGET_VXE") > + (V4SF "TARGET_VXE") (V1TF "TARGET_VXE") > + (TF "TARGET_VXE")]) > + > ; FP vector modes directly supported by the HW. This does not include > ; vector modes using only part of a vector register and should be used > ; for instructions which might trigger IEEE exceptions. > diff --git a/gcc/config/s390/vx-builtins.md b/gcc/config/s390/vx-builtins.md > index d5130799804..98ee08b2683 100644 > --- a/gcc/config/s390/vx-builtins.md > +++ b/gcc/config/s390/vx-builtins.md > @@ -517,12 +517,12 @@ > ; swapped in s390-c.cc when we get here. > > (define_insn "vsel<mode>" > - [(set (match_operand:V_HW 0 "register_operand" "=v") > - (ior:V_HW > - (and:V_HW (match_operand:V_HW 1 "register_operand" "v") > - (match_operand:V_HW 3 "register_operand" "v")) > - (and:V_HW (not:V_HW (match_dup 3)) > - (match_operand:V_HW 2 "register_operand" "v"))))] > + [(set (match_operand:V_HW_FT 0 "register_operand" "=v") > + (ior:V_HW_FT > + (and:V_HW_FT (match_operand:V_HW_FT 1 "register_operand" "v") > + (match_operand:V_HW_FT 3 "register_operand" "v")) > + (and:V_HW_FT (not:V_HW_FT (match_dup 3)) > + (match_operand:V_HW_FT 2 "register_operand" "v"))))] > "TARGET_VX" > "vsel\t%v0,%1,%2,%3" > [(set_attr "op_type" "VRR")])
On Wed, 2022-08-03 at 12:20 +0200, Ilya Leoshkevich wrote: > Bootstrapped and regtested on s390x-redhat-linux. Ok for master? > > > > dg.exp=pr104612.c fails with an ICE on s390x, because copysignv2sf3 > produces an insn that vsel<mode> is supposed to recognize, but can't, > because it's not defined for V2SF. Fix by defining it for all vector > modes supported by copysign<mode>3. > > gcc/ChangeLog: > > * config/s390/vector.md (V_HW_FT): New iterator. > * config/s390/vx-builtins.md (vsel<mode>): Use V instead of > V_HW. > --- > gcc/config/s390/vector.md | 6 ++++++ > gcc/config/s390/vx-builtins.md | 12 ++++++------ > 2 files changed, 12 insertions(+), 6 deletions(-) Jakub pointed out that this is broken in gcc-12 as well. The patch applies cleanly, and I started a bootstrap/regtest. Ok for gcc-12?
On 8/10/22 13:42, Ilya Leoshkevich wrote: > On Wed, 2022-08-03 at 12:20 +0200, Ilya Leoshkevich wrote: >> Bootstrapped and regtested on s390x-redhat-linux. Ok for master? >> >> >> >> dg.exp=pr104612.c fails with an ICE on s390x, because copysignv2sf3 >> produces an insn that vsel<mode> is supposed to recognize, but can't, >> because it's not defined for V2SF. Fix by defining it for all vector >> modes supported by copysign<mode>3. >> >> gcc/ChangeLog: >> >> * config/s390/vector.md (V_HW_FT): New iterator. >> * config/s390/vx-builtins.md (vsel<mode>): Use V instead of >> V_HW. >> --- >> gcc/config/s390/vector.md | 6 ++++++ >> gcc/config/s390/vx-builtins.md | 12 ++++++------ >> 2 files changed, 12 insertions(+), 6 deletions(-) > > Jakub pointed out that this is broken in gcc-12 as well. > The patch applies cleanly, and I started a bootstrap/regtest. > Ok for gcc-12? Yes. Thanks! Andreas
On Thu, 2022-08-11 at 07:45 +0200, Andreas Krebbel wrote: > On 8/10/22 13:42, Ilya Leoshkevich wrote: > > On Wed, 2022-08-03 at 12:20 +0200, Ilya Leoshkevich wrote: > > > Bootstrapped and regtested on s390x-redhat-linux. Ok for master? > > > > > > > > > > > > dg.exp=pr104612.c fails with an ICE on s390x, because > > > copysignv2sf3 > > > produces an insn that vsel<mode> is supposed to recognize, but > > > can't, > > > because it's not defined for V2SF. Fix by defining it for all > > > vector > > > modes supported by copysign<mode>3. > > > > > > gcc/ChangeLog: > > > > > > * config/s390/vector.md (V_HW_FT): New iterator. > > > * config/s390/vx-builtins.md (vsel<mode>): Use V instead > > > of > > > V_HW. > > > --- > > > gcc/config/s390/vector.md | 6 ++++++ > > > gcc/config/s390/vx-builtins.md | 12 ++++++------ > > > 2 files changed, 12 insertions(+), 6 deletions(-) > > > > Jakub pointed out that this is broken in gcc-12 as well. > > The patch applies cleanly, and I started a bootstrap/regtest. > > Ok for gcc-12? > > Yes. Thanks! > > Andreas Hi, I've committed this today without realizing that gcc-12 branch is closed. Sorry! Please let me know if I should revert this. Best regards, Ilya
On Wed, 17 Aug 2022, Ilya Leoshkevich wrote: > On Thu, 2022-08-11 at 07:45 +0200, Andreas Krebbel wrote: > > On 8/10/22 13:42, Ilya Leoshkevich wrote: > > > On Wed, 2022-08-03 at 12:20 +0200, Ilya Leoshkevich wrote: > > > > Bootstrapped and regtested on s390x-redhat-linux. Ok for master? > > > > > > > > > > > > > > > > dg.exp=pr104612.c fails with an ICE on s390x, because > > > > copysignv2sf3 > > > > produces an insn that vsel<mode> is supposed to recognize, but > > > > can't, > > > > because it's not defined for V2SF. Fix by defining it for all > > > > vector > > > > modes supported by copysign<mode>3. > > > > > > > > gcc/ChangeLog: > > > > > > > > * config/s390/vector.md (V_HW_FT): New iterator. > > > > * config/s390/vx-builtins.md (vsel<mode>): Use V instead > > > > of > > > > V_HW. > > > > --- > > > > gcc/config/s390/vector.md | 6 ++++++ > > > > gcc/config/s390/vx-builtins.md | 12 ++++++------ > > > > 2 files changed, 12 insertions(+), 6 deletions(-) > > > > > > Jakub pointed out that this is broken in gcc-12 as well. > > > The patch applies cleanly, and I started a bootstrap/regtest. > > > Ok for gcc-12? > > > > Yes. Thanks! > > > > Andreas > > Hi, > > I've committed this today without realizing that gcc-12 branch is > closed. Sorry! Please let me know if I should revert this. It doesn't look too risky, so leave it in. Richard.
diff --git a/gcc/config/s390/vector.md b/gcc/config/s390/vector.md index a6c4b4eb974..624729814af 100644 --- a/gcc/config/s390/vector.md +++ b/gcc/config/s390/vector.md @@ -63,6 +63,12 @@ V1DF V2DF (V1TF "TARGET_VXE") (TF "TARGET_VXE")]) +; All modes present in V_HW and VFT. +(define_mode_iterator V_HW_FT [V16QI V8HI V4SI V2DI (V1TI "TARGET_VXE") V1DF + V2DF (V1SF "TARGET_VXE") (V2SF "TARGET_VXE") + (V4SF "TARGET_VXE") (V1TF "TARGET_VXE") + (TF "TARGET_VXE")]) + ; FP vector modes directly supported by the HW. This does not include ; vector modes using only part of a vector register and should be used ; for instructions which might trigger IEEE exceptions. diff --git a/gcc/config/s390/vx-builtins.md b/gcc/config/s390/vx-builtins.md index d5130799804..98ee08b2683 100644 --- a/gcc/config/s390/vx-builtins.md +++ b/gcc/config/s390/vx-builtins.md @@ -517,12 +517,12 @@ ; swapped in s390-c.cc when we get here. (define_insn "vsel<mode>" - [(set (match_operand:V_HW 0 "register_operand" "=v") - (ior:V_HW - (and:V_HW (match_operand:V_HW 1 "register_operand" "v") - (match_operand:V_HW 3 "register_operand" "v")) - (and:V_HW (not:V_HW (match_dup 3)) - (match_operand:V_HW 2 "register_operand" "v"))))] + [(set (match_operand:V_HW_FT 0 "register_operand" "=v") + (ior:V_HW_FT + (and:V_HW_FT (match_operand:V_HW_FT 1 "register_operand" "v") + (match_operand:V_HW_FT 3 "register_operand" "v")) + (and:V_HW_FT (not:V_HW_FT (match_dup 3)) + (match_operand:V_HW_FT 2 "register_operand" "v"))))] "TARGET_VX" "vsel\t%v0,%1,%2,%3" [(set_attr "op_type" "VRR")])