• 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
..
README Loading commit data...
arithmetic.go Loading commit data...
bitfield.go Loading commit data...
bits.go Loading commit data...
comparisons.go Loading commit data...
condmove.go Loading commit data...
copy.go Loading commit data...
floats.go Loading commit data...
issue22703.go Loading commit data...
issue25378.go Loading commit data...
mapaccess.go Loading commit data...
maps.go Loading commit data...
math.go Loading commit data...
mathbits.go Loading commit data...
memcombine.go Loading commit data...
rotate.go Loading commit data...
shift.go Loading commit data...
slices.go Loading commit data...
stack.go Loading commit data...
strings.go Loading commit data...
structs.go Loading commit data...