math: new exp and exp2
commite16f7b3c02e17d0ace779a11f0d53a9c05fdd434
authorSzabolcs Nagy <nsz@port70.net>
Fri, 30 Nov 2018 21:39:47 +0000 (30 21:39 +0000)
committerRich Felker <dalias@aerifal.cx>
Thu, 18 Apr 2019 03:45:25 +0000 (17 23:45 -0400)
treef60943599162fe681d5753aa6744b471ec4193a9
parent2a3210cf4abff0a69ff3e7adc66591dfe6ab2197
math: new exp and exp2

from https://github.com/ARM-software/optimized-routines,
commit 04884bd04eac4b251da4026900010ea7d8850edc

TOINT_INTRINSICS and EXP_USE_TOINT_NARROW cases are unused.

The underflow exception is signaled if the result is in the subnormal
range even if the result is exact (e.g. exp2(-1023.0)).

code size change: -1672 bytes.
benchmark on x86_64 before, after, speedup:

-Os:
   exp rthruput:  12.73 ns/call  6.68 ns/call 1.91x
    exp latency:  45.78 ns/call 21.79 ns/call 2.1x
  exp2 rthruput:   6.35 ns/call  5.26 ns/call 1.21x
   exp2 latency:  26.00 ns/call 16.58 ns/call 1.57x
-O3:
   exp rthruput:  12.75 ns/call  6.73 ns/call 1.89x
    exp latency:  45.91 ns/call 21.80 ns/call 2.11x
  exp2 rthruput:   6.47 ns/call  5.40 ns/call 1.2x
   exp2 latency:  26.03 ns/call 16.54 ns/call 1.57x
src/math/exp.c
src/math/exp2.c
src/math/exp_data.c [new file with mode: 0644]
src/math/exp_data.h [new file with mode: 0644]