glibc/sysdeps/i386
Siddhesh Poyarekar 2506109403 Set/restore rounding mode only when needed
The most common use case of math functions is with default rounding
mode, i.e. rounding to nearest.  Setting and restoring rounding mode
is an unnecessary overhead for this, so I've added support for a
context, which does the set/restore only if the FP status needs a
change.  The code is written such that only x86 uses these.  Other
architectures should be unaffected by it, but would definitely benefit
if the set/restore has as much overhead relative to the rest of the
code, as the x86 bits do.

Here's a summary of the performance improvement due to these
improvements; I've only mentioned functions that use the set/restore
and have benchmark inputs for x86_64:

Before:

cos(): ITERS:4.69335e+08: TOTAL:28884.6Mcy, MAX:4080.28cy, MIN:57.562cy, 16248.6 calls/Mcy
exp(): ITERS:4.47604e+08: TOTAL:28796.2Mcy, MAX:207.721cy, MIN:62.385cy, 15543.9 calls/Mcy
pow(): ITERS:1.63485e+08: TOTAL:28879.9Mcy, MAX:362.255cy, MIN:172.469cy, 5660.86 calls/Mcy
sin(): ITERS:3.89578e+08: TOTAL:28900Mcy, MAX:704.859cy, MIN:47.583cy, 13480.2 calls/Mcy
tan(): ITERS:7.0971e+07: TOTAL:28902.2Mcy, MAX:1357.79cy, MIN:388.58cy, 2455.55 calls/Mcy

After:

cos(): ITERS:6.0014e+08: TOTAL:28875.9Mcy, MAX:364.283cy, MIN:45.716cy, 20783.4 calls/Mcy
exp(): ITERS:5.48578e+08: TOTAL:28764.9Mcy, MAX:191.617cy, MIN:51.011cy, 19071.1 calls/Mcy
pow(): ITERS:1.70013e+08: TOTAL:28873.6Mcy, MAX:689.522cy, MIN:163.989cy, 5888.18 calls/Mcy
sin(): ITERS:4.64079e+08: TOTAL:28891.5Mcy, MAX:6959.3cy, MIN:36.189cy, 16062.8 calls/Mcy
tan(): ITERS:7.2354e+07: TOTAL:28898.9Mcy, MAX:1295.57cy, MIN:380.698cy, 2503.7 calls/Mcy

So the improvements are:

cos: 27.9089%
exp: 22.6919%
pow: 4.01564%
sin: 19.1585%
tan: 1.96086%

The downside of the change is that it will have an adverse performance
impact on non-default rounding modes, but I think the tradeoff is
justified.
2013-06-12 10:36:48 +05:30
..
fpu Set/restore rounding mode only when needed 2013-06-12 10:36:48 +05:30
i486 Remove remaining bounded-pointers support from i386 .S files. 2013-02-21 22:21:52 +00:00
i586 Remove remaining bounded-pointers support from i386 .S files. 2013-02-21 22:21:52 +00:00
i686 Remove remaining bounded-pointers support from i386 .S files. 2013-02-21 22:21:52 +00:00
i786 Also applying directories. 1999-01-24 10:39:22 +00:00
sys Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
____longjmp_chk.S Add sigstack handling to Linux ____longjmp_chk on i386. 2009-07-30 21:50:14 -07:00
__longjmp.S Fix leading whitespaces. 2013-06-06 20:36:07 +02:00
abort-instr.h update from main archive 961220 1996-12-21 04:13:58 +00:00
add_n.S Remove remaining bounded-pointers support from i386 .S files. 2013-02-21 22:21:52 +00:00
addmul_1.S Remove remaining bounded-pointers support from i386 .S files. 2013-02-21 22:21:52 +00:00
asm-syntax.h Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
backtrace.c Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
bsd-_setjmp.S Fix leading whitespaces. 2013-06-06 20:36:07 +02:00
bsd-setjmp.S Fix leading whitespaces. 2013-06-06 20:36:07 +02:00
bzero.c Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
configure Configuring for i386 is no longer supported. 2013-04-17 17:13:20 -07:00
configure.in Configuring for i386 is no longer supported. 2013-04-17 17:13:20 -07:00
crti.S Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
crtn.S Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
dl-irel.h Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
dl-lookupcfg.h Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
dl-machine.h Avoid crashing in LD_DEBUG when program name is unavailable 2013-05-29 21:34:12 +05:30
dl-procinfo.c Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
dl-procinfo.h Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
dl-tls.h Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
dl-tlsdesc.h Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
dl-tlsdesc.S Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
dl-trampoline.S Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
ffs.c Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
gccframe.h Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
gmp-mparam.h Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
htonl.S Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
htons.S Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
i386-mcount.S Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
Implies Use x86-64 bits/byteswap.h for both i386 and x86_64 2012-05-30 14:13:18 -07:00
jmpbuf-offsets.h Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
jmpbuf-unwind.h Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
ldbl2mpn.c Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
ldsodefs.h Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
lshift.S Remove remaining bounded-pointers support from i386 .S files. 2013-02-21 22:21:52 +00:00
machine-gmon.h Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
Makefile Support crti.S and crtn.S provided directly by architectures. 2012-02-08 01:45:26 +00:00
memchr.S Remove remaining bounded-pointers support from i386 .S files. 2013-02-21 22:21:52 +00:00
memcmp.S Remove remaining bounded-pointers support from i386 .S files. 2013-02-21 22:21:52 +00:00
memcopy.h Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
memset.c Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
memusage.h Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
mp_clz_tab.c Update. 2002-03-14 20:48:50 +00:00
mul_1.S Remove remaining bounded-pointers support from i386 .S files. 2013-02-21 22:21:52 +00:00
rawmemchr.S Remove remaining bounded-pointers support from i386 .S files. 2013-02-21 22:21:52 +00:00
rshift.S Remove remaining bounded-pointers support from i386 .S files. 2013-02-21 22:21:52 +00:00
setfpucw.c Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
setjmp.S Fix leading whitespaces. 2013-06-06 20:36:07 +02:00
stackguard-macros.h Split up stackguard-macros.h into sysdeps directories. 2012-05-15 23:34:30 +00:00
stackinfo.h Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
start.S Remove remaining bounded-pointers support from i386 .S files. 2013-02-21 22:21:52 +00:00
stpcpy.S Remove remaining bounded-pointers support from i386 .S files. 2013-02-21 22:21:52 +00:00
stpncpy.S Remove remaining bounded-pointers support from i386 .S files. 2013-02-21 22:21:52 +00:00
strchr.S Remove remaining bounded-pointers support from i386 .S files. 2013-02-21 22:21:52 +00:00
strchrnul.S Remove remaining bounded-pointers support from i386 .S files. 2013-02-21 22:21:52 +00:00
strcspn.S Remove remaining bounded-pointers support from i386 .S files. 2013-02-21 22:21:52 +00:00
string-inlines.c Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
strlen.c Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
strpbrk.S Remove remaining bounded-pointers support from i386 .S files. 2013-02-21 22:21:52 +00:00
strrchr.S Remove remaining bounded-pointers support from i386 .S files. 2013-02-21 22:21:52 +00:00
strspn.S Remove remaining bounded-pointers support from i386 .S files. 2013-02-21 22:21:52 +00:00
strtok_r.S Remove remaining bounded-pointers support from i386 .S files. 2013-02-21 22:21:52 +00:00
strtok.S Remove remaining bounded-pointers support from i386 .S files. 2013-02-21 22:21:52 +00:00
sub_n.S Remove remaining bounded-pointers support from i386 .S files. 2013-02-21 22:21:52 +00:00
submul_1.S Remove remaining bounded-pointers support from i386 .S files. 2013-02-21 22:21:52 +00:00
sysdep.h Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
tls-macros.h Split tls-macros.h into sysdeps directories. 2012-07-17 11:30:58 +00:00
tlsdesc.c Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
tlsdesc.sym Introduce TLS descriptors for i386 and x86_64. 2008-05-13 05:41:30 +00:00
tst-audit.h Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
tst-stack-align.h Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
Versions Merge sysdeps/i386/elf/Versions into sysdeps/i386/Versions. 2012-03-19 21:02:40 +01:00