From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from elaine.keithp.com (home.keithp.com [63.227.221.253]) by sourceware.org (Postfix) with ESMTPS id 79A2A396DC39 for ; Wed, 2 Sep 2020 05:25:04 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 79A2A396DC39 Received: from localhost (localhost [127.0.0.1]) by elaine.keithp.com (Postfix) with ESMTP id 404003F2D6DC; Tue, 1 Sep 2020 22:25:03 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at keithp.com Received: from elaine.keithp.com ([127.0.0.1]) by localhost (elaine.keithp.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id sRTBBRvmxFTs; Tue, 1 Sep 2020 22:25:02 -0700 (PDT) Received: from keithp.com (koto.keithp.com [10.0.0.2]) by elaine.keithp.com (Postfix) with ESMTPSA id DC5A43F2D6D8; Tue, 1 Sep 2020 22:25:02 -0700 (PDT) Received: by keithp.com (Postfix, from userid 1000) id C05C01582201; Tue, 1 Sep 2020 22:25:02 -0700 (PDT) From: "Keith Packard" To: Sebastian Huber , Joseph Myers Cc: newlib@sourceware.org Subject: Re: [PATCH 0/3] ARM with only 32-bit floats do not have fast 64-bit FMA In-Reply-To: References: <20200808223413.4015633-1-keithp@keithp.com> <1fc07c90-694b-01ea-cedc-0656eccdd827@embedded-brains.de> <87wo1db8kt.fsf@keithp.com> <87lfhtayhs.fsf@keithp.com> Date: Tue, 01 Sep 2020 22:25:02 -0700 Message-ID: <87zh68agy9.fsf@keithp.com> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" X-Spam-Status: No, score=-5.2 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, SPF_HELO_NONE, SPF_PASS, TXREP 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: Wed, 02 Sep 2020 05:25:23 -0000 --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Sebastian Huber writes: > Our failing test is pretty basic, it just checks if fma() and fmaf()=20 > library functions are present as per C99. The glibc offers also a simple= =20 > default implementation, for example: > > https://sourceware.org/git/?p=3Dglibc.git;a=3Dblob;f=3Dmath/s_fma.c;h=3D4= d73af4f65d511594b2395d032a135721c578484;hb=3DHEAD That implementation violates the spec though because it does two binary operations involving two roundings, so you get a different answer than you would with a true fma. Is it better to implement the function incorrectly or better to not implement it at all? If your hardware doesn't support the operation, then doing this in software would be a lot slower than adapting your algorithm to deal with a sequence of binary operations, even though you will likely need more of them to reach the same accuracy. =2D-=20 =2Dkeith --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEw4O3eCVWE9/bQJ2R2yIaaQAAABEFAl9PLK4ACgkQ2yIaaQAA ABFkNg//WnhtIMY6pTG+Lbe2zVIEDDosnl5AbIRQtzOu79N+u6v9/vpvrnwK08ni /5IJkJ5ck9f+QtOuRwGwvJMxQxijI763Oyy3jgvrCrNs3h8ggZAcZHw4ZMdEKHlj Efpo5Lpeg96v3qposLKnc1ahJo64lg/aOe27UYemFUFj8NJun80qjsKA3PdGv7Sq SodtXaarL1MoGxmkGZNg/Y33qGe/hFcguFm0IwQCTqH8H0GHMgKhQHO+ThE3boJG XxIcsrmOTOf6I+MhNIFoO4EM3VJKyXdG/WXX2EjDSzRskYCrREpgyXE9KnJzRx2N cXG8eVCElq0AnEGAtXs92IF4fenyUH6VAHHH4ob6lKP33XCtO0IKRYXPRXBAvV1/ wgiRvUxtxxkJiKwlJu6kc4vjSMS70aelqWiBsbLBLcePhiFNHbVhMqy+kwPbkyse xRYmjMtgByM61D3sJorrYCTVvVxPbBaSsgOQOe2S0yOVAViI2O43mXvsJg9Sk05a V6Qpeg6GwFhjttRAJWRRKoYPYv9xUuFvDpsnOnf3XMB7ieNa0neY+fMccjFGqBH7 Y84FVhvltxvycJElKvT8sbUm6lakqj8EP52kmcz8k4bIAH/w9S7jq50ARei1Lyo7 j+qTfSsr2UOQWlPVHunmquOMKgLvHor7Vaj245JvsoxmixmvNuU= =tCb2 -----END PGP SIGNATURE----- --=-=-=--