[PATCH v2 8/8] x86: Fix tanh ifunc selection

Adhemerval Zanella adhemerval.zanella@linaro.org
Fri Mar 6 12:25:25 GMT 2026


The inclusion of generic tanh implementation without undefining the
libm_alias_double (to provide the __tanh_sse2 implementation) makes
the exported tanh symbol pointing to SSE2 variant.
---
 sysdeps/x86_64/fpu/multiarch/s_tanh.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/sysdeps/x86_64/fpu/multiarch/s_tanh.c b/sysdeps/x86_64/fpu/multiarch/s_tanh.c
index ce58e01d3b..ec8826f634 100644
--- a/sysdeps/x86_64/fpu/multiarch/s_tanh.c
+++ b/sysdeps/x86_64/fpu/multiarch/s_tanh.c
@@ -18,14 +18,17 @@
 
 #include <sysdeps/x86/isa-level.h>
 #if MINIMUM_X86_ISA_LEVEL < AVX2_X86_ISA_LEVEL
+#include <libm-alias-double.h>
 
 extern double __redirect_tanh (double);
 
 # define SYMBOL_NAME tanh
 # include "ifunc-fma.h"
 
-libc_ifunc_redirected (__redirect_tanh, __tanh, IFUNC_SELECTOR ());
+libc_ifunc_redirected (__redirect_tanh, tanh, IFUNC_SELECTOR ());
 
 # define __tanh __tanh_sse2
+# undef libm_alias_double
+# define libm_alias_double(a, b)
 #endif
 #include <sysdeps/ieee754/dbl-64/s_tanh.c>
-- 
2.43.0



More information about the Libc-alpha mailing list