From nobody Thu Oct 16 17:38:42 2025 X-Original-To: dev-commits-src-branches@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 4cnZtq1m8Kz6CrRS; Thu, 16 Oct 2025 17:38:43 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cnZtq18Gdz3whC; Thu, 16 Oct 2025 17:38:43 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1760636323; 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=wFUkpa6APG8xD7yohulAUEdJD9SY4YPgvr0l6OIkY6w=; b=jqChZunktPVWK2oMxWE7IeqXU2ALUa2CZ2WPKvO20xfGYy70xevC2NCBSVjlgJrgur3PWg YNH7Cge5UMBMgmZGd0muERokA21budyMP8IKOo2/kxemO0TuWlZ3b8yKwnWvIuR4Ad86nv vnPo4eVSe3xzsgnYpXOlsQFXB+Pp2pESb6lRJ6701YqKD1v8C9ofKsE8+0EEwPshmXQjfP kg69MchkaRu7U3p/pITQf5QHRFwSBeaTBOwzoiXj3bi3mkLNpGHs8V8wSDgN0MfMJEinUo Jz38DSFMRFIFQLuCWh3O2ZejI7WFnSZlKYkMsCwMVvjNvusDrgb/uP8UOw1xSw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1760636323; 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=wFUkpa6APG8xD7yohulAUEdJD9SY4YPgvr0l6OIkY6w=; b=DNbNldljUBKy7aLJoWbLU0WI0UFNdHXVOH2qxgFTYslUCTLrNOGvPc11G/eKH9YkkrxtLo eEngaVvxKaIFw0m4jtYSsQp2+hzojGwUCWlgoz9xsXgFat3UdvADVu5bsfVpBIWN1812B8 zTk4s+cq7TNOHNTsFZKOiHV6xh++xr8H143kdg9Wuu7NvB6OLzUKSteFFiSQqiL14rYLQD ftkd7gNU0JvB1A4yl+m79C/+O5NhG/K7UoXj34sp7JiT1d2iWzfyGaUBdNrWPUrtN+bWG7 Omtlbx2aVtqDR9FVPQjvVf5+5pPDQifTLGGxl4IhuTpPq7CjEy6hzEMW9hKo0A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1760636323; a=rsa-sha256; cv=none; b=N7KpTdpu9+TbmyOwerCBo4SpsPRooWNcNQjRPB0xeD2bU/Spxh1fCjQf/+baIvF85391PV GUZB3352Jlvyt1d39LoLVk+VOsCKvtQeU2nX4itFwPMgsQYPb1bXp4Po5RokGsLY9Cju52 MSag6zjGlzTyrVBbDoAkB+SobaXo4BuzKzi0zuNF7qNK7VIQlJEpyZX+1+ThXihsBQFIOp rGw1/WvpFDyg5aBtXTJiuPVMt44lZ7gsydA+5/MqI12BFBb6DFWC+A/OXPo9DvjWtOspNm AnPMgKRMMHySZ8GNZNw2tlim61uQR7M+GemSUIVGxQjBI5DnnqBMVeyZNs3RDg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none 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 4cnZtq0bcfz2ys; Thu, 16 Oct 2025 17:38:43 +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 59GHcgeE032328; Thu, 16 Oct 2025 17:38:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 59GHcgUC032325; Thu, 16 Oct 2025 17:38:42 GMT (envelope-from git) Date: Thu, 16 Oct 2025 17:38:42 GMT Message-Id: <202510161738.59GHcgUC032325@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Colin Percival Subject: git: 4c87cff1c8c5 - releng/15.0 - libm: remainder: make sure x is zero List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cperciva X-Git-Repository: src X-Git-Refname: refs/heads/releng/15.0 X-Git-Reftype: branch X-Git-Commit: 4c87cff1c8c53f06d8d25813fa32f1cc35657897 Auto-Submitted: auto-generated The branch releng/15.0 has been updated by cperciva: URL: https://cgit.FreeBSD.org/src/commit/?id=4c87cff1c8c53f06d8d25813fa32f1cc35657897 commit 4c87cff1c8c53f06d8d25813fa32f1cc35657897 Author: Ahmad Khalifa AuthorDate: 2025-10-10 09:30:52 +0000 Commit: Colin Percival CommitDate: 2025-10-16 17:37:22 +0000 libm: remainder: make sure x is zero Make sure the entirety of x is zero before flipping the sign bit. Otherwise the sign would be wrong for small values of x when x is negative and |n*y| > |x| Approved by: re (cperciva) Reported by: alfredo PR: 251091 Reviewed by: kargl MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D53023 (cherry picked from commit 25cca51ed294890d20a3c0290814cd26875db686) (cherry picked from commit 583e976d6d09770a6299a19603d4f0dbaa562cac) --- lib/msun/src/e_remainder.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/msun/src/e_remainder.c b/lib/msun/src/e_remainder.c index a5fb7141d01a..cc6cd320073e 100644 --- a/lib/msun/src/e_remainder.c +++ b/lib/msun/src/e_remainder.c @@ -64,8 +64,8 @@ remainder(double x, double p) if(x>=p_half) x -= p; } } - GET_HIGH_WORD(hx,x); - if ((hx&0x7fffffff)==0) hx = 0; + EXTRACT_WORDS(hx, lx, x); + if (((hx&0x7fffffff)|lx) == 0) hx = 0; SET_HIGH_WORD(x,hx^sx); return x; }