[Bug 272742] Fixes for bugs in sinpi/cospi/tanpi

From: <bugzilla-noreply_at_freebsd.org>
Date: Tue, 01 Aug 2023 03:39:51 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=272742

Konstantin Belousov <kib@FreeBSD.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Assignee|bugs@FreeBSD.org            |kib@FreeBSD.org
                 CC|                            |kib@FreeBSD.org

--- Comment #2 from Konstantin Belousov <kib@FreeBSD.org> ---
The following change is required for ld128 platforms to build:

diff --git a/lib/msun/ld128/s_tanpil.c b/lib/msun/ld128/s_tanpil.c
index b9ec3ef50f80..52003d0bf6c5 100644
--- a/lib/msun/ld128/s_tanpil.c
+++ b/lib/msun/ld128/s_tanpil.c
@@ -28,6 +28,7 @@
  * See ../src/s_tanpi.c for implementation details.
  */

+#include "fpmath.h"
 #include "math.h"
 #include "math_private.h"

@@ -71,6 +72,8 @@ tanpil(long double x)
 {
        long double ax, hi, lo, odd, t,  xf;
        uint32_t ix;
+       uint64_t lx, llx;
+       int16_t hx;

        ax = fabsl(x);

@@ -112,6 +115,8 @@ tanpil(long double x)
        if (isinf(x) || isnan(x))
                return (vzero / vzero);

+       EXTRACT_LDBL128_WORDS(hx, lx, llx, x);
+
        /*
         * For 0x1p112 <= |x| < 0x1p113 need to determine if x is an even
         * or odd integer to set t = +0 or -0.

If you are fine with it, I will push both this PR patch, and PR 272765.

-- 
You are receiving this mail because:
You are the assignee for the bug.