mirror of git://sourceware.org/git/glibc.git
x86_64: Add atanh with FMA
On SPR, it improves atanh bench performance by: Before After Improvement reciprocal-throughput 15.1715 14.8628 2% latency 57.1941 56.1883 2% Reviewed-by: H.J. Lu <hjl.tools@gmail.com>
This commit is contained in:
parent
9b646f5dc9
commit
c7c4a5906f
|
|
@ -1,6 +1,7 @@
|
||||||
## args: double
|
## args: double
|
||||||
## ret: double
|
## ret: double
|
||||||
## includes: math.h
|
## includes: math.h
|
||||||
|
## name: workload-random
|
||||||
0x1.5a2730bacd94ap-1
|
0x1.5a2730bacd94ap-1
|
||||||
-0x1.b57eb40fc048ep-21
|
-0x1.b57eb40fc048ep-21
|
||||||
-0x1.c0b185fb450e2p-17
|
-0x1.c0b185fb450e2p-17
|
||||||
|
|
|
||||||
|
|
@ -44,6 +44,11 @@
|
||||||
|
|
||||||
static const double huge = 1e300;
|
static const double huge = 1e300;
|
||||||
|
|
||||||
|
#ifndef SECTION
|
||||||
|
# define SECTION
|
||||||
|
#endif
|
||||||
|
|
||||||
|
SECTION
|
||||||
double
|
double
|
||||||
__ieee754_atanh (double x)
|
__ieee754_atanh (double x)
|
||||||
{
|
{
|
||||||
|
|
@ -73,4 +78,7 @@ __ieee754_atanh (double x)
|
||||||
|
|
||||||
return copysign (t, x);
|
return copysign (t, x);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifndef __ieee754_atanh
|
||||||
libm_alias_finite (__ieee754_atanh, __atanh)
|
libm_alias_finite (__ieee754_atanh, __atanh)
|
||||||
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
ifeq ($(subdir),math)
|
ifeq ($(subdir),math)
|
||||||
CFLAGS-e_asin-fma.c = -mfma -mavx2
|
CFLAGS-e_asin-fma.c = -mfma -mavx2
|
||||||
CFLAGS-e_atan2-fma.c = -mfma -mavx2
|
CFLAGS-e_atan2-fma.c = -mfma -mavx2
|
||||||
|
CFLAGS-e_atanh-fma.c = -mfma -mavx2
|
||||||
CFLAGS-e_exp-fma.c = -mfma -mavx2
|
CFLAGS-e_exp-fma.c = -mfma -mavx2
|
||||||
CFLAGS-e_log-fma.c = -mfma -mavx2
|
CFLAGS-e_log-fma.c = -mfma -mavx2
|
||||||
CFLAGS-e_log2-fma.c = -mfma -mavx2
|
CFLAGS-e_log2-fma.c = -mfma -mavx2
|
||||||
|
|
@ -59,6 +60,7 @@ libm-sysdep_routines += \
|
||||||
e_asin-fma \
|
e_asin-fma \
|
||||||
e_atan2-avx \
|
e_atan2-avx \
|
||||||
e_atan2-fma \
|
e_atan2-fma \
|
||||||
|
e_atanh-fma \
|
||||||
e_exp-avx \
|
e_exp-avx \
|
||||||
e_exp-fma \
|
e_exp-fma \
|
||||||
e_exp2f-fma \
|
e_exp2f-fma \
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,6 @@
|
||||||
|
#define __ieee754_atanh __ieee754_atanh_fma
|
||||||
|
#define __log1p __log1p_fma
|
||||||
|
|
||||||
|
#define SECTION __attribute__ ((section (".text.fma")))
|
||||||
|
|
||||||
|
#include <sysdeps/ieee754/dbl-64/e_atanh.c>
|
||||||
|
|
@ -0,0 +1,34 @@
|
||||||
|
/* Multiple versions of atanh.
|
||||||
|
Copyright (C) 2025 Free Software Foundation, Inc.
|
||||||
|
This file is part of the GNU C Library.
|
||||||
|
|
||||||
|
The GNU C Library is free software; you can redistribute it and/or
|
||||||
|
modify it under the terms of the GNU Lesser General Public
|
||||||
|
License as published by the Free Software Foundation; either
|
||||||
|
version 2.1 of the License, or (at your option) any later version.
|
||||||
|
|
||||||
|
The GNU C Library is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
Lesser General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU Lesser General Public
|
||||||
|
License along with the GNU C Library; if not, see
|
||||||
|
<https://www.gnu.org/licenses/>. */
|
||||||
|
|
||||||
|
#include <sysdeps/x86/isa-level.h>
|
||||||
|
#if MINIMUM_X86_ISA_LEVEL < AVX2_X86_ISA_LEVEL
|
||||||
|
# include <libm-alias-finite.h>
|
||||||
|
|
||||||
|
extern double __redirect_ieee754_atanh (double);
|
||||||
|
|
||||||
|
# define SYMBOL_NAME ieee754_atanh
|
||||||
|
# include "ifunc-fma.h"
|
||||||
|
|
||||||
|
libc_ifunc_redirected (__redirect_ieee754_atanh, __ieee754_atanh, IFUNC_SELECTOR ());
|
||||||
|
|
||||||
|
libm_alias_finite (__ieee754_atanh, __atanh)
|
||||||
|
|
||||||
|
# define __ieee754_atanh __ieee754_atanh_sse2
|
||||||
|
#endif
|
||||||
|
#include <sysdeps/ieee754/dbl-64/e_atanh.c>
|
||||||
Loading…
Reference in New Issue