diff options
author | erifan01 <eric.fang@arm.com> | 2019-02-11 09:40:02 +0000 |
---|---|---|
committer | Cherry Zhang <cherryyz@google.com> | 2019-03-07 13:37:54 +0000 |
commit | fee84cc90542884edda60d3eec2cd47f72d67118 (patch) | |
tree | 0193c9781e52c6b2f18977f84718546e68dcd4de /src/cmd/compile/internal/arm | |
parent | a2ace8ec18a833e5d286e4e9af6fc5de41ca9a31 (diff) | |
download | go-fee84cc90542884edda60d3eec2cd47f72d67118.tar.gz go-fee84cc90542884edda60d3eec2cd47f72d67118.zip |
cmd/compile: add an optimization rule for math/bits.ReverseBytes16 on arm
This CL adds two rules to turn patterns like ((x<<8) | (x>>8)) (the type of
x is uint16, "|" can also be "+" or "^") to a REV16 instruction on arm v6+.
This optimization rule can be used for math/bits.ReverseBytes16.
Benchmarks on arm v6:
name old time/op new time/op delta
ReverseBytes-32 2.86ns ± 0% 2.86ns ± 0% ~ (all equal)
ReverseBytes16-32 2.86ns ± 0% 2.86ns ± 0% ~ (all equal)
ReverseBytes32-32 1.29ns ± 0% 1.29ns ± 0% ~ (all equal)
ReverseBytes64-32 1.43ns ± 0% 1.43ns ± 0% ~ (all equal)
Change-Id: I819e633c9a9d308f8e476fb0c82d73fb73dd019f
Reviewed-on: https://go-review.googlesource.com/c/go/+/159019
Reviewed-by: Cherry Zhang <cherryyz@google.com>
Run-TryBot: Cherry Zhang <cherryyz@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Diffstat (limited to 'src/cmd/compile/internal/arm')
-rw-r--r-- | src/cmd/compile/internal/arm/ssa.go | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/cmd/compile/internal/arm/ssa.go b/src/cmd/compile/internal/arm/ssa.go index 9a8fabf622..320fe98707 100644 --- a/src/cmd/compile/internal/arm/ssa.go +++ b/src/cmd/compile/internal/arm/ssa.go @@ -659,6 +659,7 @@ func ssaGenValue(s *gc.SSAGenState, v *ssa.Value) { case ssa.OpARMMVN, ssa.OpARMCLZ, ssa.OpARMREV, + ssa.OpARMREV16, ssa.OpARMRBIT, ssa.OpARMSQRTD, ssa.OpARMNEGF, |