From nobody Sun Jul 28 21:38:12 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 4WXFGX6pYRz5RkRH; Sun, 28 Jul 2024 21:38:12 +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 4WXFGX4sDLz4RdG; Sun, 28 Jul 2024 21:38:12 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722202692; 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=JLWQkKG4FAdXo5nisnNlkHRy6UHaxpCWZFPaM81AvpI=; b=o64flHLwwXe1jhH30/6iFuFdwHhXr6yC0C94lit+uiVjTC7Vn4Mv4nr1gRyQZjJ0LZzC4D 2T6+EG2HvriYt+JYcx+7nQwJWUoFt4411ElFVho863nnbR0pdVlZGiNyGxd3ZzqkJ9Wxnw GKeztY4vLuXvGSXnMWLWt7f3ETJnN53P4Ty7bB/BObKARoXVzB5E0H6s+RtxnTAABlzVcy FTF33kH2dr6KCglk5dWpIef+GjF8eaMTEZTqOf1uTqYVCEa459fvC5Zo/BTbn+V+G5znFf bL4EtP9f6q/3XQ+wj6wyC9FNHfvOhNaEY0ooE4phsZmR6xNTFLLRFvFjactL4g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722202692; a=rsa-sha256; cv=none; b=bsSMDO3PAan5WP9LXZjUFt7HtP/X2xvnGP2J8y9Q9pAa4yOF1CnlvdPAKyyQmzT/0KK/vE DnbMHAsz5CgXiscs4axWD92ExrkbShJu0eG+OPAdmJRFmDmJCAkmiZaWTZY6507s+Ep42F iFmilBf/3Z3/PaJVMBqOMYka1OTTKxciBLGDh4ajFu6uyeSxxhENThgWRSRyggAY4v1tn7 a1pK8N5vhpy17p9vyOq+wi/vQL6U+BAWYAOBlHcvNpbNk4CiQcOgSt7f2YzytY7h4DWRFH 9PJUZEi08nBZvy2xg6kr30tOhwl9Nd3Uuf1sk82oTAEgG6ZeOY81U2AMTYfInQ== 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=1722202692; 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=JLWQkKG4FAdXo5nisnNlkHRy6UHaxpCWZFPaM81AvpI=; b=r1Sh0gkq7cEa7cLUcnx6TtgeIYpv+cV2o5MJzh5WXJojgHBIsOiJq+a6pS9kqk6OMFQCIF EtYh+xk23XSu7Xuyx2WjgfL6B/vVEh8vZxZgJ+aSnE6ok7lbg9XVXi4skreDP6EvTU0+8H COLyzQnN2WMVbWyRvIwosgvvD6tsEOhFSQF0UTQvUW1toddqEewwEYVL2Y9CbB1Z437I5H Z/KXTCc9r0EMRJI/I7KrLcSYndAa/kE5c6WzeWverJPNd+H1B0ZAseP5fWes5LxL7slWM1 RdBVcJDUVuxy3RQGDgqFotrXqcRjgvaFxK6p8ll60SWNBuTat0Ui5ctxq+ffzQ== 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 4WXFGX4ScWz16vF; Sun, 28 Jul 2024 21:38:12 +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 46SLcCkG069582; Sun, 28 Jul 2024 21:38:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46SLcCkF069579; Sun, 28 Jul 2024 21:38:12 GMT (envelope-from git) Date: Sun, 28 Jul 2024 21:38:12 GMT Message-Id: <202407282138.46SLcCkF069579@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ed Maste Subject: git: 34f746cc7f8a - main - 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/main X-Git-Reftype: branch X-Git-Commit: 34f746cc7f8a8dd261027a8b392b76e70adc8438 Auto-Submitted: auto-generated The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=34f746cc7f8a8dd261027a8b392b76e70adc8438 commit 34f746cc7f8a8dd261027a8b392b76e70adc8438 Author: Steve Kargl AuthorDate: 2024-06-16 23:41:38 +0000 Commit: Ed Maste CommitDate: 2024-07-28 21:37:45 +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 --- 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) {