From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by sourceware.org (Postfix) with ESMTPS id BC790384B83A for ; Mon, 30 May 2022 10:12:37 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org BC790384B83A Received: from pps.filterd (m0098393.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 24U9jxvW010908; Mon, 30 May 2022 10:12:36 GMT Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3gcuk10gau-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 30 May 2022 10:12:36 +0000 Received: from m0098393.ppops.net (m0098393.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 24UAAqBO024825; Mon, 30 May 2022 10:12:36 GMT Received: from ppma04ams.nl.ibm.com (63.31.33a9.ip4.static.sl-reverse.com [169.51.49.99]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3gcuk10ga5-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 30 May 2022 10:12:36 +0000 Received: from pps.filterd (ppma04ams.nl.ibm.com [127.0.0.1]) by ppma04ams.nl.ibm.com (8.16.1.2/8.16.1.2) with SMTP id 24U9pDZC009592; Mon, 30 May 2022 10:12:33 GMT Received: from b06avi18626390.portsmouth.uk.ibm.com (b06avi18626390.portsmouth.uk.ibm.com [9.149.26.192]) by ppma04ams.nl.ibm.com with ESMTP id 3gbcae2hk9-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 30 May 2022 10:12:33 +0000 Received: from d06av25.portsmouth.uk.ibm.com (d06av25.portsmouth.uk.ibm.com [9.149.105.61]) by b06avi18626390.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 24U9wBpD51708234 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 30 May 2022 09:58:11 GMT Received: from d06av25.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id AEA0911C050; Mon, 30 May 2022 10:12:30 +0000 (GMT) Received: from d06av25.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id A23B311C04A; Mon, 30 May 2022 10:12:28 +0000 (GMT) Received: from [9.197.252.204] (unknown [9.197.252.204]) by d06av25.portsmouth.uk.ibm.com (Postfix) with ESMTP; Mon, 30 May 2022 10:12:28 +0000 (GMT) Message-ID: Date: Mon, 30 May 2022 18:12:26 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0) Gecko/20100101 Thunderbird/91.6.1 Subject: Re: [PATCH v2, rs6000] Fix ICE on expand bcd__ [PR100736] Content-Language: en-US To: HAO CHEN GUI Cc: Segher Boessenkool , David , Peter Bergner , gcc-patches References: <41da7001-549d-c7ae-fa6b-534a8faf673e@linux.ibm.com> From: "Kewen.Lin" In-Reply-To: <41da7001-549d-c7ae-fa6b-534a8faf673e@linux.ibm.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: 1h-AYYKcFjsaLnR40n2Gc5Uh968mJ9DN X-Proofpoint-GUID: O8HXhs90QwL2Faa8HEwg1tcWfP4tZQK9 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.874,Hydra:6.0.486,FMLib:17.11.64.514 definitions=2022-05-30_03,2022-05-30_01,2022-02-23_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 phishscore=0 suspectscore=0 spamscore=0 mlxlogscore=999 malwarescore=0 bulkscore=0 adultscore=0 clxscore=1015 lowpriorityscore=0 impostorscore=0 priorityscore=1501 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2204290000 definitions=main-2205300053 X-Spam-Status: No, score=-11.9 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_EF, GIT_PATCH_0, KAM_SHORT, NICE_REPLY_A, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE 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: , X-List-Received-Date: Mon, 30 May 2022 10:12:39 -0000 Hi Haochen, on 2022/5/26 15:35, HAO CHEN GUI wrote: > Hi, > This patch fixes the ICE reported in PR100736. It removes the condition > check of finite math only flag not setting in "*_cc" pattern. > With or without this flag, we still can use "cror" to check if either > two bits of CC is set or not for "fp_two" codes. We don't need a reverse > comparison (implemented by crnot) here when the finite math flag is set, > as the latency of "cror" and "crnor" are the same. > > Bootstrapped and tested on powerpc64-linux BE and LE with no regressions. > Is this okay for trunk? Any recommendations? Thanks a lot. > > ChangeLog > 2022-05-26 Haochen Gui > > gcc/ > * config/rs6000/rs6000.md (*_cc): Remove condition of > finite math only flag not setting. > > gcc/testsuite/ > * gcc.target/powerpc/pr100736.c: New. > > > patch.diff > diff --git a/gcc/config/rs6000/rs6000.md b/gcc/config/rs6000/rs6000.md > index fdfbc6566a5..a6f9cbc9b8b 100644 > --- a/gcc/config/rs6000/rs6000.md > +++ b/gcc/config/rs6000/rs6000.md > @@ -12995,9 +12995,9 @@ (define_insn_and_split "*_cc" > [(set (match_operand:GPR 0 "gpc_reg_operand" "=r") > (fp_two:GPR (match_operand:CCFP 1 "cc_reg_operand" "y") > (const_int 0)))] > - "!flag_finite_math_only" > + "" > "#" > - "&& 1" > + "" Segher added this hunk, not sure if he prefer to keep the condition unchanged and update the expansion side, looking forward to his comments. :) > [(pc)] > { > rtx cc = rs6000_emit_fp_cror (, mode, operands[1]); > diff --git a/gcc/testsuite/gcc.target/powerpc/pr100736.c b/gcc/testsuite/gcc.target/powerpc/pr100736.c > new file mode 100644 > index 00000000000..32cb6df6cd9 > --- /dev/null > +++ b/gcc/testsuite/gcc.target/powerpc/pr100736.c > @@ -0,0 +1,12 @@ > +/* { dg-do compile } */ > +/* { dg-require-effective-target powerpc_p8vector_ok } */ > +/* { dg-options "-mdejagnu-cpu=power8 -O2 -ffinite-math-only" } */ > + > +typedef __attribute__ ((altivec (vector__))) unsigned char v; > + > +int foo (v a, v b) > +{ > + return __builtin_vec_bcdsub_ge (a, b, 0); > +} > + > +/* { dg-final { scan-assembler {\mcror\M} } } */ > The case of PR100736 fails with ICE as reported, maybe we can remove this dg-final check, since as you noted in the description above either "cror" or "crnor" are acceptable, this extra check could probably make this case fragile. BR, Kewen