• Alberto Donizetti's avatar
    math: check overflow in amd64 Exp implementation · f44e5870
    Alberto Donizetti authored
    Unlike the pure go implementation used by every other architecture,
    the amd64 asm implementation of Exp does not fail early if the
    argument is known to overflow. Make it fail early.
    
    Cost of the check is < 1ns (on an old Sandy Bridge machine):
    
    name   old time/op  new time/op  delta
    Exp-4  18.3ns ± 1%  18.7ns ± 1%  +2.08%  (p=0.000 n=18+20)
    
    Fixes #14932
    Fixes #18912
    
    Change-Id: I04b3f9b4ee853822cbdc97feade726fbe2907289
    Reviewed-on: https://go-review.googlesource.com/36271
    Run-TryBot: Alberto Donizetti <alb.donizetti@gmail.com>
    Reviewed-by: 's avatarRuss Cox <rsc@golang.org>
    TryBot-Result: Gobot Gobot <gobot@golang.org>
    f44e5870
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...