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 151F43854540 for ; Mon, 21 Nov 2022 06:18:51 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 151F43854540 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 Received: from pps.filterd (m0187473.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 2AL4jsLO011278; Mon, 21 Nov 2022 06:18:50 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=message-id : date : mime-version : subject : to : cc : references : from : in-reply-to : content-type : content-transfer-encoding; s=pp1; bh=zfN+XaZ0G1e2WhZsyL8F3dZi6EPVg3oqeWjORZdVneA=; b=OfQwZlbRa5IhJ19cQVfQ0puIykgmpk66EeH54DqG9VB8vuayQh+cWtS+woguVyxWYyyx GYiAtE+q0KMSkEapNq7Mclj2QRKPCvRCOtpFDKL3A5tSV+Z0bk+YOg1WC0iK04MeE0Jb dSCnEKX+mF1O7tj5ZZQU/cQWS4bbu0n377azYq9uZ8cJFiHUMsQAr+use+d9JBwjZCPe zmMsootOMtH6Q305G2A58pXzvGDZ7+Pj6QbEILZ9D9ofmnuJ8isZoAQN+NgzNNLzHbw6 MwR4WIfr6YsbIf/DtOQTeAEkpwGzRfMD5/AbmCS4wC8iEodXdSA3eIrU/kzOqImC+Ss/ MQ== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3ky9798cfh-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 21 Nov 2022 06:18:49 +0000 Received: from m0187473.ppops.net (m0187473.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 2AL5MciL009248; Mon, 21 Nov 2022 06:18:49 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 3ky9798cf2-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 21 Nov 2022 06:18:49 +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 2AL64nC1025814; Mon, 21 Nov 2022 06:18:46 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 3kxps8t58g-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 21 Nov 2022 06:18:46 +0000 Received: from d06av22.portsmouth.uk.ibm.com (d06av22.portsmouth.uk.ibm.com [9.149.105.58]) by b06avi18626390.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 2AL6CXTW47579518 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 21 Nov 2022 06:12:33 GMT Received: from d06av22.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 4CACE4C040; Mon, 21 Nov 2022 06:18:43 +0000 (GMT) Received: from d06av22.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 78D134C04A; Mon, 21 Nov 2022 06:18:41 +0000 (GMT) Received: from [9.200.43.170] (unknown [9.200.43.170]) by d06av22.portsmouth.uk.ibm.com (Postfix) with ESMTP; Mon, 21 Nov 2022 06:18:41 +0000 (GMT) Message-ID: <4056dfc0-57e3-0d13-633c-297572c5c647@linux.ibm.com> Date: Mon, 21 Nov 2022 14:18:39 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.5.0 Subject: Re: [PATCHv2, rs6000] Enable have_cbranchcc4 on rs6000 To: Segher Boessenkool Cc: David Edelsohn , gcc-patches , "Kewen.Lin" , Peter Bergner References: <438c6628-0b9c-e5d0-e198-2fd6edd16a93@linux.ibm.com> <20221118121822.GY25951@gate.crashing.org> From: HAO CHEN GUI In-Reply-To: <20221118121822.GY25951@gate.crashing.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-TM-AS-GCONF: 00 X-Proofpoint-GUID: y50ET4zQMWUqLGW_Ffu9Ee7-9VHPokKa X-Proofpoint-ORIG-GUID: RcC5JSmgJufbsQu_eFzRPWF7aW0w4Uld X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.219,Aquarius:18.0.895,Hydra:6.0.545,FMLib:17.11.122.1 definitions=2022-11-21_03,2022-11-18_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 impostorscore=0 phishscore=0 lowpriorityscore=0 spamscore=0 adultscore=0 clxscore=1015 bulkscore=0 mlxscore=0 mlxlogscore=908 suspectscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2210170000 definitions=main-2211210047 X-Spam-Status: No, score=-4.5 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,KAM_NUMSUBJECT,NICE_REPLY_A,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: Hi Segher, 在 2022/11/18 20:18, Segher Boessenkool 写道: > I don't think we should pretend we have any conditional jumps the > machine does not actually have, in cbranchcc4. When would this ever be > useful? cror;beq can be quite expensive, compared to the code it would > replace anyway. > > If something generates those here (which then ICEs later), that is > wrong, fix *that*? Is it ifcvt doing it? "*cbranch_2insn" is a valid insn for rs6000. So it generates such insn at expand pass. The "prepare_cmp_insn" called by ifcvt just wants to verify that the following comparison rtx is valid. (unlt (reg:CCFP 156) (const_int 0 [0])) It should be valid as it's extracted from an existing insn. It hits ICE only when the comparison rtx can't pass the predicate check of "cbranchcc4". So "cbranchcc4" should include "extra_insn_branch_comparison_operator". Then, ifcvt tries to call emit_conditional_move_1 to generates a condition move for FP mode. It definitely fails as there is no conditional move insn for FP mode in rs6000. The behavior of ifcvt is correct. It tries to do conversion but fails. It won't hit ICEs after cbranchcc4 is correctly defined. Actually, "*cbranch_2insn" has the same logical as float "*cbranch" in ifcvt. Both of them get a final false return from "rs6000_emit_int_cmove" as rs6000 doesn't have conditional move for FP mode. So I think "cbranchcc4" should include "extra_insn_branch_comparison_operator" as "*cbranch_2insn" is a valid insn. Just let ifcvt decide a conditional move is valid or not. Thanks Gui Haochen