]> git.ipfire.org Git - thirdparty/glibc.git/commit
[PATCH 2/7] sin/cos slow paths: remove large range reduction
authorWilco Dijkstra <wdijkstr@arm.com>
Tue, 3 Apr 2018 15:28:03 +0000 (16:28 +0100)
committerFangrui Song <i@maskray.me>
Sat, 28 Aug 2021 00:26:05 +0000 (17:26 -0700)
commite525ff25dfea2fd30566066b0e050c9f6f80e092
tree02170ea02b9df8e2f39a1c4e809fbdf0ac968b75
parentbc57e68bbbc6b5290d8944ab8a5cf30a4351beb4
[PATCH 2/7] sin/cos slow paths: remove large range reduction

This patch removes the large range reduction code and defers to the huge range
reduction code.  The first level range reducer supports inputs up to 2^27,
which is way too large given that inputs for sin/cos are typically small
(< 10), and optimizing for a smaller range would give a significant speedup.

Input values above 2^27 are practically never used, so there is no reason for
supporting range reduction between 2^27 and 2^48.  Removing it significantly
simplifies code and enables further speedups.  There is about a 2.3x slowdown
in this range due to __branred being extremely slow  (a better algorithm could
easily more than double performance).

* sysdeps/ieee754/dbl-64/s_sin.c (reduce_sincos_2): Remove function.
(do_sincos_2): Likewise.
(__sin): Remove middle range reduction case.
(__cos): Likewise.
* sysdeps/ieee754/dbl-64/s_sincos.c (__sincos): Remove middle range
reduction case.
sysdeps/ieee754/dbl-64/s_sin.c
sysdeps/ieee754/dbl-64/s_sincos.c