• erifan01's avatar
    cmd/compile: implement non-constant rotates using ROR on arm64 · 204cc14b
    erifan01 authored
    Add some rules to match the Go code like:
    	y &= 63
    	x << y | x >> (64-y)
    or
    	y &= 63
    	x >> y | x << (64-y)
    as a ROR instruction. Make math/bits.RotateLeft faster on arm64.
    
    Extends CL 132435 to arm64.
    
    Benchmarks of math/bits.RotateLeftxxN:
    name            old time/op       new time/op       delta
    RotateLeft-8    3.548750ns +- 1%  2.003750ns +- 0%  -43.54%  (p=0.000 n=8+8)
    RotateLeft8-8   3.925000ns +- 0%  3.925000ns +- 0%     ~     (p=1.000 n=8+8)
    RotateLeft16-8  3.925000ns +- 0%  3.927500ns +- 0%     ~     (p=0.608 n=8+8)
    RotateLeft32-8  3.925000ns +- 0%  2.002500ns +- 0%  -48.98%  (p=0.000 n=8+8)
    RotateLeft64-8  3.536250ns +- 0%  2.003750ns +- 0%  -43.34%  (p=0.000 n=8+8)
    
    Change-Id: I77622cd7f39b917427e060647321f5513973232c
    Reviewed-on: https://go-review.googlesource.com/122542
    Run-TryBot: Ben Shi <powerman1st@163.com>
    TryBot-Result: Gobot Gobot <gobot@golang.org>
    Reviewed-by: 's avatarCherry Zhang <cherryyz@google.com>
    204cc14b
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...