From patchwork Mon Oct 16 11:20:13 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Schulze Frielinghaus X-Patchwork-Id: 153343 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:2908:b0:403:3b70:6f57 with SMTP id ib8csp3385682vqb; Mon, 16 Oct 2023 04:21:08 -0700 (PDT) X-Google-Smtp-Source: AGHT+IH8cCKNv5bpMPAsI2ce0ZmonHAcosTeRi1MZmGLJ8VE+BrwRUUCmMCNJmrQDrGwZm7+c3pE X-Received: by 2002:a5b:c0c:0:b0:d9a:4246:9304 with SMTP id f12-20020a5b0c0c000000b00d9a42469304mr19165348ybq.46.1697455268208; Mon, 16 Oct 2023 04:21:08 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1697455268; cv=pass; d=google.com; s=arc-20160816; b=vpeXJ5XQuyFl2os3inEY3Y6wsZukaWUW+jHBH7r7AdDn0kX2ifv4SkgfTc9MUmhCT/ /k1SjcLnnJYh7m5HWFmmqoLrTJ30zfDObHs2fZHanVJ2SzIw7RD+fyHTGtMf86AnBvjp Z8feS6XiML7FRywnWOcL+CKTrE9Q/nGPgMSg0WKGgXgal+UMcIzHc0K7GKJ9wdoO7SMh 8tNs0AMjnsmatgFnlHuRbuFb5cf7BcOy/A1xXizVQLM7BnA2JG9NTIP5bOoIdFSd408o rRBXg0WpKSrFMsez4DTfIVFPJ1ctCFH8mO2NSuaBGwrjsnfnZPJTxll8zfcDkoriryVy e6+Q== ARC-Message-Signature: i=2; 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:content-transfer-encoding :mime-version:message-id:date:subject:cc:to:from:dkim-signature :arc-filter:dmarc-filter:delivered-to; bh=Bkv2TdMfFPwMrBkXDiGELbo08FST6BVIoJK5+E3nRT8=; fh=b8RxUuxE+TBDYdILUFGNEkIOKUNToWSD6tzeM8szxsA=; b=Bo4rPczTPJNCuX9dnhNooeH5p9p7kfvXX2L3R1E2UKEIGK1ODl4W/gu2qcOnQ1x9Ty 82Tpy6FAZVVlcDrHoC+lmlDRmBDY9YQPfSlxXK4bvDDwdEJ+gn29Fl0AqJ3LS7xmNfE0 dnOgTxqqn5WsA9SYTCisBnyvjBwcsI2OV61MEeXsoPkpuhsK5oeaQsSACo/weC3UPe+E CTjvjTQYkndWWahESajx+I5oISth80EX4SSh8Lk7zNFJpPdqqvwNofN8woGgEeIdPBPm eSZpEGqZWnAgzZVneuJNH1kKZiBNb6l+SOY7UF2AidZyowewYx8pkOkLk6QWut5CCkrd tRKA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b="q/n45mHx"; arc=pass (i=1); 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=pass (p=REJECT sp=NONE dis=NONE) header.from=ibm.com Received: from server2.sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id lv8-20020a056214578800b0066cf5fda809si5133222qvb.316.2023.10.16.04.21.08 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Oct 2023 04:21:08 -0700 (PDT) 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=@ibm.com header.s=pp1 header.b="q/n45mHx"; arc=pass (i=1); 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=pass (p=REJECT sp=NONE dis=NONE) header.from=ibm.com Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id E75543858431 for ; Mon, 16 Oct 2023 11:21:07 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mx0b-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by sourceware.org (Postfix) with ESMTPS id C88093858D32 for ; Mon, 16 Oct 2023 11:20:43 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org C88093858D32 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=linux.ibm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=linux.ibm.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org C88093858D32 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=148.163.158.5 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1697455244; cv=none; b=Hd79q3SBH6ir6x+kyJ+rgKsC1lwrOtqMq7zHWl8yqzLUaJzZZL8eBBsPc1M4a1r+S74KT+Ye4nBu06Gdsb2+0EpXZb0gp4it2ESax5ekncc5DeDzpkVLqJ2Do3wHEbxw5DUmv8/kagMmZn2bvlw33HDfUqEcrH1yy0RlQlYjRaI= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1697455244; c=relaxed/simple; bh=FPsE9JEvFcfC+9F1h6M/KnbeA2x9qM8AUu+O5Lwg6w0=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=RQGyktOOQRZNSr7aDym+zSx6bjHTPxYLQ25o9c9XmlKEcJYGCtiFnhwO3n30erTomAw7XxYilp/GyKel3ynZLePyee0DAZy0PxT9yyijYLkmno4tJjK1Al1VICHQOSX8w3coIjqAL4KcGN4995VwuwvLfUe9mukvnUeFUNRkUNY= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from pps.filterd (m0356516.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 39GAdUxu003026 for ; Mon, 16 Oct 2023 11:20:43 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=from : to : cc : subject : date : message-id : mime-version : content-transfer-encoding; s=pp1; bh=Bkv2TdMfFPwMrBkXDiGELbo08FST6BVIoJK5+E3nRT8=; b=q/n45mHx60arrvAkxv4L8l6gzILThSmxihqmqlGvIJ9hvgZKk2b7OPcmsJh+EpHuMAAN o5l1CqYerJ4k1nVcfRgkx0iUKTSiXpe2IlShajYXUMimb1jMZITN/1LuHNlWoBbqqbiI 2JAS1tV9BcSnTffUpPncno1MCG5lIRLLCkewDtgrC7zlXiiJkG2IcCpVKgmDP5B8ak+A l++IJGOIcphcycFc8Z8nxuhArbZEL5zgnIKITlMx4YUARmwmps/U4kYHPQ2lh9o52fP0 vNcF1c23pPD9dbVNMkEkOC/SoOopBWVnX+BCImy4j5tLSYrJKlTCIBVZ6RePRM5/eSFs SQ== Received: from ppma22.wdc07v.mail.ibm.com (5c.69.3da9.ip4.static.sl-reverse.com [169.61.105.92]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3ts3m1994y-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Mon, 16 Oct 2023 11:20:43 +0000 Received: from pps.filterd (ppma22.wdc07v.mail.ibm.com [127.0.0.1]) by ppma22.wdc07v.mail.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 39G9AmJh012900 for ; Mon, 16 Oct 2023 11:20:42 GMT Received: from smtprelay06.fra02v.mail.ibm.com ([9.218.2.230]) by ppma22.wdc07v.mail.ibm.com (PPS) with ESMTPS id 3tr5py0j1j-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Mon, 16 Oct 2023 11:20:42 +0000 Received: from smtpav02.fra02v.mail.ibm.com (smtpav02.fra02v.mail.ibm.com [10.20.54.101]) by smtprelay06.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 39GBKbbw45416936 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 16 Oct 2023 11:20:37 GMT Received: from smtpav02.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 149CA20043; Mon, 16 Oct 2023 11:20:37 +0000 (GMT) Received: from smtpav02.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id EEC7320040; Mon, 16 Oct 2023 11:20:36 +0000 (GMT) Received: from a8345010.lnxne.boe (unknown [9.152.108.100]) by smtpav02.fra02v.mail.ibm.com (Postfix) with ESMTPS; Mon, 16 Oct 2023 11:20:36 +0000 (GMT) From: Stefan Schulze Frielinghaus To: krebbel@linux.ibm.com, gcc-patches@gcc.gnu.org Cc: Stefan Schulze Frielinghaus Subject: [PATCH] s390: Fix expander popcountv8hi2_vx Date: Mon, 16 Oct 2023 13:20:13 +0200 Message-ID: <20231016112013.512552-1-stefansf@linux.ibm.com> X-Mailer: git-send-email 2.41.0 MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: qpC4Tza7eGpFV-3_14hxDG14qCOOM9BP X-Proofpoint-GUID: qpC4Tza7eGpFV-3_14hxDG14qCOOM9BP X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.980,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-10-16_04,2023-10-12_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 spamscore=0 lowpriorityscore=0 mlxscore=0 suspectscore=0 impostorscore=0 bulkscore=0 phishscore=0 clxscore=1015 mlxlogscore=848 malwarescore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2309180000 definitions=main-2310160099 X-Spam-Status: No, score=-8.3 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL, 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.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: 1779910855407074624 X-GMAIL-MSGID: 1779910855407074624 The normal form of a CONST_INT which represents an integer of a mode with fewer bits than in HOST_WIDE_INT is sign extended. This even holds for unsigned integers. This fixes an ICE during cse1 where we bail out at rtl.h:2297 since INTVAL (x.first) == sext_hwi (INTVAL (x.first), precision) does not hold. gcc/ChangeLog: * config/s390/vector.md (popcountv8hi2_vx): Sign extend each unsigned vector element. --- gcc/config/s390/vector.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/gcc/config/s390/vector.md b/gcc/config/s390/vector.md index f0e9ed3d263..7d1eb36e844 100644 --- a/gcc/config/s390/vector.md +++ b/gcc/config/s390/vector.md @@ -1154,14 +1154,14 @@ (plus:V16QI (match_dup 2) (match_dup 3))) ; Generate mask for the odd numbered byte elements (set (match_dup 3) - (const_vector:V16QI [(const_int 0) (const_int 255) - (const_int 0) (const_int 255) - (const_int 0) (const_int 255) - (const_int 0) (const_int 255) - (const_int 0) (const_int 255) - (const_int 0) (const_int 255) - (const_int 0) (const_int 255) - (const_int 0) (const_int 255)])) + (const_vector:V16QI [(const_int 0) (const_int -1) + (const_int 0) (const_int -1) + (const_int 0) (const_int -1) + (const_int 0) (const_int -1) + (const_int 0) (const_int -1) + (const_int 0) (const_int -1) + (const_int 0) (const_int -1) + (const_int 0) (const_int -1)])) ; Zero out the even indexed bytes (set (match_operand:V8HI 0 "register_operand" "=v") (and:V8HI (subreg:V8HI (match_dup 2) 0)