From nobody Mon Jun 10 23:31:02 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 4Vyp3D3Lmmz5N7Yy; Mon, 10 Jun 2024 23:31:20 +0000 (UTC) (envelope-from rlibby@gmail.com) Received: from mail-lj1-x22e.google.com (mail-lj1-x22e.google.com [IPv6:2a00:1450:4864:20::22e]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "WR4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Vyp3C3MNPz4bst; Mon, 10 Jun 2024 23:31:19 +0000 (UTC) (envelope-from rlibby@gmail.com) Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20230601 header.b=PPrsqTZf; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of rlibby@gmail.com designates 2a00:1450:4864:20::22e as permitted sender) smtp.mailfrom=rlibby@gmail.com Received: by mail-lj1-x22e.google.com with SMTP id 38308e7fff4ca-2ebed33cbafso11372851fa.1; Mon, 10 Jun 2024 16:31:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1718062275; x=1718667075; darn=freebsd.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=HR9RLGvpB6hmp5kvMy9vruVlowUG53VrVwT56QGrXdo=; b=PPrsqTZfYKrwruwqSC3qjD5UsvhDIiCKx6NK+goz1OzcBxpRqh8XFAjHcx0CSEWYsA busIevHCKy8a4LDLx7Eg7STbTvNesb0ZMWsgjmg9wET4Tfxm758T5lBDFGmtfmHpA4SN DALNoZydzopYKAlBzprCikw/UH04xvs/8pYOMz0/WJqcBEieFrtXUEAkzjyeKP0WNxsu Nv4QZ+7fmXu7tY6GRuS/b8GRh26bSESwCtL2nfHgcpivgs+SdpX1QDRJ12Wa10TJQNKf KNCa233HTVFYz5lxw7cbi643DvQucBg6/SXgO5l4HYW0uPv4Ak4PN865fhSdeJ8rGso4 LD3A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718062275; x=1718667075; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=HR9RLGvpB6hmp5kvMy9vruVlowUG53VrVwT56QGrXdo=; b=Zkm9fDzTy3zJUcCNb955Zxpb6WtVyCTdaFEWqgAcQeSVYwbc6W0BsI423lykBT7ScX 2+OxU8YMGbQnoTqYDsQEtFZlgp7NRtmuRM7XjzrHJJf7Ddaw4PjRWcnU+Ifa6SbIFHj9 j3zIm4DvVD9AnsUzuoBXxaHqcaekvJC/j97n5fi3+HqXWSBlnALU1ytYDcx8fwR7MGrm vPD1548NWR+hkEY3DIRTXxzmOwGAssBXhJ/jj49gIQvsqznUDTNrvf+V6idbpOkLkLlc HUqameMG8+vg2Xky0B0Vi2noLDd8nVf00GRB4ByPWDASWAig1IMTsBIC+TrI4ppPkLzh DhRQ== X-Forwarded-Encrypted: i=1; AJvYcCVqUH/hJl9p94EGU2iin0hq+Fqe/htnQVWEs/zONHl7XZdJAnTt+3EBVJ3rIMYt6MFpx2u7m4zdJiO7BmOfg1RTqt42rXhk1LtBmlNAofFdDFeTlqw2reipeer1tmxV3GuUjK4lxN1T+VXOixALUlpS379yYZ+/vNXoDUsbUZjVp3XzfeY= X-Gm-Message-State: AOJu0Yyoq2enYEmEF0Cwtk/yKv5ciNDh8SfGbhG+WLLPW197jAil/2SM QFrfKI+qp14KSdtaodtlrAgvXipfG+sIbYMWdPhOqH4+/0YHAKyK/4ilajIkdahgA2oBDpwr7C/ pIADp2xu6PEfrA1YwtxAY+9EH65E5sDv+iOE= X-Google-Smtp-Source: AGHT+IFHF57uBrhTvu8f5ZlkpZEbN+EIKCOOrlJ/xDwGFjHlKczwnFciDWsBO7ej/2gsUL83YlaQtTNzXk+ATGYZekw= X-Received: by 2002:a05:6512:114a:b0:52c:8a39:83d7 with SMTP id 2adb3069b0e04-52c8a39846emr3026919e87.52.1718062274195; Mon, 10 Jun 2024 16:31:14 -0700 (PDT) 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 References: <202406081556.458FuJYN022360@gitrepo.freebsd.org> In-Reply-To: <202406081556.458FuJYN022360@gitrepo.freebsd.org> From: Ryan Libby Date: Mon, 10 Jun 2024 16:31:02 -0700 Message-ID: Subject: Re: git: 888796ade284 - main - libm: fma: correct zero sign with small inputs To: Ed Maste , kargl@freebsd.org Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spamd-Bar: --- X-Spamd-Result: default: False [-4.00 / 15.00]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_SHORT(-1.00)[-1.000]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; R_SPF_ALLOW(-0.20)[+ip6:2a00:1450:4000::/36]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20230601]; MIME_GOOD(-0.10)[text/plain]; RCVD_TLS_LAST(0.00)[]; ARC_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; TO_MATCH_ENVRCPT_ALL(0.00)[]; TO_DN_SOME(0.00)[]; FREEMAIL_FROM(0.00)[gmail.com]; RCVD_IN_DNSWL_NONE(0.00)[2a00:1450:4864:20::22e:from]; DWL_DNSWL_NONE(0.00)[gmail.com:dkim]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_FIVE(0.00)[5]; MLMMJ_DEST(0.00)[dev-commits-src-all@freebsd.org,dev-commits-src-main@freebsd.org]; MID_RHS_MATCH_FROMTLD(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; DKIM_TRACE(0.00)[gmail.com:+]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US]; RCVD_COUNT_ONE(0.00)[1]; FREEFALL_USER(0.00)[rlibby]; MISSING_XM_UA(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com] X-Rspamd-Queue-Id: 4Vyp3C3MNPz4bst On Sat, Jun 8, 2024 at 8:56=E2=80=AFAM Ed Maste wrote: > > The branch main has been updated by emaste: > > URL: https://cgit.FreeBSD.org/src/commit/?id=3D888796ade2842486d3167067e8= 034254c38aadd3 > > 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 =3D zs; /* XXX gcc CSE bug workaround= */ > - return (xy.hi + vzs + ldexp(xy.lo, spread)); > + xs =3D ldexp(xy.lo, spread); > + xy.hi +=3D vzs; > + return (xy.hi =3D=3D 0 ? xs : xy.hi + xs); > } > > if (oround !=3D 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 =3D zs; /* XXX gcc CSE bug worka= round */ > - return (xy.hi + vzs + ldexpl(xy.lo, spread)); > + xs =3D ldexpl(xy.lo, spread); > + xy.hi +=3D vzs; > + return (xy.hi =3D=3D 0 ? xs : xy.hi + xs); > } > > if (oround !=3D FE_TONEAREST) { This seems to have caused the lib/msun/fma_tests:zeroes test to fail in the FE_ROUNDDOWN mode on amd64, now finding 0 while expecting -0. I don't know if the test is wrong or too strict, or if the new result is wrong. https://ci.freebsd.org/job/FreeBSD-main-amd64-test/25249/testReport/junit/l= ib.msun/fma_test/zeroes/ Reproduces with kyua debug -k /usr/tests/Kyuafile lib/msun/fma_test:zeroes Ryan