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 58B833858C98 for ; Mon, 25 Dec 2023 10:51:51 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 58B833858C98 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 58B833858C98 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=1703501512; cv=none; b=Y9D/i2ZS28yKwQMhUSiqfZE7PqMv3HwK2CSQc0hrqijAVvFU8wQH1rkbo33oq9ojZpDuHY8Q59tIzv3BE4uyktlk1EbYL+NtEbqKoXoA10p2ZlfHw1TISeuObSLR3yBQmh6JgMQLSqpYZTJVJPLpKCf60Ky65QP6II/zyCZiB7s= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1703501512; c=relaxed/simple; bh=KcxDCQVHau4ipNVKOsVIDoG6M4yI1oLzzD9AMJE4BbY=; h=DKIM-Signature:Message-ID:Subject:From:To:Date:MIME-Version; b=K7HGIoCkEhSrtoQKmVZ6SC0Hj71JV18wXTI6pimFNlyHk3RlRGu9d5WpSgxqG0ILlpbbVRiRG2Uwt1yv/RuONCPQCfJaK+2/OzYd5e67VhUYZWrgldKU+pcVgNOfZ4lLtv1lKoJty74gn/8ab66SgxVJarnpq24Of8/onXtrtEk= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=xry111.site; s=default; t=1703501510; bh=KcxDCQVHau4ipNVKOsVIDoG6M4yI1oLzzD9AMJE4BbY=; h=Subject:From:To:Cc:Date:In-Reply-To:References:From; b=QjEJ00wpiybt8xlpdVHIKyO3yvOA1vFIh6tAY35wAVcPwCp8/bM2lVvvNrIb3EE4B RI5Ak/rCk2qRmiTt4LD8hjUFzwOwqGGt8zH/DqjM3Sgd9ZRCSILqjTiMghv3+P/egY d5lszNF0jmhWX7S2s9NeJ9d5LCBrP+2ybcAdhjzA= Received: from [IPv6:240e:358:113a:1b00:dc73:854d:832e:2] (unknown [IPv6:240e:358:113a:1b00:dc73:854d:832e:2]) (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 6C836669AE; Mon, 25 Dec 2023 05:51:48 -0500 (EST) Message-ID: Subject: Re: [PATCH 2/2] MIPS: Hard-float rounding instructions support From: Xi Ruoyao To: Junxian Zhu , libc-alpha@sourceware.org Cc: rongrong@oss.cipunited.com Date: Mon, 25 Dec 2023 18:51:42 +0800 In-Reply-To: <20231225103548.1615-4-zhujunxian@oss.cipunited.com> References: <20231225103548.1615-2-zhujunxian@oss.cipunited.com> <20231225103548.1615-4-zhujunxian@oss.cipunited.com> 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.2 MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 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 Mon, 2023-12-25 at 18:35 +0800, Junxian Zhu wrote: /* snip */ > +/* > + * ceil(x) > + * Return x rounded toward -inf to integral value > + * Method: > + * Bit twiddling. > + */ > + > +#if ((__mips_fpr =3D=3D 64) && (__mips_hard_float =3D=3D 1) && ((__mips = =3D=3D 32 && __mips_isa_rev > 1) || __mips =3D=3D 64)) > +#include > +#include > +#include > + > +ENTRY(__ceil) > + .set push > + .set noreorder > + .set noat > +# $f0=3Dret, $f12=3Ddouble, a0=3Dint64/int32_h, a1=3Dint32_l, a2=3Dsign,= a3=3Dexp > +#if __mips =3D=3D 64 > + dmfc1=C2=A0=C2=A0 a0, $f12 # assign int64 > +#else > + mfhc1=C2=A0=C2=A0 a0, $f12 # assign int64 > +#endif > + cfc1=C2=A0=C2=A0=C2=A0 t0, $f26 > + ceil.l.d=C2=A0=C2=A0=C2=A0 $f0, $f12 No, C23 does not allow this function to raise an INEXACT exception, but ceil.l.d will do so. Such optimizations should be performed in GCC which can be controlled by the programmer with -std=3Dc23 and/or -f[no-]fp-int-builtin-inexact, not in Glibc where we cannot know if the programmer wants to deviate from C23. --=20 Xi Ruoyao School of Aerospace Science and Technology, Xidian University