This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Improves __ieee754_exp() performance by 2x-5x on sparc/x86.


On 1/3/2018 1:28 PM, Patrick McGehearty wrote:
Version 10 of proposed patch.

Add removal of sysdeps/i386/fpu/slowexp.c, sysdeps/ia64/fpu/slowexp.c
and sysdeps/m68k/m680x0/fpu/slowexp.c as building of slowexp.c no
longer needs to be overriden in these architectures.

Reverted eexp.tbl to 64 entries for scaling table and changed back to
invln2_64, ln2_64hi, ln2_64lo. Reduces L1 cache impact of table at
cost of increasing frequency of 1 ulp differences from old method.

Cleaned up trailing white space in e_exp.c

Performance gain for typical values is 2x on Sparc and 5x on x86.
SET_RESTORE_ROUND is particularly slow on Sparc.  Investigating the
root cause is out of scope for this patch, but worthy of later study
as the same issue may be seen elsewhere.  For those values which
triggered calls to "slowexp" in the previous algorithm, the speedup on
both Sparc and x86 is over 100x. Over a range of randomly generated
values, these slow cases are rare but have been reported to be notable
in some applications.


Here is the proposed change log to go with patch version 10.
It includes the files overlooked in patch version 8.

2017-12-19  Patrick McGehearty <patrick.mcgehearty@oracle.com>

        * sysdeps/ieee754/dbl-64/e_exp.c: 5x faster __ieee754_exp() routine.
        * sysdeps/ieee754/dbl-64/eexp.tbl: New file for e_exp.
        * sysdeps/ieee754/dbl-64/slowexp.c: Removed.
        * sysdeps/i386/fpu/slowexp.c: Removed.
        * sysdeps/ia64/fpu/slowexp.c: Removed.
        * sysdeps/m68k/m680x0/fpu/slowexp.c: Removed.
        * sysdeps/x86_64/fpu/multiarch/slowexp-avx.c: Removed.
        * sysdeps/x86_64/fpu/multiarch/slowexp-fma.c: Removed.
        * sysdeps/x86_64/fpu/multiarch/slowexp-fma4.c: Removed.
        * sysdeps/generic/math_private.h: Remove slowexp.
        * sysdeps/ieee754/dbl-64/e_pow.c: Likewise.
        * sysdeps/powerpc/power4/fpu/Makefile: Likewise.
        * sysdeps/x86_64/fpu/multiarch/Makefile: Likewise.
        * sysdeps/x86_64/fpu/multiarch/e_exp-avx.c: Likewise.
        * sysdeps/x86_64/fpu/multiarch/e_exp-fma.c: Likewise.
        * sysdeps/x86_64/fpu/multiarch/e_exp-fma4.c: Likewise.
        * math/Makefile: Likewise.
        * manual/probes.texi: Remove slowexp documentation.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]