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] Sparc exp(), expf() performance improvement


On 8/2/2017 6:19 PM, David Miller wrote:
From: Patrick McGehearty <patrick.mcgehearty@oracle.com>
Date: Wed, 2 Aug 2017 14:53:19 -0500

I concur that it would be beneficial to use -mcpu=niagara4 for
selected libm functions, but do not believe it should be default on
without more extensive testing (and likely more compiler tuning).
This is precisely what has been suggested, have an niagara4 IFUNC
vector for math functions that benefit greatly from the fp<-->int
register move instructions.

I'm new to linux glibc development and have been using existing examples to suggest how I should do things like use ifunc. If there is a different approach that is recommended,
I'm willing to use it but will need some hints/instruction on what is.

My current approach of using
sparc_libm_ifunc (exp, hwcap & HWCAP_SPARC_CRYPTO ?
                  __exp_niagara4 : __ieee754_exp);
in sysdeps/sparc/sparc64/fpu/multiarch/e_exp-niagara4.c matches the approach used in
sysdeps/sparc/sparc64/fpu/multiarch/s_ceil.c
sysdeps/sparc/sparc64/fpu/multiarch/s_ceilf.c
sysdeps/sparc/sparc64/fpu/multiarch/s_floor.c
sysdeps/sparc/sparc64/fpu/multiarch/s_floorf.c
sysdeps/sparc/sparc64/fpu/multiarch/s_fma.c
sysdeps/sparc/sparc64/fpu/multiarch/s_fmaf.c
sysdeps/sparc/sparc64/fpu/multiarch/s_trunc.c
sysdeps/sparc/sparc64/fpu/multiarch/s_truncf.c

I'll note that simply using -mcpu=niagara4 on the existing ieee754 exp() code only provides a 5% performance gain. Due to other assignments, I will not have time/resources
to redo other libm functions at this time.

- patrick


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