From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-74.mimecast.com (us-smtp-delivery-74.mimecast.com [216.205.24.74]) by sourceware.org (Postfix) with ESMTP id 655783875DFD for ; Fri, 20 Mar 2020 09:16:12 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 655783875DFD Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-191-b4mMlMicMriz0cbyyVs7bg-1; Fri, 20 Mar 2020 05:16:08 -0400 X-MC-Unique: b4mMlMicMriz0cbyyVs7bg-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id E7F95107ACC4; Fri, 20 Mar 2020 09:16:06 +0000 (UTC) Received: from calimero.vinschen.de (ovpn-112-139.ams2.redhat.com [10.36.112.139]) by smtp.corp.redhat.com (Postfix) with ESMTPS id B742610016EB; Fri, 20 Mar 2020 09:16:05 +0000 (UTC) Received: by calimero.vinschen.de (Postfix, from userid 500) id EDBC5A807AE; Fri, 20 Mar 2020 10:16:03 +0100 (CET) Date: Fri, 20 Mar 2020 10:16:03 +0100 From: Corinna Vinschen To: Fabian Schriever Cc: newlib@sourceware.org Subject: Re: [PATCH] Fix hypotf missing mask in hi+lo decomposition Message-ID: <20200320091603.GH778468@calimero.vinschen.de> Reply-To: newlib@sourceware.org Mail-Followup-To: Fabian Schriever , newlib@sourceware.org References: <20200319153408.1413-1-fabian.schriever@gtd-gmbh.de> MIME-Version: 1.0 In-Reply-To: <20200319153408.1413-1-fabian.schriever@gtd-gmbh.de> X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="KJY2Ze80yH5MUxol" Content-Disposition: inline X-Spam-Status: No, score=-27.1 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: newlib@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Newlib mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Mar 2020 09:16:13 -0000 --KJY2Ze80yH5MUxol Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mar 19 16:34, Fabian Schriever wrote: > Add the missing mask for the decomposition of hi+lo which caused some > errors of 1-2 ULP. >=20 > This change is taken over from FreeBSD: > https://github.com/freebsd/freebsd/commit/95436ce20dab5a34ba46373410b9641= 1b1734578 >=20 > Additionally I've removed some variable assignments which were never > read before being overwritten again in the next 2 lines. > --- > newlib/libm/math/ef_hypot.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) >=20 > diff --git a/newlib/libm/math/ef_hypot.c b/newlib/libm/math/ef_hypot.c > index 9368eb41c..a70c92b88 100644 > --- a/newlib/libm/math/ef_hypot.c > +++ b/newlib/libm/math/ef_hypot.c > @@ -29,7 +29,7 @@ > =09ha &=3D 0x7fffffffL; > =09GET_FLOAT_WORD(hb,y); > =09hb &=3D 0x7fffffffL; > -=09if(hb > ha) {a=3Dy;b=3Dx;j=3Dha; ha=3Dhb;hb=3Dj;} else {a=3Dx;b=3Dy;} > +=09if(hb > ha) { j =3D ha; ha =3D hb; hb =3D j; } > =09SET_FLOAT_WORD(a,ha);=09/* a <- |a| */ > =09SET_FLOAT_WORD(b,hb);=09/* b <- |b| */ > =09if((ha-hb)>0xf000000L) {return a+b;} /* x/y > 2**30 */ > @@ -72,7 +72,7 @@ > =09 a =3D a+a; > =09 SET_FLOAT_WORD(y1,hb&0xfffff000L); > =09 y2 =3D b - y1; > -=09 SET_FLOAT_WORD(t1,ha+0x00800000L); > +=09 SET_FLOAT_WORD(t1,(ha+0x00800000L)&0xfffff000UL); > =09 t2 =3D a - t1; > =09 w =3D __ieee754_sqrtf(t1*y1-(w*(-w)-(t1*y2+t2*b))); > =09} > --=20 > 2.24.1.windows.2 >=20 Pushed. Thanks, Corinna --=20 Corinna Vinschen Cygwin Maintainer Red Hat --KJY2Ze80yH5MUxol Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEoVYPmneWZnwT6kwF9TYGna5ET6AFAl50idMACgkQ9TYGna5E T6D15Q//TAjpmcNnZAaD21vnc3dWLd/K3/0g+5Gv4S/IG3x9SHy/p5eSOJuO5Jx4 gyEcUJ/IKLxLb5+SHQL+/cY2hlqkis/7fHS3IkVsd3P3jhT1M7ziteNYUgaoWsSa yofGNI9BYmWGPr5E+B2W018ZowW8ru5gyoWaZKnBDENrP4K12Fx8He6h23HtyUZr xb30eIp8fpKWWTCaMQq3LEwsXfJxjr7mXo4/C+ataZ3dgnos5pY1j9PYckJBmrlz SZrpMxP5u1t9SFr2EsevJXb4TZKOuRlFhhENFLr5TqYn3ojwKVIx6cFHzSOMFuec LyyGZm5ty6PT3Wu6tmAQqpP+gjAA6LgZVrHWRtP/YiYU514cD4V2EFa4fYUnGi0Z ZpcDZD5BQ5enWoKP4Pkkw5Rf8zLrd98YW43s4qAoEnKceBvOon14wNymUZzQfVM1 3/L2dR9gp4Fe39mU8JnDNb9+Kqzl5KygJRuU8bcLpjYx18OsE3QB4ThqS8NFnIuQ Hjki5a7QNaGAjod0hRWZQht6ZrB7qPFarU8xJdCNpx+HtQlHqMXFW/qSMINYV/zV aqwHW/cu9U+2bppMcwLWd8Nfn2ThwcLoGvihZRmm39IFL95Q68bQkNlagX5epakL ZZObGiYt+JwkHr8VlMTY4plKb0OSFDk/i/kZAl/oqBRdl5masHU= =ELAa -----END PGP SIGNATURE----- --KJY2Ze80yH5MUxol--