[PATCH 0/8] Add sinf/cosf/sincosf CORE-MATH implementations
Adhemerval Zanella
adhemerval.zanella@linaro.org
Wed Mar 25 19:22:18 GMT 2026
This patchset adds the optimized and correctly rounded cosf, sinf, and
sincosf from CORE-MATH [1]. The patch adds new input ranges for the
benchtests based on feedback from SPECcpu2017 usage.
The performance is similar, with some gains and some regressions. The
x86_64-v1 shows some performance regression because the CORE-MATH
implementation relies on roundeven. The x86_64v2 and forward provide
a specific instruction, and x86_64 already provides an FMA ifunc variant.
[1] https://gitlab.inria.fr/core-math/core-math
Adhemerval Zanella (8):
benchtest: Redefine cosf ranges
benchtest: Redefine sinf ranges
benchtest: Redefine sincosf ranges
math: Use sinf from CORE-MATH
math: Use cosf from CORE-MATH
math: Use sincosf from CORE-MATH
math: Consolidate common definitions for cosf/sinf/tanf/sincosf
math: Remove unused definitions for sinf/cosf/sincosf implementation
SHARED-FILES | 6 +
benchtests/cosf-inputs | 5409 ++++++-----
benchtests/sincosf-inputs | 8309 ++++++-----------
benchtests/sinf-inputs | 7919 ++++++----------
math/Makefile | 2 +
math/auto-libm-test-in | 1 +
math/auto-libm-test-out-sincos | 25 +
sysdeps/ieee754/flt-32/libm-test-ulps | 36 +
sysdeps/ieee754/flt-32/reduce_aux.h | 38 +-
.../flt-32/reduce_aux_data.c} | 37 +-
sysdeps/ieee754/flt-32/s_cosf.c | 160 +-
sysdeps/ieee754/flt-32/s_sincosf.c | 191 +-
sysdeps/ieee754/flt-32/s_sincosf.h | 95 -
sysdeps/ieee754/flt-32/s_sincosf_common.c | 90 +
sysdeps/ieee754/flt-32/s_sincosf_common.h | 63 +
sysdeps/ieee754/flt-32/s_sincosf_data.c | 157 +-
sysdeps/ieee754/flt-32/s_sincosf_data.h | 64 +
sysdeps/ieee754/flt-32/s_sinf.c | 164 +-
sysdeps/ieee754/flt-32/s_tanf.c | 65 +-
sysdeps/ieee754/flt-32/sincosf_poly.h | 87 -
sysdeps/x86/fpu/sincosf_poly.h | 111 -
21 files changed, 9752 insertions(+), 13277 deletions(-)
rename sysdeps/{x86/fpu/s_sincosf_data.c => ieee754/flt-32/reduce_aux_data.c} (58%)
delete mode 100644 sysdeps/ieee754/flt-32/s_sincosf.h
create mode 100644 sysdeps/ieee754/flt-32/s_sincosf_common.c
create mode 100644 sysdeps/ieee754/flt-32/s_sincosf_common.h
create mode 100644 sysdeps/ieee754/flt-32/s_sincosf_data.h
delete mode 100644 sysdeps/ieee754/flt-32/sincosf_poly.h
delete mode 100644 sysdeps/x86/fpu/sincosf_poly.h
--
2.43.0
More information about the Libc-alpha
mailing list