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 0AE44385C647; Thu, 15 Dec 2022 07:45:53 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 0AE44385C647 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 (m0098409.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 2BF7Fp8R032344; Thu, 15 Dec 2022 07:45:51 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=/Aehifw0LprU47J/ob7+adrcqUjEacfCje7pSvBPnIw=; b=lckffAmeHPeDJS6Qj4K04TiHY1V5dAZhTMmDmvlpW7PgY26k3ca+aZqE7YrhEnlrNd5d tMUXesnLuVYtMP+R+cQE5BHh2O2M4psGvDWsdDMOk3po79Jjbfwk8UMt52V5ZXQWb5ro dgZhHGdMeEU5CjUjjucY8BezwoQG+D44eW6c0VHvhjHimf8wvWF7YPCmmBXxPRVOlzaZ 42dyQ97z1kXTk0FbgBlHEEMfMdjsL2Y6asIS4i4i9AAeBa8muzI0PXLNFt/M7ODdiQYX lkfKB0l/hms6LhfFsbOM6Yh9MTJRkIf/OU8wz59zFcJXvb+4Ji+DSNINruuWJ+jdmg3w bA== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3mfy1s0md0-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 15 Dec 2022 07:45:51 +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 2BF7FtoZ032438; Thu, 15 Dec 2022 07:45:50 GMT Received: from ppma06fra.de.ibm.com (48.49.7a9f.ip4.static.sl-reverse.com [159.122.73.72]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3mfy1s0mc8-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 15 Dec 2022 07:45:50 +0000 Received: from pps.filterd (ppma06fra.de.ibm.com [127.0.0.1]) by ppma06fra.de.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 2BF46XVL004699; Thu, 15 Dec 2022 07:45:48 GMT Received: from smtprelay02.fra02v.mail.ibm.com ([9.218.2.226]) by ppma06fra.de.ibm.com (PPS) with ESMTPS id 3meyqy1xqg-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 15 Dec 2022 07:45:48 +0000 Received: from smtpav01.fra02v.mail.ibm.com (smtpav01.fra02v.mail.ibm.com [10.20.54.100]) by smtprelay02.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 2BF7ji4w47841552 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 15 Dec 2022 07:45:44 GMT Received: from smtpav01.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 49C3020049; Thu, 15 Dec 2022 07:45:44 +0000 (GMT) Received: from smtpav01.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id C6CC720040; Thu, 15 Dec 2022 07:45:40 +0000 (GMT) Received: from [9.197.253.236] (unknown [9.197.253.236]) by smtpav01.fra02v.mail.ibm.com (Postfix) with ESMTP; Thu, 15 Dec 2022 07:45:40 +0000 (GMT) Message-ID: Date: Thu, 15 Dec 2022 15:45:38 +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 2/3] Make __float128 use the _Float128 type, PR target/107299 Content-Language: en-US To: Jakub Jelinek Cc: Michael Meissner , gcc-patches@gcc.gnu.org, Segher Boessenkool , Peter Bergner , David Edelsohn , Will Schmidt , William Seurer , Joseph Myers References: <6b7325c6-6416-d64f-89a8-7341aeb8226c@linux.ibm.com> <3cbaa3d2-4327-c62a-2904-eac5ca506d20@linux.ibm.com> From: "Kewen.Lin" In-Reply-To: <3cbaa3d2-4327-c62a-2904-eac5ca506d20@linux.ibm.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-TM-AS-GCONF: 00 X-Proofpoint-GUID: Cp0kWhbxyiR-qP3ZnMttUct3DCeOOdLo X-Proofpoint-ORIG-GUID: pzY_efjinopcHaianE3oe9kFFOweAHum X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.923,Hydra:6.0.545,FMLib:17.11.122.1 definitions=2022-12-15_03,2022-12-14_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 impostorscore=0 adultscore=0 priorityscore=1501 mlxscore=0 lowpriorityscore=0 mlxlogscore=999 suspectscore=0 malwarescore=0 spamscore=0 phishscore=0 bulkscore=0 clxscore=1015 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2212070000 definitions=main-2212150059 X-Spam-Status: No, score=-11.0 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,GIT_PATCH_0,KAM_NUMSUBJECT,NICE_REPLY_A,RCVD_IN_MSPIKE_H2,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 List-Id: >> I bet the above workaround in generic code was added for a reason, it would >> surprise me if _Float128 worked at all without that hack. > > OK, I'll have a look at those nan failures soon. By investigating the exposed NaN failures, I found it's due to that it wants to convert _Float128 type constant to long double type constant, it goes through function real_convert which clears the signalling bit in the context of !HONOR_SNANS (arg). if (r->cl == rvc_nan) r->signalling = 0; The test cases don't have the explicit option -fsignaling-nans, I'm inclined to believe it's intentional since there is only a sNaN generation. If so, we don't want this kind of conversion which is useless and can clear signalling bit unexpectedly, one shortcut is to just copy the corresponding REAL_VALUE_TYPE and rebuild with the given type if the modes are the same. ----- diff --git a/gcc/fold-const.cc b/gcc/fold-const.cc index e80be8049e1..d036b09dc6f 100644 --- a/gcc/fold-const.cc +++ b/gcc/fold-const.cc @@ -2178,6 +2178,14 @@ fold_convert_const_real_from_real (tree type, const_tree arg1) REAL_VALUE_TYPE value; tree t; + /* If the underlying modes are the same, just copy the + TREE_REAL_CST information and rebuild with the given type. */ + if (TYPE_MODE (type) == TYPE_MODE (TREE_TYPE (arg1))) + { + t = build_real (type, TREE_REAL_CST (arg1)); + return t; + } + /* Don't perform the operation if flag_signaling_nans is on and the operand is a signaling NaN. */ if (HONOR_SNANS (arg1) ----- The above diff can fix all exposed NaN failures. BR, Kewen