From nobody Sat Jun 08 15:56:19 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 4VxN3864s0z5M91x; Sat, 08 Jun 2024 15:56:20 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VxN383cqvz4Kbx; Sat, 8 Jun 2024 15:56:20 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1717862180; 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=OyZKrHDdKkPiml2WCLGp8wF3GtoMHRSWb9C+l5o0Gyc=; b=w83KoNVfdF6t1C5TgVX4n3v5jB9oj0zBIwkGvrRnpQwNf2AGtMogGkhivdRAv8e8Ti3lkN M8R5OSbUk2jJXpb++gY0Hweid9O0YVhNOVjXn8dMpeyBJHnLdgwOzXmfPuUrWkeeaXdnSW nl2gwF6SxzT9NCIjFGXcs08dC/EiiZWF8jBZoNsMsftr9TAE1oe2rQjYM62c7+fyjbDh+o ERMB5gtnSjzQS5EgegAwrYP7irnVEpJhiu7HT3kqbPnh6LOm51O2LTVrExp+NxfH0d0exh deqAXB8dWY1gcvO0DyaSgvX2X8s4NVUCFpCRve1rP7EfiQjwMaoJvhgcrTM5+w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1717862180; a=rsa-sha256; cv=none; b=vdBP4qGOF5/yXXTxtQXjkWAEssgbcMj+iXKb/qKm1VwbkfcgSQymd3Ards3cRX/qWmM+Pk m/Br2Y4ldgEuvY2EJg00FpTcwqgzC2HO8TUmshbK29r33ECluIeTcIHlvLwQwTbx14IJZW ldCxfO2QGCKuq71uRzdoOT+FWeJwqeIBZDWJl7uQKggViFmN1T+MFfbrBKe680Nq7vGd3T Rq+teyynrSMx9468oGJgUxTKv/6Un3YoJ1Lfzlf5fptoZWlmeac0g0ZZZVXQu1Z9gjNx6Y R0l7bsbpSqkCQSP1+uLuEPe3u3pqMR4/CX34W85FZr3uBydMA4HjII86Wul89w== 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=1717862180; 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=OyZKrHDdKkPiml2WCLGp8wF3GtoMHRSWb9C+l5o0Gyc=; b=t3SY5c0v7aAUZP3cEoEH06z3rHHTuEEN+caIeSQMHL+Z7QAZzhi3em4+gKa2tvHpeRFtBW fOEZjfsIe+yZ9Nb90g4VTrT1q5T4+E90EVzMk17zjoq+xzsQ9TqMoM8u4Co0XsYFtHsfcC h3dGYdY94Dac0vtrmq3o7fz3w30CMqGCynrmA0ujkPEUPQuIWPRC/dguqVv6EI5PM3LXit bSCuDHIDhn5BRToBz68Xvu7ClqDwm/WMuglhbT3zyR+0Z8drk+WF4SWYczV9U9wfY3UNnS 228Zp4545Sr3jRy1EoT2bKHRj7asVUYqSpGd2QENJzQy+3IZkW3VIfoKVHHOvw== 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 4VxN380jYlz14VY; Sat, 8 Jun 2024 15:56:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 458FuJqW022363; Sat, 8 Jun 2024 15:56:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 458FuJYN022360; Sat, 8 Jun 2024 15:56:19 GMT (envelope-from git) Date: Sat, 8 Jun 2024 15:56:19 GMT Message-Id: <202406081556.458FuJYN022360@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: 888796ade284 - 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: 888796ade2842486d3167067e8034254c38aadd3 Auto-Submitted: auto-generated The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=888796ade2842486d3167067e8034254c38aadd3 commit 888796ade2842486d3167067e8034254c38aadd3 Author: Ed Maste AuthorDate: 2024-03-19 14:31:39 +0000 Commit: Ed Maste CommitDate: 2024-06-08 15:55:36 +0000 libm: fma: correct zero sign with small inputs PR: 277783 Reported by: Victor Stinner Submitted by: kargl MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D44433 --- lib/msun/src/s_fma.c | 4 +++- lib/msun/src/s_fmal.c | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/msun/src/s_fma.c b/lib/msun/src/s_fma.c index b8a342646d85..4d08b40cc71a 100644 --- a/lib/msun/src/s_fma.c +++ b/lib/msun/src/s_fma.c @@ -267,7 +267,9 @@ fma(double x, double y, double z) */ fesetround(oround); volatile double vzs = zs; /* XXX gcc CSE bug workaround */ - return (xy.hi + vzs + ldexp(xy.lo, spread)); + xs = ldexp(xy.lo, spread); + xy.hi += vzs; + return (xy.hi == 0 ? xs : xy.hi + xs); } if (oround != FE_TONEAREST) { diff --git a/lib/msun/src/s_fmal.c b/lib/msun/src/s_fmal.c index 3d333632127c..12f9c364670b 100644 --- a/lib/msun/src/s_fmal.c +++ b/lib/msun/src/s_fmal.c @@ -248,7 +248,9 @@ fmal(long double x, long double y, long double z) */ fesetround(oround); volatile long double vzs = zs; /* XXX gcc CSE bug workaround */ - return (xy.hi + vzs + ldexpl(xy.lo, spread)); + xs = ldexpl(xy.lo, spread); + xy.hi += vzs; + return (xy.hi == 0 ? xs : xy.hi + xs); } if (oround != FE_TONEAREST) {