From patchwork Thu May 26 07:35:39 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: HAO CHEN GUI X-Patchwork-Id: 54399 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 2883F3834E49 for ; Thu, 26 May 2022 07:36:21 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 2883F3834E49 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1653550581; bh=rDcFWLta2hfKIGGdOAs6LpGTGXopLM2WxAZnpGHaS5Y=; h=Date:To:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:Cc:From; b=ZIRY+eKfUjqJcLHNn74pZdEQepqQCdHQtO0zpZMpIKnG2FkOWQXZHgsOzpdA/NFgT ANFdrYIrWjSMNircA2yuNNckGrmCwIlh+hVBAYzCjI9Y6Js/6rCfU5FE4xw2/WMXVk sOsMc0txyn9TogrCNuj+GbHvlVc5m5QtUtP8WqSs= 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 26F09385E45D for ; Thu, 26 May 2022 07:35:51 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 26F09385E45D Received: from pps.filterd (m0098409.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 24Q46L1w014631; Thu, 26 May 2022 07:35:49 GMT Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3ga1qrbhvm-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 26 May 2022 07:35:49 +0000 Received: from m0098409.ppops.net (m0098409.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 24Q7ZaCx028045; Thu, 26 May 2022 07:35:49 GMT Received: from ppma06ams.nl.ibm.com (66.31.33a9.ip4.static.sl-reverse.com [169.51.49.102]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3ga1qrbhv4-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 26 May 2022 07:35:48 +0000 Received: from pps.filterd (ppma06ams.nl.ibm.com [127.0.0.1]) by ppma06ams.nl.ibm.com (8.16.1.2/8.16.1.2) with SMTP id 24Q7IT9N019808; Thu, 26 May 2022 07:35:46 GMT Received: from b06avi18878370.portsmouth.uk.ibm.com (b06avi18878370.portsmouth.uk.ibm.com [9.149.26.194]) by ppma06ams.nl.ibm.com with ESMTP id 3g93uwa7ad-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 26 May 2022 07:35:46 +0000 Received: from d06av24.portsmouth.uk.ibm.com (d06av24.portsmouth.uk.ibm.com [9.149.105.60]) by b06avi18878370.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 24Q7YogS32833904 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 26 May 2022 07:34:50 GMT Received: from d06av24.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 69D6242041; Thu, 26 May 2022 07:35:43 +0000 (GMT) Received: from d06av24.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 8278642042; Thu, 26 May 2022 07:35:41 +0000 (GMT) Received: from [9.200.42.164] (unknown [9.200.42.164]) by d06av24.portsmouth.uk.ibm.com (Postfix) with ESMTP; Thu, 26 May 2022 07:35:41 +0000 (GMT) Message-ID: <41da7001-549d-c7ae-fa6b-534a8faf673e@linux.ibm.com> Date: Thu, 26 May 2022 15:35:39 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.9.1 Content-Language: en-US To: gcc-patches Subject: [PATCH v2, rs6000] Fix ICE on expand bcd__ [PR100736] X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: jfAAYc8Dz3B7oFLnomzEk2NbcAa1SDHg X-Proofpoint-GUID: 4Iy1qkQIzMo5o1cTM-LYXhyydvQd3eoZ 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-26_02,2022-05-25_02,2022-02-23_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 phishscore=0 mlxscore=0 malwarescore=0 suspectscore=0 priorityscore=1501 bulkscore=0 mlxlogscore=999 lowpriorityscore=0 impostorscore=0 spamscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2204290000 definitions=main-2205260037 X-Spam-Status: No, score=-12.9 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_EF, GIT_PATCH_0, KAM_SHORT, 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-Patchwork-Original-From: HAO CHEN GUI via Gcc-patches From: HAO CHEN GUI Reply-To: HAO CHEN GUI Cc: Peter Bergner , David , Segher Boessenkool Errors-To: gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org Sender: "Gcc-patches" 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" + "" [(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} } } */