From nobody Tue Aug 06 21:25:52 2024 X-Original-To: dev-commits-src-all@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 4WdmZ90BNLz5ShHK; Tue, 06 Aug 2024 21:25:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WdmZ86cGMz4Z5X; Tue, 6 Aug 2024 21:25:52 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722979552; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=P0/1fciIm4qWJIcJE36xW1dpYkkmmmzbqIGZF7+9MqY=; b=RK0DqCktDXJoNV58cTXKF1zm9itXtJR7ME5c3ueMmcSUOan7aUyHe0knTQ0w75Sh8cWuQ5 jKBG2ucL7UJbbe6AeR0rkQyj7fYvMx5+ScjBw+Yt2u1kjtBLVfkZG4cg6QhxEABQ6qAoF/ WfTGE6MXzY5KbUf5LvRfxXhmLVx0KTbIrYtgUOTcub+e4E8vkbHNf8Uxp3o7t7XG0ZgLqQ /r+DwJW1V5+Nd+5zVaL+9IlVGkVd9fgs5UOdlEwzNE3MRf4rdnxW4KTd54y3/LPM9c0KMC keT8j65fz2Vs4CEcjodxAOcEMWqAq+FMDKEYeb4xhIGO51c2/8DfsVajcICmag== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722979552; a=rsa-sha256; cv=none; b=rPT0sOWIFNO1hozuKKb9Jm5M1NTzexI0JjRU5KvMV3vIkDla2if43B18OVVI627zSAZ7tN G6HZU4osn0uN4QX7wqVx+KvNVMwYedNCWPCMdotg5Hqy++fBa4/ySxRMHpb9sGKH79eFv5 3AS5qSZcR3EFTDS3eXhSkEk3L1d/5Pb2ltWgWRvFXyN1E6686XFEz0LkTJ3jUgA5t3VbL7 aNyCs6dvDTMolKxLZ7Ptv7ds908WZ4xkdwBniX/hBCdHfb2HZrgy9GrrqzR/yiXRx3k6Iu 6dTSpPl8uK1S/L62P7BexeGLGtOQll+7FCP6jNasO4S05Dn+XHGEHtkj+0or8g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722979552; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=P0/1fciIm4qWJIcJE36xW1dpYkkmmmzbqIGZF7+9MqY=; b=h7r3aJxipqYeshoRVXruGkBZ3nYXQENhAqFrUqXoUGlB+eh+nrmpvxzl4JqpO6KAg8P922 PKHJMrgBs86GoiKxqdlLPKff2j5y8G+NgcmhbHgSIXcC5+v+JUJozQ9s+KY5ChMlWXR52q N7awG9wGk/aDMr1BScypBGgIhNlt2HU6Nu4doGE3oCOMogxgL7B9S5qJC79d3pTBlsgFSm qW4G/u9LsR5iUTTHNdSIxZEy9Zr7LX88skUUIt9aCK72ItZ2fGt6dLGTE4cbkKwfN4ZNMw iNt0mvL7RUagaRQXmtOyh47+bJXBFc5swd94vlNUHCvU9mkBuSbez0gkFjLs+g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WdmZ869G1zNGt; Tue, 6 Aug 2024 21:25:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 476LPq1J067375; Tue, 6 Aug 2024 21:25:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 476LPqi6067372; Tue, 6 Aug 2024 21:25:52 GMT (envelope-from git) Date: Tue, 6 Aug 2024 21:25:52 GMT Message-Id: <202408062125.476LPqi6067372@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: dc39004bc670 - stable/14 - libm: fma: correct zero sign with small inputs List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: dc39004bc670fe33ae6759816380c93a37268dd6 Auto-Submitted: auto-generated The branch stable/14 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=dc39004bc670fe33ae6759816380c93a37268dd6 commit dc39004bc670fe33ae6759816380c93a37268dd6 Author: Steve Kargl AuthorDate: 2024-06-16 23:41:38 +0000 Commit: Ed Maste CommitDate: 2024-08-06 21:25:10 +0000 libm: fma: correct zero sign with small inputs This is a fixed version of 888796ade284. PR: 277783 Reported by: Victor Stinner Reviewed by: emaste MFC after: 1 week (cherry picked from commit 888796ade2842486d3167067e8034254c38aadd3) (cherry picked from commit e77ad954bb825983b4346b9cc646c9c910b1be24) (cherry picked from commit 34f746cc7f8a8dd261027a8b392b76e70adc8438) --- lib/msun/src/s_fma.c | 4 ++-- lib/msun/src/s_fmal.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/msun/src/s_fma.c b/lib/msun/src/s_fma.c index 6c889a6a46ca..23a84491dd2a 100644 --- a/lib/msun/src/s_fma.c +++ b/lib/msun/src/s_fma.c @@ -260,14 +260,14 @@ fma(double x, double y, double z) spread = ex + ey; - if (r.hi == 0.0) { + if (r.hi == 0.0 && xy.lo == 0) { /* * When the addends cancel to 0, ensure that the result has * the correct sign. */ fesetround(oround); volatile double vzs = zs; /* XXX gcc CSE bug workaround */ - return (xy.hi + vzs + ldexp(xy.lo, spread)); + return (xy.hi + vzs); } if (oround != FE_TONEAREST) { diff --git a/lib/msun/src/s_fmal.c b/lib/msun/src/s_fmal.c index 80c835d09c2b..2fca20610157 100644 --- a/lib/msun/src/s_fmal.c +++ b/lib/msun/src/s_fmal.c @@ -241,14 +241,14 @@ fmal(long double x, long double y, long double z) spread = ex + ey; - if (r.hi == 0.0) { + if (r.hi == 0.0 && xy.lo == 0) { /* * When the addends cancel to 0, ensure that the result has * the correct sign. */ fesetround(oround); volatile long double vzs = zs; /* XXX gcc CSE bug workaround */ - return (xy.hi + vzs + ldexpl(xy.lo, spread)); + return (xy.hi + vzs); } if (oround != FE_TONEAREST) {