From nobody Sun May 10 16:38:21 2026 X-Original-To: bugs@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 4gD7p52BtPz6d5VB for ; Sun, 10 May 2026 16:38:21 +0000 (UTC) (envelope-from bugzilla-noreply@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 "R13" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4gD7p51RWFz48vg for ; Sun, 10 May 2026 16:38:21 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1778431101; 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: in-reply-to:in-reply-to:references:references; bh=ZEC9A8lAxKdSDfVPkvxBz6OtfUW8FTcfKxSFAtelKKs=; b=P+51ANuk544XyxV5t4Qg0JqdvbipDcqpqZH1yxnyL71hnpGn6HX5/RX3rv0GoCd6f8W3+3 WQGg6szahnzE6siTXpiL0kl9gP6pc+8g5kAmQRimuDgy8ud7Kd5Rs6KZw8gW5J6wKqRujk hZKe8XCn0wdSv/LuCnBo9ymxqU0gzuA6/q0gSUSekGCQNlcYeY8L/hvw+0fFoVJauZ89Lf 5RVMqYXDGp6Rf4DSmFePk4et8VNTEAonIVkC3cP92FF/5GLRWCKpNBk5f3r0ByLQkTcN+6 +hkVR1XD0npeGkBDr9SRMgGvKTTDemMr2JCJuIzdaHZ53AiJQBpap5KVVEexwA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1778431101; a=rsa-sha256; cv=none; b=paJOhvgqE810Zz/zo7dQVaHgxnyEOlQPuca/JPpcljRhvAigZHLvJLEZrpLId2Cy3ixmgp PaD7N4F3jT3eNincqbNhZ/nx6y8ZFEVXRRnUJbORGvm2FCj8gV6idJusPGPYDpCTu3Lf2m e7zCuqUyDEbNhwh4sd+ocf014PwREI7mfKy0mxZF0TE5OtODlH/CmDupBOwN8ZMINoS+R2 MeBIlVz2NbRHh5DczHv5wG8bKPgz579lc3C0l648ZDPRqPxS79/FuUJtlWpYhc2xuhV2Vc PmuHyAs9yd9K6j6hw3IY4yjn3NxomWtKU3h5YSdzl9Bc+Es++lNUdN9OAvVrsg== 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=1778431101; 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: in-reply-to:in-reply-to:references:references; bh=ZEC9A8lAxKdSDfVPkvxBz6OtfUW8FTcfKxSFAtelKKs=; b=dThjf26XdMlhELJIed2AsqQr742hT36bMtDOo35wf2nU89CbRirlV71IYjfliYH6pHRv/L SeiqZhDpHfRMMfSYWV3kezQn61St7BH8XTcxRr0xxa2++tjVeeErAI9leRb5eyiEqnzpbr 2vVNZM8+hEnmJ3cpDsbVidZkjmBAeb8FSRRFjITXdkd/CdO9KGSI5SsbeRZUHaOAIClsSX /miyjqN64ZBlLfOFfmOPKlzdj8Tooo6fmi+M+iJkMjymQz2lNValFHCSDoVSud1m5DhHK4 8kq/pmO3GPNsbUlFdcXjMR3nrHwQrVdIZvdHMMGUSing6P9KAYKIKwkemvcN7g== Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d]) (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 4gD7p50nj6zdp7 for ; Sun, 10 May 2026 16:38:21 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.5]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id 64AGcLrl002869 for ; Sun, 10 May 2026 16:38:21 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from bugzilla@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 64AGcLpn002868 for bugs@FreeBSD.org; Sun, 10 May 2026 16:38:21 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: bugzilla set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: bugs@FreeBSD.org Subject: [Bug 295089] [libm] implementation of rsqrt, rsqrtf, and rsqrtl. Date: Sun, 10 May 2026 16:38:21 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: bin X-Bugzilla-Version: CURRENT X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Only Me X-Bugzilla-Who: commit-hook@FreeBSD.org X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: bugs@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="UTF-8" X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated List-Id: Bug reports List-Archive: https://lists.freebsd.org/archives/freebsd-bugs List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-bugs@FreeBSD.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D295089 --- Comment #2 from commit-hook@FreeBSD.org --- A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=3D3085fc9d97bd83785ba3ba43e0378d7d6= 7987d1f commit 3085fc9d97bd83785ba3ba43e0378d7d67987d1f Author: Steve Kargl AuthorDate: 2026-05-08 14:06:08 +0000 Commit: Konstantin Belousov CommitDate: 2026-05-10 16:36:33 +0000 [libm] implementation of rsqrt, rsqrtf, and rsqrtl From the PR: The attached diff implements the inverse square root function, i.e, rsqrt(x) =3D 1 / sqrt(x). Exhaustive testing of the float version suggests that it is correctly rounded in round-to-nearest for all test values in the range [0x1p-127,0x1p126]. Exhaustive testing of rsqrt and rsqrtl cannot be done, but 1100M values of x for rsqrt and 400M values for rsqrtl were tested. All tested values were correctly rounded. I do not have access to LD128 (i.e., IEEE 128-bit floating point) hardware, so the implementation of rsqrtl() is untested. The following is a summary of changes to source code. * lib/msun/Makefile: . Add s_rsqrt.c and s_rsqrtf.c to COMMON_SRCS. . For non-53-bit long double targets, add s_rsqrtl.c to COMMON_SRCS. . Add MLINKS for rsqrt.3, rsqrtf.3, and rsqrtl.3 to sqrt.3. * lib/msun/Symbol.map: . Add rsqrt, rsqrtf, and rsqrtl to the Symbol map for shared libm.so. * lib/msun/man/sqrt.3: . Update the sqrt.3 manual page to include information for rsqrt[fl]. . Note, these function come from ISO C23 (and IEEE-754 2008). * lib/msun/src/math.h: . Add prototypes for new functions. * lib/msun/src/math_private.h: . Add _SPLIT, _FAST2SUM, _SLOW2SUM, _XADD, _MUL, and _XMUL macros to perform type-type arthimetic (i.e., float-float). * src/s_rsqrt.c: . New file with the implementation of 'double rsqrt(double)'. . For 53-bit long double targets, add a weak reference for rsqrtl. * src/s_rsqrtf.c: . New file with the implementation of 'float rsqrt(float)'. * src/s_rsqrtl.c . New file with the implementation of 'long double rsqrt(long double)= '. Note, the LD80 version uses bit twiddling and LD128 version is a straight C language implementation. The LD128 is untested due to lack of hardware. PR: 295089 MFC after: 1 week lib/msun/Makefile | 6 +- lib/msun/Symbol.map | 3 + lib/msun/man/sqrt.3 | 53 ++++++++++- lib/msun/src/math.h | 3 + lib/msun/src/math_private.h | 83 +++++++++++++++++ lib/msun/src/s_rsqrt.c (new) | 153 +++++++++++++++++++++++++++++++ lib/msun/src/s_rsqrtf.c (new) | 155 ++++++++++++++++++++++++++++++++ lib/msun/src/s_rsqrtl.c (new) | 203 ++++++++++++++++++++++++++++++++++++++= ++++ 8 files changed, 654 insertions(+), 5 deletions(-) --=20 You are receiving this mail because: You are the assignee for the bug.=