Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/2216089/?format=api
{ "id": 2216089, "url": "http://patchwork.ozlabs.org/api/patches/2216089/?format=api", "web_url": "http://patchwork.ozlabs.org/project/glibc/patch/20260325192357.1284741-9-adhemerval.zanella@linaro.org/", "project": { "id": 41, "url": "http://patchwork.ozlabs.org/api/projects/41/?format=api", "name": "GNU C Library", "link_name": "glibc", "list_id": "libc-alpha.sourceware.org", "list_email": "libc-alpha@sourceware.org", "web_url": "", "scm_url": "", "webscm_url": "", "list_archive_url": "", "list_archive_url_format": "", "commit_url_format": "" }, "msgid": "<20260325192357.1284741-9-adhemerval.zanella@linaro.org>", "list_archive_url": null, "date": "2026-03-25T19:22:26", "name": "[8/8] math: Remove unused definitions for sinf/cosf/sincosf implementation", "commit_ref": null, "pull_url": null, "state": "new", "archived": false, "hash": "9b00a66608f849001c5ca8a6f23c281d555e15ec", "submitter": { "id": 66065, "url": "http://patchwork.ozlabs.org/api/people/66065/?format=api", "name": "Adhemerval Zanella Netto", "email": "adhemerval.zanella@linaro.org" }, "delegate": null, "mbox": "http://patchwork.ozlabs.org/project/glibc/patch/20260325192357.1284741-9-adhemerval.zanella@linaro.org/mbox/", "series": [ { "id": 497503, "url": "http://patchwork.ozlabs.org/api/series/497503/?format=api", "web_url": "http://patchwork.ozlabs.org/project/glibc/list/?series=497503", "date": "2026-03-25T19:22:18", "name": "Add sinf/cosf/sincosf CORE-MATH implementations", "version": 1, "mbox": "http://patchwork.ozlabs.org/series/497503/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/2216089/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/2216089/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<libc-alpha-bounces~incoming=patchwork.ozlabs.org@sourceware.org>", "X-Original-To": [ "incoming@patchwork.ozlabs.org", "libc-alpha@sourceware.org" ], "Delivered-To": [ "patchwork-incoming@legolas.ozlabs.org", "libc-alpha@sourceware.org" ], "Authentication-Results": [ "legolas.ozlabs.org;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256\n header.s=google header.b=VIgQ4A7Q;\n\tdkim-atps=neutral", "legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=sourceware.org\n (client-ip=2620:52:6:3111::32; helo=vm01.sourceware.org;\n envelope-from=libc-alpha-bounces~incoming=patchwork.ozlabs.org@sourceware.org;\n receiver=patchwork.ozlabs.org)", "sourceware.org;\n\tdkim=pass (2048-bit key,\n unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256\n header.s=google header.b=VIgQ4A7Q", "sourceware.org;\n dmarc=pass (p=none dis=none) header.from=linaro.org", "sourceware.org; spf=pass smtp.mailfrom=linaro.org", "server2.sourceware.org;\n arc=none smtp.remote-ip=2607:f8b0:4864:20::a2c" ], "Received": [ "from vm01.sourceware.org (vm01.sourceware.org\n [IPv6:2620:52:6:3111::32])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519 server-signature ECDSA (secp384r1) server-digest SHA384)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4fgxl708RFz1y1K\n\tfor <incoming@patchwork.ozlabs.org>; Thu, 26 Mar 2026 06:28:03 +1100 (AEDT)", "from vm01.sourceware.org (localhost [127.0.0.1])\n\tby sourceware.org (Postfix) with ESMTP id 1C2604BB58E3\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 25 Mar 2026 19:28:01 +0000 (GMT)", "from mail-vk1-xa2c.google.com (mail-vk1-xa2c.google.com\n [IPv6:2607:f8b0:4864:20::a2c])\n by sourceware.org (Postfix) with ESMTPS id 0D8534BB58E0\n for <libc-alpha@sourceware.org>; Wed, 25 Mar 2026 19:24:26 +0000 (GMT)", "by mail-vk1-xa2c.google.com with SMTP id\n 71dfb90a1353d-56cfe7b2344so108761e0c.2\n for <libc-alpha@sourceware.org>; Wed, 25 Mar 2026 12:24:26 -0700 (PDT)", "from mandiga.. ([2804:1b3:a7c1:90ea:f31d:ca7d:f8dd:c20b])\n by smtp.gmail.com with ESMTPSA id\n 71dfb90a1353d-56d31d394fcsm1040021e0c.12.2026.03.25.12.24.21\n (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n Wed, 25 Mar 2026 12:24:23 -0700 (PDT)" ], "DKIM-Filter": [ "OpenDKIM Filter v2.11.0 sourceware.org 1C2604BB58E3", "OpenDKIM Filter v2.11.0 sourceware.org 0D8534BB58E0" ], "DMARC-Filter": "OpenDMARC Filter v1.4.2 sourceware.org 0D8534BB58E0", "ARC-Filter": "OpenARC Filter v1.0.0 sourceware.org 0D8534BB58E0", "ARC-Seal": "i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1774466666; cv=none;\n b=UlG/CaZ4JmP86Ch+uZyxiQVeMjbU3TccdB//dxvXS+iQvOqNRKQ5yCxr1X7GnbAfXK/CFsSlZVRq+L2pc/6Z7kQT6HigHiwZDNt1wWk6qeV5p9qpq1cqssNlejEfou7ZTFe4Epv47rWdYQV1ILxNGu2dIoZpiEQ1T8VOCF/Ay3E=", "ARC-Message-Signature": "i=1; a=rsa-sha256; d=sourceware.org; s=key;\n t=1774466666; c=relaxed/simple;\n bh=xoAdhNVrXaWnkWwFkiE1lVEUtgtgr9DXYIbtwUOqoaA=;\n h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version;\n b=EXCziDEnOtSptiqp192uj3E5//wyj0UCgZTlDi7dLf+BJmlhgxHMQ3GoJHfjhzmFQhXnX4tQy/YlFh+0+BPFXPwz2xaJHs5q3R2wHyhu0tHNA4yU3BcW8cibCA/1WyLtOuOpDRH/nX8YLCVnmxVkJA5avQN0AqN7dwtT/y5zLZA=", "ARC-Authentication-Results": "i=1; server2.sourceware.org", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=linaro.org; s=google; t=1774466665; x=1775071465; darn=sourceware.org;\n h=content-transfer-encoding:mime-version:references:in-reply-to\n :message-id:date:subject:cc:to:from:from:to:cc:subject:date\n :message-id:reply-to;\n bh=QEAxk0LyS18Qigpp6rMmTHnzXyQxA1N+oshSNMdTCmg=;\n b=VIgQ4A7QBJf7gl85V8wRCm7RKyIiD2wHCxfaK5UmBUDCpF6ATptCguivouM/Aw/4RS\n C7Xl57vyvwb8QiXsvOi+239ysTEeqSsjs+0WW7rt3AgZ5o2SHqLQQGhKAm9T5aFXeRv8\n UufxEui0m0sTPlRoaVsS86yTBbG2XLhueMhiJcEoKMDBRLJ5Ly2HcrF43RTh7cDJihOR\n NUmw6HvXmVCYy/fl4ChdtLnFyWSF14oEFKhUOT4/tXoJ44NwILvOyg/d9kHxogyxqMyq\n ia5ZhDDgSPKMM1kxayK/ijRWYwEOGVNCbh6aVLYVoglLSVEHTLfPQN7O3pgbuUJ2176i\n F17A==", "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20251104; t=1774466665; x=1775071465;\n h=content-transfer-encoding:mime-version:references:in-reply-to\n :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from\n :to:cc:subject:date:message-id:reply-to;\n bh=QEAxk0LyS18Qigpp6rMmTHnzXyQxA1N+oshSNMdTCmg=;\n b=ogCpVBO26hfCuGvmield4R5Bi9/kGjnhvoBjGxPCl3F3Ac4zt0L6i1f1Gvq8Va3ZpE\n f1EYLavr73vD1OwmHCeSAqJmhpOn9gTmVoz0a7thZ8G+hsEtJ/J1XFW6+NojGMzN6cHq\n P4V07SvebkPU5uwUAyAu0lJLi47HIrk00Oq6YZ4ARTzjUk5iTmQ0nQnaAJh2vz/OxEkX\n oe33Wc3pYWtlk+r9Mb7YwiqQqUYCfXhcYTfYHvmyZR4M635kMrTlUdjhKCZzzM0vKB6s\n sRE41Rl4VhIlqkzF/uOPGJTN18/5l5iHaDMvRyE2Y4Qmm0QGmrle4f/hC634bhMd2jqq\n 4t6g==", "X-Gm-Message-State": "AOJu0YyxAj9V5h/ZiBOtkK2wGAudI1G7TpruL4tjykHCNZEwa9beLuNU\n NmlZBAN+0HS8V9M2bgjeMgu638lyYwmVwc89hDDYeS0YwIo7WfbqRiHhcWd0Vj8O5ozmAOlP6Tq\n +1C5V", "X-Gm-Gg": "ATEYQzyKXt8vjVPKsFIlZYfaTnGaAwYw6N8Y+u8RXRiZPbzmLg/mcDYTbK4ytNwNli3\n LetnhtZ7QRjiE9LjTMtKNvX5Nw4bAgIYgXtcDawf/llc/wSvqF6h833gwAa3G+/FDG34XNYMFPf\n cI6O8k8esxFBEam3uqXVPoHlFLATxt6Dcpuh1pP5cS3JPUXYrBULu2LyBl+DvP7MiARn7b2X+nq\n GbuHlvnD94aMklCr5z8W73wn7IuV6lMwXH0gbSp29hZBAp0x5/r2ZII2GBNA+1plPvygfidK0RB\n XCaJId7D5+miGZZoOC3+ynipnKZfcJTP4eU1pTzojmX9wCn5/qBOZwEdxvNAXw8ofuiMk88oSOy\n lfy1A9tsrpu0TNXWfjH1TotGRotK0Gf1huuWIMWWAudkO33iHp+0CQ9I3Vkmnl4aRyBVzsMkoSR\n 9Fh4AnKnaNg9Tvi3BBd07xcuAzPAhL9XI2ZZE=", "X-Received": "by 2002:a05:6122:8ce:b0:56c:d623:8967 with SMTP id\n 71dfb90a1353d-56d220be51cmr2367252e0c.15.1774466664434;\n Wed, 25 Mar 2026 12:24:24 -0700 (PDT)", "From": "Adhemerval Zanella <adhemerval.zanella@linaro.org>", "To": "libc-alpha@sourceware.org", "Cc": "Paul Zimmermann <Paul.Zimmermann@inria.fr>,\n\tDJ Delorie <dj@redhat.com>", "Subject": "[PATCH 8/8] math: Remove unused definitions for sinf/cosf/sincosf\n implementation", "Date": "Wed, 25 Mar 2026 16:22:26 -0300", "Message-ID": "<20260325192357.1284741-9-adhemerval.zanella@linaro.org>", "X-Mailer": "git-send-email 2.43.0", "In-Reply-To": "<20260325192357.1284741-1-adhemerval.zanella@linaro.org>", "References": "<20260325192357.1284741-1-adhemerval.zanella@linaro.org>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "X-BeenThere": "libc-alpha@sourceware.org", "X-Mailman-Version": "2.1.30", "Precedence": "list", "List-Id": "Libc-alpha mailing list <libc-alpha.sourceware.org>", "List-Unsubscribe": "<https://sourceware.org/mailman/options/libc-alpha>,\n <mailto:libc-alpha-request@sourceware.org?subject=unsubscribe>", "List-Archive": "<https://sourceware.org/pipermail/libc-alpha/>", "List-Post": "<mailto:libc-alpha@sourceware.org>", "List-Help": "<mailto:libc-alpha-request@sourceware.org?subject=help>", "List-Subscribe": "<https://sourceware.org/mailman/listinfo/libc-alpha>,\n <mailto:libc-alpha-request@sourceware.org?subject=subscribe>", "Errors-To": "libc-alpha-bounces~incoming=patchwork.ozlabs.org@sourceware.org" }, "content": "The reduce_large function has been moved to reduce_aux.h, since it is\nno longer used in the sinf/cosf/sincosf implementation. The\n__inv_pio4 is also moved to a new TU (reduce_aux_data).\n\nThe x86-specific sincosf_poly.h is no longer required.\n\nChecked on x86_64-linux-gnu, i686-linux-gnu, aarch64-linux-gnu,\nand powerpc64le-linux-gnu.\n---\n math/Makefile | 1 +\n sysdeps/ieee754/flt-32/reduce_aux.h | 38 ++++-\n .../flt-32/reduce_aux_data.c} | 39 +----\n sysdeps/ieee754/flt-32/s_sincosf.h | 95 -----------\n sysdeps/ieee754/flt-32/s_sincosf_data.c | 157 ++++++++++--------\n sysdeps/ieee754/flt-32/s_sincosf_data.h | 2 +\n .../ieee754/flt-32/s_sincosf_data_generic.c | 103 ------------\n sysdeps/ieee754/flt-32/sincosf_poly.h | 87 ----------\n sysdeps/x86/fpu/sincosf_poly.h | 111 -------------\n 9 files changed, 133 insertions(+), 500 deletions(-)\n rename sysdeps/{x86/fpu/s_sincosf_data.c => ieee754/flt-32/reduce_aux_data.c} (57%)\n delete mode 100644 sysdeps/ieee754/flt-32/s_sincosf.h\n delete mode 100644 sysdeps/ieee754/flt-32/s_sincosf_data_generic.c\n delete mode 100644 sysdeps/ieee754/flt-32/sincosf_poly.h\n delete mode 100644 sysdeps/x86/fpu/sincosf_poly.h", "diff": "diff --git a/math/Makefile b/math/Makefile\nindex eaea4c77b9..69995406bd 100644\n--- a/math/Makefile\n+++ b/math/Makefile\n@@ -386,6 +386,7 @@ type-float-routines := \\\n e_powf_log2_data \\\n e_sincoshf_data \\\n math_errf \\\n+ reduce_aux_data \\\n s_asincosf_data \\\n s_asincoshf_data \\\n s_asincospif_data \\\ndiff --git a/sysdeps/ieee754/flt-32/reduce_aux.h b/sysdeps/ieee754/flt-32/reduce_aux.h\nindex b20c4c0c03..3dd77518ff 100644\n--- a/sysdeps/ieee754/flt-32/reduce_aux.h\n+++ b/sysdeps/ieee754/flt-32/reduce_aux.h\n@@ -21,7 +21,43 @@\n \n #include <math.h>\n #include <math_private.h>\n-#include <s_sincosf.h>\n+#include \"math_config.h\"\n+\n+/* 2PI * 2^-64. */\n+static const double pi63 = 0x1.921FB54442D18p-62;\n+\n+/* Table with 4/PI to 192 bit precision. */\n+extern const uint32_t __inv_pio4[] attribute_hidden;\n+\n+/* Reduce the range of XI to a multiple of PI/2 using fast integer arithmetic.\n+ XI is a reinterpreted float and must be >= 2.0f (the sign bit is ignored).\n+ Return the modulo between -PI/4 and PI/4 and store the quadrant in NP.\n+ Reduction uses a table of 4/PI with 192 bits of precision. A 32x96->128 bit\n+ multiply computes the exact 2.62-bit fixed-point modulo. Since the result\n+ can have at most 29 leading zeros after the binary point, the double\n+ precision result is accurate to 33 bits. */\n+static inline double\n+reduce_large (uint32_t xi, int *np)\n+{\n+ const uint32_t *arr = &__inv_pio4[(xi >> 26) & 15];\n+ int shift = (xi >> 23) & 7;\n+ uint64_t n, res0, res1, res2;\n+\n+ xi = (xi & 0xffffff) | 0x800000;\n+ xi <<= shift;\n+\n+ res0 = xi * arr[0];\n+ res1 = (uint64_t)xi * arr[4];\n+ res2 = (uint64_t)xi * arr[8];\n+ res0 = (res2 >> 32) | (res0 << 32);\n+ res0 += res1;\n+\n+ n = (res0 + (1ULL << 61)) >> 62;\n+ res0 -= n << 62;\n+ double x = (int64_t)res0;\n+ *np = n;\n+ return x * pi63;\n+}\n \n /* Return h and update n such that:\n Now x - pi/4 - alpha = h + n*pi/2 mod (2*pi). */\ndiff --git a/sysdeps/x86/fpu/s_sincosf_data.c b/sysdeps/ieee754/flt-32/reduce_aux_data.c\nsimilarity index 57%\nrename from sysdeps/x86/fpu/s_sincosf_data.c\nrename to sysdeps/ieee754/flt-32/reduce_aux_data.c\nindex 8e96ecb86e..62abd44d11 100644\n--- a/sysdeps/x86/fpu/s_sincosf_data.c\n+++ b/sysdeps/ieee754/flt-32/reduce_aux_data.c\n@@ -18,42 +18,7 @@\n \n #include <stdint.h>\n #include <math.h>\n-#include <sysdeps/ieee754/flt-32/math_config.h>\n-#include <s_sincosf.h>\n-\n-/* The constants and polynomials for sine and cosine. The 2nd entry\n- computes -cos (x) rather than cos (x) to get negation for free. */\n-const sincos_t __sincosf_table[2] =\n-{\n- {\n- { 1.0, -1.0, -1.0, 1.0 },\n-#if TOINT_INTRINSICS\n- 0x1.45F306DC9C883p-1,\n-#else\n- 0x1.45F306DC9C883p+23,\n-#endif\n- 0x1.921FB54442D18p0,\n- 0x1p0,\n- -0x1.ffffffd0c621cp-2,\n- { -0x1.555545995a603p-3, 0x1.55553e1068f19p-5 },\n- { 0x1.1107605230bc4p-7, -0x1.6c087e89a359dp-10 },\n- { -0x1.994eb3774cf24p-13, 0x1.99343027bf8c3p-16 }\n- },\n- {\n- { 1.0, -1.0, -1.0, 1.0 },\n-#if TOINT_INTRINSICS\n- 0x1.45F306DC9C883p-1,\n-#else\n- 0x1.45F306DC9C883p+23,\n-#endif\n- 0x1.921FB54442D18p0,\n- -0x1p0,\n- 0x1.ffffffd0c621cp-2,\n- { -0x1.555545995a603p-3, -0x1.55553e1068f19p-5 },\n- { 0x1.1107605230bc4p-7, 0x1.6c087e89a359dp-10 },\n- { -0x1.994eb3774cf24p-13, -0x1.99343027bf8c3p-16 }\n- }\n-};\n+#include \"math_config.h\"\n \n /* Table with 4/PI to 192 bit precision. To avoid unaligned accesses\n only 8 new bits are added per entry, making the table 4 times larger. */\n@@ -66,5 +31,3 @@ const uint32_t __inv_pio4[24] =\n 0x34ddc0db, 0xddc0db62, 0xc0db6295, 0xdb629599,\n 0x6295993c, 0x95993c43, 0x993c4390, 0x3c439041\n };\n-\n-#include <sysdeps/ieee754/flt-32/s_sincosf_data_generic.c>\ndiff --git a/sysdeps/ieee754/flt-32/s_sincosf.h b/sysdeps/ieee754/flt-32/s_sincosf.h\ndeleted file mode 100644\nindex 553bac9eac..0000000000\n--- a/sysdeps/ieee754/flt-32/s_sincosf.h\n+++ /dev/null\n@@ -1,95 +0,0 @@\n-/* Used by sinf, cosf and sincosf functions.\n- Copyright (C) 2018-2026 Free Software Foundation, Inc.\n- This file is part of the GNU C Library.\n-\n- The GNU C Library is free software; you can redistribute it and/or\n- modify it under the terms of the GNU Lesser General Public\n- License as published by the Free Software Foundation; either\n- version 2.1 of the License, or (at your option) any later version.\n-\n- The GNU C Library is distributed in the hope that it will be useful,\n- but WITHOUT ANY WARRANTY; without even the implied warranty of\n- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\n- Lesser General Public License for more details.\n-\n- You should have received a copy of the GNU Lesser General Public\n- License along with the GNU C Library; if not, see\n- <https://www.gnu.org/licenses/>. */\n-\n-#include <stdint.h>\n-#include <math.h>\n-#include \"math_config.h\"\n-#include <sincosf_poly.h>\n-\n-/* 2PI * 2^-64. */\n-static const double pi63 = 0x1.921FB54442D18p-62;\n-/* PI / 4. */\n-static const float pio4 = 0x1.921FB6p-1f;\n-\n-/* Polynomial data (the cosine polynomial is negated in the 2nd entry). */\n-extern const sincos_t __sincosf_table[2] attribute_hidden;\n-\n-/* Table with 4/PI to 192 bit precision. */\n-extern const uint32_t __inv_pio4[] attribute_hidden;\n-\n-/* Top 12 bits of the float representation with the sign bit cleared. */\n-static inline uint32_t\n-abstop12 (float x)\n-{\n- return (asuint (x) >> 20) & 0x7ff;\n-}\n-\n-/* Fast range reduction using single multiply-subtract. Return the modulo of\n- X as a value between -PI/4 and PI/4 and store the quadrant in NP.\n- The values for PI/2 and 2/PI are accessed via P. Since PI/2 as a double\n- is accurate to 55 bits and the worst-case cancellation happens at 6 * PI/4,\n- the result is accurate for |X| <= 120.0. */\n-static inline double\n-reduce_fast (double x, const sincos_t *p, int *np)\n-{\n- double r;\n-#if TOINT_INTRINSICS\n- /* Use fast round and lround instructions when available. */\n- r = x * p->hpi_inv;\n- *np = converttoint (r);\n- return x - roundtoint (r) * p->hpi;\n-#else\n- /* Use scaled float to int conversion with explicit rounding.\n- hpi_inv is prescaled by 2^24 so the quadrant ends up in bits 24..31.\n- This avoids inaccuracies introduced by truncating negative values. */\n- r = x * p->hpi_inv;\n- int n = ((int32_t)r + 0x800000) >> 24;\n- *np = n;\n- return x - n * p->hpi;\n-#endif\n-}\n-\n-/* Reduce the range of XI to a multiple of PI/2 using fast integer arithmetic.\n- XI is a reinterpreted float and must be >= 2.0f (the sign bit is ignored).\n- Return the modulo between -PI/4 and PI/4 and store the quadrant in NP.\n- Reduction uses a table of 4/PI with 192 bits of precision. A 32x96->128 bit\n- multiply computes the exact 2.62-bit fixed-point modulo. Since the result\n- can have at most 29 leading zeros after the binary point, the double\n- precision result is accurate to 33 bits. */\n-static inline double\n-reduce_large (uint32_t xi, int *np)\n-{\n- const uint32_t *arr = &__inv_pio4[(xi >> 26) & 15];\n- int shift = (xi >> 23) & 7;\n- uint64_t n, res0, res1, res2;\n-\n- xi = (xi & 0xffffff) | 0x800000;\n- xi <<= shift;\n-\n- res0 = xi * arr[0];\n- res1 = (uint64_t)xi * arr[4];\n- res2 = (uint64_t)xi * arr[8];\n- res0 = (res2 >> 32) | (res0 << 32);\n- res0 += res1;\n-\n- n = (res0 + (1ULL << 61)) >> 62;\n- res0 -= n << 62;\n- double x = (int64_t)res0;\n- *np = n;\n- return x * pi63;\n-}\ndiff --git a/sysdeps/ieee754/flt-32/s_sincosf_data.c b/sysdeps/ieee754/flt-32/s_sincosf_data.c\nindex 8c914a8bf6..2a85b687dd 100644\n--- a/sysdeps/ieee754/flt-32/s_sincosf_data.c\n+++ b/sysdeps/ieee754/flt-32/s_sincosf_data.c\n@@ -1,76 +1,103 @@\n-/* Compute sine and cosine of argument.\n- Copyright (C) 2018-2026 Free Software Foundation, Inc.\n- This file is part of the GNU C Library.\n+/* Correctly-rounded sine of binary32 value.\n+ \n+Copyright (c) 2022-2026 Alexei Sibidanov.\n+ \n+The original version of this file was copied from the CORE-MATH\n+project (file src/binary32/cosh/coshf.c, revision 8ea8ea35.\n \n- The GNU C Library is free software; you can redistribute it and/or\n- modify it under the terms of the GNU Lesser General Public\n- License as published by the Free Software Foundation; either\n- version 2.1 of the License, or (at your option) any later version.\n+Permission is hereby granted, free of charge, to any person obtaining a copy\n+of this software and associated documentation files (the \"Software\"), to deal\n+in the Software without restriction, including without limitation the rights\n+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n+copies of the Software, and to permit persons to whom the Software is\n+furnished to do so, subject to the following conditions:\n \n- The GNU C Library is distributed in the hope that it will be useful,\n- but WITHOUT ANY WARRANTY; without even the implied warranty of\n- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\n- Lesser General Public License for more details.\n+The above copyright notice and this permission notice shall be included in all\n+copies or substantial portions of the Software.\n \n- You should have received a copy of the GNU Lesser General Public\n- License along with the GNU C Library; if not, see\n- <https://www.gnu.org/licenses/>. */\n+THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n+SOFTWARE.\n+*/\n \n-#include <stdint.h>\n-#include <math.h>\n-#include \"math_config.h\"\n-#include \"s_sincosf.h\"\n+#include <s_sincosf_data.h>\n \n-/* The constants and polynomials for sine and cosine. The 2nd entry\n- computes -cos (x) rather than cos (x) to get negation for free. */\n-const sincos_t __sincosf_table[2] =\n+const uint64_t __sinf_ipi[] =\n {\n- {\n- { 1.0, -1.0, -1.0, 1.0 },\n-#if TOINT_INTRINSICS\n- 0x1.45F306DC9C883p-1,\n-#else\n- 0x1.45F306DC9C883p+23,\n-#endif\n- 0x1.921FB54442D18p0,\n- 0x1p0,\n- -0x1.ffffffd0c621cp-2,\n- 0x1.55553e1068f19p-5,\n- -0x1.6c087e89a359dp-10,\n- 0x1.99343027bf8c3p-16,\n- -0x1.555545995a603p-3,\n- 0x1.1107605230bc4p-7,\n- -0x1.994eb3774cf24p-13\n- },\n- {\n- { 1.0, -1.0, -1.0, 1.0 },\n-#if TOINT_INTRINSICS\n- 0x1.45F306DC9C883p-1,\n-#else\n- 0x1.45F306DC9C883p+23,\n-#endif\n- 0x1.921FB54442D18p0,\n- -0x1p0,\n- 0x1.ffffffd0c621cp-2,\n- -0x1.55553e1068f19p-5,\n- 0x1.6c087e89a359dp-10,\n- -0x1.99343027bf8c3p-16,\n- -0x1.555545995a603p-3,\n- 0x1.1107605230bc4p-7,\n- -0x1.994eb3774cf24p-13\n- }\n+ 0xfe5163abdebbc562, 0xdb6295993c439041, 0xfc2757d1f534ddc0,\n+ 0xa2f9836e4e441529\n };\n \n-/* Table with 4/PI to 192 bit precision. To avoid unaligned accesses\n- only 8 new bits are added per entry, making the table 4 times larger. */\n-const uint32_t __inv_pio4[24] =\n+const double __sinf_b[] =\n {\n- 0xa2, 0xa2f9,\t 0xa2f983, 0xa2f9836e,\n- 0xf9836e4e, 0x836e4e44, 0x6e4e4415, 0x4e441529,\n- 0x441529fc, 0x1529fc27, 0x29fc2757, 0xfc2757d1,\n- 0x2757d1f5, 0x57d1f534, 0xd1f534dd, 0xf534ddc0,\n- 0x34ddc0db, 0xddc0db62, 0xc0db6295, 0xdb629599,\n- 0x6295993c, 0x95993c43, 0x993c4390, 0x3c439041\n+ 0x1.3bd3cc9be45dcp-6, -0x1.03c1f081b0833p-14, 0x1.55d3c6fc9ac1fp-24,\n+ -0x1.e1d3ff281b40dp-35\n+};\n+const double __sinf_a[] =\n+{\n+ 0x1.921fb54442d17p-3, -0x1.4abbce6256a39p-10, 0x1.466bc5a518c16p-19,\n+ -0x1.32bdc61074ff6p-29\n+};\n+const double __sinf_tb[] =\n+{\n+ 0x0p+0, 0x1.8f8b83c69a60bp-3, 0x1.87de2a6aea963p-2,\n+ 0x1.1c73b39ae68c8p-1, 0x1.6a09e667f3bcdp-1, 0x1.a9b66290ea1a3p-1,\n+ 0x1.d906bcf328d46p-1, 0x1.f6297cff75cbp-1, 0x1p+0,\n+ 0x1.f6297cff75cbp-1, 0x1.d906bcf328d46p-1, 0x1.a9b66290ea1a3p-1,\n+ 0x1.6a09e667f3bcdp-1, 0x1.1c73b39ae68c8p-1, 0x1.87de2a6aea963p-2,\n+ 0x1.8f8b83c69a60bp-3, 0x0p+0, -0x1.8f8b83c69a60bp-3,\n+ -0x1.87de2a6aea963p-2, -0x1.1c73b39ae68c8p-1, -0x1.6a09e667f3bcdp-1,\n+ -0x1.a9b66290ea1a3p-1, -0x1.d906bcf328d46p-1, -0x1.f6297cff75cbp-1,\n+ -0x1p+0, -0x1.f6297cff75cbp-1, -0x1.d906bcf328d46p-1,\n+ -0x1.a9b66290ea1a3p-1, -0x1.6a09e667f3bcdp-1, -0x1.1c73b39ae68c8p-1,\n+ -0x1.87de2a6aea963p-2, -0x1.8f8b83c69a60bp-3\n };\n \n-#include <sysdeps/ieee754/flt-32/s_sincosf_data_generic.c>\n+const double __cosf_tb[] =\n+{\n+ 0x1p+0, 0x1.f6297cff75cbp-1, 0x1.d906bcf328d46p-1,\n+ 0x1.a9b66290ea1a3p-1, 0x1.6a09e667f3bcdp-1, 0x1.1c73b39ae68c8p-1,\n+ 0x1.87de2a6aea963p-2, 0x1.8f8b83c69a60bp-3, 0x0p+0,\n+ -0x1.8f8b83c69a60bp-3, -0x1.87de2a6aea963p-2, -0x1.1c73b39ae68c8p-1,\n+ -0x1.6a09e667f3bcdp-1, -0x1.a9b66290ea1a3p-1, -0x1.d906bcf328d46p-1,\n+ -0x1.f6297cff75cbp-1, -0x1p+0, -0x1.f6297cff75cbp-1,\n+ -0x1.d906bcf328d46p-1, -0x1.a9b66290ea1a3p-1, -0x1.6a09e667f3bcdp-1,\n+ -0x1.1c73b39ae68c8p-1, -0x1.87de2a6aea963p-2, -0x1.8f8b83c69a60bp-3,\n+ 0x0p+0, 0x1.8f8b83c69a60bp-3, 0x1.87de2a6aea963p-2,\n+ 0x1.1c73b39ae68c8p-1, 0x1.6a09e667f3bcdp-1, 0x1.a9b66290ea1a3p-1,\n+ 0x1.d906bcf328d46p-1, 0x1.f6297cff75cbp-1\n+};\n+\n+const sincosf_database_t __sinf_st[] =\n+{\n+ { { 0x1.33333p+13 }, -0x1.63f4bap-2, -0x1p-27 },\n+ { { 0x1.75b8a2p-1 }, 0x1.55688ap-1, -0x1p-26 },\n+ { { 0x1.4f0654p+0 }, 0x1.ee836cp-1, -0x1p-26 },\n+ { { 0x1.2d97c8p+3 }, -0x1.99bc5ap-26, -0x1p-51 },\n+};\n+\n+const sincosf_database_t __cosf_st[] =\n+{\n+ { { 0x1.2d97c8p+2 }, 0x1.99bc5cp-27, -0x1p-52 },\n+ { { 0x1.4555p+51 }, 0x1.115d7ep-1, -0x1p-26 },\n+ { { 0x1.48a858p+54 }, 0x1.f48148p-2, 0x1p-27 },\n+ { { 0x1.3170fp+63 }, 0x1.fe2976p-1, 0x1p-26 },\n+ { { 0x1.2b9622p+67 }, 0x1.f0285ep-1, -0x1p-26 },\n+};\n+\n+const sincosf2_database_t __sincosf_st[] =\n+{\n+ { { 0x1.33333p+13 }, -0x1.63f4bap-2, -0x1p-27, -0x1.e01216p-1, -0x1p-26 },\n+ { { 0x1.75b8a2p-1 }, 0x1.55688ap-1, -0x1p-26, 0x1.7d8e1ep-1, 0x1p-26 },\n+ { { 0x1.4f0654p+0 }, 0x1.ee836cp-1, -0x1p-26, 0x1.09558p-2, -0x1p-27 },\n+ { { 0x1.2d97c8p+3 }, -0x1.99bc5ap-26, -0x1p-51, -0x1p+0, 0x1p-25 },\n+ { { 0x1.2d97c8p+2 }, -0x1p+0, 0x1p-25, 0x1.99bc5cp-27, -0x1p-52 },\n+ { { 0x1.4555p+51 }, -0x1.b0ea44p-1, 0x1p-26, 0x1.115d7ep-1, -0x1p-26 },\n+ { { 0x1.48a858p+54 }, 0x1.beac8cp-1, 0x1p-26, 0x1.f48148p-2, 0x1p-27 },\n+ { { 0x1.3170fp+63 }, 0x1.5ac1eep-4, -0x1p-30, 0x1.fe2976p-1, 0x1p-26 },\n+ { { 0x1.2b9622p+67 }, -0x1.f983c2p-3, 0x1p-28, 0x1.f0285ep-1, -0x1p-26 },\n+};\ndiff --git a/sysdeps/ieee754/flt-32/s_sincosf_data.h b/sysdeps/ieee754/flt-32/s_sincosf_data.h\nindex 354e9b6a88..ca7164de52 100644\n--- a/sysdeps/ieee754/flt-32/s_sincosf_data.h\n+++ b/sysdeps/ieee754/flt-32/s_sincosf_data.h\n@@ -19,6 +19,8 @@\n #ifndef _S_SINCOSF_DATA_H\n #define _S_SINCOSF_DATA_H\n \n+#include <stdint.h>\n+\n extern const uint64_t __sinf_ipi[] attribute_hidden;\n #define IPI __sinf_ipi\n \ndiff --git a/sysdeps/ieee754/flt-32/s_sincosf_data_generic.c b/sysdeps/ieee754/flt-32/s_sincosf_data_generic.c\ndeleted file mode 100644\nindex 2a85b687dd..0000000000\n--- a/sysdeps/ieee754/flt-32/s_sincosf_data_generic.c\n+++ /dev/null\n@@ -1,103 +0,0 @@\n-/* Correctly-rounded sine of binary32 value.\n- \n-Copyright (c) 2022-2026 Alexei Sibidanov.\n- \n-The original version of this file was copied from the CORE-MATH\n-project (file src/binary32/cosh/coshf.c, revision 8ea8ea35.\n-\n-Permission is hereby granted, free of charge, to any person obtaining a copy\n-of this software and associated documentation files (the \"Software\"), to deal\n-in the Software without restriction, including without limitation the rights\n-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n-copies of the Software, and to permit persons to whom the Software is\n-furnished to do so, subject to the following conditions:\n-\n-The above copyright notice and this permission notice shall be included in all\n-copies or substantial portions of the Software.\n-\n-THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n-SOFTWARE.\n-*/\n-\n-#include <s_sincosf_data.h>\n-\n-const uint64_t __sinf_ipi[] =\n-{\n- 0xfe5163abdebbc562, 0xdb6295993c439041, 0xfc2757d1f534ddc0,\n- 0xa2f9836e4e441529\n-};\n-\n-const double __sinf_b[] =\n-{\n- 0x1.3bd3cc9be45dcp-6, -0x1.03c1f081b0833p-14, 0x1.55d3c6fc9ac1fp-24,\n- -0x1.e1d3ff281b40dp-35\n-};\n-const double __sinf_a[] =\n-{\n- 0x1.921fb54442d17p-3, -0x1.4abbce6256a39p-10, 0x1.466bc5a518c16p-19,\n- -0x1.32bdc61074ff6p-29\n-};\n-const double __sinf_tb[] =\n-{\n- 0x0p+0, 0x1.8f8b83c69a60bp-3, 0x1.87de2a6aea963p-2,\n- 0x1.1c73b39ae68c8p-1, 0x1.6a09e667f3bcdp-1, 0x1.a9b66290ea1a3p-1,\n- 0x1.d906bcf328d46p-1, 0x1.f6297cff75cbp-1, 0x1p+0,\n- 0x1.f6297cff75cbp-1, 0x1.d906bcf328d46p-1, 0x1.a9b66290ea1a3p-1,\n- 0x1.6a09e667f3bcdp-1, 0x1.1c73b39ae68c8p-1, 0x1.87de2a6aea963p-2,\n- 0x1.8f8b83c69a60bp-3, 0x0p+0, -0x1.8f8b83c69a60bp-3,\n- -0x1.87de2a6aea963p-2, -0x1.1c73b39ae68c8p-1, -0x1.6a09e667f3bcdp-1,\n- -0x1.a9b66290ea1a3p-1, -0x1.d906bcf328d46p-1, -0x1.f6297cff75cbp-1,\n- -0x1p+0, -0x1.f6297cff75cbp-1, -0x1.d906bcf328d46p-1,\n- -0x1.a9b66290ea1a3p-1, -0x1.6a09e667f3bcdp-1, -0x1.1c73b39ae68c8p-1,\n- -0x1.87de2a6aea963p-2, -0x1.8f8b83c69a60bp-3\n-};\n-\n-const double __cosf_tb[] =\n-{\n- 0x1p+0, 0x1.f6297cff75cbp-1, 0x1.d906bcf328d46p-1,\n- 0x1.a9b66290ea1a3p-1, 0x1.6a09e667f3bcdp-1, 0x1.1c73b39ae68c8p-1,\n- 0x1.87de2a6aea963p-2, 0x1.8f8b83c69a60bp-3, 0x0p+0,\n- -0x1.8f8b83c69a60bp-3, -0x1.87de2a6aea963p-2, -0x1.1c73b39ae68c8p-1,\n- -0x1.6a09e667f3bcdp-1, -0x1.a9b66290ea1a3p-1, -0x1.d906bcf328d46p-1,\n- -0x1.f6297cff75cbp-1, -0x1p+0, -0x1.f6297cff75cbp-1,\n- -0x1.d906bcf328d46p-1, -0x1.a9b66290ea1a3p-1, -0x1.6a09e667f3bcdp-1,\n- -0x1.1c73b39ae68c8p-1, -0x1.87de2a6aea963p-2, -0x1.8f8b83c69a60bp-3,\n- 0x0p+0, 0x1.8f8b83c69a60bp-3, 0x1.87de2a6aea963p-2,\n- 0x1.1c73b39ae68c8p-1, 0x1.6a09e667f3bcdp-1, 0x1.a9b66290ea1a3p-1,\n- 0x1.d906bcf328d46p-1, 0x1.f6297cff75cbp-1\n-};\n-\n-const sincosf_database_t __sinf_st[] =\n-{\n- { { 0x1.33333p+13 }, -0x1.63f4bap-2, -0x1p-27 },\n- { { 0x1.75b8a2p-1 }, 0x1.55688ap-1, -0x1p-26 },\n- { { 0x1.4f0654p+0 }, 0x1.ee836cp-1, -0x1p-26 },\n- { { 0x1.2d97c8p+3 }, -0x1.99bc5ap-26, -0x1p-51 },\n-};\n-\n-const sincosf_database_t __cosf_st[] =\n-{\n- { { 0x1.2d97c8p+2 }, 0x1.99bc5cp-27, -0x1p-52 },\n- { { 0x1.4555p+51 }, 0x1.115d7ep-1, -0x1p-26 },\n- { { 0x1.48a858p+54 }, 0x1.f48148p-2, 0x1p-27 },\n- { { 0x1.3170fp+63 }, 0x1.fe2976p-1, 0x1p-26 },\n- { { 0x1.2b9622p+67 }, 0x1.f0285ep-1, -0x1p-26 },\n-};\n-\n-const sincosf2_database_t __sincosf_st[] =\n-{\n- { { 0x1.33333p+13 }, -0x1.63f4bap-2, -0x1p-27, -0x1.e01216p-1, -0x1p-26 },\n- { { 0x1.75b8a2p-1 }, 0x1.55688ap-1, -0x1p-26, 0x1.7d8e1ep-1, 0x1p-26 },\n- { { 0x1.4f0654p+0 }, 0x1.ee836cp-1, -0x1p-26, 0x1.09558p-2, -0x1p-27 },\n- { { 0x1.2d97c8p+3 }, -0x1.99bc5ap-26, -0x1p-51, -0x1p+0, 0x1p-25 },\n- { { 0x1.2d97c8p+2 }, -0x1p+0, 0x1p-25, 0x1.99bc5cp-27, -0x1p-52 },\n- { { 0x1.4555p+51 }, -0x1.b0ea44p-1, 0x1p-26, 0x1.115d7ep-1, -0x1p-26 },\n- { { 0x1.48a858p+54 }, 0x1.beac8cp-1, 0x1p-26, 0x1.f48148p-2, 0x1p-27 },\n- { { 0x1.3170fp+63 }, 0x1.5ac1eep-4, -0x1p-30, 0x1.fe2976p-1, 0x1p-26 },\n- { { 0x1.2b9622p+67 }, -0x1.f983c2p-3, 0x1p-28, 0x1.f0285ep-1, -0x1p-26 },\n-};\ndiff --git a/sysdeps/ieee754/flt-32/sincosf_poly.h b/sysdeps/ieee754/flt-32/sincosf_poly.h\ndeleted file mode 100644\nindex ee862919e8..0000000000\n--- a/sysdeps/ieee754/flt-32/sincosf_poly.h\n+++ /dev/null\n@@ -1,87 +0,0 @@\n-/* Used by sinf, cosf and sincosf functions.\n- Copyright (C) 2018-2026 Free Software Foundation, Inc.\n- This file is part of the GNU C Library.\n-\n- The GNU C Library is free software; you can redistribute it and/or\n- modify it under the terms of the GNU Lesser General Public\n- License as published by the Free Software Foundation; either\n- version 2.1 of the License, or (at your option) any later version.\n-\n- The GNU C Library is distributed in the hope that it will be useful,\n- but WITHOUT ANY WARRANTY; without even the implied warranty of\n- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\n- Lesser General Public License for more details.\n-\n- You should have received a copy of the GNU Lesser General Public\n- License along with the GNU C Library; if not, see\n- <https://www.gnu.org/licenses/>. */\n-\n-/* The constants and polynomials for sine and cosine. */\n-typedef struct\n-{\n- double sign[4];\t\t/* Sign of sine in quadrants 0..3. */\n- double hpi_inv;\t\t/* 2 / PI ( * 2^24 if !TOINT_INTRINSICS). */\n- double hpi;\t\t\t/* PI / 2. */\n- double c0, c1, c2, c3, c4;\t/* Cosine polynomial. */\n- double s1, s2, s3;\t\t/* Sine polynomial. */\n-} sincos_t;\n-\n-/* Compute the sine and cosine of inputs X and X2 (X squared), using the\n- polynomial P and store the results in SINP and COSP. N is the quadrant,\n- if odd the cosine and sine polynomials are swapped. */\n-static inline void\n-sincosf_poly (double x, double x2, const sincos_t *p, int n, float *sinp,\n-\t float *cosp)\n-{\n- double x3, x4, x5, x6, s, c, c1, c2, s1;\n-\n- x4 = x2 * x2;\n- x3 = x2 * x;\n- c2 = p->c3 + x2 * p->c4;\n- s1 = p->s2 + x2 * p->s3;\n-\n- /* Swap sin/cos result based on quadrant. */\n- float *tmp = (n & 1 ? cosp : sinp);\n- cosp = (n & 1 ? sinp : cosp);\n- sinp = tmp;\n-\n- c1 = p->c0 + x2 * p->c1;\n- x5 = x3 * x2;\n- x6 = x4 * x2;\n-\n- s = x + x3 * p->s1;\n- c = c1 + x4 * p->c2;\n-\n- *sinp = s + x5 * s1;\n- *cosp = c + x6 * c2;\n-}\n-\n-/* Return the sine of inputs X and X2 (X squared) using the polynomial P.\n- N is the quadrant, and if odd the cosine polynomial is used. */\n-static inline float\n-sinf_poly (double x, double x2, const sincos_t *p, int n)\n-{\n- double x3, x4, x6, x7, s, c, c1, c2, s1;\n-\n- if ((n & 1) == 0)\n- {\n- x3 = x * x2;\n- s1 = p->s2 + x2 * p->s3;\n-\n- x7 = x3 * x2;\n- s = x + x3 * p->s1;\n-\n- return s + x7 * s1;\n- }\n- else\n- {\n- x4 = x2 * x2;\n- c2 = p->c3 + x2 * p->c4;\n- c1 = p->c0 + x2 * p->c1;\n-\n- x6 = x4 * x2;\n- c = c1 + x4 * p->c2;\n-\n- return c + x6 * c2;\n- }\n-}\ndiff --git a/sysdeps/x86/fpu/sincosf_poly.h b/sysdeps/x86/fpu/sincosf_poly.h\ndeleted file mode 100644\nindex 211d36efa5..0000000000\n--- a/sysdeps/x86/fpu/sincosf_poly.h\n+++ /dev/null\n@@ -1,111 +0,0 @@\n-/* Used by sinf, cosf and sincosf functions. X86-64 version.\n- Copyright (C) 2018-2026 Free Software Foundation, Inc.\n- This file is part of the GNU C Library.\n-\n- The GNU C Library is free software; you can redistribute it and/or\n- modify it under the terms of the GNU Lesser General Public\n- License as published by the Free Software Foundation; either\n- version 2.1 of the License, or (at your option) any later version.\n-\n- The GNU C Library is distributed in the hope that it will be useful,\n- but WITHOUT ANY WARRANTY; without even the implied warranty of\n- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\n- Lesser General Public License for more details.\n-\n- You should have received a copy of the GNU Lesser General Public\n- License along with the GNU C Library; if not, see\n- <https://www.gnu.org/licenses/>. */\n-\n-typedef double v2df_t __attribute__ ((vector_size (2 * sizeof (double))));\n-\n-#ifdef __SSE2_MATH__\n-typedef float v4sf_t __attribute__ ((vector_size (4 * sizeof (float))));\n-\n-static inline void\n-v2df_to_sf (v2df_t v2df, float *f0p, float *f1p)\n-{\n- v4sf_t v4sf = __builtin_ia32_cvtpd2ps (v2df);\n- *f0p = v4sf[0];\n- *f1p = v4sf[1];\n-}\n-#else\n-static inline void\n-v2df_to_sf (v2df_t v2df, float *f0p, float *f1p)\n-{\n- *f0p = (float) v2df[0];\n- *f1p = (float) v2df[1];\n-}\n-#endif\n-\n-/* The constants and polynomials for sine and cosine. */\n-typedef struct\n-{\n- double sign[4];\t\t/* Sign of sine in quadrants 0..3. */\n- double hpi_inv;\t\t/* 2 / PI ( * 2^24 if !TOINT_INTRINSICS). */\n- double hpi;\t\t\t/* PI / 2. */\n- /* Cosine polynomial: c0, c1, c2, c3, c4.\n- Sine polynomial: s1, s2, s3. */\n- double c0, c1;\n- v2df_t s1c2, s2c3, s3c4;\n-} sincos_t;\n-\n-/* Compute the sine and cosine of inputs X and X2 (X squared), using the\n- polynomial P and store the results in SINP and COSP. N is the quadrant,\n- if odd the cosine and sine polynomials are swapped. */\n-static inline void\n-sincosf_poly (double x, double x2, const sincos_t *p, int n, float *sinp,\n-\t float *cosp)\n-{\n- v2df_t vx2x2 = { x2, x2 };\n- v2df_t vxx2 = { x, x2 };\n- v2df_t vx3x4, vs1c2;\n-\n- vx3x4 = vx2x2 * vxx2;\n- vs1c2 = p->s2c3 + vx2x2 * p->s3c4;\n-\n- /* Swap sin/cos result based on quadrant. */\n- if (n & 1)\n- {\n- float *tmp = cosp;\n- cosp = sinp;\n- sinp = tmp;\n- }\n-\n- double c1 = p->c0 + x2 * p->c1;\n- v2df_t vxc1 = { x, c1 };\n- v2df_t vx5x6 = vx3x4 * vx2x2;\n-\n- v2df_t vsincos = vxc1 + vx3x4 * p->s1c2;\n- vsincos = vsincos + vx5x6 * vs1c2;\n- v2df_to_sf (vsincos, sinp, cosp);\n-}\n-\n-/* Return the sine of inputs X and X2 (X squared) using the polynomial P.\n- N is the quadrant, and if odd the cosine polynomial is used. */\n-static inline float\n-sinf_poly (double x, double x2, const sincos_t *p, int n)\n-{\n- double x3, x4, x6, x7, s, c, c1, c2, s1;\n-\n- if ((n & 1) == 0)\n- {\n- x3 = x * x2;\n- s1 = p->s2c3[0] + x2 * p->s3c4[0];\n-\n- x7 = x3 * x2;\n- s = x + x3 * p->s1c2[0];\n-\n- return s + x7 * s1;\n- }\n- else\n- {\n- x4 = x2 * x2;\n- c2 = p->s2c3[1] + x2 * p->s3c4[1];\n- c1 = p->c0 + x2 * p->c1;\n-\n- x6 = x4 * x2;\n- c = c1 + x4 * p->s1c2[1];\n-\n- return c + x6 * c2;\n- }\n-}\n", "prefixes": [ "8/8" ] }