From nobody Tue Oct 01 01:19:46 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 4XHg8f5VN1z5XyDg; Tue, 01 Oct 2024 01:19:46 +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 4XHg8f4j23z4tT9; Tue, 1 Oct 2024 01:19:46 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727745586; 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=+X32XH6VuoP/m+i4G5sTyEy7atc1IdVs8QvJDCvSrBw=; b=UiRl6QlJYjIbDN8LJ5Uh8bfDmV1JOhni8aAhlkPNusjcMFev2N1Q81HCvMwFZyhl5jjnaB gnZ2hE9Klt9V2usUaKCCa/vW+O848rLiRiZgWQvXs5+IejvVaaUbMybLPlFfVYaWrG8ZvH oxpaARZo66iKSjh3dLHyLaP1t+DRn7HlYQSLAU3kxsYQxNP1g6Q66MosMP0nIQfDcj+G+7 /HjV0uhnVsKcWkOhbGOP7PYUa+5+QnZySSv1KKhoMZTyQlIM6N+G9MKN2ejekxYYjUciUV 39R8EMWzcmz45PRqKtKdSq7+6z6gb5ONMt/7fDVG8NsBRCEixcaarePgp7pUgg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727745586; 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=+X32XH6VuoP/m+i4G5sTyEy7atc1IdVs8QvJDCvSrBw=; b=PnRt0gwEqRdl9uXuDpNQOLfvoGnNOMwwwrOufLenlNiLis+yBYv6tiDe6EGi/ttbpSHM59 pOkUcB32t5MtOuUjVYDVo2zUn2A/Ftjb6D/xecF0LKpMoRomOM7fp6MzB6oVX7VIuQ9Qkl 3wEInqWb5a2EGAKjbJVoZgXe+ubYMATY1Ow26aBAJV5vzIQ4RUglczjVerSzZHxbx88VGB ZAMWBfYSXHu7XnUQh6R8o1skqygLMztltkwRB3blMsIU5Zw1flVyh4DL3LvA6lD5W4iacd 2iHcS0kTQRe4dQW2gNFDbM3og4FsLLDN2EB/q6qDSDbICOhM/uTGSnP1ONsMtg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1727745586; a=rsa-sha256; cv=none; b=bN1/l0BFywAZTkNHKAvyJSXAY+6pCZcteRf+JZ0q0Q5tTIO1zKBklmMIFFDr3kDhdfsjkR p3xKOLT871u9HQnArMJ8cJwx2jlnKvfMb0cYgJ6g6TUFdjUTQNzpjsFxbwZxcl0dtJs4zl X2n/xrIiV/bQlonUpFju8LSIo26sWmS7LDZCcEmTHgWPHzMmIBcvghaZ/yTy/EFu/XjG/J 0tv+VnvFvVGJFC0JfCes9LXpU9GkQljPrwFWH6YLdFFk5NZWUDDLQu5Pd0LRBdyJk65jBi A5Lqyj0VVVhJuCjM3LD7bH6W3tLoOT9MjCykPn8BWoPgZ47bxoS/sRsS8cSKCQ== 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 4XHg8f49vzzHGq; Tue, 1 Oct 2024 01:19:46 +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 4911JkKB016802; Tue, 1 Oct 2024 01:19:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4911Jk59016799; Tue, 1 Oct 2024 01:19:46 GMT (envelope-from git) Date: Tue, 1 Oct 2024 01:19:46 GMT Message-Id: <202410010119.4911Jk59016799@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: 3d77026d8a48 - stable/13 - 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/13 X-Git-Reftype: branch X-Git-Commit: 3d77026d8a48a8d056a145b56f288f838c159afc Auto-Submitted: auto-generated The branch stable/13 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=3d77026d8a48a8d056a145b56f288f838c159afc commit 3d77026d8a48a8d056a145b56f288f838c159afc Author: Steve Kargl AuthorDate: 2024-06-16 23:41:38 +0000 Commit: Ed Maste CommitDate: 2024-10-01 01:19:13 +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) (cherry picked from commit dc39004bc670fe33ae6759816380c93a37268dd6) --- 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 017067c6c92a..fb12c0369fec 100644 --- a/lib/msun/src/s_fma.c +++ b/lib/msun/src/s_fma.c @@ -261,14 +261,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 acaaaaf3678d..f7aa42287d7a 100644 --- a/lib/msun/src/s_fmal.c +++ b/lib/msun/src/s_fmal.c @@ -242,14 +242,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) {