From nobody Fri Nov 05 21:32:26 2021 X-Original-To: freebsd-current@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 3E3331857F17 for ; Fri, 5 Nov 2021 21:32:34 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HmDHk1LQwz3pQJ; Fri, 5 Nov 2021 21:32:34 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from tensor.andric.com (tensor.andric.com [87.251.56.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "tensor.andric.com", Issuer "R3" (verified OK)) (Authenticated sender: dim) by smtp.freebsd.org (Postfix) with ESMTPSA id ECF93AE09; Fri, 5 Nov 2021 21:32:33 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from smtpclient.apple (longrow.home.andric.com [192.168.0.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id 8252742CC8; Fri, 5 Nov 2021 22:32:32 +0100 (CET) From: Dimitry Andric Message-Id: <34FEBFCC-1CD6-48CB-BA2A-7A2BBD6B4EA1@FreeBSD.org> Content-Type: multipart/signed; boundary="Apple-Mail=_AAC422C0-B0D2-47AB-86F1-006E4783A159"; protocol="application/pgp-signature"; micalg=pgp-sha1 List-Id: Discussions about the use of FreeBSD-current List-Archive: https://lists.freebsd.org/archives/freebsd-current List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-current@freebsd.org Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.120.0.1.13\)) Subject: Re: WHY? commit ac76bc1145dd7f4476e5d982ce8f355f71015713 Date: Fri, 5 Nov 2021 22:32:26 +0100 In-Reply-To: <20211105201323.GA26765@troutmask.apl.washington.edu> Cc: freebsd-current@freebsd.org, lwhsu@freebsd.org To: Steve Kargl References: <20211105201323.GA26765@troutmask.apl.washington.edu> X-Mailer: Apple Mail (2.3654.120.0.1.13) X-ThisMailContainsUnwantedMimeParts: N --Apple-Mail=_AAC422C0-B0D2-47AB-86F1-006E4783A159 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii On 5 Nov 2021, at 21:13, Steve Kargl = wrote: >=20 > Why was this committed? >=20 > commit ac76bc1145dd7f4476e5d982ce8f355f71015713 > Author: Dimitry Andric > Date: Tue Feb 9 22:06:51 2021 +0100 >=20 > Fix lib/msun's ctrig_test/test_inf_inputs test case with clang >=3D = 10 >=20 > This sprinkles a few strategic volatiles in an attempt to defeat = clang's > optimization interfering with the expected floating-point exception > flags. >=20 > There is nothing, and I mean, nothing strategic about "sprinkling" > volatile onto the declaration of "float x, y, h;" These variables > are referenced in all floating pointing operations in the file, > which means that there are needless reloading of x, y, and h > from memory. There was more context in https://bugs.freebsd.org/244732, but the gist was that with clang >=3D 10, ctanh() and ctanhf() had FE_INVALID set = after calling them with {inf,inf}. The reasons for this were obscure to me at the time, since it regressed with an llvm commit that seemed to have very little to do with floating point. However, in 3b00222f156d we added -fp-exception-behavior=3Dmaytrap to clang's compile flags for lib/msun, for https://bugs.freebsd.org/254911, to force it to use stricter floating point semantics. This turns out to also make the admittedly ugly volatile fixes unnecessary. So I have reverted ac76bc1145dd (minus the ctrig_test.c part) in: = https://cgit.freebsd.org/src/commit/?id=3De2157cd0000f6dbb6465d7a885f2dcfd= 4d3596cb -Dimitry --Apple-Mail=_AAC422C0-B0D2-47AB-86F1-006E4783A159 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.2 iF0EARECAB0WIQR6tGLSzjX8bUI5T82wXqMKLiCWowUCYYWi6gAKCRCwXqMKLiCW o4FNAJ4lRuHu13EM8+INk+Ao+C4515ONqgCeL8wo/SibHe26krnYJAxXbTeBfpI= =3HIb -----END PGP SIGNATURE----- --Apple-Mail=_AAC422C0-B0D2-47AB-86F1-006E4783A159--