From owner-freebsd-current@freebsd.org Thu Mar 14 18:50:55 2019 Return-Path: Delivered-To: freebsd-current@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 86BA81527949; Thu, 14 Mar 2019 18:50:55 +0000 (UTC) (envelope-from peter@rulingia.com) Received: from vtr.rulingia.com (vtr.rulingia.com [IPv6:2001:19f0:5801:ebe:5400:1ff:fe53:30fd]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "vtr.rulingia.com", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7C3C28C8EA; Thu, 14 Mar 2019 18:50:54 +0000 (UTC) (envelope-from peter@rulingia.com) Received: from server.rulingia.com (ppp59-167-167-3.static.internode.on.net [59.167.167.3]) by vtr.rulingia.com (8.15.2/8.15.2) with ESMTPS id x2EIog59034550 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 15 Mar 2019 05:50:48 +1100 (AEDT) (envelope-from peter@rulingia.com) X-Bogosity: Ham, spamicity=0.000000 Received: from server.rulingia.com (localhost.rulingia.com [127.0.0.1]) by server.rulingia.com (8.15.2/8.15.2) with ESMTPS id x2EIobL5023030 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Fri, 15 Mar 2019 05:50:37 +1100 (AEDT) (envelope-from peter@server.rulingia.com) Received: (from peter@localhost) by server.rulingia.com (8.15.2/8.15.2/Submit) id x2EIobtH023029; Fri, 15 Mar 2019 05:50:37 +1100 (AEDT) (envelope-from peter) Date: Fri, 15 Mar 2019 05:50:37 +1100 From: Peter Jeremy To: Steve Kargl Cc: John Baldwin , freebsd-toolchain@freebsd.org, freebsd-current@freebsd.org Subject: Re: Optimization bug with floating-point? Message-ID: <20190314185037.GI87064@server.rulingia.com> References: <20190313024506.GA31746@troutmask.apl.washington.edu> <20190313151635.GA34757@troutmask.apl.washington.edu> <20190313164039.GA35340@troutmask.apl.washington.edu> <20190313212455.GA37717@troutmask.apl.washington.edu> <20190314063007.GA41995@troutmask.apl.washington.edu> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="ABTtc+pdwF7KHXCz" Content-Disposition: inline In-Reply-To: <20190314063007.GA41995@troutmask.apl.washington.edu> X-PGP-Key: http://www.rulingia.com/keys/peter.pgp User-Agent: Mutt/1.11.1 (2018-12-01) X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Mar 2019 18:50:55 -0000 --ABTtc+pdwF7KHXCz Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 2019-Mar-13 23:30:07 -0700, Steve Kargl wrote: >AFAICT, all libm float routines need to be modified to conditional >include ieeefp.h and call fpsetprec(FP_PD). This will work around >issues is FP and libm. FreeBSD needs to issue an erratum about=20 >the numerical issues with clang. I vaguely recall looking into the x87 initialisation a long time ago and STR that the startup code (either crtX or in the kernel) does a fninit() to set the precision. I don't recall exactly where. IMO, calling fpsetprec() in every libm float function is overkill. It should be enough to fpsetprec() before main() and add a note in the man pages that libm is built to use the default FPU configuration and changing the configuration (precision or rounding) may result in larger errors. --=20 Peter Jeremy --ABTtc+pdwF7KHXCz Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQKTBAEBCgB9FiEE7rKYbDBnHnTmXCJ+FqWXoOSiCzQFAlyKon1fFIAAAAAALgAo aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldEVF QjI5ODZDMzA2NzFFNzRFNjVDMjI3RTE2QTU5N0EwRTRBMjBCMzQACgkQFqWXoOSi CzRz9Q/+OjrikP4PpHTymluNc8n4nsbSy40WblYJX2mCk85Rn3F8y0IPYAPk8x6U GlyulPEvgdom2WwuWJ4EhyEqH2pGQzFHSoc3sLiF8XRNlLH/IX0CkFhv2CWGTD0R oCHb1Q5Gs0RdbKKIbrHJTCCQeuYNwPiLExZfxZ2nwpxMOhTAuMSVBTlG00E3a2OF 3APRz+f/cL72+1mt8PV9bIEg4R0xaGzpxf8t9/V9/Ljnzh/Wd/nNhI9NrOoUJ8Df i1/gHcg4SUiMaZBIdU4WpPo2dhy2PJx3w6wl5M6CKd+6VUmX041M+xkDqa6mepvc UdsJkfJ3Kfj7iZ0UYGWw56QR2yTlbNyB73enGbQEUv6fbUgVeAlcKoVS+JWE6t8y en3VC8JcsdlbmRUkJCFlDufJMD6v+wtN7fe/wAedut5gp5j/wlWFzNYhb+2UBBJp FCaE7zgkILXJY58tae2kTOe00zNYg1SlAyHIk4XZt1qlZ99wjAmbD/Fo+YSVR7wL xsgCJ8ZDUqiV8ny2TospBYdoCuqGTgEu5tJw3l5HAyX86RVLMVFDj94PvdrkdvtO v6y68hnIeCO6f5bnQ/AzWFhtWHx8QxB7MCGDnNPM3XVhXFQLs+GtSg9o4V6yt27p Itss96uin2NlCVgAC0lsFz+ZO2VR/UWu0slzsopgDTn+zonbOdE= =M9/i -----END PGP SIGNATURE----- --ABTtc+pdwF7KHXCz--