From patchwork Wed Oct 25 09:27:33 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: 157955 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:ce89:0:b0:403:3b70:6f57 with SMTP id p9csp2472615vqx; Wed, 25 Oct 2023 02:28:28 -0700 (PDT) X-Google-Smtp-Source: AGHT+IE9GBWMLmcyVmmeWbQhYSOXJNoiZHYpTMrvZ9rLkjUe9UxgYc4/L1uo6YJPjdrwlFV2Q398 X-Received: by 2002:a05:6214:d4b:b0:66d:65ae:18f6 with SMTP id 11-20020a0562140d4b00b0066d65ae18f6mr18491774qvr.50.1698226108376; Wed, 25 Oct 2023 02:28:28 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1698226108; cv=pass; d=google.com; s=arc-20160816; b=X7cIWhpgk8GKTPO34fNKU60JLavjiorxEZq1uks7ihzJkG7ANUInY3sit88QCBC8/9 e66XOXElYqE9BgoFv7UoF4++Cg26XTCD/AXCxo9c3UBaukA9iGoGVZionhHSFBXuUKv6 leBeUOqgfawRPXAiwHmr33XUHp7lrqSib7ZHOWC5y1JOR5VUrfLNf43bQKbDJ48/U7T9 op+lpM7gQAoH/LrDhyvFyneAWL2Jsgk/kOZSgyBdsjEV1qZ5991ZQ6tq4bokWLVSyzpD chPIu5mPT9G753I/WcUsbxLF/oBETaRC9JlyZANu9F+r/DxC1gkrn+U+gM2JPNVOPpj9 7CPA== 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=hZiuiwygnAf9uM+JULlIZdLEd1wyOPrKoXpFSHUh5MU=; fh=b8RxUuxE+TBDYdILUFGNEkIOKUNToWSD6tzeM8szxsA=; b=oWdXm5b7k93S6+8rJsZ7QnpAvLxMs7Pk04bWfq16NQ/SobCZNvhj7qPFqcCu8ktste TU3D/OCqWOdzAnSd96+6vWNkRq+LR4rT7N8aNZR6mAh5GpI7kKG/BEKkZretCX3741VN r6ieQrQ6s5nxfNm9pSDO38bnukZwYKYzisyDLQN+pqAJpfh7NNH5oDaS/IFv8SIcuWGa mJAyl4zwF01XJiFZ71Ncra7iXFsuwI2byqumiYOpR/wzYuOtwt7owOYmQJ5X04034MDS lIZy0T4TutZCw0y/vA7A7Y28PaJbX50CbgsaDEOwsV9S7iXReocHIoBkcnd81Roof2Wf MoGQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=VxexhnNF; 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 h28-20020a05620a13fc00b007756b12c2eesi7811030qkl.26.2023.10.25.02.28.28 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 25 Oct 2023 02:28:28 -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=VxexhnNF; 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 2826F3857BA4 for ; Wed, 25 Oct 2023 09:28:28 +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 C1AD43858C53 for ; Wed, 25 Oct 2023 09:28:04 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org C1AD43858C53 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 C1AD43858C53 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=1698226086; cv=none; b=I/1e6aewRXFNoF7fPmSRic8DGCqdtOTeSL9+oE16L7zRt5l10Wm8l3O//LoM0fXqKf4uh5V/8V+hmdWGT5IA6zV18MJyVaj6BMQTWV06l6DiGU042wVIxlw3h2cm4v6D4nZmDe8zYC1QxrM5BDAqmr3YgU9ZWViPA7/KDesNROk= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1698226086; c=relaxed/simple; bh=ddrOAkQEEQvriaK0AzbvrEfxOBb1RBCiLR7hHQy3yiM=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=JCDdcyeTAXCrCpw9gDWFCz472BESNZXFpVYGVRjnfZPRCGiYmhYFXVa96rtQcdl1luUPbsfBTX9NT48LoaCExVSAPWJstH+eEHqNjVO0yTBpnMdqXCJ9r7+DRt9HpMuT8ndrXvywzBBzWdRm4lsFt6r2DrNMcJtirTxUPihmGbw= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from pps.filterd (m0353724.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 39P9EdjK007311 for ; Wed, 25 Oct 2023 09:28:04 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=hZiuiwygnAf9uM+JULlIZdLEd1wyOPrKoXpFSHUh5MU=; b=VxexhnNFI+Zoec7iyksfeUgsXA2iolGmAwJyiH9NpIGBMcFD1qlzoj58rYEG5TF+/ugj 7IOxG2NLigsXozvG+pdg5nWirtRLw+8G3Gn1f0f2k//vbtHianx/YXIbvPPIYMagk3WO rmheGvvVxzcuh/37EX4e8krMgYR1XWFQd0fCxq+qBu/IOj7K0TPAj+o3vJChZCpEbHJ4 fL4y8AxRl1QSJ+LOyFuBLItk3/7E3P87sXgb87/BzRgMrpoTJllP9qVBVn35DS5kBpOF 3z7U8kBl2Z2xfD5pskl1134jhqHtABZYtcyHsroGfDk6RL4pFu9+bvEvhLMjBMQqoV9S 9g== Received: from ppma12.dal12v.mail.ibm.com (dc.9e.1632.ip4.static.sl-reverse.com [50.22.158.220]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3ty07ard3c-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Wed, 25 Oct 2023 09:28:03 +0000 Received: from pps.filterd (ppma12.dal12v.mail.ibm.com [127.0.0.1]) by ppma12.dal12v.mail.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 39P6ujoj023807 for ; Wed, 25 Oct 2023 09:28:03 GMT Received: from smtprelay02.fra02v.mail.ibm.com ([9.218.2.226]) by ppma12.dal12v.mail.ibm.com (PPS) with ESMTPS id 3tvryt5v9c-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Wed, 25 Oct 2023 09:28:03 +0000 Received: from smtpav05.fra02v.mail.ibm.com (smtpav05.fra02v.mail.ibm.com [10.20.54.104]) by smtprelay02.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 39P9S07618743934 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 25 Oct 2023 09:28:00 GMT Received: from smtpav05.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 20EBD2004B; Wed, 25 Oct 2023 09:28:00 +0000 (GMT) Received: from smtpav05.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id F3B5620043; Wed, 25 Oct 2023 09:27:59 +0000 (GMT) Received: from a8345010.lnxne.boe (unknown [9.152.108.100]) by smtpav05.fra02v.mail.ibm.com (Postfix) with ESMTPS; Wed, 25 Oct 2023 09:27:59 +0000 (GMT) From: Stefan Schulze Frielinghaus To: krebbel@linux.ibm.com, gcc-patches@gcc.gnu.org Cc: Stefan Schulze Frielinghaus Subject: [PATCH] s390: Fix constraint for insn *cmphi_ccu Date: Wed, 25 Oct 2023 11:27:33 +0200 Message-ID: <20231025092732.1636701-2-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: 61gVoXSXgfaMuW2BowMFN5VvmGrcdgnP X-Proofpoint-GUID: 61gVoXSXgfaMuW2BowMFN5VvmGrcdgnP 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-25_01,2023-10-24_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxlogscore=557 priorityscore=1501 lowpriorityscore=0 impostorscore=0 mlxscore=0 bulkscore=0 malwarescore=0 suspectscore=0 phishscore=0 adultscore=0 spamscore=0 clxscore=1015 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2310170001 definitions=main-2310250080 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: 1780719139824555816 X-GMAIL-MSGID: 1780719139824555816 Currently for an unsigned 16-bit comparison between memory and an immediate where the high bit is set, a clc is emitted. This is because the constant is created for mode HI and therefore sign extended. This means constraint D does not hold anymore. Since the mode already restricts the immediate to 16 bit, it is enough to make use of constraint n and chop of the high bits in the output template. Bootstrapped and regtested on s390. Ok for mainline? gcc/ChangeLog: * config/s390/s390.md (*cmphi_ccu): For immediate operand 1 make use of constraint n instead of D and chop of high bits in the output template. --- gcc/config/s390/s390.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gcc/config/s390/s390.md b/gcc/config/s390/s390.md index 3f29ba21442..777a20f8e77 100644 --- a/gcc/config/s390/s390.md +++ b/gcc/config/s390/s390.md @@ -1355,13 +1355,13 @@ (define_insn "*cmphi_ccu" [(set (reg CC_REGNUM) (compare (match_operand:HI 0 "nonimmediate_operand" "d,d,Q,Q,BQ") - (match_operand:HI 1 "general_operand" "Q,S,D,BQ,Q")))] + (match_operand:HI 1 "general_operand" "Q,S,n,BQ,Q")))] "s390_match_ccmode (insn, CCUmode) && !register_operand (operands[1], HImode)" "@ clm\t%0,3,%S1 clmy\t%0,3,%S1 - clhhsi\t%0,%1 + clhhsi\t%0,%x1 # #" [(set_attr "op_type" "RS,RSY,SIL,SS,SS")