diff options
author | Alberto Donizetti <alb.donizetti@gmail.com> | 2020-10-27 11:03:21 +0100 |
---|---|---|
committer | Alberto Donizetti <alb.donizetti@gmail.com> | 2020-10-27 20:03:41 +0000 |
commit | 5c1122b52895c1d7f2d41ea16d354bce636496d0 (patch) | |
tree | 4700abc98004078dcd8ca4abf9fae76af63d7a97 /src/cmd/compile/internal/ssa/rewriteAMD64.go | |
parent | d68c01fa1d770b0646f9819bc9ce86c14cb1e1b5 (diff) | |
download | go-5c1122b52895c1d7f2d41ea16d354bce636496d0.tar.gz go-5c1122b52895c1d7f2d41ea16d354bce636496d0.zip |
cmd/compile: delete isPowerOfTwo, switch to isPowerOfTwo64
rewrite.go has two identical functions isPowerOfTwo and
isPowerOfTwo64; the former has been there for a while, while the
latter was added together with isPowerOfTwo{8,16,32} for use in typed
rules.
This change deletes isPowerOfTwo and switch to using isPowerOfTwo64
everywhere.
Change-Id: If26c94565d2393fac6f0ba117ee7ee2fc915f7cd
Reviewed-on: https://go-review.googlesource.com/c/go/+/265417
Trust: Alberto Donizetti <alb.donizetti@gmail.com>
Run-TryBot: Alberto Donizetti <alb.donizetti@gmail.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
Diffstat (limited to 'src/cmd/compile/internal/ssa/rewriteAMD64.go')
-rw-r--r-- | src/cmd/compile/internal/ssa/rewriteAMD64.go | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/cmd/compile/internal/ssa/rewriteAMD64.go b/src/cmd/compile/internal/ssa/rewriteAMD64.go index 15bb627450..833470ea66 100644 --- a/src/cmd/compile/internal/ssa/rewriteAMD64.go +++ b/src/cmd/compile/internal/ssa/rewriteAMD64.go @@ -15834,12 +15834,12 @@ func rewriteValueAMD64_OpAMD64MULLconst(v *Value) bool { return true } // match: (MULLconst [c] x) - // cond: isPowerOfTwo(int64(c)+1) && c >= 15 + // cond: isPowerOfTwo64(int64(c)+1) && c >= 15 // result: (SUBL (SHLLconst <v.Type> [int8(log2(int64(c)+1))] x) x) for { c := auxIntToInt32(v.AuxInt) x := v_0 - if !(isPowerOfTwo(int64(c)+1) && c >= 15) { + if !(isPowerOfTwo64(int64(c)+1) && c >= 15) { break } v.reset(OpAMD64SUBL) @@ -16281,12 +16281,12 @@ func rewriteValueAMD64_OpAMD64MULQconst(v *Value) bool { return true } // match: (MULQconst [c] x) - // cond: isPowerOfTwo(int64(c)+1) && c >= 15 + // cond: isPowerOfTwo64(int64(c)+1) && c >= 15 // result: (SUBQ (SHLQconst <v.Type> [int8(log2(int64(c)+1))] x) x) for { c := auxIntToInt32(v.AuxInt) x := v_0 - if !(isPowerOfTwo(int64(c)+1) && c >= 15) { + if !(isPowerOfTwo64(int64(c)+1) && c >= 15) { break } v.reset(OpAMD64SUBQ) |