• erifan01's avatar
    cmd/compile: intrinsify math.RoundToEven and math.Abs on arm64 · 8149db4f
    erifan01 authored
    math.RoundToEven can be done by one arm64 instruction FRINTND, intrinsify it to improve performance.
    The current pure Go implementation of the function Abs is translated into five instructions on arm64:
    str, ldr, and, str, ldr. The intrinsic implementation requires only one instruction, so in terms of
    performance, intrinsify it is worthwhile.
    
    Benchmarks:
    name           old time/op  new time/op  delta
    Abs-8          3.50ns ± 0%  1.50ns ± 0%  -57.14%  (p=0.000 n=10+10)
    RoundToEven-8  9.26ns ± 0%  1.50ns ± 0%  -83.80%  (p=0.000 n=10+10)
    
    Change-Id: I9456b26ab282b544dfac0154fc86f17aed96ac3d
    Reviewed-on: https://go-review.googlesource.com/116535Reviewed-by: 's avatarCherry Zhang <cherryyz@google.com>
    Run-TryBot: Cherry Zhang <cherryyz@google.com>
    TryBot-Result: Gobot Gobot <gobot@golang.org>
    8149db4f
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...