From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx0b-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by sourceware.org (Postfix) with ESMTPS id A3A36385801E for ; Thu, 2 Jun 2022 05:30:14 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org A3A36385801E Received: from pps.filterd (m0098421.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 2525Dl1L026659; Thu, 2 Jun 2022 05:30:13 GMT Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3gepve87kf-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 02 Jun 2022 05:30:13 +0000 Received: from m0098421.ppops.net (m0098421.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 2525P28n004254; Thu, 2 Jun 2022 05:30:13 GMT Received: from ppma02fra.de.ibm.com (47.49.7a9f.ip4.static.sl-reverse.com [159.122.73.71]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3gepve87jj-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 02 Jun 2022 05:30:13 +0000 Received: from pps.filterd (ppma02fra.de.ibm.com [127.0.0.1]) by ppma02fra.de.ibm.com (8.16.1.2/8.16.1.2) with SMTP id 25255Kic024556; Thu, 2 Jun 2022 05:30:11 GMT Received: from b06avi18626390.portsmouth.uk.ibm.com (b06avi18626390.portsmouth.uk.ibm.com [9.149.26.192]) by ppma02fra.de.ibm.com with ESMTP id 3gbcc6cx2j-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 02 Jun 2022 05:30:11 +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 2525U43U15139196 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 2 Jun 2022 05:30:04 GMT Received: from d06av22.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 13DD54C05C; Thu, 2 Jun 2022 05:30:08 +0000 (GMT) Received: from d06av22.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 3BFE84C04A; Thu, 2 Jun 2022 05:30:06 +0000 (GMT) Received: from [9.197.228.153] (unknown [9.197.228.153]) by d06av22.portsmouth.uk.ibm.com (Postfix) with ESMTP; Thu, 2 Jun 2022 05:30:05 +0000 (GMT) Message-ID: <0660b290-bb3c-9494-d232-4dcb192351eb@linux.ibm.com> Date: Thu, 2 Jun 2022 13:30:04 +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 Subject: Re: [PATCH v2, rs6000] Fix ICE on expand bcd__ [PR100736] Content-Language: en-US To: Segher Boessenkool , "Kewen.Lin" Cc: Peter Bergner , gcc-patches , David References: <41da7001-549d-c7ae-fa6b-534a8faf673e@linux.ibm.com> <20220531235600.GU25951@gate.crashing.org> <20220601220514.GY25951@gate.crashing.org> From: HAO CHEN GUI In-Reply-To: <20220601220514.GY25951@gate.crashing.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: 5tigSZynKmp246FFlmNxdyKyagXiOKu3 X-Proofpoint-GUID: _2Jm3aVOA9-8LGgF10UOZPpcLzxn4J2h X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.874,Hydra:6.0.517,FMLib:17.11.64.514 definitions=2022-06-02_01,2022-06-01_01,2022-02-23_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 adultscore=0 mlxlogscore=999 clxscore=1015 mlxscore=0 malwarescore=0 suspectscore=0 impostorscore=0 spamscore=0 priorityscore=1501 phishscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2204290000 definitions=main-2206020019 X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_EF, 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: Thu, 02 Jun 2022 05:30:16 -0000 Segher, Does BCD comparison return false when either operand is invalid coding? If yes, the result could be 3-way. We can check gt and eq bits for ge. We still can't use crnot to only check lt bit as there could be invalid coding. Also, do you think finite-math-only excludes invalid coding? Seems GCC doesn't clear define it. Thanks. Gui Haochen On 2/6/2022 上午 6:05, Segher Boessenkool wrote: > Hi! > > On Tue, May 31, 2022 at 06:56:00PM -0500, Segher Boessenkool wrote: >> It's not clear to me how this can ever happen without finite_math_only? >> The patch is safe, sure, but it may the real problem is elsewhere. > > So, it is incorrect the RTL for our bcd{add,sub} insns uses CCFP at all. > > CCFP stands for the result of a 4-way comparison, regular float > comparison: lt gt eq un. But bcdadd does not have an unordered at all. > Instead, it has the result of a 3-way comparison (lt gt eq), and bit 3 > is set if an overflow happened -- but still exactly one of bits 0..2 is > set then! (If one of the inputs is an invalid number it sets bits 0..3 > to 0001 though.) > > So it would be much more correct and sensible to use regular integer > comparison results here, so, CC. > > Does that fix the problem? > > > Segher