From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from xry111.site (xry111.site [89.208.246.23]) by sourceware.org (Postfix) with ESMTPS id 7CB103858D39 for ; Fri, 24 Nov 2023 10:30:10 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 7CB103858D39 Authentication-Results: sourceware.org; dmarc=pass (p=reject dis=none) header.from=xry111.site Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=xry111.site ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 7CB103858D39 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=89.208.246.23 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1700821811; cv=none; b=ECtmqjgHIPZHV0iBAgU/SyauCiw6lU2fxhS1wWhRlO4wRfIqAaNgftoLdXInkOQ1icwxc5BX5gur//3VTF5fQA3bLZaD1H3NKex1TifAE5bkghCQi/e8dxdHUAoasSNDqtC5togHRbQZ+OXFbCzfjm909e/Z6dkn3IDWYCvrp30= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1700821811; c=relaxed/simple; bh=dxhhKtmsrOMzwsBxtcrDux/ru7UfZRsyPOTyAFHjKLs=; h=DKIM-Signature:Message-ID:Subject:From:To:Date:MIME-Version; b=jPK45kgz1UqdVH/VDH6tbMAAEh2U9g81g74HWkVFHZaWu+CfnkY/sfJyC6A+UfmTk7LUBGZHdS28FK/Q7yAvgHJ5+jSnQOm7U/BBqLei8a/fd4OwDfgiiS29GS1SdRidhu62UwOmlGVroAW8EaqJzwW61wBGb6VkWczDQ87FVgE= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=xry111.site; s=default; t=1700821806; bh=dxhhKtmsrOMzwsBxtcrDux/ru7UfZRsyPOTyAFHjKLs=; h=Subject:From:To:Cc:Date:In-Reply-To:References:From; b=F76Ls+poHn1UFUy5gbI5o87Rl10UKIt3Fo+R3b1kmiN8IZeXNLxvsVe9VItFz/glP aPtvibhwHP+0eFPP+ryPokWb3cl+Dk4gHMpa2kJ71Lq64TQ2XRn7AWi51az3knK17Q e6L3HdhY6M9/eH7IuSt4BvzTfu8z301BGMDe78Mw= Received: from [127.0.0.1] (unknown [IPv6:2001:470:683e::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature ECDSA (P-384) server-digest SHA384) (Client did not present a certificate) (Authenticated sender: xry111@xry111.site) by xry111.site (Postfix) with ESMTPSA id E3C1266B39; Fri, 24 Nov 2023 05:30:04 -0500 (EST) Message-ID: <1dce723786e28a25ec7c44a323c79b26e5eb5b03.camel@xry111.site> Subject: Re: [PATCH v3 1/5] LoongArch: Fix usage of LSX and LASX frint/ftint instructions [PR112578] From: Xi Ruoyao To: chenglulu , Joseph Myers Cc: gcc-patches@gcc.gnu.org, Uros Bizjak , i@xen0n.name, xuchenghua@loongson.cn Date: Fri, 24 Nov 2023 18:30:03 +0800 In-Reply-To: <97012389-18f1-97ee-24b3-778c5728aa54@loongson.cn> References: <20231120004728.205167-1-xry111@xry111.site> <20231120004728.205167-2-xry111@xry111.site> <2d1c9d59544d15ef7fba07d758431da840cc0bfe.camel@xry111.site> <9ce7e0b2-eeeb-a8c5-2cc7-e9b65b1b2a6b@loongson.cn> <0fc6f3d2536b6d2d8a1e86a5e17354f89ba7040a.camel@xry111.site> <29426aaa-8bd6-c63c-2c9a-0ba7d007582a@loongson.cn> <1ab40b49c384517ca38f528fda96e688eae210db.camel@xry111.site> <97012389-18f1-97ee-24b3-778c5728aa54@loongson.cn> Autocrypt: addr=xry111@xry111.site; prefer-encrypt=mutual; keydata=mDMEYnkdPhYJKwYBBAHaRw8BAQdAsY+HvJs3EVKpwIu2gN89cQT/pnrbQtlvd6Yfq7egugi0HlhpIFJ1b3lhbyA8eHJ5MTExQHhyeTExMS5zaXRlPoiTBBMWCgA7FiEEkdD1djAfkk197dzorKrSDhnnEOMFAmJ5HT4CGwMFCwkIBwICIgIGFQoJCAsCBBYCAwECHgcCF4AACgkQrKrSDhnnEOPHFgD8D9vUToTd1MF5bng9uPJq5y3DfpcxDp+LD3joA3U2TmwA/jZtN9xLH7CGDHeClKZK/ZYELotWfJsqRcthOIGjsdAPuDgEYnkdPhIKKwYBBAGXVQEFAQEHQG+HnNiPZseiBkzYBHwq/nN638o0NPwgYwH70wlKMZhRAwEIB4h4BBgWCgAgFiEEkdD1djAfkk197dzorKrSDhnnEOMFAmJ5HT4CGwwACgkQrKrSDhnnEOPjXgD/euD64cxwqDIqckUaisT3VCst11RcnO5iRHm6meNIwj0BALLmWplyi7beKrOlqKfuZtCLbiAPywGfCNg8LOTt4iMD Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.50.1 MIME-Version: 1.0 X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,LIKELY_SPAM_FROM,SPF_HELO_PASS,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE 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: On Fri, 2023-11-24 at 17:46 +0800, chenglulu wrote: > It's just that I'm confused that the description of rint in n2310,=20 > including Joseph's email, > all say that rint will not set errno, but linux-man says "which might=20 > set errno to ERANGE" . Annex F has: The C floating types match the IEC 60559 formats as follows: - The float type matches the IEC 60559 single format. - The double type matches the IEC 60559 double format. With these constraints rint and rintf just cannot have a range or domain error. So Annex F does not say rint may set errno. Linux-man says: ERRORS No errors occur. POSIX.1=E2=80=902001 documents a range error for = overflows, but see NOTES. It's because POSIX does not mandates float/double to match the IEC 60559 formats, thus a range error may happen with some strange floating point formats. The NOTES says "this won't happen for IEC 60559 formats". For lrint, N2310 says: If the rounded value is outside the range of the return type, the numeric result is unspecified and a domain error or range error may occur. So a EDOM or ERANGE may be set. On the contrary, the man page says: The following errors can occur: Domain error: x is a NaN or infinite, or the rounded value is too la= rge An invalid floating=E2=80=90point exception (FE_INVALID) is r= aised. These functions do not set errno. The last paragraph is Glibc-specific, and it's considered a Glibc bug (https://sourceware.org/bugzilla/show_bug.cgi?id=3D6798). --=20 Xi Ruoyao School of Aerospace Science and Technology, Xidian University