From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id DA8DFC433F5 for ; Thu, 16 Dec 2021 20:37:38 +0000 (UTC) Received: from localhost ([::1]:42116 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mxxVR-0003GV-RP for qemu-devel@archiver.kernel.org; Thu, 16 Dec 2021 15:37:37 -0500 Received: from eggs.gnu.org ([209.51.188.92]:37158) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mxxKw-0001H5-ER; Thu, 16 Dec 2021 15:26:46 -0500 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:42700) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mxxKu-0007KL-5b; Thu, 16 Dec 2021 15:26:46 -0500 Received: from pps.filterd (m0098409.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 1BGKIIBQ018664; Thu, 16 Dec 2021 20:26:39 GMT Received: from ppma06ams.nl.ibm.com (66.31.33a9.ip4.static.sl-reverse.com [169.51.49.102]) by mx0a-001b2d01.pphosted.com with ESMTP id 3cyn1k71ns-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 16 Dec 2021 20:26:39 +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 1BGKDD3v019537; Thu, 16 Dec 2021 20:26:37 GMT Received: from b06cxnps3074.portsmouth.uk.ibm.com (d06relay09.portsmouth.uk.ibm.com [9.149.109.194]) by ppma06ams.nl.ibm.com with ESMTP id 3cy78ek0py-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 16 Dec 2021 20:26:36 +0000 Received: from d06av23.portsmouth.uk.ibm.com (d06av23.portsmouth.uk.ibm.com [9.149.105.59]) by b06cxnps3074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 1BGKQYQa44302758 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 16 Dec 2021 20:26:34 GMT Received: from d06av23.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 92675A4040; Thu, 16 Dec 2021 20:26:34 +0000 (GMT) Received: from d06av23.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 57E86A4051; Thu, 16 Dec 2021 20:26:34 +0000 (GMT) Received: from smtp.tlslab.ibm.com (unknown [9.101.4.1]) by d06av23.portsmouth.uk.ibm.com (Postfix) with SMTP; Thu, 16 Dec 2021 20:26:34 +0000 (GMT) Received: from yukon.ibmuc.com (unknown [9.171.48.122]) by smtp.tlslab.ibm.com (Postfix) with ESMTP id AF010220238; Thu, 16 Dec 2021 21:26:33 +0100 (CET) From: =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= To: qemu-ppc@nongnu.org, qemu-devel@nongnu.org Subject: [PULL 025/101] softfloat: Add flag specific to convert non-nan to int Date: Thu, 16 Dec 2021 21:24:58 +0100 Message-Id: <20211216202614.414266-26-clg@kaod.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20211216202614.414266-1-clg@kaod.org> References: <20211216202614.414266-1-clg@kaod.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: EW0kN_ylOB0G7pzKS6OKcFpVlkTRHba5 X-Proofpoint-GUID: EW0kN_ylOB0G7pzKS6OKcFpVlkTRHba5 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.790,Hydra:6.0.425,FMLib:17.11.62.513 definitions=2021-12-16_08,2021-12-16_01,2021-12-02_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 phishscore=0 mlxlogscore=793 lowpriorityscore=0 priorityscore=1501 impostorscore=0 suspectscore=0 clxscore=1034 malwarescore=0 spamscore=0 mlxscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2110150000 definitions=main-2112160109 Received-SPF: softfail client-ip=148.163.156.1; envelope-from=clg@kaod.org; helo=mx0a-001b2d01.pphosted.com X-Spam_score_int: -11 X-Spam_score: -1.2 X-Spam_bar: - X-Spam_report: (-1.2 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_SOFTFAIL=0.665 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Richard Henderson , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" From: Richard Henderson PowerPC has this flag, and it's easier to compute it here than after the fact. Signed-off-by: Richard Henderson Message-Id: <20211119160502.17432-7-richard.henderson@linaro.org> Signed-off-by: C=C3=A9dric Le Goater --- include/fpu/softfloat-types.h | 1 + fpu/softfloat-parts.c.inc | 14 +++++++------- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/include/fpu/softfloat-types.h b/include/fpu/softfloat-types.= h index 33224b5f227d..9ca50e930b8d 100644 --- a/include/fpu/softfloat-types.h +++ b/include/fpu/softfloat-types.h @@ -157,6 +157,7 @@ enum { float_flag_invalid_idi =3D 0x0200, /* inf / inf */ float_flag_invalid_zdz =3D 0x0400, /* 0 / 0 */ float_flag_invalid_sqrt =3D 0x0800, /* sqrt(-x) */ + float_flag_invalid_cvti =3D 0x1000, /* non-nan to integer */ }; =20 /* diff --git a/fpu/softfloat-parts.c.inc b/fpu/softfloat-parts.c.inc index cc8c2c3aee1a..ce580347dda6 100644 --- a/fpu/softfloat-parts.c.inc +++ b/fpu/softfloat-parts.c.inc @@ -1055,7 +1055,7 @@ static int64_t partsN(float_to_sint)(FloatPartsN *p= , FloatRoundMode rmode, break; =20 case float_class_inf: - flags =3D float_flag_invalid; + flags =3D float_flag_invalid | float_flag_invalid_cvti; r =3D p->sign ? min : max; break; =20 @@ -1077,11 +1077,11 @@ static int64_t partsN(float_to_sint)(FloatPartsN = *p, FloatRoundMode rmode, if (r <=3D -(uint64_t)min) { r =3D -r; } else { - flags =3D float_flag_invalid; + flags =3D float_flag_invalid | float_flag_invalid_cvti; r =3D min; } } else if (r > max) { - flags =3D float_flag_invalid; + flags =3D float_flag_invalid | float_flag_invalid_cvti; r =3D max; } break; @@ -1120,7 +1120,7 @@ static uint64_t partsN(float_to_uint)(FloatPartsN *= p, FloatRoundMode rmode, break; =20 case float_class_inf: - flags =3D float_flag_invalid; + flags =3D float_flag_invalid | float_flag_invalid_cvti; r =3D p->sign ? 0 : max; break; =20 @@ -1138,15 +1138,15 @@ static uint64_t partsN(float_to_uint)(FloatPartsN= *p, FloatRoundMode rmode, } =20 if (p->sign) { - flags =3D float_flag_invalid; + flags =3D float_flag_invalid | float_flag_invalid_cvti; r =3D 0; } else if (p->exp > DECOMPOSED_BINARY_POINT) { - flags =3D float_flag_invalid; + flags =3D float_flag_invalid | float_flag_invalid_cvti; r =3D max; } else { r =3D p->frac_hi >> (DECOMPOSED_BINARY_POINT - p->exp); if (r > max) { - flags =3D float_flag_invalid; + flags =3D float_flag_invalid | float_flag_invalid_cvti; r =3D max; } } --=20 2.31.1