• Agniva De Sarker's avatar
    math: implement fast path for Exp · d2f31721
    Agniva De Sarker authored
    - using FMA and AVX instructions if available to speed-up
    Exp calculation on amd64
    
    - using a data table instead of #define'ed constants because
    these instructions do not support loading floating point immediates.
    One has to use a memory operand / register.
    
    - Benchmark results on Intel(R) Core(TM) i5-5200U CPU @ 2.20GHz:
    
    Original vs New (non-FMA path)
    name  old time/op    new time/op    delta
    Exp     16.0ns ± 1%    16.1ns ± 3%   ~     (p=0.308 n=9+10)
    
    Original vs New (FMA path)
    name  old time/op    new time/op    delta
    Exp     16.0ns ± 1%    13.7ns ± 2%  -14.80%  (p=0.000 n=9+10)
    
    Change-Id: I3d8986925d82b39b95ee979ae06f59d7e591d02e
    Reviewed-on: https://go-review.googlesource.com/62590Reviewed-by: 's avatarIlya Tocar <ilya.tocar@intel.com>
    Reviewed-by: 's avatarKeith Randall <khr@golang.org>
    Run-TryBot: Keith Randall <khr@golang.org>
    TryBot-Result: Gobot Gobot <gobot@golang.org>
    d2f31721
Name
Last commit
Last update
.github Loading commit data...
api Loading commit data...
doc Loading commit data...
lib/time Loading commit data...
misc Loading commit data...
src Loading commit data...
test Loading commit data...
.gitattributes Loading commit data...
.gitignore Loading commit data...
AUTHORS Loading commit data...
CONTRIBUTING.md Loading commit data...
CONTRIBUTORS Loading commit data...
LICENSE Loading commit data...
PATENTS Loading commit data...
README.md Loading commit data...
favicon.ico Loading commit data...
robots.txt Loading commit data...