Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/2194424/?format=api
{ "id": 2194424, "url": "http://patchwork.ozlabs.org/api/patches/2194424/?format=api", "web_url": "http://patchwork.ozlabs.org/project/glibc/patch/20260208220454.51741-2-zihong.plct@isrc.iscas.ac.cn/", "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": "<20260208220454.51741-2-zihong.plct@isrc.iscas.ac.cn>", "list_archive_url": null, "date": "2026-02-08T22:04:36", "name": "[RFC,1/5] riscv: libmvec: add RVV log and infrastructure", "commit_ref": null, "pull_url": null, "state": "new", "archived": false, "hash": "3daff2a3f3e0c3e07668e60700b479f7dfe431fd", "submitter": { "id": 91553, "url": "http://patchwork.ozlabs.org/api/people/91553/?format=api", "name": "Yao Zihong", "email": "zihong.plct@isrc.iscas.ac.cn" }, "delegate": null, "mbox": "http://patchwork.ozlabs.org/project/glibc/patch/20260208220454.51741-2-zihong.plct@isrc.iscas.ac.cn/mbox/", "series": [ { "id": 491443, "url": "http://patchwork.ozlabs.org/api/series/491443/?format=api", "web_url": "http://patchwork.ozlabs.org/project/glibc/list/?series=491443", "date": "2026-02-08T22:04:40", "name": "riscv: Add libmvec routines", "version": 1, "mbox": "http://patchwork.ozlabs.org/series/491443/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/2194424/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/2194424/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 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; dmarc=none (p=none dis=none)\n header.from=isrc.iscas.ac.cn", "sourceware.org;\n spf=pass smtp.mailfrom=isrc.iscas.ac.cn", "server2.sourceware.org;\n arc=none smtp.remote-ip=159.226.251.21" ], "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 4f8MS81fvbz1xwN\n\tfor <incoming@patchwork.ozlabs.org>; Mon, 09 Feb 2026 09:09:28 +1100 (AEDT)", "from vm01.sourceware.org (localhost [127.0.0.1])\n\tby sourceware.org (Postfix) with ESMTP id 443CE452C4F6\n\tfor <incoming@patchwork.ozlabs.org>; Sun, 8 Feb 2026 22:09:26 +0000 (GMT)", "from cstnet.cn (smtp21.cstnet.cn [159.226.251.21])\n by sourceware.org (Postfix) with ESMTPS id 4921C452C4FD\n for <libc-alpha@sourceware.org>; Sun, 8 Feb 2026 22:05:08 +0000 (GMT)", "from Mobilestation.localdomain (unknown [183.6.59.140])\n by APP-01 (Coremail) with SMTP id qwCowAAHsGuICIlpA257Bw--.50153S3;\n Mon, 09 Feb 2026 06:05:02 +0800 (CST)" ], "DKIM-Filter": [ "OpenDKIM Filter v2.11.0 sourceware.org 443CE452C4F6", "OpenDKIM Filter v2.11.0 sourceware.org 4921C452C4FD" ], "DMARC-Filter": "OpenDMARC Filter v1.4.2 sourceware.org 4921C452C4FD", "ARC-Filter": "OpenARC Filter v1.0.0 sourceware.org 4921C452C4FD", "ARC-Seal": "i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1770588310; cv=none;\n b=AAmXUKPAy8sAJYotcb691fO4L4YfSQU0O6wrRaiwGwh9BfhjY1hHp2pkRbzk9f/na+loX0GT4f3ZDU6mi0Zn0WRZ57o3iuhEQnSDNSGOZ8ZmdJRB7q5bhfMGKDgr9/M8abilsuP/i5SnO5ErkpQ2N/Iwbpajh4zrUEfikiBb3Bc=", "ARC-Message-Signature": "i=1; a=rsa-sha256; d=sourceware.org; s=key;\n t=1770588310; c=relaxed/simple;\n bh=QWDHFcOtwm6Gc9OwB27++SzFTQkjzWhJUT2gm7XyKhQ=;\n h=From:To:Subject:Date:Message-ID:MIME-Version;\n b=evea2qQtrIvGio+VplLCl3b+CvnJd79RP45tXI2JuRaAJvgnt6pAKfLxmed78QU8UExRuf1ZQWqfQtek+lsYLG+mJ53qxFvUNE2jrKHC69kbkJRVbQEG3r3/x1rZ+wOExyMR0yOALu9HKnz/aeQu01CGhyAqoiahhPDwawK5ILY=", "ARC-Authentication-Results": "i=1; server2.sourceware.org", "From": "Yao Zihong <zihong.plct@isrc.iscas.ac.cn>", "To": "libc-alpha@sourceware.org", "Cc": "zhangyin2018@iscas.ac.cn, zihongyao@outlook.com,\n Zihong Yao <zihong.plct@isrc.iscas.ac.cn>,\n Yulong Shi <shiyulong@iscas.ac.cn>, Zhijin Zeng <zhijin.zeng@spacemit.com>", "Subject": "[RFC PATCH 1/5] riscv: libmvec: add RVV log and infrastructure", "Date": "Mon, 9 Feb 2026 06:04:36 +0800", "Message-ID": "<20260208220454.51741-2-zihong.plct@isrc.iscas.ac.cn>", "X-Mailer": "git-send-email 2.47.3", "In-Reply-To": "<20260208220454.51741-1-zihong.plct@isrc.iscas.ac.cn>", "References": "<20260208220454.51741-1-zihong.plct@isrc.iscas.ac.cn>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "X-CM-TRANSID": "qwCowAAHsGuICIlpA257Bw--.50153S3", "X-Coremail-Antispam": "1UD129KBjvAXoWfuFyxKr48Xry5AFyxCr1ftFb_yoWrJr4rGo\n WfWFW5Ja1kGrn3Crn5C3s7JFZ7Wa17KFW7X3yUXFWkAr1kXFn5GFy0ya43X3y5Gr4fuFZ5\n JFyxtFW3JF4Yvr1xn29KB7ZKAUJUUUU8529EdanIXcx71UUUUU7v73VFW2AGmfu7bjvjm3\n AaLaJ3UjIYCTnIWjp_UUUYK7AC8VAFwI0_Gr0_Xr1l1xkIjI8I6I8E6xAIw20EY4v20xva\n j40_Wr0E3s1l1IIY67AEw4v_Jr0_Jr4l82xGYIkIc2x26280x7IE14v26r18M28IrcIa0x\n kI8VCY1x0267AKxVWUXVWUCwA2ocxC64kIII0Yj41l84x0c7CEw4AK67xGY2AK021l84AC\n jcxK6xIIjxv20xvE14v26r1j6r1xM28EF7xvwVC0I7IYx2IY6xkF7I0E14v26r1j6r4UM2\n 8EF7xvwVC2z280aVAFwI0_Jr0_Gr1l84ACjcxK6I8E87Iv6xkF7I0E14v26r1j6r4UM2AI\n xVAIcxkEcVAq07x20xvEncxIr21l5I8CrVACY4xI64kE6c02F40Ex7xfMcIj6xIIjxv20x\n vE14v26r106r15McIj6I8E87Iv67AKxVWUJVW8JwAm72CE4IkC6x0Yz7v_Jr0_Gr1lF7xv\n r2IYc2Ij64vIr41lF7I21c0EjII2zVCS5cI20VAGYxC7MxkF7I0En4kS14v26r126r1DMx\n AIw28IcxkI7VAKI48JMxC20s026xCaFVCjc4AY6r1j6r4UMI8I3I0E5I8CrVAFwI0_Jr0_\n Jr4lx2IqxVCjr7xvwVAFwI0_JrI_JrWlx4CE17CEb7AF67AKxVWUAVWUtwCIc40Y0x0EwI\n xGrwCI42IY6xIIjxv20xvE14v26r1j6r1xMIIF0xvE2Ix0cI8IcVCY1x0267AKxVWUJVW8\n JwCI42IY6xAIw20EY4v20xvaj40_Jr0_JF4lIxAIcVC2z280aVAFwI0_Jr0_Gr1lIxAIcV\n C2z280aVCY1x0267AKxVWUJVW8JbIYCTnIWIevJa73UjIFyTuYvjfUrjg4DUUUU", "X-Originating-IP": "[183.6.59.140]", "X-CM-SenderInfo": "p2lk00vjoszunw6l223fol2u1dvotugofq/", "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": "From: Zihong Yao <zihong.plct@isrc.iscas.ac.cn>\n\nAdd the initial RVV libmvec for RISC-V and wire it into the mathvec build\nand symbol exports.\n\nProvide the RVV variant list and importer glue plus a double-precision\nlog implementation/data/skeleton.\n\nMove ptr_barrier to generic/math_private.h so it is shared by the new RVV code.\n\nThe vector log implementation is derived from veclibm:\nhttps://github.com/rivosinc/veclibm\n\nSigned-off-by: Zihong Yao <zihong.plct@isrc.iscas.ac.cn>\nCo-authored-by: Yulong Shi <shiyulong@iscas.ac.cn>\nCo-authored-by: Zhijin Zeng <zhijin.zeng@spacemit.com>\n---\n sysdeps/aarch64/fpu/vecmath_config.h | 9 -\n sysdeps/generic/math_private.h | 9 +\n sysdeps/riscv/rvd/Makeconfig | 33 ++++\n sysdeps/riscv/rvd/Makefile | 25 +++\n sysdeps/riscv/rvd/Versions | 15 ++\n sysdeps/riscv/rvd/bits/math-vector.h | 25 +++\n sysdeps/riscv/rvd/v_d_log.c | 22 +++\n sysdeps/riscv/rvd/v_d_log_data.c | 152 ++++++++++++++++\n sysdeps/riscv/rvd/v_d_log_skeleton.c | 151 ++++++++++++++++\n sysdeps/riscv/rvd/v_math.h | 169 ++++++++++++++++++\n sysdeps/riscv/rvd/v_math_importer.h | 137 ++++++++++++++\n sysdeps/riscv/rvd/v_math_names.h | 27 +++\n sysdeps/riscv/rvd/v_math_variants.h | 48 +++++\n sysdeps/riscv/rvd/vecmath_config.h | 110 ++++++++++++\n sysdeps/unix/sysv/linux/riscv/libmvec.abilist | 11 ++\n 15 files changed, 934 insertions(+), 9 deletions(-)\n create mode 100644 sysdeps/riscv/rvd/Makeconfig\n create mode 100644 sysdeps/riscv/rvd/Makefile\n create mode 100644 sysdeps/riscv/rvd/Versions\n create mode 100644 sysdeps/riscv/rvd/bits/math-vector.h\n create mode 100644 sysdeps/riscv/rvd/v_d_log.c\n create mode 100644 sysdeps/riscv/rvd/v_d_log_data.c\n create mode 100644 sysdeps/riscv/rvd/v_d_log_skeleton.c\n create mode 100644 sysdeps/riscv/rvd/v_math.h\n create mode 100644 sysdeps/riscv/rvd/v_math_importer.h\n create mode 100644 sysdeps/riscv/rvd/v_math_names.h\n create mode 100644 sysdeps/riscv/rvd/v_math_variants.h\n create mode 100644 sysdeps/riscv/rvd/vecmath_config.h\n create mode 100644 sysdeps/unix/sysv/linux/riscv/libmvec.abilist", "diff": "diff --git a/sysdeps/aarch64/fpu/vecmath_config.h b/sysdeps/aarch64/fpu/vecmath_config.h\nindex b75f09e5f1..244d188b73 100644\n--- a/sysdeps/aarch64/fpu/vecmath_config.h\n+++ b/sysdeps/aarch64/fpu/vecmath_config.h\n@@ -21,15 +21,6 @@\n \n #include <math_private.h>\n \n-/* Return ptr but hide its value from the compiler so accesses through it\n- cannot be optimized based on the contents. */\n-#define ptr_barrier(ptr) \\\n- ({ \\\n- __typeof (ptr) __ptr = (ptr); \\\n- __asm(\"\" : \"+r\"(__ptr)); \\\n- __ptr; \\\n- })\n-\n #define V_LOG_POLY_ORDER 6\n #define V_LOG_TABLE_BITS 7\n extern const struct v_log_data\ndiff --git a/sysdeps/generic/math_private.h b/sysdeps/generic/math_private.h\nindex 3865dcf905..811cfd80f2 100644\n--- a/sysdeps/generic/math_private.h\n+++ b/sysdeps/generic/math_private.h\n@@ -200,4 +200,13 @@ extern double __sin (double __x);\n extern double __cos (double __x);\n extern int __branred (double __x, double *__a, double *__aa);\n \n+/* Return ptr but hide its value from the compiler so accesses through it\n+ cannot be optimized based on the contents. */\n+#define ptr_barrier(ptr) \\\n+ ({ \\\n+ __typeof (ptr) __ptr = (ptr); \\\n+ __asm(\"\" : \"+r\"(__ptr)); \\\n+ __ptr; \\\n+ })\n+\n #endif /* _MATH_PRIVATE_H_ */\ndiff --git a/sysdeps/riscv/rvd/Makeconfig b/sysdeps/riscv/rvd/Makeconfig\nnew file mode 100644\nindex 0000000000..56f63a5d01\n--- /dev/null\n+++ b/sysdeps/riscv/rvd/Makeconfig\n@@ -0,0 +1,33 @@\n+# Generate libmvec.mk for libmvec.\n+\n+# Copyright (C) 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 $(common-objpfx)libmvec.mk\n+postclean-generated += libmvec.mk\n+\n+libmvec-float-funcs-bare = \\\n+\n+libmvec-float-funcs-with-data = \\\n+\n+libmvec-double-funcs-bare = \\\n+\n+libmvec-double-funcs-with-data = \\\n+ log \\\n+\n+libmvec-float-funcs = $(libmvec-float-funcs-bare) $(libmvec-float-funcs-with-data)\n+libmvec-double-funcs = $(libmvec-double-funcs-bare) $(libmvec-double-funcs-with-data)\ndiff --git a/sysdeps/riscv/rvd/Makefile b/sysdeps/riscv/rvd/Makefile\nnew file mode 100644\nindex 0000000000..05cd793906\n--- /dev/null\n+++ b/sysdeps/riscv/rvd/Makefile\n@@ -0,0 +1,25 @@\n+ifeq ($(subdir),mathvec)\n+\n+libmvec-sysdep_routines = \\\n+\t$(addprefix $(libmvec-vprefix)v_d_, $(libmvec-double-funcs)) \\\n+\t$(addsuffix _data, $(addprefix v_d_, $(libmvec-double-funcs-with-data))) \\\n+\t$(addprefix v_f_, $(libmvec-float-funcs)) \\\n+\t$(addsuffix _data, $(addprefix v_f_, $(libmvec-float-funcs-with-data))) \\\n+\n+define riscv64-vector-cflags-template\n+CFLAGS-$(1).c += -march=rv64gcv -Wno-maybe-uninitialized -Wno-undef\n+endef\n+\n+define riscv32-vector-cflags-template\n+CFLAGS-$(1).c += -march=rv32gcv -Wno-maybe-uninitialized -Wno-undef\n+endef\n+\n+ifeq ($(config-machine),riscv64)\n+$(foreach f,$(libmvec-sysdep_routines), $(eval $(call riscv64-vector-cflags-template,$(f))))\n+endif\n+\n+ifeq ($(config-machine),riscv32)\n+$(foreach f,$(libmvec-sysdep_routines), $(eval $(call riscv32-vector-cflags-template,$(f))))\n+endif\n+\n+endif\ndiff --git a/sysdeps/riscv/rvd/Versions b/sysdeps/riscv/rvd/Versions\nnew file mode 100644\nindex 0000000000..9d43e652a9\n--- /dev/null\n+++ b/sysdeps/riscv/rvd/Versions\n@@ -0,0 +1,15 @@\n+libmvec {\n+ GLIBC_2.43 {\n+ _ZGVr1N2v_log;\n+ _ZGVr1N4v_log;\n+ _ZGVr2N2v_log;\n+ _ZGVr2N4v_log;\n+ _ZGVr2N8v_log;\n+ _ZGVr4N4v_log;\n+ _ZGVr4N8v_log;\n+ _ZGVr4N16v_log;\n+ _ZGVr8N8v_log;\n+ _ZGVr8N16v_log;\n+ _ZGVr8N32v_log;\n+ }\n+}\ndiff --git a/sysdeps/riscv/rvd/bits/math-vector.h b/sysdeps/riscv/rvd/bits/math-vector.h\nnew file mode 100644\nindex 0000000000..29c55c3e35\n--- /dev/null\n+++ b/sysdeps/riscv/rvd/bits/math-vector.h\n@@ -0,0 +1,25 @@\n+/* Platform-specific SIMD declarations of math functions.\n+ Copyright (C) 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+#ifndef _MATH_H\n+# error \"Never include <bits/math-vector.h> directly;\\\n+ include <math.h> instead.\"\n+#endif\n+\n+/* Use the default empty SIMD declaration stubs unless overridden. */\n+#include <bits/libm-simd-decl-stubs.h>\ndiff --git a/sysdeps/riscv/rvd/v_d_log.c b/sysdeps/riscv/rvd/v_d_log.c\nnew file mode 100644\nindex 0000000000..9462db7964\n--- /dev/null\n+++ b/sysdeps/riscv/rvd/v_d_log.c\n@@ -0,0 +1,22 @@\n+/* Double-precision vector log function.\n+ Copyright (C) 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+#define LIBMVEC_TYPE double\n+#define LIBMVEC_FUNC log\n+#define LIBMVEC_IMPL \"v_d_log_skeleton.c\"\n+#include \"v_math_importer.h\"\ndiff --git a/sysdeps/riscv/rvd/v_d_log_data.c b/sysdeps/riscv/rvd/v_d_log_data.c\nnew file mode 100644\nindex 0000000000..ffcc42e2ac\n--- /dev/null\n+++ b/sysdeps/riscv/rvd/v_d_log_data.c\n@@ -0,0 +1,152 @@\n+/* Data table for double-precision vector log function.\n+ Copyright (C) 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 <vecmath_config.h>\n+\n+const struct v_log_data __v_log_data = {\n+ .table = {0x0,\n+ 0x22d443c414148a1,\n+ 0x3a475f892273f13,\n+ 0x51ea81cd5dc13cb,\n+ 0x69be70ddf74c6a8,\n+ 0x81c3f7de5434ed0,\n+ 0x8dd9953002a4e86,\n+ 0xa62b07f3457c407,\n+ 0xbeb024b67dda634,\n+ 0xd769c8d5b33a728,\n+ 0xe3da945b878e27d,\n+ 0xfce4aee0e88b275,\n+ 0x1162593186da6fc4,\n+ 0x122dadc2ab3496d3,\n+ 0x13c6fb650cde50a1,\n+ 0x1563dc29ffacb20d,\n+ 0x1633a8bf437ce10b,\n+ 0x17d60496cfbb4c67,\n+ 0x18a8980abfbd3266,\n+ 0x1a5094b54d282840,\n+ 0x1b2602497d53458d,\n+ 0x1cd3c712d3110932,\n+ 0x1dac22d3e441d2fe,\n+ 0x1f5fd8a9063e3491,\n+ 0x203b3779f4c3a8bb,\n+ 0x21f509008966a211,\n+ 0x22d380a6c7e2b0e4,\n+ 0x23b30593aa4e106c,\n+ 0x2575418697c3d7e0,\n+ 0x2657fdc6e1dcd0cb,\n+ 0x273bd1c2ab3edefe,\n+ 0x2906cbcd2baf2d54,\n+ 0x29edf7659d8b30f2,\n+ 0x2ad645cd6af1c939,\n+ 0x2bbfb9e3dd5c1c88,\n+ 0x2d961ed0cb91d407,\n+ 0x2e83159d77e31d6d,\n+ 0x2f713e059e555a64,\n+ 0x30609b21823fa654,\n+ 0x315130157f7a64cd,\n+ 0x33360e552d8d64de,\n+ 0x342a5e28530367af,\n+ 0x351ff2e30214bc30,\n+ 0x3616cfe9e8d01fea,\n+ 0x370ef8af6360dfe0,\n+ 0x380870b3c5fb66f7,\n+ 0x39033b85a8bfc871,\n+ 0x39ff5cc235a256c5,\n+ 0x3afcd815786af188,\n+ 0x3bfbb13ab0dc5614,\n+ 0x3cfbebfca715669e,\n+ 0x3dfd8c36023f0ab7,\n+ 0x3f0095d1a19a0332,\n+ 0x40050ccaf800ca8c,\n+ 0x410af52e69f26264,\n+ 0x42125319ae3bbf06,\n+ 0x431b2abc31565be7,\n+ 0x442580577b936763,\n+ 0x4531583f9a2be204,\n+ 0x463eb6db8b4f066d,\n+ 0x474da0a5ad495303,\n+ 0x485e1a2c30df9ea9,\n+ 0x497028118efabeb8,\n+ 0x4a83cf0d01c16e3d,\n+ -0x3466ec14fec0a13b,\n+ -0x335004723c465e69,\n+ -0x323775123e2e1169,\n+ -0x323775123e2e1169,\n+ -0x311d38e5c1644b49,\n+ -0x30014ac62c38a865,\n+ -0x2ee3a574fdf677c9,\n+ -0x2dc4439b3a19bcaf,\n+ -0x2ca31fc8cef74dca,\n+ -0x2ca31fc8cef74dca,\n+ -0x2b803473f7ad0f3f,\n+ -0x2a5b7bf8992d66fc,\n+ -0x2934f0979a3715fd,\n+ -0x280c8c76360892eb,\n+ -0x280c8c76360892eb,\n+ -0x26e2499d499bd9b3,\n+ -0x25b621f89b355ede,\n+ -0x24880f561c0e7305,\n+ -0x24880f561c0e7305,\n+ -0x23580b6523e0e0a5,\n+ -0x22260fb5a616eb96,\n+ -0x20f215b7606012de,\n+ -0x20f215b7606012de,\n+ -0x1fbc16b902680a24,\n+ -0x1e840be74e6a4cc8,\n+ -0x1e840be74e6a4cc8,\n+ -0x1d49ee4c32596fc9,\n+ -0x1c0db6cdd94dee41,\n+ -0x1c0db6cdd94dee41,\n+ -0x1acf5e2db4ec93f0,\n+ -0x198edd077e70df03,\n+ -0x198edd077e70df03,\n+ -0x184c2bd02f03b2fe,\n+ -0x170742d4ef027f2a,\n+ -0x170742d4ef027f2a,\n+ -0x15c01a39fbd687a0,\n+ -0x1476a9f983f74d31,\n+ -0x1476a9f983f74d31,\n+ -0x132ae9e278ae1a1f,\n+ -0x132ae9e278ae1a1f,\n+ -0x11dcd197552b7b5f,\n+ -0x108c588cda79e396,\n+ -0x108c588cda79e396,\n+ -0xf397608bfd2d90e,\n+ -0xf397608bfd2d90e,\n+ -0xde4212056d5dd32,\n+ -0xc8c50b72319ad57,\n+ -0xc8c50b72319ad57,\n+ -0xb31fb7d64898b3e,\n+ -0xb31fb7d64898b3e,\n+ -0x9d517ee93f8e16c,\n+ -0x9d517ee93f8e16c,\n+ -0x8759c4fd14fcd5a,\n+ -0x7137eae42aad7bd,\n+ -0x7137eae42aad7bd,\n+ -0x5aeb4dd63bf61cc,\n+ -0x5aeb4dd63bf61cc,\n+ -0x447347544cd04bb,\n+ -0x447347544cd04bb,\n+ -0x2dcf2d0b85a4531,\n+ -0x2dcf2d0b85a4531,\n+ -0x16fe50b6ef08518,\n+ -0x16fe50b6ef08518,\n+ 0x0\n+ }\n+};\ndiff --git a/sysdeps/riscv/rvd/v_d_log_skeleton.c b/sysdeps/riscv/rvd/v_d_log_skeleton.c\nnew file mode 100644\nindex 0000000000..f8b3213df5\n--- /dev/null\n+++ b/sysdeps/riscv/rvd/v_d_log_skeleton.c\n@@ -0,0 +1,151 @@\n+/* Double-precision vector log function.\n+ Copyright (C) 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 <vecmath_config.h>\n+#include <v_math.h>\n+\n+#ifndef RVV_LIBMVEC_IMPL_NAME\n+# error \"RVV_LIBMVEC_IMPL_NAME must be defined for RVV libmvec skeleton\"\n+#endif\n+#ifndef V_MATH_FUNC\n+# error \"V_MATH_FUNC must be defined for RVV libmvec skeleton\"\n+#endif\n+\n+#ifndef V_D_LOG_SKELETON_ONCE\n+#define V_D_LOG_SKELETON_ONCE\n+\n+#define LOGB_2_HI 0x1.62e42fefa39efp-1\n+#define LOGB_2_LO 0x1.abc9e3b39803fp-56\n+\n+#endif\n+\n+static VFLOAT\n+RVV_LIBMVEC_IMPL_NAME (V_MATH_FUNC, LMUL) (VFLOAT x, size_t vlen)\n+{\n+ const struct v_log_data *d = ptr_barrier(&__v_log_data);\n+ VFLOAT vx, vy, vy_special;\n+ VBOOL special_args;\n+ VINT n_adjust;\n+\n+ SET_ROUNDTONEAREST;\n+ /* stripmining over input arguments: vlen chosen by wrapper */\n+ vx = x;\n+\n+ /* NaN, Inf, and -ve handling, as well as scaling denormal input by 2^64\n+ */\n+ VUINT vclass = __riscv_vfclass((vx), (vlen));\n+ /* special handling except positive normal number */\n+ IDENTIFY(vclass, 0x3BF, (special_args), (vlen));\n+ UINT nb_special_args = __riscv_vcpop((special_args), (vlen));\n+ n_adjust = VMVI_VX(0, (vlen));\n+ if (nb_special_args > 0)\n+ {\n+ VBOOL id_mask;\n+ /* substitute negative arguments with sNaN */\n+ IDENTIFY(vclass, class_negative, id_mask, (vlen));\n+ vx = VFMERGE_VFM(vx, fp_sNaN, id_mask, vlen);\n+ /* substitute +0 argument with -0 */\n+ IDENTIFY(vclass, class_posZero, id_mask, vlen);\n+ vx = VFMERGE_VFM(vx, fp_negZero, id_mask, vlen);\n+ /* eliminate positive denorm input from special_args */\n+ IDENTIFY(vclass, 0x39F, (special_args), (vlen));\n+ /* for narrowed set of special arguments, compute vx+vfrec7(vx) */\n+ vy_special = VFREC7_M((special_args), (vx), (vlen));\n+ vy_special\n+ = VFADD_VV_M((special_args), vy_special, (vx), (vlen));\n+ vx = VFMERGE_VFM((vx), fp_posOne, (special_args), (vlen));\n+ /* scale up input for positive denormals */\n+ IDENTIFY(vclass, class_posDenorm, id_mask, (vlen));\n+ n_adjust = VMERGE_VXM_I(n_adjust, 64, id_mask, vlen);\n+ VFLOAT vx_normalized = VFMUL_VF_M(id_mask, vx, 0x1.0p64, vlen);\n+ vx = VMERGE_VVM_F(vx, vx_normalized, id_mask, vlen);\n+ }\n+\n+ /* in_arg at this point are positive, finite and not subnormal\n+ Decompose in_arg into n, B, r: in_arg = 2^n (1/B) (1 + r)\n+ B is equivalently defined by ind, 0 <= ind < 128 */\n+ VINT n = U_AS_I(__riscv_vadd(\n+ __riscv_vsrl(F_AS_U (vx), MAN_LEN - 1, vlen), 1, vlen));\n+ n = __riscv_vsra(n, 1, vlen);\n+ n = __riscv_vsub(n, EXP_BIAS, vlen);\n+ vx = U_AS_F(\n+ __riscv_vsrl(__riscv_vsll (F_AS_U (vx), BIT_WIDTH - MAN_LEN, vlen),\n+ BIT_WIDTH - MAN_LEN, vlen));\n+ vx = U_AS_F(\n+ __riscv_vadd (F_AS_U (vx), (uint64_t)EXP_BIAS << MAN_LEN, vlen));\n+ n = __riscv_vsub (n, n_adjust, vlen);\n+ VFLOAT n_flt = __riscv_vfcvt_f(n, vlen);\n+ VFLOAT B = __riscv_vfrec7(vx, vlen);\n+ /* get 7 msb of mantissa, and left shift by 3 to get address */\n+ VUINT ind = __riscv_vand(__riscv_vsrl (F_AS_U (vx), MAN_LEN - 10, vlen),\n+ 0x3F8, vlen);\n+ /* adjust B to be 1.0 if ind == 0 */\n+ VBOOL adjust_B = __riscv_vmseq(ind, 0, vlen);\n+ B = VFMERGE_VFM(B, fp_posOne, adjust_B, vlen);\n+ /* finally get r = B * in_arg - 1.0 */\n+ VFLOAT r = VFMV_VF(fp_posOne, vlen);\n+ r = __riscv_vfmsac(r, vx, B, vlen);\n+\n+ /* Base-B log is logB(in_arg) = logB(2^n * 1/B) + logB(1 + r)\n+ (n + log2(1/B))*logB(2) + log(1+r)*logB(e)\n+ log2(1/B) is stored in a table\n+ and log(1+r) is approximated by r + poly\n+ poly is a polynomial in r in the form r^2 * (p0 + p1 r + ... )\n+ To deliver this result accurately, one uses logB(2) and logB(e)\n+ with extra precision and sums the various terms in an appropriate\n+ order */\n+ VFLOAT rsq = __riscv_vfmul(r, r, vlen);\n+ VFLOAT rcube = __riscv_vfmul(rsq, r, vlen);\n+\n+ VFLOAT poly_right = PSTEP(\n+ 0x1.9999998877038p-3, r,\n+ PSTEP(-0x1.555c54f8b7c6cp-3, 0x1.2499765b3c27ap-3, r, vlen), vlen);\n+\n+ VFLOAT poly_left = PSTEP(\n+ -0x1.000000000001cp-1, r,\n+ PSTEP(0x1.55555555555a9p-2, -0x1.fffffff2018cfp-3, r, vlen), vlen);\n+\n+ VFLOAT poly = __riscv_vfmadd(poly_right, rcube, poly_left, vlen);\n+ poly = __riscv_vfmul(rsq, poly, vlen);\n+ /* log_e(1+r) is r + poly */\n+\n+ /* Load table values and get n_flt + T to be A + a */\n+ VINT T = __riscv_vluxei64(d->table, ind, vlen);\n+ VINT T_hi = __riscv_vsll(__riscv_vsra (T, 24, vlen), 24, vlen);\n+ VINT T_lo = __riscv_vsub(T, T_hi, vlen);\n+ VFLOAT T_hi_flt = __riscv_vfcvt_f(T_hi, vlen);\n+ VFLOAT A = __riscv_vfmadd(T_hi_flt, 0x1.0p-63, n_flt, vlen);\n+ VFLOAT a = __riscv_vfcvt_f(T_lo, vlen);\n+ a = __riscv_vfmul (a, 0x1.0p-63, vlen);\n+\n+ /* Compute (A + a) * (logB_2_hi + logB_2_lo) + (r + P) * (logB_e_hi +\n+ logB_e_lo) */\n+ VFLOAT delta_1 = __riscv_vfmul(A, LOGB_2_LO, vlen);\n+ delta_1 = __riscv_vfmadd(a, LOGB_2_HI, delta_1, vlen);\n+ poly = __riscv_vfadd(poly, delta_1, vlen);\n+\n+ poly = __riscv_vfadd(poly, r, vlen);\n+\n+ vy = __riscv_vfmadd(A, LOGB_2_HI, poly, vlen);\n+ vy = VMERGE_VVM_F(vy, vy_special, special_args, vlen);\n+\n+ RESTORE_FRM;\n+ return vy;\n+}\n+\n+#undef LMUL\ndiff --git a/sysdeps/riscv/rvd/v_math.h b/sysdeps/riscv/rvd/v_math.h\nnew file mode 100644\nindex 0000000000..5b00267ada\n--- /dev/null\n+++ b/sysdeps/riscv/rvd/v_math.h\n@@ -0,0 +1,169 @@\n+/* Utilities for RVV libmvec routines.\n+ Copyright (C) 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+#ifndef _V_MATH_H\n+#define _V_MATH_H\n+\n+#include <riscv_vector.h>\n+#include <math_private.h>\n+#include <assert.h>\n+\n+#include <v_math_names.h>\n+\n+#ifndef _GNU_SOURCE\n+#define _GNU_SOURCE\n+#define _NEED_UNDEF_GNU_SOURCE_V_MATH\n+#endif\n+\n+#include <math.h>\n+#ifndef NAN\n+_Static_assert (0, \"NaN not available on this architecture\");\n+#endif\n+\n+#define __PASTE2_BASE(A, B) A##B\n+#define __PASTE2(A, B) __PASTE2_BASE (A, B)\n+#define __PASTE3_BASE(A, B, C) A##B##C\n+#define __PASTE3(A, B, C) __PASTE3_BASE (A, B, C)\n+#define __PASTE4_BASE(A, B, C, D) A##B##C##D\n+#define __PASTE4(A, B, C, D) __PASTE4_BASE (A, B, C, D)\n+#define __PASTE5_BASE(A, B, C, D, E) A##B##C##D##E\n+#define __PASTE5(A, B, C, D, E) __PASTE5_BASE (A, B, C, D, E)\n+static const uint64_t class_posZero = 0x10;\n+static const uint64_t class_posDenorm = 0x20;\n+static const uint64_t class_negative = 0x7;\n+\n+#ifdef _NEED_UNDEF_GNU_SOURCE_V_MATH\n+#undef _GNU_SOURCE\n+#undef _NEED_UNDEF_GNU_SOURCE_V_MATH\n+#endif\n+\n+#endif\n+\n+#ifndef LMUL\n+# error \"Must assign an LMUL before including v_math.h\"\n+#endif\n+#ifndef BIT_WIDTH\n+# error \"Must assign BIT_WIDTH before including v_math.h\"\n+#endif\n+\n+/* Undefine previous LMUL-dependent macros to allow redefinition */\n+#undef MAKE_VTYPE\n+#undef MAKE_TYPE\n+#undef MAKE_FUNC\n+#undef MAKE_VBOOL\n+#undef VSET\n+#undef MAKE_REINTERPRET\n+#undef FLOAT\n+#undef VFLOAT\n+#undef INT\n+#undef VINT\n+#undef UINT\n+#undef VUINT\n+#undef VBOOL\n+#undef F_AS_I\n+#undef F_AS_U\n+#undef I_AS_F\n+#undef U_AS_F\n+#undef I_AS_U\n+#undef U_AS_I\n+#undef VMVI_VX\n+#undef VFMV_VF\n+#undef EXP_BIAS\n+#undef MAN_LEN\n+\n+#define MAKE_VTYPE(A) __PASTE3 (A, BIT_WIDTH, __PASTE3 (m, LMUL, _t))\n+#define MAKE_TYPE(A) __PASTE3 (A, BIT_WIDTH, _t)\n+#define MAKE_FUNC(A) __PASTE3 (A, BIT_WIDTH, __PASTE2 (m, LMUL))\n+\n+#if (BIT_WIDTH == 64)\n+# define EXP_BIAS 1023\n+# define MAN_LEN 52\n+# ifndef _V_MATH_SCALAR_64\n+# define _V_MATH_SCALAR_64\n+typedef double scalar_t;\n+static const scalar_t fp_sNaN = __builtin_nans (\"\");\n+static const scalar_t fp_negZero = -0.;\n+static const scalar_t fp_posZero = 0.0;\n+static const scalar_t fp_posOne = 0x1.0p0;\n+# endif\n+#elif (BIT_WIDTH == 32)\n+# define EXP_BIAS 127\n+# define MAN_LEN 23\n+# ifndef _V_MATH_SCALAR_32\n+# define _V_MATH_SCALAR_32\n+typedef float scalar_t;\n+static const scalar_t fp_sNaN = __builtin_nansf (\"\");\n+static const scalar_t fp_negZero = -0.f;\n+static const scalar_t fp_posZero = 0.0f;\n+static const scalar_t fp_posOne = 0x1.0p0f;\n+# endif\n+#else\n+# error \"requested BIT_WIDTH unsupported\"\n+#endif\n+\n+/* For MAKE_VBOOL, the value is BIT_WIDTH/LMUL for the current element size. */\n+#if (BIT_WIDTH == 64)\n+# if (LMUL == 1)\n+# define MAKE_VBOOL(A) __PASTE3 (A, 64, _t)\n+# elif (LMUL == 2)\n+# define MAKE_VBOOL(A) __PASTE3 (A, 32, _t)\n+# elif (LMUL == 4)\n+# define MAKE_VBOOL(A) __PASTE3 (A, 16, _t)\n+# elif (LMUL == 8)\n+# define MAKE_VBOOL(A) __PASTE3 (A, 8, _t)\n+# else\n+# error \"requested LMUL unsupported\"\n+# endif\n+#elif (BIT_WIDTH == 32)\n+# if (LMUL == 1)\n+# define MAKE_VBOOL(A) __PASTE3 (A, 32, _t)\n+# elif (LMUL == 2)\n+# define MAKE_VBOOL(A) __PASTE3 (A, 16, _t)\n+# elif (LMUL == 4)\n+# define MAKE_VBOOL(A) __PASTE3 (A, 8, _t)\n+# elif (LMUL == 8)\n+# define MAKE_VBOOL(A) __PASTE3 (A, 4, _t)\n+# else\n+# error \"requested LMUL unsupported\"\n+# endif\n+#else\n+# error \"requested BIT_WIDTH unsupported\"\n+#endif\n+\n+#define VSET __PASTE2 (__riscv_vsetvl_e, __PASTE3 (BIT_WIDTH, m, LMUL))\n+#define MAKE_REINTERPRET(A, B) \\\n+ __PASTE5 (__riscv_vreinterpret_v_, A, __PASTE4 (BIT_WIDTH, m, LMUL, _), B, \\\n+ __PASTE3 (BIT_WIDTH, m, LMUL))\n+\n+#define FLOAT MAKE_TYPE (float)\n+#define VFLOAT MAKE_VTYPE (vfloat)\n+#define INT MAKE_TYPE (int)\n+#define VINT MAKE_VTYPE (vint)\n+#define UINT MAKE_TYPE (uint)\n+#define VUINT MAKE_VTYPE (vuint)\n+#define VBOOL MAKE_VBOOL (vbool)\n+\n+#define F_AS_I MAKE_REINTERPRET (f, i)\n+#define F_AS_U MAKE_REINTERPRET (f, u)\n+#define I_AS_F MAKE_REINTERPRET (i, f)\n+#define U_AS_F MAKE_REINTERPRET (u, f)\n+#define I_AS_U MAKE_REINTERPRET (i, u)\n+#define U_AS_I MAKE_REINTERPRET (u, i)\n+\n+#define VMVI_VX MAKE_FUNC (__riscv_vmv_v_x_i)\n+#define VFMV_VF MAKE_FUNC (__riscv_vfmv_v_f_f)\ndiff --git a/sysdeps/riscv/rvd/v_math_importer.h b/sysdeps/riscv/rvd/v_math_importer.h\nnew file mode 100644\nindex 0000000000..385ab04f2e\n--- /dev/null\n+++ b/sysdeps/riscv/rvd/v_math_importer.h\n@@ -0,0 +1,137 @@\n+/* RVV libmvec implementation importer.\n+ Copyright (C) 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 <v_math_variants.h>\n+\n+#ifndef LIBMVEC_TYPE\n+# error \"LIBMVEC_TYPE must be defined for RVV libmvec import\"\n+#endif\n+#ifndef LIBMVEC_FUNC\n+# error \"LIBMVEC_FUNC must be defined for RVV libmvec import\"\n+#endif\n+#ifndef LIBMVEC_IMPL\n+# error \"LIBMVEC_IMPL must be defined for RVV libmvec import\"\n+#endif\n+\n+#define RVV_LIBMVEC_IS_VALID_TYPE_double 1\n+#define RVV_LIBMVEC_IS_VALID_TYPE_float 1\n+#define RVV_LIBMVEC_IS_VALID_TYPE_INNER(t) RVV_LIBMVEC_IS_VALID_TYPE_##t\n+#define RVV_LIBMVEC_IS_VALID_TYPE(t) RVV_LIBMVEC_IS_VALID_TYPE_INNER (t)\n+\n+#if !RVV_LIBMVEC_IS_VALID_TYPE (LIBMVEC_TYPE)\n+# error \"Unsupported LIBMVEC_TYPE for RVV libmvec import (expected float or double)\"\n+#endif\n+\n+#define RVV_LIBMVEC_IS_DOUBLE_double 1\n+#define RVV_LIBMVEC_IS_DOUBLE_float 0\n+#define RVV_LIBMVEC_IS_DOUBLE_INNER(t) RVV_LIBMVEC_IS_DOUBLE_##t\n+#define RVV_LIBMVEC_IS_DOUBLE(t) RVV_LIBMVEC_IS_DOUBLE_INNER (t)\n+\n+#define RVV_LIBMVEC_BIT_WIDTH_double 64\n+#define RVV_LIBMVEC_BIT_WIDTH_float 32\n+#define RVV_LIBMVEC_BIT_WIDTH_INNER(t) RVV_LIBMVEC_BIT_WIDTH_##t\n+#define RVV_LIBMVEC_BIT_WIDTH(t) RVV_LIBMVEC_BIT_WIDTH_INNER (t)\n+\n+#define BIT_WIDTH RVV_LIBMVEC_BIT_WIDTH (LIBMVEC_TYPE)\n+\n+/* Internal function naming and wrapper helpers. */\n+#if RVV_LIBMVEC_IS_DOUBLE (LIBMVEC_TYPE)\n+\n+# define RVV_LIBMVEC_IMPL_NAME_INNER(fun, lmul) \\\n+ __rvv_##fun##_w64_m##lmul##_impl\n+# define RVV_LIBMVEC_IMPL_NAME(fun, lmul) \\\n+ RVV_LIBMVEC_IMPL_NAME_INNER (fun, lmul)\n+\n+# define RVV_LIBMVEC_VFLOAT(lmul) vfloat64m##lmul##_t\n+# define RVV_LIBMVEC_VSETVL(lmul) __riscv_vsetvl_e64m##lmul\n+\n+# define RVV_LIBMVEC_VARIANTS(X) RVV_LIBMVEC_VARIANTS_F64 (X)\n+\n+#else\n+\n+# define RVV_LIBMVEC_IMPL_NAME_INNER(fun, lmul) \\\n+ __rvv_##fun##_w32_m##lmul##_impl\n+# define RVV_LIBMVEC_IMPL_NAME(fun, lmul) \\\n+ RVV_LIBMVEC_IMPL_NAME_INNER (fun, lmul)\n+\n+# define RVV_LIBMVEC_VFLOAT(lmul) vfloat32m##lmul##_t\n+# define RVV_LIBMVEC_VSETVL(lmul) __riscv_vsetvl_e32m##lmul\n+\n+# define RVV_LIBMVEC_VARIANTS(X) RVV_LIBMVEC_VARIANTS_F32 (X)\n+\n+#endif\n+\n+/* Macros used by the skeleton implementation. */\n+#define V_MATH_FUNC LIBMVEC_FUNC\n+#define V_MATH_IMPL LIBMVEC_IMPL\n+\n+/* Instantiate the skeleton once per LMUL (the wrapper controls vlen). */\n+#undef LMUL\n+#define LMUL 1\n+#include V_MATH_IMPL\n+\n+#undef LMUL\n+#define LMUL 2\n+#include V_MATH_IMPL\n+\n+#undef LMUL\n+#define LMUL 4\n+#include V_MATH_IMPL\n+\n+#undef LMUL\n+#define LMUL 8\n+#include V_MATH_IMPL\n+\n+/* Exported wrappers for each LMUL/SIMDLEN pair. */\n+#define RVV_LIBMVEC_DEFINE_WRAPPER(lmul, simdlen) \\\n+ RVV_LIBMVEC_VFLOAT (lmul) \\\n+ V_NAME_D1 (lmul, simdlen, V_MATH_FUNC) (RVV_LIBMVEC_VFLOAT (lmul) x) \\\n+ { \\\n+ size_t vlen = RVV_LIBMVEC_VSETVL (lmul) (simdlen); \\\n+ return RVV_LIBMVEC_IMPL_NAME (V_MATH_FUNC, lmul) (x, vlen); \\\n+ }\n+\n+#define X(lmul, simdlen) RVV_LIBMVEC_DEFINE_WRAPPER (lmul, simdlen)\n+RVV_LIBMVEC_VARIANTS (X)\n+#undef X\n+\n+#undef RVV_LIBMVEC_DEFINE_WRAPPER\n+#undef RVV_LIBMVEC_VARIANTS\n+#undef RVV_LIBMVEC_VSETVL\n+#undef RVV_LIBMVEC_VFLOAT\n+#undef RVV_LIBMVEC_IMPL_NAME\n+#undef RVV_LIBMVEC_IMPL_NAME_INNER\n+\n+#undef V_MATH_IMPL\n+#undef V_MATH_FUNC\n+\n+#undef BIT_WIDTH\n+#undef RVV_LIBMVEC_BIT_WIDTH\n+#undef RVV_LIBMVEC_BIT_WIDTH_INNER\n+#undef RVV_LIBMVEC_BIT_WIDTH_double\n+#undef RVV_LIBMVEC_BIT_WIDTH_float\n+\n+#undef RVV_LIBMVEC_IS_DOUBLE\n+#undef RVV_LIBMVEC_IS_DOUBLE_INNER\n+#undef RVV_LIBMVEC_IS_DOUBLE_double\n+#undef RVV_LIBMVEC_IS_DOUBLE_float\n+\n+#undef RVV_LIBMVEC_IS_VALID_TYPE\n+#undef RVV_LIBMVEC_IS_VALID_TYPE_INNER\n+#undef RVV_LIBMVEC_IS_VALID_TYPE_double\n+#undef RVV_LIBMVEC_IS_VALID_TYPE_float\ndiff --git a/sysdeps/riscv/rvd/v_math_names.h b/sysdeps/riscv/rvd/v_math_names.h\nnew file mode 100644\nindex 0000000000..c83b7abc15\n--- /dev/null\n+++ b/sysdeps/riscv/rvd/v_math_names.h\n@@ -0,0 +1,27 @@\n+/* RVV libmvec name helpers.\n+ Copyright (C) 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+#ifndef V_MATH_NAMES_H\n+#define V_MATH_NAMES_H\n+\n+#ifndef V_NAME_D1\n+# define V_NAME_D1_INNER(lmul, simdlen, fun) _ZGVr##lmul##N##simdlen##v_##fun\n+# define V_NAME_D1(lmul, simdlen, fun) V_NAME_D1_INNER (lmul, simdlen, fun)\n+#endif\n+\n+#endif\ndiff --git a/sysdeps/riscv/rvd/v_math_variants.h b/sysdeps/riscv/rvd/v_math_variants.h\nnew file mode 100644\nindex 0000000000..6862337ad0\n--- /dev/null\n+++ b/sysdeps/riscv/rvd/v_math_variants.h\n@@ -0,0 +1,48 @@\n+/* RVV libmvec LMUL/SIMDLEN variants.\n+ Copyright (C) 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+#ifndef V_MATH_VARIANTS_H\n+#define V_MATH_VARIANTS_H\n+\n+#define RVV_LIBMVEC_VARIANTS_F64(X) \\\n+ X (1, 2) \\\n+ X (1, 4) \\\n+ X (2, 2) \\\n+ X (2, 4) \\\n+ X (2, 8) \\\n+ X (4, 4) \\\n+ X (4, 8) \\\n+ X (4, 16) \\\n+ X (8, 8) \\\n+ X (8, 16) \\\n+ X (8, 32)\n+\n+#define RVV_LIBMVEC_VARIANTS_F32(X) \\\n+ X (1, 4) \\\n+ X (1, 8) \\\n+ X (2, 4) \\\n+ X (2, 8) \\\n+ X (2, 16) \\\n+ X (4, 8) \\\n+ X (4, 16) \\\n+ X (4, 32) \\\n+ X (8, 16) \\\n+ X (8, 32) \\\n+ X (8, 64)\n+\n+#endif\ndiff --git a/sysdeps/riscv/rvd/vecmath_config.h b/sysdeps/riscv/rvd/vecmath_config.h\nnew file mode 100644\nindex 0000000000..3a5af212e4\n--- /dev/null\n+++ b/sysdeps/riscv/rvd/vecmath_config.h\n@@ -0,0 +1,110 @@\n+/* Copyright (C) 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+#ifndef _VECMATH_CONFIG_H\n+#define _VECMATH_CONFIG_H\n+\n+#include <stdint.h>\n+\n+__BEGIN_DECLS\n+\n+#define __VCFG_PASTE4_BASE(A, B, C, D) A##B##C##D\n+#define __VCFG_PASTE4(A, B, C, D) __VCFG_PASTE4_BASE (A, B, C, D)\n+#define __VCFG_PASTE5_BASE(A, B, C, D, E) A##B##C##D##E\n+#define __VCFG_PASTE5(A, B, C, D, E) __VCFG_PASTE5_BASE (A, B, C, D, E)\n+\n+#define __MAKE_VMERGE_VVM(T) \\\n+ __VCFG_PASTE5 (__riscv_vmerge_vvm_, T, BIT_WIDTH, m, LMUL)\n+#define __MAKE_VMERGE_VXM(T) \\\n+ __VCFG_PASTE5 (__riscv_vmerge_vxm_, T, BIT_WIDTH, m, LMUL)\n+#define __MAKE_VFMERGE_VFM \\\n+ __VCFG_PASTE4 (__riscv_vfmerge_vfm_f, BIT_WIDTH, m, LMUL)\n+#define __MAKE_VFMUL_VF_M \\\n+ __VCFG_PASTE5 (__riscv_vfmul_vf_f, BIT_WIDTH, m, LMUL, _m)\n+#define __MAKE_VFREC7_M \\\n+ __VCFG_PASTE5 (__riscv_vfrec7_v_f, BIT_WIDTH, m, LMUL, _m)\n+#define __MAKE_VFADD_VV_M \\\n+ __VCFG_PASTE5 (__riscv_vfadd_vv_f, BIT_WIDTH, m, LMUL, _m)\n+\n+#define VMERGE_VVM_F(op1, op2, mask, vlen) \\\n+ __MAKE_VMERGE_VVM (f) ((op1), (op2), (mask), (vlen))\n+#define VMERGE_VXM_I(op1, scalar, mask, vlen) \\\n+ __MAKE_VMERGE_VXM (i) ((op1), (scalar), (mask), (vlen))\n+#define VFMERGE_VFM(op1, scalar, mask, vlen) \\\n+ __MAKE_VFMERGE_VFM ((op1), (scalar), (mask), (vlen))\n+#define VFMUL_VF_M(mask, op1, scalar, vlen) \\\n+ __MAKE_VFMUL_VF_M ((mask), (op1), (scalar), (vlen))\n+#define VFREC7_M(mask, op1, vlen) \\\n+ __MAKE_VFREC7_M ((mask), (op1), (vlen))\n+#define VFADD_VV_M(mask, op1, op2, vlen) \\\n+ __MAKE_VFADD_VV_M ((mask), (op1), (op2), (vlen))\n+\n+#ifndef FE_TONEAREST\n+#define FE_TONEAREST 0x000\n+#endif\n+\n+#define read_frm() \\\n+ ({ \\\n+ unsigned long __value; \\\n+ __asm__ __volatile__ (\"frrm %0\" : \"=r\"(__value)::\"memory\"); \\\n+ __value; \\\n+ })\n+\n+#define write_frm(value) \\\n+ ({ \\\n+ unsigned long __value; \\\n+ __asm__ __volatile__ (\"fsrm %0, %1\" \\\n+ : \"=r\"(__value) \\\n+ : \"r\"(value) \\\n+ : \"memory\"); \\\n+ __value; \\\n+ })\n+\n+#define SET_ROUNDTONEAREST \\\n+ int __original_frm = read_frm (); \\\n+ if (__original_frm != FE_TONEAREST) \\\n+ { \\\n+ write_frm (FE_TONEAREST); \\\n+ }\n+\n+#define RESTORE_FRM \\\n+ do \\\n+ { \\\n+ if (__original_frm != FE_TONEAREST) \\\n+ { \\\n+ write_frm (__original_frm); \\\n+ } \\\n+ } \\\n+ while (0)\n+\n+#define PSTEP(coeff_j, x, poly, vlen) \\\n+ __riscv_vfmadd ((poly), (x), VFMV_VF ((coeff_j), (vlen)), (vlen))\n+\n+#define IDENTIFY(vclass, stencil, identity_mask, vlen) \\\n+ identity_mask = __riscv_vmsgtu (__riscv_vand ((vclass), (stencil), (vlen)), \\\n+ 0, (vlen))\n+\n+/* Define the table for table-driven implementations. */\n+#define V_LOG_TABLE_BITS 7\n+extern const struct v_log_data\n+{\n+ const int64_t table[1 << V_LOG_TABLE_BITS];\n+} __v_log_data attribute_hidden;\n+\n+__END_DECLS\n+\n+#endif\ndiff --git a/sysdeps/unix/sysv/linux/riscv/libmvec.abilist b/sysdeps/unix/sysv/linux/riscv/libmvec.abilist\nnew file mode 100644\nindex 0000000000..2592c2dc6f\n--- /dev/null\n+++ b/sysdeps/unix/sysv/linux/riscv/libmvec.abilist\n@@ -0,0 +1,11 @@\n+GLIBC_2.43 _ZGVr1N2v_log F\n+GLIBC_2.43 _ZGVr1N4v_log F\n+GLIBC_2.43 _ZGVr2N2v_log F\n+GLIBC_2.43 _ZGVr2N4v_log F\n+GLIBC_2.43 _ZGVr2N8v_log F\n+GLIBC_2.43 _ZGVr4N4v_log F\n+GLIBC_2.43 _ZGVr4N8v_log F\n+GLIBC_2.43 _ZGVr4N16v_log F\n+GLIBC_2.43 _ZGVr8N8v_log F\n+GLIBC_2.43 _ZGVr8N16v_log F\n+GLIBC_2.43 _ZGVr8N32v_log F\n", "prefixes": [ "RFC", "1/5" ] }