From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from eggs.gnu.org (eggs.gnu.org [IPv6:2001:470:142:3::10]) by sourceware.org (Postfix) with ESMTPS id 31596385840F for ; Fri, 24 Nov 2023 14:59:35 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 31596385840F Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=loongson.cn Authentication-Results: sourceware.org; spf=fail smtp.mailfrom=loongson.cn ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 31596385840F Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2001:470:142:3::10 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1700837977; cv=none; b=MDjOUM9C/df/2WIoW2PrO41fcctMCRs84l3uDF8P6zWEEkz2YZuEa6XpSqc7k+nMGkS6IqeQUm9jW0VUBthWkmDJJR6SnD8sRDRQd2LY6gbF5zayUJl6DE5y4r/oUPeXVMBYt6w+r+EtPEnfDOk4i8o3LcD8Rf+sy3XQieoHBLc= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1700837977; c=relaxed/simple; bh=T1U+A9iPsxT8HTz8kzRgum6iNJZUm0nRo7TWpVrw4dI=; h=Subject:To:From:Message-ID:Date:MIME-Version; b=bmyjL5yKPPYti7hvggTf0bq2NSKZcRUtruXMZ5DPSqZnutBwK+Nkt6fgtDze0x56PsWFoQAbvUdoPSDKaLjXW/pWCjeBnpcWefn0CEhctHMIsbJBdHa4wkd70gtZaFu66rE0SXZEvo8RrEnZDxSn/FtmsX3u55i+iLADGvmPGK8= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from mail.loongson.cn ([114.242.206.163]) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1r6XeU-0005Qz-HE for gcc-patches@gcc.gnu.org; Fri, 24 Nov 2023 09:59:33 -0500 Received: from loongson.cn (unknown [117.129.62.95]) by gateway (Coremail) with SMTP id _____8Cx7+tLumBlyZk8AA--.53680S3; Fri, 24 Nov 2023 22:59:23 +0800 (CST) Received: from [192.168.2.109] (unknown [117.129.62.95]) by localhost.localdomain (Coremail) with SMTP id AQAAf8BxbNxJumBlRKhLAA--.36371S3; Fri, 24 Nov 2023 22:59:22 +0800 (CST) Subject: Re: [PATCH v3 1/5] LoongArch: Fix usage of LSX and LASX frint/ftint instructions [PR112578] To: Xi Ruoyao , Joseph Myers Cc: gcc-patches@gcc.gnu.org, Uros Bizjak , i@xen0n.name, xuchenghua@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> <1dce723786e28a25ec7c44a323c79b26e5eb5b03.camel@xry111.site> From: chenglulu Message-ID: Date: Fri, 24 Nov 2023 22:59:21 +0800 User-Agent: Mozilla/5.0 (X11; Linux loongarch64; rv:68.0) Gecko/20100101 Thunderbird/68.7.0 MIME-Version: 1.0 In-Reply-To: <1dce723786e28a25ec7c44a323c79b26e5eb5b03.camel@xry111.site> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US X-CM-TRANSID:AQAAf8BxbNxJumBlRKhLAA--.36371S3 X-CM-SenderInfo: xfkh0wpoxo3qxorr0wxvrqhubq/ X-Coremail-Antispam: 1Uk129KBj93XoW7Ww4kWr45Aw4xCw4rWFWrXrc_yoW8Wr4xpr 4xCw4qqrs5JF48Xr1Iy3y0qr98J392q398WFyfW34vyan8GwnYqF1Skr1j9r98Gw1jvw15 ta1Sg34Uu39YvagCm3ZEXasCq-sJn29KB7ZKAUJUUUU8529EdanIXcx71UUUUU7KY7ZEXa sCq-sGcSsGvfJ3Ic02F40EFcxC0VAKzVAqx4xG6I80ebIjqfuFe4nvWSU5nxnvy29KBjDU 0xBIdaVrnRJUUUvIb4IE77IF4wAFF20E14v26r1j6r4UM7CY07I20VC2zVCF04k26cxKx2 IYs7xG6rWj6s0DM7CIcVAFz4kK6r1Y6r17M28lY4IEw2IIxxk0rwA2F7IY1VAKz4vEj48v e4kI8wA2z4x0Y4vE2Ix0cI8IcVAFwI0_Jr0_JF4l84ACjcxK6xIIjxv20xvEc7CjxVAFwI 0_Jr0_Gr1l84ACjcxK6I8E87Iv67AKxVW8Jr0_Cr1UM28EF7xvwVC2z280aVCY1x0267AK xVW8Jr0_Cr1UM2AIxVAIcxkEcVAq07x20xvEncxIr21l57IF6xkI12xvs2x26I8E6xACxx 1l5I8CrVACY4xI64kE6c02F40Ex7xfMcIj6xIIjxv20xvE14v26r106r15McIj6I8E87Iv 67AKxVWUJVW8JwAm72CE4IkC6x0Yz7v_Jr0_Gr1lF7xvr2IY64vIr41lc7I2V7IY0VAS07 AlzVAYIcxG8wCF04k20xvY0x0EwIxGrwCFx2IqxVCFs4IE7xkEbVWUJVW8JwC20s026c02 F40E14v26r1j6r18MI8I3I0E7480Y4vE14v26r106r1rMI8E67AF67kF1VAFwI0_JF0_Jw 1lIxkGc2Ij64vIr41lIxAIcVC0I7IYx2IY67AKxVWUJVWUCwCI42IY6xIIjxv20xvEc7Cj xVAFwI0_Jr0_Gr1lIxAIcVCF04k26cxKx2IYs7xG6r1j6r1xMIIF0xvEx4A2jsIE14v26r 4j6F4UMIIF0xvEx4A2jsIEc7CjxVAFwI0_Gr0_Gr1UYxBIdaVFxhVjvjDU0xZFpf9x07jU sqXUUUUU= Received-SPF: pass client-ip=114.242.206.163; envelope-from=chenglulu@loongson.cn; helo=mail.loongson.cn X-Spam_score_int: -34 X-Spam_score: -3.5 X-Spam_bar: --- X-Spam_report: (-3.5 / 5.0 requ) BAYES_00=-1.9,NICE_REPLY_A=-1.592,SPF_HELO_NONE=0.001,SPF_PASS=-0.001,T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,KAM_DMARC_STATUS,NICE_REPLY_A,SPF_FAIL,SPF_HELO_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 List-Id: 在 2023/11/24 下午6:30, Xi Ruoyao 写道: > 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, >> including Joseph's email, >> all say that rint will not set errno, but linux-man says "which might >> 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‐2001 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 large > An invalid floating‐point exception (FE_INVALID) is raised. > > 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=6798). > Ok, the question is clear, I have no objection.