]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/compile: use generics for isPowerOfTwo predicates
authorkhr@golang.org <khr@golang.org>
Thu, 19 Sep 2024 17:06:55 +0000 (10:06 -0700)
committerGopher Robot <gobot@golang.org>
Tue, 24 Sep 2024 21:02:31 +0000 (21:02 +0000)
Change-Id: I097b53e9f13de6ff6eb18ae2261842b097f26390
Reviewed-on: https://go-review.googlesource.com/c/go/+/615197
Auto-Submit: Keith Randall <khr@google.com>
Reviewed-by: Keith Randall <khr@google.com>
Reviewed-by: Cuong Manh Le <cuong.manhle.vn@gmail.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: David Chase <drchase@google.com>
19 files changed:
src/cmd/compile/internal/ssa/_gen/386.rules
src/cmd/compile/internal/ssa/_gen/AMD64.rules
src/cmd/compile/internal/ssa/_gen/ARM.rules
src/cmd/compile/internal/ssa/_gen/ARM64.rules
src/cmd/compile/internal/ssa/_gen/LOONG64.rules
src/cmd/compile/internal/ssa/_gen/MIPS.rules
src/cmd/compile/internal/ssa/_gen/MIPS64.rules
src/cmd/compile/internal/ssa/_gen/S390X.rules
src/cmd/compile/internal/ssa/_gen/generic.rules
src/cmd/compile/internal/ssa/rewrite.go
src/cmd/compile/internal/ssa/rewrite386.go
src/cmd/compile/internal/ssa/rewriteAMD64.go
src/cmd/compile/internal/ssa/rewriteARM.go
src/cmd/compile/internal/ssa/rewriteARM64.go
src/cmd/compile/internal/ssa/rewriteLOONG64.go
src/cmd/compile/internal/ssa/rewriteMIPS.go
src/cmd/compile/internal/ssa/rewriteMIPS64.go
src/cmd/compile/internal/ssa/rewriteS390X.go
src/cmd/compile/internal/ssa/rewritegeneric.go

index d92dddd377af337bbc81e714c3164eda6159297e..433981222468a0b20dce23213c86c0ba16088157 100644 (file)
 (MULLconst [73] x) => (LEAL8 x (LEAL8 <v.Type> x x))
 (MULLconst [81] x) => (LEAL8 (LEAL8 <v.Type> x x) (LEAL8 <v.Type> x x))
 
-(MULLconst [c] x) && isPowerOfTwo32(c+1) && c >= 15 => (SUBL (SHLLconst <v.Type> [int32(log32(c+1))] x) x)
-(MULLconst [c] x) && isPowerOfTwo32(c-1) && c >= 17 => (LEAL1 (SHLLconst <v.Type> [int32(log32(c-1))] x) x)
-(MULLconst [c] x) && isPowerOfTwo32(c-2) && c >= 34 => (LEAL2 (SHLLconst <v.Type> [int32(log32(c-2))] x) x)
-(MULLconst [c] x) && isPowerOfTwo32(c-4) && c >= 68 => (LEAL4 (SHLLconst <v.Type> [int32(log32(c-4))] x) x)
-(MULLconst [c] x) && isPowerOfTwo32(c-8) && c >= 136 => (LEAL8 (SHLLconst <v.Type> [int32(log32(c-8))] x) x)
-(MULLconst [c] x) && c%3 == 0 && isPowerOfTwo32(c/3) => (SHLLconst [int32(log32(c/3))] (LEAL2 <v.Type> x x))
-(MULLconst [c] x) && c%5 == 0 && isPowerOfTwo32(c/5) => (SHLLconst [int32(log32(c/5))] (LEAL4 <v.Type> x x))
-(MULLconst [c] x) && c%9 == 0 && isPowerOfTwo32(c/9) => (SHLLconst [int32(log32(c/9))] (LEAL8 <v.Type> x x))
+(MULLconst [c] x) && isPowerOfTwo(c+1) && c >= 15 => (SUBL (SHLLconst <v.Type> [int32(log32(c+1))] x) x)
+(MULLconst [c] x) && isPowerOfTwo(c-1) && c >= 17 => (LEAL1 (SHLLconst <v.Type> [int32(log32(c-1))] x) x)
+(MULLconst [c] x) && isPowerOfTwo(c-2) && c >= 34 => (LEAL2 (SHLLconst <v.Type> [int32(log32(c-2))] x) x)
+(MULLconst [c] x) && isPowerOfTwo(c-4) && c >= 68 => (LEAL4 (SHLLconst <v.Type> [int32(log32(c-4))] x) x)
+(MULLconst [c] x) && isPowerOfTwo(c-8) && c >= 136 => (LEAL8 (SHLLconst <v.Type> [int32(log32(c-8))] x) x)
+(MULLconst [c] x) && c%3 == 0 && isPowerOfTwo(c/3) => (SHLLconst [int32(log32(c/3))] (LEAL2 <v.Type> x x))
+(MULLconst [c] x) && c%5 == 0 && isPowerOfTwo(c/5) => (SHLLconst [int32(log32(c/5))] (LEAL4 <v.Type> x x))
+(MULLconst [c] x) && c%9 == 0 && isPowerOfTwo(c/9) => (SHLLconst [int32(log32(c/9))] (LEAL8 <v.Type> x x))
 
 // combine add/shift into LEAL
 (ADDL x (SHLLconst [3] y)) => (LEAL8 x y)
index d8bdf6b17e32e9b5a4896e722cae5bf400b05aa1..7ac9d5ca16826357d41aa09c6a0fe90cbaa6fb25 100644 (file)
 (MUL(Q|L)const [73] x) => (LEA(Q|L)8 x (LEA(Q|L)8 <v.Type> x x))
 (MUL(Q|L)const [81] x) => (LEA(Q|L)8 (LEA(Q|L)8 <v.Type> x x) (LEA(Q|L)8 <v.Type> x x))
 
-(MUL(Q|L)const [c] x) && isPowerOfTwo64(int64(c)+1) && c >=  15 => (SUB(Q|L)  (SHL(Q|L)const <v.Type> [int8(log64(int64(c)+1))] x) x)
-(MUL(Q|L)const [c] x) && isPowerOfTwo32(c-1) && c >=  17 => (LEA(Q|L)1 (SHL(Q|L)const <v.Type> [int8(log32(c-1))] x) x)
-(MUL(Q|L)const [c] x) && isPowerOfTwo32(c-2) && c >=  34 => (LEA(Q|L)2 (SHL(Q|L)const <v.Type> [int8(log32(c-2))] x) x)
-(MUL(Q|L)const [c] x) && isPowerOfTwo32(c-4) && c >=  68 => (LEA(Q|L)4 (SHL(Q|L)const <v.Type> [int8(log32(c-4))] x) x)
-(MUL(Q|L)const [c] x) && isPowerOfTwo32(c-8) && c >= 136 => (LEA(Q|L)8 (SHL(Q|L)const <v.Type> [int8(log32(c-8))] x) x)
-(MUL(Q|L)const [c] x) && c%3 == 0 && isPowerOfTwo32(c/3) => (SHL(Q|L)const [int8(log32(c/3))] (LEA(Q|L)2 <v.Type> x x))
-(MUL(Q|L)const [c] x) && c%5 == 0 && isPowerOfTwo32(c/5) => (SHL(Q|L)const [int8(log32(c/5))] (LEA(Q|L)4 <v.Type> x x))
-(MUL(Q|L)const [c] x) && c%9 == 0 && isPowerOfTwo32(c/9) => (SHL(Q|L)const [int8(log32(c/9))] (LEA(Q|L)8 <v.Type> x x))
+(MUL(Q|L)const [c] x) && isPowerOfTwo(int64(c)+1) && c >=  15 => (SUB(Q|L)  (SHL(Q|L)const <v.Type> [int8(log64(int64(c)+1))] x) x)
+(MUL(Q|L)const [c] x) && isPowerOfTwo(c-1) && c >=  17 => (LEA(Q|L)1 (SHL(Q|L)const <v.Type> [int8(log32(c-1))] x) x)
+(MUL(Q|L)const [c] x) && isPowerOfTwo(c-2) && c >=  34 => (LEA(Q|L)2 (SHL(Q|L)const <v.Type> [int8(log32(c-2))] x) x)
+(MUL(Q|L)const [c] x) && isPowerOfTwo(c-4) && c >=  68 => (LEA(Q|L)4 (SHL(Q|L)const <v.Type> [int8(log32(c-4))] x) x)
+(MUL(Q|L)const [c] x) && isPowerOfTwo(c-8) && c >= 136 => (LEA(Q|L)8 (SHL(Q|L)const <v.Type> [int8(log32(c-8))] x) x)
+(MUL(Q|L)const [c] x) && c%3 == 0 && isPowerOfTwo(c/3) => (SHL(Q|L)const [int8(log32(c/3))] (LEA(Q|L)2 <v.Type> x x))
+(MUL(Q|L)const [c] x) && c%5 == 0 && isPowerOfTwo(c/5) => (SHL(Q|L)const [int8(log32(c/5))] (LEA(Q|L)4 <v.Type> x x))
+(MUL(Q|L)const [c] x) && c%9 == 0 && isPowerOfTwo(c/9) => (SHL(Q|L)const [int8(log32(c/9))] (LEA(Q|L)8 <v.Type> x x))
 
 // combine add/shift into LEAQ/LEAL
 (ADD(L|Q) x (SHL(L|Q)const [3] y)) => (LEA(L|Q)8 x y)
index ed0ed80afa729feb0e8c3c8f9318dd6a0259f975..9cdb5d8ad541c986f211b254ef56c182a8c3dda5 100644 (file)
 (MUL x (MOVWconst [c])) && int32(c) == -1 => (RSBconst [0] x)
 (MUL _ (MOVWconst [0])) => (MOVWconst [0])
 (MUL x (MOVWconst [1])) => x
-(MUL x (MOVWconst [c])) && isPowerOfTwo32(c) => (SLLconst [int32(log32(c))] x)
-(MUL x (MOVWconst [c])) && isPowerOfTwo32(c-1) && c >= 3 => (ADDshiftLL x x [int32(log32(c-1))])
-(MUL x (MOVWconst [c])) && isPowerOfTwo32(c+1) && c >= 7 => (RSBshiftLL x x [int32(log32(c+1))])
-(MUL x (MOVWconst [c])) && c%3 == 0 && isPowerOfTwo32(c/3) => (SLLconst [int32(log32(c/3))] (ADDshiftLL <x.Type> x x [1]))
-(MUL x (MOVWconst [c])) && c%5 == 0 && isPowerOfTwo32(c/5) => (SLLconst [int32(log32(c/5))] (ADDshiftLL <x.Type> x x [2]))
-(MUL x (MOVWconst [c])) && c%7 == 0 && isPowerOfTwo32(c/7) => (SLLconst [int32(log32(c/7))] (RSBshiftLL <x.Type> x x [3]))
-(MUL x (MOVWconst [c])) && c%9 == 0 && isPowerOfTwo32(c/9) => (SLLconst [int32(log32(c/9))] (ADDshiftLL <x.Type> x x [3]))
+(MUL x (MOVWconst [c])) && isPowerOfTwo(c) => (SLLconst [int32(log32(c))] x)
+(MUL x (MOVWconst [c])) && isPowerOfTwo(c-1) && c >= 3 => (ADDshiftLL x x [int32(log32(c-1))])
+(MUL x (MOVWconst [c])) && isPowerOfTwo(c+1) && c >= 7 => (RSBshiftLL x x [int32(log32(c+1))])
+(MUL x (MOVWconst [c])) && c%3 == 0 && isPowerOfTwo(c/3) => (SLLconst [int32(log32(c/3))] (ADDshiftLL <x.Type> x x [1]))
+(MUL x (MOVWconst [c])) && c%5 == 0 && isPowerOfTwo(c/5) => (SLLconst [int32(log32(c/5))] (ADDshiftLL <x.Type> x x [2]))
+(MUL x (MOVWconst [c])) && c%7 == 0 && isPowerOfTwo(c/7) => (SLLconst [int32(log32(c/7))] (RSBshiftLL <x.Type> x x [3]))
+(MUL x (MOVWconst [c])) && c%9 == 0 && isPowerOfTwo(c/9) => (SLLconst [int32(log32(c/9))] (ADDshiftLL <x.Type> x x [3]))
 
 (MULA x (MOVWconst [c]) a) && c == -1 => (SUB a x)
 (MULA _ (MOVWconst [0]) a) => a
 (MULA x (MOVWconst [1]) a) => (ADD x a)
-(MULA x (MOVWconst [c]) a) && isPowerOfTwo32(c) => (ADD (SLLconst <x.Type> [int32(log32(c))] x) a)
-(MULA x (MOVWconst [c]) a) && isPowerOfTwo32(c-1) && c >= 3 => (ADD (ADDshiftLL <x.Type> x x [int32(log32(c-1))]) a)
-(MULA x (MOVWconst [c]) a) && isPowerOfTwo32(c+1) && c >= 7 => (ADD (RSBshiftLL <x.Type> x x [int32(log32(c+1))]) a)
-(MULA x (MOVWconst [c]) a) && c%3 == 0 && isPowerOfTwo32(c/3) => (ADD (SLLconst <x.Type> [int32(log32(c/3))] (ADDshiftLL <x.Type> x x [1])) a)
-(MULA x (MOVWconst [c]) a) && c%5 == 0 && isPowerOfTwo32(c/5) => (ADD (SLLconst <x.Type> [int32(log32(c/5))] (ADDshiftLL <x.Type> x x [2])) a)
-(MULA x (MOVWconst [c]) a) && c%7 == 0 && isPowerOfTwo32(c/7) => (ADD (SLLconst <x.Type> [int32(log32(c/7))] (RSBshiftLL <x.Type> x x [3])) a)
-(MULA x (MOVWconst [c]) a) && c%9 == 0 && isPowerOfTwo32(c/9) => (ADD (SLLconst <x.Type> [int32(log32(c/9))] (ADDshiftLL <x.Type> x x [3])) a)
+(MULA x (MOVWconst [c]) a) && isPowerOfTwo(c) => (ADD (SLLconst <x.Type> [int32(log32(c))] x) a)
+(MULA x (MOVWconst [c]) a) && isPowerOfTwo(c-1) && c >= 3 => (ADD (ADDshiftLL <x.Type> x x [int32(log32(c-1))]) a)
+(MULA x (MOVWconst [c]) a) && isPowerOfTwo(c+1) && c >= 7 => (ADD (RSBshiftLL <x.Type> x x [int32(log32(c+1))]) a)
+(MULA x (MOVWconst [c]) a) && c%3 == 0 && isPowerOfTwo(c/3) => (ADD (SLLconst <x.Type> [int32(log32(c/3))] (ADDshiftLL <x.Type> x x [1])) a)
+(MULA x (MOVWconst [c]) a) && c%5 == 0 && isPowerOfTwo(c/5) => (ADD (SLLconst <x.Type> [int32(log32(c/5))] (ADDshiftLL <x.Type> x x [2])) a)
+(MULA x (MOVWconst [c]) a) && c%7 == 0 && isPowerOfTwo(c/7) => (ADD (SLLconst <x.Type> [int32(log32(c/7))] (RSBshiftLL <x.Type> x x [3])) a)
+(MULA x (MOVWconst [c]) a) && c%9 == 0 && isPowerOfTwo(c/9) => (ADD (SLLconst <x.Type> [int32(log32(c/9))] (ADDshiftLL <x.Type> x x [3])) a)
 
 (MULA (MOVWconst [c]) x a) && c == -1 => (SUB a x)
 (MULA (MOVWconst [0]) _ a) => a
 (MULA (MOVWconst [1]) x a) => (ADD x a)
-(MULA (MOVWconst [c]) x a) && isPowerOfTwo32(c) => (ADD (SLLconst <x.Type> [int32(log32(c))] x) a)
-(MULA (MOVWconst [c]) x a) && isPowerOfTwo32(c-1) && c >= 3 => (ADD (ADDshiftLL <x.Type> x x [int32(log32(c-1))]) a)
-(MULA (MOVWconst [c]) x a) && isPowerOfTwo32(c+1) && c >= 7 => (ADD (RSBshiftLL <x.Type> x x [int32(log32(c+1))]) a)
-(MULA (MOVWconst [c]) x a) && c%3 == 0 && isPowerOfTwo32(c/3) => (ADD (SLLconst <x.Type> [int32(log32(c/3))] (ADDshiftLL <x.Type> x x [1])) a)
-(MULA (MOVWconst [c]) x a) && c%5 == 0 && isPowerOfTwo32(c/5) => (ADD (SLLconst <x.Type> [int32(log32(c/5))] (ADDshiftLL <x.Type> x x [2])) a)
-(MULA (MOVWconst [c]) x a) && c%7 == 0 && isPowerOfTwo32(c/7) => (ADD (SLLconst <x.Type> [int32(log32(c/7))] (RSBshiftLL <x.Type> x x [3])) a)
-(MULA (MOVWconst [c]) x a) && c%9 == 0 && isPowerOfTwo32(c/9) => (ADD (SLLconst <x.Type> [int32(log32(c/9))] (ADDshiftLL <x.Type> x x [3])) a)
+(MULA (MOVWconst [c]) x a) && isPowerOfTwo(c) => (ADD (SLLconst <x.Type> [int32(log32(c))] x) a)
+(MULA (MOVWconst [c]) x a) && isPowerOfTwo(c-1) && c >= 3 => (ADD (ADDshiftLL <x.Type> x x [int32(log32(c-1))]) a)
+(MULA (MOVWconst [c]) x a) && isPowerOfTwo(c+1) && c >= 7 => (ADD (RSBshiftLL <x.Type> x x [int32(log32(c+1))]) a)
+(MULA (MOVWconst [c]) x a) && c%3 == 0 && isPowerOfTwo(c/3) => (ADD (SLLconst <x.Type> [int32(log32(c/3))] (ADDshiftLL <x.Type> x x [1])) a)
+(MULA (MOVWconst [c]) x a) && c%5 == 0 && isPowerOfTwo(c/5) => (ADD (SLLconst <x.Type> [int32(log32(c/5))] (ADDshiftLL <x.Type> x x [2])) a)
+(MULA (MOVWconst [c]) x a) && c%7 == 0 && isPowerOfTwo(c/7) => (ADD (SLLconst <x.Type> [int32(log32(c/7))] (RSBshiftLL <x.Type> x x [3])) a)
+(MULA (MOVWconst [c]) x a) && c%9 == 0 && isPowerOfTwo(c/9) => (ADD (SLLconst <x.Type> [int32(log32(c/9))] (ADDshiftLL <x.Type> x x [3])) a)
 
 (MULS x (MOVWconst [c]) a) && c == -1 => (ADD a x)
 (MULS _ (MOVWconst [0]) a) => a
 (MULS x (MOVWconst [1]) a) => (RSB x a)
-(MULS x (MOVWconst [c]) a) && isPowerOfTwo32(c) => (RSB (SLLconst <x.Type> [int32(log32(c))] x) a)
-(MULS x (MOVWconst [c]) a) && isPowerOfTwo32(c-1) && c >= 3 => (RSB (ADDshiftLL <x.Type> x x [int32(log32(c-1))]) a)
-(MULS x (MOVWconst [c]) a) && isPowerOfTwo32(c+1) && c >= 7 => (RSB (RSBshiftLL <x.Type> x x [int32(log32(c+1))]) a)
-(MULS x (MOVWconst [c]) a) && c%3 == 0 && isPowerOfTwo32(c/3) => (RSB (SLLconst <x.Type> [int32(log32(c/3))] (ADDshiftLL <x.Type> x x [1])) a)
-(MULS x (MOVWconst [c]) a) && c%5 == 0 && isPowerOfTwo32(c/5) => (RSB (SLLconst <x.Type> [int32(log32(c/5))] (ADDshiftLL <x.Type> x x [2])) a)
-(MULS x (MOVWconst [c]) a) && c%7 == 0 && isPowerOfTwo32(c/7) => (RSB (SLLconst <x.Type> [int32(log32(c/7))] (RSBshiftLL <x.Type> x x [3])) a)
-(MULS x (MOVWconst [c]) a) && c%9 == 0 && isPowerOfTwo32(c/9) => (RSB (SLLconst <x.Type> [int32(log32(c/9))] (ADDshiftLL <x.Type> x x [3])) a)
+(MULS x (MOVWconst [c]) a) && isPowerOfTwo(c) => (RSB (SLLconst <x.Type> [int32(log32(c))] x) a)
+(MULS x (MOVWconst [c]) a) && isPowerOfTwo(c-1) && c >= 3 => (RSB (ADDshiftLL <x.Type> x x [int32(log32(c-1))]) a)
+(MULS x (MOVWconst [c]) a) && isPowerOfTwo(c+1) && c >= 7 => (RSB (RSBshiftLL <x.Type> x x [int32(log32(c+1))]) a)
+(MULS x (MOVWconst [c]) a) && c%3 == 0 && isPowerOfTwo(c/3) => (RSB (SLLconst <x.Type> [int32(log32(c/3))] (ADDshiftLL <x.Type> x x [1])) a)
+(MULS x (MOVWconst [c]) a) && c%5 == 0 && isPowerOfTwo(c/5) => (RSB (SLLconst <x.Type> [int32(log32(c/5))] (ADDshiftLL <x.Type> x x [2])) a)
+(MULS x (MOVWconst [c]) a) && c%7 == 0 && isPowerOfTwo(c/7) => (RSB (SLLconst <x.Type> [int32(log32(c/7))] (RSBshiftLL <x.Type> x x [3])) a)
+(MULS x (MOVWconst [c]) a) && c%9 == 0 && isPowerOfTwo(c/9) => (RSB (SLLconst <x.Type> [int32(log32(c/9))] (ADDshiftLL <x.Type> x x [3])) a)
 
 (MULS (MOVWconst [c]) x a) && c == -1 => (ADD a x)
 (MULS (MOVWconst [0]) _ a) => a
 (MULS (MOVWconst [1]) x a) => (RSB x a)
-(MULS (MOVWconst [c]) x a) && isPowerOfTwo32(c) => (RSB (SLLconst <x.Type> [int32(log32(c))] x) a)
-(MULS (MOVWconst [c]) x a) && isPowerOfTwo32(c-1) && c >= 3 => (RSB (ADDshiftLL <x.Type> x x [int32(log32(c-1))]) a)
-(MULS (MOVWconst [c]) x a) && isPowerOfTwo32(c+1) && c >= 7 => (RSB (RSBshiftLL <x.Type> x x [int32(log32(c+1))]) a)
-(MULS (MOVWconst [c]) x a) && c%3 == 0 && isPowerOfTwo32(c/3) => (RSB (SLLconst <x.Type> [int32(log32(c/3))] (ADDshiftLL <x.Type> x x [1])) a)
-(MULS (MOVWconst [c]) x a) && c%5 == 0 && isPowerOfTwo32(c/5) => (RSB (SLLconst <x.Type> [int32(log32(c/5))] (ADDshiftLL <x.Type> x x [2])) a)
-(MULS (MOVWconst [c]) x a) && c%7 == 0 && isPowerOfTwo32(c/7) => (RSB (SLLconst <x.Type> [int32(log32(c/7))] (RSBshiftLL <x.Type> x x [3])) a)
-(MULS (MOVWconst [c]) x a) && c%9 == 0 && isPowerOfTwo32(c/9) => (RSB (SLLconst <x.Type> [int32(log32(c/9))] (ADDshiftLL <x.Type> x x [3])) a)
+(MULS (MOVWconst [c]) x a) && isPowerOfTwo(c) => (RSB (SLLconst <x.Type> [int32(log32(c))] x) a)
+(MULS (MOVWconst [c]) x a) && isPowerOfTwo(c-1) && c >= 3 => (RSB (ADDshiftLL <x.Type> x x [int32(log32(c-1))]) a)
+(MULS (MOVWconst [c]) x a) && isPowerOfTwo(c+1) && c >= 7 => (RSB (RSBshiftLL <x.Type> x x [int32(log32(c+1))]) a)
+(MULS (MOVWconst [c]) x a) && c%3 == 0 && isPowerOfTwo(c/3) => (RSB (SLLconst <x.Type> [int32(log32(c/3))] (ADDshiftLL <x.Type> x x [1])) a)
+(MULS (MOVWconst [c]) x a) && c%5 == 0 && isPowerOfTwo(c/5) => (RSB (SLLconst <x.Type> [int32(log32(c/5))] (ADDshiftLL <x.Type> x x [2])) a)
+(MULS (MOVWconst [c]) x a) && c%7 == 0 && isPowerOfTwo(c/7) => (RSB (SLLconst <x.Type> [int32(log32(c/7))] (RSBshiftLL <x.Type> x x [3])) a)
+(MULS (MOVWconst [c]) x a) && c%9 == 0 && isPowerOfTwo(c/9) => (RSB (SLLconst <x.Type> [int32(log32(c/9))] (ADDshiftLL <x.Type> x x [3])) a)
 
 // div by constant
 (Select0 (CALLudiv x (MOVWconst [1]))) => x
 (Select1 (CALLudiv _ (MOVWconst [1]))) => (MOVWconst [0])
-(Select0 (CALLudiv x (MOVWconst [c]))) && isPowerOfTwo32(c) => (SRLconst [int32(log32(c))] x)
-(Select1 (CALLudiv x (MOVWconst [c]))) && isPowerOfTwo32(c) => (ANDconst [c-1] x)
+(Select0 (CALLudiv x (MOVWconst [c]))) && isPowerOfTwo(c) => (SRLconst [int32(log32(c))] x)
+(Select1 (CALLudiv x (MOVWconst [c]))) && isPowerOfTwo(c) => (ANDconst [c-1] x)
 
 // constant comparisons
 (CMPconst (MOVWconst [x]) [y]) => (FlagConstant [subFlags32(x,y)])
index 21780d5a624a2521eb01e04001bb3f954340c2a0..9064b515f7422d1cfb63ae520f2edfc9179a2d3d 100644 (file)
 (MUL x (MOVDconst [-1])) => (NEG x)
 (MUL _ (MOVDconst [0])) => (MOVDconst [0])
 (MUL x (MOVDconst [1])) => x
-(MUL x (MOVDconst [c])) && isPowerOfTwo64(c) => (SLLconst [log64(c)] x)
-(MUL x (MOVDconst [c])) && isPowerOfTwo64(c-1) && c >= 3 => (ADDshiftLL x x [log64(c-1)])
-(MUL x (MOVDconst [c])) && isPowerOfTwo64(c+1) && c >= 7 => (ADDshiftLL (NEG <x.Type> x) x [log64(c+1)])
-(MUL x (MOVDconst [c])) && c%3 == 0 && isPowerOfTwo64(c/3) => (SLLconst [log64(c/3)] (ADDshiftLL <x.Type> x x [1]))
-(MUL x (MOVDconst [c])) && c%5 == 0 && isPowerOfTwo64(c/5) => (SLLconst [log64(c/5)] (ADDshiftLL <x.Type> x x [2]))
-(MUL x (MOVDconst [c])) && c%7 == 0 && isPowerOfTwo64(c/7) => (SLLconst [log64(c/7)] (ADDshiftLL <x.Type> (NEG <x.Type> x) x [3]))
-(MUL x (MOVDconst [c])) && c%9 == 0 && isPowerOfTwo64(c/9) => (SLLconst [log64(c/9)] (ADDshiftLL <x.Type> x x [3]))
+(MUL x (MOVDconst [c])) && isPowerOfTwo(c) => (SLLconst [log64(c)] x)
+(MUL x (MOVDconst [c])) && isPowerOfTwo(c-1) && c >= 3 => (ADDshiftLL x x [log64(c-1)])
+(MUL x (MOVDconst [c])) && isPowerOfTwo(c+1) && c >= 7 => (ADDshiftLL (NEG <x.Type> x) x [log64(c+1)])
+(MUL x (MOVDconst [c])) && c%3 == 0 && isPowerOfTwo(c/3) => (SLLconst [log64(c/3)] (ADDshiftLL <x.Type> x x [1]))
+(MUL x (MOVDconst [c])) && c%5 == 0 && isPowerOfTwo(c/5) => (SLLconst [log64(c/5)] (ADDshiftLL <x.Type> x x [2]))
+(MUL x (MOVDconst [c])) && c%7 == 0 && isPowerOfTwo(c/7) => (SLLconst [log64(c/7)] (ADDshiftLL <x.Type> (NEG <x.Type> x) x [3]))
+(MUL x (MOVDconst [c])) && c%9 == 0 && isPowerOfTwo(c/9) => (SLLconst [log64(c/9)] (ADDshiftLL <x.Type> x x [3]))
 
 (MULW x (MOVDconst [c])) && int32(c)==-1 => (MOVWUreg (NEG <x.Type> x))
 (MULW _ (MOVDconst [c])) && int32(c)==0 => (MOVDconst [0])
 (MULW x (MOVDconst [c])) && int32(c)==1 => (MOVWUreg x)
-(MULW x (MOVDconst [c])) && isPowerOfTwo64(c) => (MOVWUreg (SLLconst <x.Type> [log64(c)] x))
-(MULW x (MOVDconst [c])) && isPowerOfTwo64(c-1) && int32(c) >= 3 => (MOVWUreg (ADDshiftLL <x.Type> x x [log64(c-1)]))
-(MULW x (MOVDconst [c])) && isPowerOfTwo64(c+1) && int32(c) >= 7 => (MOVWUreg (ADDshiftLL <x.Type> (NEG <x.Type> x) x [log64(c+1)]))
-(MULW x (MOVDconst [c])) && c%3 == 0 && isPowerOfTwo64(c/3) && is32Bit(c) => (MOVWUreg (SLLconst <x.Type> [log64(c/3)] (ADDshiftLL <x.Type> x x [1])))
-(MULW x (MOVDconst [c])) && c%5 == 0 && isPowerOfTwo64(c/5) && is32Bit(c) => (MOVWUreg (SLLconst <x.Type> [log64(c/5)] (ADDshiftLL <x.Type> x x [2])))
-(MULW x (MOVDconst [c])) && c%7 == 0 && isPowerOfTwo64(c/7) && is32Bit(c) => (MOVWUreg (SLLconst <x.Type> [log64(c/7)] (ADDshiftLL <x.Type> (NEG <x.Type> x) x [3])))
-(MULW x (MOVDconst [c])) && c%9 == 0 && isPowerOfTwo64(c/9) && is32Bit(c) => (MOVWUreg (SLLconst <x.Type> [log64(c/9)] (ADDshiftLL <x.Type> x x [3])))
+(MULW x (MOVDconst [c])) && isPowerOfTwo(c) => (MOVWUreg (SLLconst <x.Type> [log64(c)] x))
+(MULW x (MOVDconst [c])) && isPowerOfTwo(c-1) && int32(c) >= 3 => (MOVWUreg (ADDshiftLL <x.Type> x x [log64(c-1)]))
+(MULW x (MOVDconst [c])) && isPowerOfTwo(c+1) && int32(c) >= 7 => (MOVWUreg (ADDshiftLL <x.Type> (NEG <x.Type> x) x [log64(c+1)]))
+(MULW x (MOVDconst [c])) && c%3 == 0 && isPowerOfTwo(c/3) && is32Bit(c) => (MOVWUreg (SLLconst <x.Type> [log64(c/3)] (ADDshiftLL <x.Type> x x [1])))
+(MULW x (MOVDconst [c])) && c%5 == 0 && isPowerOfTwo(c/5) && is32Bit(c) => (MOVWUreg (SLLconst <x.Type> [log64(c/5)] (ADDshiftLL <x.Type> x x [2])))
+(MULW x (MOVDconst [c])) && c%7 == 0 && isPowerOfTwo(c/7) && is32Bit(c) => (MOVWUreg (SLLconst <x.Type> [log64(c/7)] (ADDshiftLL <x.Type> (NEG <x.Type> x) x [3])))
+(MULW x (MOVDconst [c])) && c%9 == 0 && isPowerOfTwo(c/9) && is32Bit(c) => (MOVWUreg (SLLconst <x.Type> [log64(c/9)] (ADDshiftLL <x.Type> x x [3])))
 
 // mneg by constant
 (MNEG x (MOVDconst [-1])) => x
 (MNEG _ (MOVDconst [0])) => (MOVDconst [0])
 (MNEG x (MOVDconst [1])) => (NEG x)
-(MNEG x (MOVDconst [c])) && isPowerOfTwo64(c) => (NEG (SLLconst <x.Type> [log64(c)] x))
-(MNEG x (MOVDconst [c])) && isPowerOfTwo64(c-1) && c >= 3 => (NEG (ADDshiftLL <x.Type> x x [log64(c-1)]))
-(MNEG x (MOVDconst [c])) && isPowerOfTwo64(c+1) && c >= 7 => (NEG (ADDshiftLL <x.Type> (NEG <x.Type> x) x [log64(c+1)]))
-(MNEG x (MOVDconst [c])) && c%3 == 0 && isPowerOfTwo64(c/3) => (SLLconst <x.Type> [log64(c/3)] (SUBshiftLL <x.Type> x x [2]))
-(MNEG x (MOVDconst [c])) && c%5 == 0 && isPowerOfTwo64(c/5) => (NEG (SLLconst <x.Type> [log64(c/5)] (ADDshiftLL <x.Type> x x [2])))
-(MNEG x (MOVDconst [c])) && c%7 == 0 && isPowerOfTwo64(c/7) => (SLLconst <x.Type> [log64(c/7)] (SUBshiftLL <x.Type> x x [3]))
-(MNEG x (MOVDconst [c])) && c%9 == 0 && isPowerOfTwo64(c/9) => (NEG (SLLconst <x.Type> [log64(c/9)] (ADDshiftLL <x.Type> x x [3])))
+(MNEG x (MOVDconst [c])) && isPowerOfTwo(c) => (NEG (SLLconst <x.Type> [log64(c)] x))
+(MNEG x (MOVDconst [c])) && isPowerOfTwo(c-1) && c >= 3 => (NEG (ADDshiftLL <x.Type> x x [log64(c-1)]))
+(MNEG x (MOVDconst [c])) && isPowerOfTwo(c+1) && c >= 7 => (NEG (ADDshiftLL <x.Type> (NEG <x.Type> x) x [log64(c+1)]))
+(MNEG x (MOVDconst [c])) && c%3 == 0 && isPowerOfTwo(c/3) => (SLLconst <x.Type> [log64(c/3)] (SUBshiftLL <x.Type> x x [2]))
+(MNEG x (MOVDconst [c])) && c%5 == 0 && isPowerOfTwo(c/5) => (NEG (SLLconst <x.Type> [log64(c/5)] (ADDshiftLL <x.Type> x x [2])))
+(MNEG x (MOVDconst [c])) && c%7 == 0 && isPowerOfTwo(c/7) => (SLLconst <x.Type> [log64(c/7)] (SUBshiftLL <x.Type> x x [3]))
+(MNEG x (MOVDconst [c])) && c%9 == 0 && isPowerOfTwo(c/9) => (NEG (SLLconst <x.Type> [log64(c/9)] (ADDshiftLL <x.Type> x x [3])))
 
 
 (MNEGW x (MOVDconst [c])) && int32(c)==-1 => (MOVWUreg x)
 (MNEGW _ (MOVDconst [c])) && int32(c)==0 => (MOVDconst [0])
 (MNEGW x (MOVDconst [c])) && int32(c)==1 => (MOVWUreg (NEG <x.Type> x))
-(MNEGW x (MOVDconst [c])) && isPowerOfTwo64(c) => (NEG (SLLconst <x.Type> [log64(c)] x))
-(MNEGW x (MOVDconst [c])) && isPowerOfTwo64(c-1) && int32(c) >= 3 => (MOVWUreg (NEG <x.Type> (ADDshiftLL <x.Type> x x [log64(c-1)])))
-(MNEGW x (MOVDconst [c])) && isPowerOfTwo64(c+1) && int32(c) >= 7 => (MOVWUreg (NEG <x.Type> (ADDshiftLL <x.Type> (NEG <x.Type> x) x [log64(c+1)])))
-(MNEGW x (MOVDconst [c])) && c%3 == 0 && isPowerOfTwo64(c/3) && is32Bit(c) => (MOVWUreg (SLLconst <x.Type> [log64(c/3)] (SUBshiftLL <x.Type> x x [2])))
-(MNEGW x (MOVDconst [c])) && c%5 == 0 && isPowerOfTwo64(c/5) && is32Bit(c) => (MOVWUreg (NEG <x.Type> (SLLconst <x.Type> [log64(c/5)] (ADDshiftLL <x.Type> x x [2]))))
-(MNEGW x (MOVDconst [c])) && c%7 == 0 && isPowerOfTwo64(c/7) && is32Bit(c) => (MOVWUreg (SLLconst <x.Type> [log64(c/7)] (SUBshiftLL <x.Type> x x [3])))
-(MNEGW x (MOVDconst [c])) && c%9 == 0 && isPowerOfTwo64(c/9) && is32Bit(c) => (MOVWUreg (NEG <x.Type> (SLLconst <x.Type> [log64(c/9)] (ADDshiftLL <x.Type> x x [3]))))
+(MNEGW x (MOVDconst [c])) && isPowerOfTwo(c) => (NEG (SLLconst <x.Type> [log64(c)] x))
+(MNEGW x (MOVDconst [c])) && isPowerOfTwo(c-1) && int32(c) >= 3 => (MOVWUreg (NEG <x.Type> (ADDshiftLL <x.Type> x x [log64(c-1)])))
+(MNEGW x (MOVDconst [c])) && isPowerOfTwo(c+1) && int32(c) >= 7 => (MOVWUreg (NEG <x.Type> (ADDshiftLL <x.Type> (NEG <x.Type> x) x [log64(c+1)])))
+(MNEGW x (MOVDconst [c])) && c%3 == 0 && isPowerOfTwo(c/3) && is32Bit(c) => (MOVWUreg (SLLconst <x.Type> [log64(c/3)] (SUBshiftLL <x.Type> x x [2])))
+(MNEGW x (MOVDconst [c])) && c%5 == 0 && isPowerOfTwo(c/5) && is32Bit(c) => (MOVWUreg (NEG <x.Type> (SLLconst <x.Type> [log64(c/5)] (ADDshiftLL <x.Type> x x [2]))))
+(MNEGW x (MOVDconst [c])) && c%7 == 0 && isPowerOfTwo(c/7) && is32Bit(c) => (MOVWUreg (SLLconst <x.Type> [log64(c/7)] (SUBshiftLL <x.Type> x x [3])))
+(MNEGW x (MOVDconst [c])) && c%9 == 0 && isPowerOfTwo(c/9) && is32Bit(c) => (MOVWUreg (NEG <x.Type> (SLLconst <x.Type> [log64(c/9)] (ADDshiftLL <x.Type> x x [3]))))
 
 
 (MADD a x (MOVDconst [-1])) => (SUB a x)
 (MADD a _ (MOVDconst [0])) => a
 (MADD a x (MOVDconst [1])) => (ADD a x)
-(MADD a x (MOVDconst [c])) && isPowerOfTwo64(c) => (ADDshiftLL a x [log64(c)])
-(MADD a x (MOVDconst [c])) && isPowerOfTwo64(c-1) && c>=3 => (ADD a (ADDshiftLL <x.Type> x x [log64(c-1)]))
-(MADD a x (MOVDconst [c])) && isPowerOfTwo64(c+1) && c>=7 => (SUB a (SUBshiftLL <x.Type> x x [log64(c+1)]))
-(MADD a x (MOVDconst [c])) && c%3 == 0 && isPowerOfTwo64(c/3) => (SUBshiftLL a (SUBshiftLL <x.Type> x x [2]) [log64(c/3)])
-(MADD a x (MOVDconst [c])) && c%5 == 0 && isPowerOfTwo64(c/5) => (ADDshiftLL a (ADDshiftLL <x.Type> x x [2]) [log64(c/5)])
-(MADD a x (MOVDconst [c])) && c%7 == 0 && isPowerOfTwo64(c/7) => (SUBshiftLL a (SUBshiftLL <x.Type> x x [3]) [log64(c/7)])
-(MADD a x (MOVDconst [c])) && c%9 == 0 && isPowerOfTwo64(c/9) => (ADDshiftLL a (ADDshiftLL <x.Type> x x [3]) [log64(c/9)])
+(MADD a x (MOVDconst [c])) && isPowerOfTwo(c) => (ADDshiftLL a x [log64(c)])
+(MADD a x (MOVDconst [c])) && isPowerOfTwo(c-1) && c>=3 => (ADD a (ADDshiftLL <x.Type> x x [log64(c-1)]))
+(MADD a x (MOVDconst [c])) && isPowerOfTwo(c+1) && c>=7 => (SUB a (SUBshiftLL <x.Type> x x [log64(c+1)]))
+(MADD a x (MOVDconst [c])) && c%3 == 0 && isPowerOfTwo(c/3) => (SUBshiftLL a (SUBshiftLL <x.Type> x x [2]) [log64(c/3)])
+(MADD a x (MOVDconst [c])) && c%5 == 0 && isPowerOfTwo(c/5) => (ADDshiftLL a (ADDshiftLL <x.Type> x x [2]) [log64(c/5)])
+(MADD a x (MOVDconst [c])) && c%7 == 0 && isPowerOfTwo(c/7) => (SUBshiftLL a (SUBshiftLL <x.Type> x x [3]) [log64(c/7)])
+(MADD a x (MOVDconst [c])) && c%9 == 0 && isPowerOfTwo(c/9) => (ADDshiftLL a (ADDshiftLL <x.Type> x x [3]) [log64(c/9)])
 
 (MADD a (MOVDconst [-1]) x) => (SUB a x)
 (MADD a (MOVDconst [0]) _) => a
 (MADD a (MOVDconst [1]) x) => (ADD a x)
-(MADD a (MOVDconst [c]) x) && isPowerOfTwo64(c) => (ADDshiftLL a x [log64(c)])
-(MADD a (MOVDconst [c]) x) && isPowerOfTwo64(c-1) && c>=3 => (ADD a (ADDshiftLL <x.Type> x x [log64(c-1)]))
-(MADD a (MOVDconst [c]) x) && isPowerOfTwo64(c+1) && c>=7 => (SUB a (SUBshiftLL <x.Type> x x [log64(c+1)]))
-(MADD a (MOVDconst [c]) x) && c%3 == 0 && isPowerOfTwo64(c/3) => (SUBshiftLL a (SUBshiftLL <x.Type> x x [2]) [log64(c/3)])
-(MADD a (MOVDconst [c]) x) && c%5 == 0 && isPowerOfTwo64(c/5) => (ADDshiftLL a (ADDshiftLL <x.Type> x x [2]) [log64(c/5)])
-(MADD a (MOVDconst [c]) x) && c%7 == 0 && isPowerOfTwo64(c/7) => (SUBshiftLL a (SUBshiftLL <x.Type> x x [3]) [log64(c/7)])
-(MADD a (MOVDconst [c]) x) && c%9 == 0 && isPowerOfTwo64(c/9) => (ADDshiftLL a (ADDshiftLL <x.Type> x x [3]) [log64(c/9)])
+(MADD a (MOVDconst [c]) x) && isPowerOfTwo(c) => (ADDshiftLL a x [log64(c)])
+(MADD a (MOVDconst [c]) x) && isPowerOfTwo(c-1) && c>=3 => (ADD a (ADDshiftLL <x.Type> x x [log64(c-1)]))
+(MADD a (MOVDconst [c]) x) && isPowerOfTwo(c+1) && c>=7 => (SUB a (SUBshiftLL <x.Type> x x [log64(c+1)]))
+(MADD a (MOVDconst [c]) x) && c%3 == 0 && isPowerOfTwo(c/3) => (SUBshiftLL a (SUBshiftLL <x.Type> x x [2]) [log64(c/3)])
+(MADD a (MOVDconst [c]) x) && c%5 == 0 && isPowerOfTwo(c/5) => (ADDshiftLL a (ADDshiftLL <x.Type> x x [2]) [log64(c/5)])
+(MADD a (MOVDconst [c]) x) && c%7 == 0 && isPowerOfTwo(c/7) => (SUBshiftLL a (SUBshiftLL <x.Type> x x [3]) [log64(c/7)])
+(MADD a (MOVDconst [c]) x) && c%9 == 0 && isPowerOfTwo(c/9) => (ADDshiftLL a (ADDshiftLL <x.Type> x x [3]) [log64(c/9)])
 
 (MADDW a x (MOVDconst [c])) && int32(c)==-1 => (MOVWUreg (SUB <a.Type> a x))
 (MADDW a _ (MOVDconst [c])) && int32(c)==0 => (MOVWUreg a)
 (MADDW a x (MOVDconst [c])) && int32(c)==1 => (MOVWUreg (ADD <a.Type> a x))
-(MADDW a x (MOVDconst [c])) && isPowerOfTwo64(c) => (MOVWUreg (ADDshiftLL <a.Type> a x [log64(c)]))
-(MADDW a x (MOVDconst [c])) && isPowerOfTwo64(c-1) && int32(c)>=3 => (MOVWUreg (ADD <a.Type> a (ADDshiftLL <x.Type> x x [log64(c-1)])))
-(MADDW a x (MOVDconst [c])) && isPowerOfTwo64(c+1) && int32(c)>=7 => (MOVWUreg (SUB <a.Type> a (SUBshiftLL <x.Type> x x [log64(c+1)])))
-(MADDW a x (MOVDconst [c])) && c%3 == 0 && isPowerOfTwo64(c/3) && is32Bit(c) => (MOVWUreg (SUBshiftLL <a.Type> a (SUBshiftLL <x.Type> x x [2]) [log64(c/3)]))
-(MADDW a x (MOVDconst [c])) && c%5 == 0 && isPowerOfTwo64(c/5) && is32Bit(c) => (MOVWUreg (ADDshiftLL <a.Type> a (ADDshiftLL <x.Type> x x [2]) [log64(c/5)]))
-(MADDW a x (MOVDconst [c])) && c%7 == 0 && isPowerOfTwo64(c/7) && is32Bit(c) => (MOVWUreg (SUBshiftLL <a.Type> a (SUBshiftLL <x.Type> x x [3]) [log64(c/7)]))
-(MADDW a x (MOVDconst [c])) && c%9 == 0 && isPowerOfTwo64(c/9) && is32Bit(c) => (MOVWUreg (ADDshiftLL <a.Type> a (ADDshiftLL <x.Type> x x [3]) [log64(c/9)]))
+(MADDW a x (MOVDconst [c])) && isPowerOfTwo(c) => (MOVWUreg (ADDshiftLL <a.Type> a x [log64(c)]))
+(MADDW a x (MOVDconst [c])) && isPowerOfTwo(c-1) && int32(c)>=3 => (MOVWUreg (ADD <a.Type> a (ADDshiftLL <x.Type> x x [log64(c-1)])))
+(MADDW a x (MOVDconst [c])) && isPowerOfTwo(c+1) && int32(c)>=7 => (MOVWUreg (SUB <a.Type> a (SUBshiftLL <x.Type> x x [log64(c+1)])))
+(MADDW a x (MOVDconst [c])) && c%3 == 0 && isPowerOfTwo(c/3) && is32Bit(c) => (MOVWUreg (SUBshiftLL <a.Type> a (SUBshiftLL <x.Type> x x [2]) [log64(c/3)]))
+(MADDW a x (MOVDconst [c])) && c%5 == 0 && isPowerOfTwo(c/5) && is32Bit(c) => (MOVWUreg (ADDshiftLL <a.Type> a (ADDshiftLL <x.Type> x x [2]) [log64(c/5)]))
+(MADDW a x (MOVDconst [c])) && c%7 == 0 && isPowerOfTwo(c/7) && is32Bit(c) => (MOVWUreg (SUBshiftLL <a.Type> a (SUBshiftLL <x.Type> x x [3]) [log64(c/7)]))
+(MADDW a x (MOVDconst [c])) && c%9 == 0 && isPowerOfTwo(c/9) && is32Bit(c) => (MOVWUreg (ADDshiftLL <a.Type> a (ADDshiftLL <x.Type> x x [3]) [log64(c/9)]))
 
 (MADDW a (MOVDconst [c]) x) && int32(c)==-1 => (MOVWUreg (SUB <a.Type> a x))
 (MADDW a (MOVDconst [c]) _) && int32(c)==0 => (MOVWUreg a)
 (MADDW a (MOVDconst [c]) x) && int32(c)==1 => (MOVWUreg (ADD <a.Type> a x))
-(MADDW a (MOVDconst [c]) x) && isPowerOfTwo64(c) => (MOVWUreg (ADDshiftLL <a.Type> a x [log64(c)]))
-(MADDW a (MOVDconst [c]) x) && isPowerOfTwo64(c-1) && int32(c)>=3 => (MOVWUreg (ADD <a.Type> a (ADDshiftLL <x.Type> x x [log64(c-1)])))
-(MADDW a (MOVDconst [c]) x) && isPowerOfTwo64(c+1) && int32(c)>=7 => (MOVWUreg (SUB <a.Type> a (SUBshiftLL <x.Type> x x [log64(c+1)])))
-(MADDW a (MOVDconst [c]) x) && c%3 == 0 && isPowerOfTwo64(c/3) && is32Bit(c) => (MOVWUreg (SUBshiftLL <a.Type> a (SUBshiftLL <x.Type> x x [2]) [log64(c/3)]))
-(MADDW a (MOVDconst [c]) x) && c%5 == 0 && isPowerOfTwo64(c/5) && is32Bit(c) => (MOVWUreg (ADDshiftLL <a.Type> a (ADDshiftLL <x.Type> x x [2]) [log64(c/5)]))
-(MADDW a (MOVDconst [c]) x) && c%7 == 0 && isPowerOfTwo64(c/7) && is32Bit(c) => (MOVWUreg (SUBshiftLL <a.Type> a (SUBshiftLL <x.Type> x x [3]) [log64(c/7)]))
-(MADDW a (MOVDconst [c]) x) && c%9 == 0 && isPowerOfTwo64(c/9) && is32Bit(c) => (MOVWUreg (ADDshiftLL <a.Type> a (ADDshiftLL <x.Type> x x [3]) [log64(c/9)]))
+(MADDW a (MOVDconst [c]) x) && isPowerOfTwo(c) => (MOVWUreg (ADDshiftLL <a.Type> a x [log64(c)]))
+(MADDW a (MOVDconst [c]) x) && isPowerOfTwo(c-1) && int32(c)>=3 => (MOVWUreg (ADD <a.Type> a (ADDshiftLL <x.Type> x x [log64(c-1)])))
+(MADDW a (MOVDconst [c]) x) && isPowerOfTwo(c+1) && int32(c)>=7 => (MOVWUreg (SUB <a.Type> a (SUBshiftLL <x.Type> x x [log64(c+1)])))
+(MADDW a (MOVDconst [c]) x) && c%3 == 0 && isPowerOfTwo(c/3) && is32Bit(c) => (MOVWUreg (SUBshiftLL <a.Type> a (SUBshiftLL <x.Type> x x [2]) [log64(c/3)]))
+(MADDW a (MOVDconst [c]) x) && c%5 == 0 && isPowerOfTwo(c/5) && is32Bit(c) => (MOVWUreg (ADDshiftLL <a.Type> a (ADDshiftLL <x.Type> x x [2]) [log64(c/5)]))
+(MADDW a (MOVDconst [c]) x) && c%7 == 0 && isPowerOfTwo(c/7) && is32Bit(c) => (MOVWUreg (SUBshiftLL <a.Type> a (SUBshiftLL <x.Type> x x [3]) [log64(c/7)]))
+(MADDW a (MOVDconst [c]) x) && c%9 == 0 && isPowerOfTwo(c/9) && is32Bit(c) => (MOVWUreg (ADDshiftLL <a.Type> a (ADDshiftLL <x.Type> x x [3]) [log64(c/9)]))
 
 (MSUB a x (MOVDconst [-1])) => (ADD a x)
 (MSUB a _ (MOVDconst [0])) => a
 (MSUB a x (MOVDconst [1])) => (SUB a x)
-(MSUB a x (MOVDconst [c])) && isPowerOfTwo64(c) => (SUBshiftLL a x [log64(c)])
-(MSUB a x (MOVDconst [c])) && isPowerOfTwo64(c-1) && c>=3 => (SUB a (ADDshiftLL <x.Type> x x [log64(c-1)]))
-(MSUB a x (MOVDconst [c])) && isPowerOfTwo64(c+1) && c>=7 => (ADD a (SUBshiftLL <x.Type> x x [log64(c+1)]))
-(MSUB a x (MOVDconst [c])) && c%3 == 0 && isPowerOfTwo64(c/3) => (ADDshiftLL a (SUBshiftLL <x.Type> x x [2]) [log64(c/3)])
-(MSUB a x (MOVDconst [c])) && c%5 == 0 && isPowerOfTwo64(c/5) => (SUBshiftLL a (ADDshiftLL <x.Type> x x [2]) [log64(c/5)])
-(MSUB a x (MOVDconst [c])) && c%7 == 0 && isPowerOfTwo64(c/7) => (ADDshiftLL a (SUBshiftLL <x.Type> x x [3]) [log64(c/7)])
-(MSUB a x (MOVDconst [c])) && c%9 == 0 && isPowerOfTwo64(c/9) => (SUBshiftLL a (ADDshiftLL <x.Type> x x [3]) [log64(c/9)])
+(MSUB a x (MOVDconst [c])) && isPowerOfTwo(c) => (SUBshiftLL a x [log64(c)])
+(MSUB a x (MOVDconst [c])) && isPowerOfTwo(c-1) && c>=3 => (SUB a (ADDshiftLL <x.Type> x x [log64(c-1)]))
+(MSUB a x (MOVDconst [c])) && isPowerOfTwo(c+1) && c>=7 => (ADD a (SUBshiftLL <x.Type> x x [log64(c+1)]))
+(MSUB a x (MOVDconst [c])) && c%3 == 0 && isPowerOfTwo(c/3) => (ADDshiftLL a (SUBshiftLL <x.Type> x x [2]) [log64(c/3)])
+(MSUB a x (MOVDconst [c])) && c%5 == 0 && isPowerOfTwo(c/5) => (SUBshiftLL a (ADDshiftLL <x.Type> x x [2]) [log64(c/5)])
+(MSUB a x (MOVDconst [c])) && c%7 == 0 && isPowerOfTwo(c/7) => (ADDshiftLL a (SUBshiftLL <x.Type> x x [3]) [log64(c/7)])
+(MSUB a x (MOVDconst [c])) && c%9 == 0 && isPowerOfTwo(c/9) => (SUBshiftLL a (ADDshiftLL <x.Type> x x [3]) [log64(c/9)])
 
 (MSUB a (MOVDconst [-1]) x) => (ADD a x)
 (MSUB a (MOVDconst [0]) _) => a
 (MSUB a (MOVDconst [1]) x) => (SUB a x)
-(MSUB a (MOVDconst [c]) x) && isPowerOfTwo64(c) => (SUBshiftLL a x [log64(c)])
-(MSUB a (MOVDconst [c]) x) && isPowerOfTwo64(c-1) && c>=3 => (SUB a (ADDshiftLL <x.Type> x x [log64(c-1)]))
-(MSUB a (MOVDconst [c]) x) && isPowerOfTwo64(c+1) && c>=7 => (ADD a (SUBshiftLL <x.Type> x x [log64(c+1)]))
-(MSUB a (MOVDconst [c]) x) && c%3 == 0 && isPowerOfTwo64(c/3) => (ADDshiftLL a (SUBshiftLL <x.Type> x x [2]) [log64(c/3)])
-(MSUB a (MOVDconst [c]) x) && c%5 == 0 && isPowerOfTwo64(c/5) => (SUBshiftLL a (ADDshiftLL <x.Type> x x [2]) [log64(c/5)])
-(MSUB a (MOVDconst [c]) x) && c%7 == 0 && isPowerOfTwo64(c/7) => (ADDshiftLL a (SUBshiftLL <x.Type> x x [3]) [log64(c/7)])
-(MSUB a (MOVDconst [c]) x) && c%9 == 0 && isPowerOfTwo64(c/9) => (SUBshiftLL a (ADDshiftLL <x.Type> x x [3]) [log64(c/9)])
+(MSUB a (MOVDconst [c]) x) && isPowerOfTwo(c) => (SUBshiftLL a x [log64(c)])
+(MSUB a (MOVDconst [c]) x) && isPowerOfTwo(c-1) && c>=3 => (SUB a (ADDshiftLL <x.Type> x x [log64(c-1)]))
+(MSUB a (MOVDconst [c]) x) && isPowerOfTwo(c+1) && c>=7 => (ADD a (SUBshiftLL <x.Type> x x [log64(c+1)]))
+(MSUB a (MOVDconst [c]) x) && c%3 == 0 && isPowerOfTwo(c/3) => (ADDshiftLL a (SUBshiftLL <x.Type> x x [2]) [log64(c/3)])
+(MSUB a (MOVDconst [c]) x) && c%5 == 0 && isPowerOfTwo(c/5) => (SUBshiftLL a (ADDshiftLL <x.Type> x x [2]) [log64(c/5)])
+(MSUB a (MOVDconst [c]) x) && c%7 == 0 && isPowerOfTwo(c/7) => (ADDshiftLL a (SUBshiftLL <x.Type> x x [3]) [log64(c/7)])
+(MSUB a (MOVDconst [c]) x) && c%9 == 0 && isPowerOfTwo(c/9) => (SUBshiftLL a (ADDshiftLL <x.Type> x x [3]) [log64(c/9)])
 
 (MSUBW a x (MOVDconst [c])) && int32(c)==-1 => (MOVWUreg (ADD <a.Type> a x))
 (MSUBW a _ (MOVDconst [c])) && int32(c)==0 => (MOVWUreg a)
 (MSUBW a x (MOVDconst [c])) && int32(c)==1 => (MOVWUreg (SUB <a.Type> a x))
-(MSUBW a x (MOVDconst [c])) && isPowerOfTwo64(c) => (MOVWUreg (SUBshiftLL <a.Type> a x [log64(c)]))
-(MSUBW a x (MOVDconst [c])) && isPowerOfTwo64(c-1) && int32(c)>=3 => (MOVWUreg (SUB <a.Type> a (ADDshiftLL <x.Type> x x [log64(c-1)])))
-(MSUBW a x (MOVDconst [c])) && isPowerOfTwo64(c+1) && int32(c)>=7 => (MOVWUreg (ADD <a.Type> a (SUBshiftLL <x.Type> x x [log64(c+1)])))
-(MSUBW a x (MOVDconst [c])) && c%3 == 0 && isPowerOfTwo64(c/3) && is32Bit(c) => (MOVWUreg (ADDshiftLL <a.Type> a (SUBshiftLL <x.Type> x x [2]) [log64(c/3)]))
-(MSUBW a x (MOVDconst [c])) && c%5 == 0 && isPowerOfTwo64(c/5) && is32Bit(c) => (MOVWUreg (SUBshiftLL <a.Type> a (ADDshiftLL <x.Type> x x [2]) [log64(c/5)]))
-(MSUBW a x (MOVDconst [c])) && c%7 == 0 && isPowerOfTwo64(c/7) && is32Bit(c) => (MOVWUreg (ADDshiftLL <a.Type> a (SUBshiftLL <x.Type> x x [3]) [log64(c/7)]))
-(MSUBW a x (MOVDconst [c])) && c%9 == 0 && isPowerOfTwo64(c/9) && is32Bit(c) => (MOVWUreg (SUBshiftLL <a.Type> a (ADDshiftLL <x.Type> x x [3]) [log64(c/9)]))
+(MSUBW a x (MOVDconst [c])) && isPowerOfTwo(c) => (MOVWUreg (SUBshiftLL <a.Type> a x [log64(c)]))
+(MSUBW a x (MOVDconst [c])) && isPowerOfTwo(c-1) && int32(c)>=3 => (MOVWUreg (SUB <a.Type> a (ADDshiftLL <x.Type> x x [log64(c-1)])))
+(MSUBW a x (MOVDconst [c])) && isPowerOfTwo(c+1) && int32(c)>=7 => (MOVWUreg (ADD <a.Type> a (SUBshiftLL <x.Type> x x [log64(c+1)])))
+(MSUBW a x (MOVDconst [c])) && c%3 == 0 && isPowerOfTwo(c/3) && is32Bit(c) => (MOVWUreg (ADDshiftLL <a.Type> a (SUBshiftLL <x.Type> x x [2]) [log64(c/3)]))
+(MSUBW a x (MOVDconst [c])) && c%5 == 0 && isPowerOfTwo(c/5) && is32Bit(c) => (MOVWUreg (SUBshiftLL <a.Type> a (ADDshiftLL <x.Type> x x [2]) [log64(c/5)]))
+(MSUBW a x (MOVDconst [c])) && c%7 == 0 && isPowerOfTwo(c/7) && is32Bit(c) => (MOVWUreg (ADDshiftLL <a.Type> a (SUBshiftLL <x.Type> x x [3]) [log64(c/7)]))
+(MSUBW a x (MOVDconst [c])) && c%9 == 0 && isPowerOfTwo(c/9) && is32Bit(c) => (MOVWUreg (SUBshiftLL <a.Type> a (ADDshiftLL <x.Type> x x [3]) [log64(c/9)]))
 
 (MSUBW a (MOVDconst [c]) x) && int32(c)==-1 => (MOVWUreg (ADD <a.Type> a x))
 (MSUBW a (MOVDconst [c]) _) && int32(c)==0 => (MOVWUreg a)
 (MSUBW a (MOVDconst [c]) x) && int32(c)==1 => (MOVWUreg (SUB <a.Type> a x))
-(MSUBW a (MOVDconst [c]) x) && isPowerOfTwo64(c) => (MOVWUreg (SUBshiftLL <a.Type> a x [log64(c)]))
-(MSUBW a (MOVDconst [c]) x) && isPowerOfTwo64(c-1) && int32(c)>=3 => (MOVWUreg (SUB <a.Type> a (ADDshiftLL <x.Type> x x [log64(c-1)])))
-(MSUBW a (MOVDconst [c]) x) && isPowerOfTwo64(c+1) && int32(c)>=7 => (MOVWUreg (ADD <a.Type> a (SUBshiftLL <x.Type> x x [log64(c+1)])))
-(MSUBW a (MOVDconst [c]) x) && c%3 == 0 && isPowerOfTwo64(c/3) && is32Bit(c) => (MOVWUreg (ADDshiftLL <a.Type> a (SUBshiftLL <x.Type> x x [2]) [log64(c/3)]))
-(MSUBW a (MOVDconst [c]) x) && c%5 == 0 && isPowerOfTwo64(c/5) && is32Bit(c) => (MOVWUreg (SUBshiftLL <a.Type> a (ADDshiftLL <x.Type> x x [2]) [log64(c/5)]))
-(MSUBW a (MOVDconst [c]) x) && c%7 == 0 && isPowerOfTwo64(c/7) && is32Bit(c) => (MOVWUreg (ADDshiftLL <a.Type> a (SUBshiftLL <x.Type> x x [3]) [log64(c/7)]))
-(MSUBW a (MOVDconst [c]) x) && c%9 == 0 && isPowerOfTwo64(c/9) && is32Bit(c) => (MOVWUreg (SUBshiftLL <a.Type> a (ADDshiftLL <x.Type> x x [3]) [log64(c/9)]))
+(MSUBW a (MOVDconst [c]) x) && isPowerOfTwo(c) => (MOVWUreg (SUBshiftLL <a.Type> a x [log64(c)]))
+(MSUBW a (MOVDconst [c]) x) && isPowerOfTwo(c-1) && int32(c)>=3 => (MOVWUreg (SUB <a.Type> a (ADDshiftLL <x.Type> x x [log64(c-1)])))
+(MSUBW a (MOVDconst [c]) x) && isPowerOfTwo(c+1) && int32(c)>=7 => (MOVWUreg (ADD <a.Type> a (SUBshiftLL <x.Type> x x [log64(c+1)])))
+(MSUBW a (MOVDconst [c]) x) && c%3 == 0 && isPowerOfTwo(c/3) && is32Bit(c) => (MOVWUreg (ADDshiftLL <a.Type> a (SUBshiftLL <x.Type> x x [2]) [log64(c/3)]))
+(MSUBW a (MOVDconst [c]) x) && c%5 == 0 && isPowerOfTwo(c/5) && is32Bit(c) => (MOVWUreg (SUBshiftLL <a.Type> a (ADDshiftLL <x.Type> x x [2]) [log64(c/5)]))
+(MSUBW a (MOVDconst [c]) x) && c%7 == 0 && isPowerOfTwo(c/7) && is32Bit(c) => (MOVWUreg (ADDshiftLL <a.Type> a (SUBshiftLL <x.Type> x x [3]) [log64(c/7)]))
+(MSUBW a (MOVDconst [c]) x) && c%9 == 0 && isPowerOfTwo(c/9) && is32Bit(c) => (MOVWUreg (SUBshiftLL <a.Type> a (ADDshiftLL <x.Type> x x [3]) [log64(c/9)]))
 
 // div by constant
 (UDIV  x (MOVDconst [1])) => x
-(UDIV  x (MOVDconst [c])) && isPowerOfTwo64(c) => (SRLconst [log64(c)] x)
+(UDIV  x (MOVDconst [c])) && isPowerOfTwo(c) => (SRLconst [log64(c)] x)
 (UDIVW x (MOVDconst [c])) && uint32(c)==1 => (MOVWUreg x)
-(UDIVW x (MOVDconst [c])) && isPowerOfTwo64(c) && is32Bit(c) => (SRLconst [log64(c)] (MOVWUreg <v.Type> x))
+(UDIVW x (MOVDconst [c])) && isPowerOfTwo(c) && is32Bit(c) => (SRLconst [log64(c)] (MOVWUreg <v.Type> x))
 (UMOD  _ (MOVDconst [1])) => (MOVDconst [0])
-(UMOD  x (MOVDconst [c])) && isPowerOfTwo64(c) => (ANDconst [c-1] x)
+(UMOD  x (MOVDconst [c])) && isPowerOfTwo(c) => (ANDconst [c-1] x)
 (UMODW _ (MOVDconst [c])) && uint32(c)==1 => (MOVDconst [0])
-(UMODW x (MOVDconst [c])) && isPowerOfTwo64(c) && is32Bit(c) => (ANDconst [c-1] x)
+(UMODW x (MOVDconst [c])) && isPowerOfTwo(c) && is32Bit(c) => (ANDconst [c-1] x)
 
 // generic simplifications
 (ADD x (NEG y)) => (SUB x y)
index ae01b5eb24a6a0be6a1dfef4d63aa02e409c7c78..74ec2f2b94fcc0703ad2ee5c26b3f7072140f623 100644 (file)
 (MULV x (MOVVconst [-1])) => (NEGV x)
 (MULV _ (MOVVconst [0])) => (MOVVconst [0])
 (MULV x (MOVVconst [1])) => x
-(MULV x (MOVVconst [c])) && isPowerOfTwo64(c) => (SLLVconst [log64(c)] x)
+(MULV x (MOVVconst [c])) && isPowerOfTwo(c) => (SLLVconst [log64(c)] x)
 
 // div by constant
 (DIVVU x (MOVVconst [1])) => x
-(DIVVU x (MOVVconst [c])) && isPowerOfTwo64(c) => (SRLVconst [log64(c)] x)
+(DIVVU x (MOVVconst [c])) && isPowerOfTwo(c) => (SRLVconst [log64(c)] x)
 (REMVU _ (MOVVconst [1])) => (MOVVconst [0])                       // mod
-(REMVU x (MOVVconst [c])) && isPowerOfTwo64(c) => (ANDconst [c-1] x) // mod
+(REMVU x (MOVVconst [c])) && isPowerOfTwo(c) => (ANDconst [c-1] x) // mod
 
 // generic simplifications
 (ADDV x (NEGV y)) => (SUBV x y)
index d6ae0101cbd4b013b395df043145f8bc6c6706c6..f4e0467ea001b18bd4cdf235a0b199658d9d3fc1 100644 (file)
 (Select0 (MULTU (MOVWconst [1])  _ )) => (MOVWconst [0])
 (Select1 (MULTU (MOVWconst [-1]) x )) => (NEG <x.Type> x)
 (Select0 (MULTU (MOVWconst [-1]) x )) => (CMOVZ (ADDconst <x.Type> [-1] x) (MOVWconst [0]) x)
-(Select1 (MULTU (MOVWconst [c])  x )) && isPowerOfTwo64(int64(uint32(c))) => (SLLconst [int32(log2uint32(int64(c)))] x)
-(Select0 (MULTU (MOVWconst [c])  x )) && isPowerOfTwo64(int64(uint32(c))) => (SRLconst [int32(32-log2uint32(int64(c)))] x)
+(Select1 (MULTU (MOVWconst [c])  x )) && isPowerOfTwo(int64(uint32(c))) => (SLLconst [int32(log2uint32(int64(c)))] x)
+(Select0 (MULTU (MOVWconst [c])  x )) && isPowerOfTwo(int64(uint32(c))) => (SRLconst [int32(32-log2uint32(int64(c)))] x)
 
 (MUL (MOVWconst [0])  _ ) => (MOVWconst [0])
 (MUL (MOVWconst [1])  x ) => x
 (MUL (MOVWconst [-1]) x ) => (NEG x)
-(MUL (MOVWconst [c]) x ) && isPowerOfTwo64(int64(uint32(c))) => (SLLconst [int32(log2uint32(int64(c)))] x)
+(MUL (MOVWconst [c]) x ) && isPowerOfTwo(int64(uint32(c))) => (SLLconst [int32(log2uint32(int64(c)))] x)
 
 // generic simplifications
 (ADD x (NEG y)) => (SUB x y)
index cabc7c652dff6ce4d8157ce10c25f947c5261802..8aed350039ab7eeef26e64988df8e116c9ecc554 100644 (file)
 (Select1 (MULVU x (MOVVconst [-1]))) => (NEGV x)
 (Select1 (MULVU _ (MOVVconst [0]))) => (MOVVconst [0])
 (Select1 (MULVU x (MOVVconst [1]))) => x
-(Select1 (MULVU x (MOVVconst [c]))) && isPowerOfTwo64(c) => (SLLVconst [log64(c)] x)
+(Select1 (MULVU x (MOVVconst [c]))) && isPowerOfTwo(c) => (SLLVconst [log64(c)] x)
 
 // div by constant
 (Select1 (DIVVU x (MOVVconst [1]))) => x
-(Select1 (DIVVU x (MOVVconst [c]))) && isPowerOfTwo64(c) => (SRLVconst [log64(c)] x)
+(Select1 (DIVVU x (MOVVconst [c]))) && isPowerOfTwo(c) => (SRLVconst [log64(c)] x)
 (Select0 (DIVVU _ (MOVVconst [1]))) => (MOVVconst [0])                       // mod
-(Select0 (DIVVU x (MOVVconst [c]))) && isPowerOfTwo64(c) => (ANDconst [c-1] x) // mod
+(Select0 (DIVVU x (MOVVconst [c]))) && isPowerOfTwo(c) => (ANDconst [c-1] x) // mod
 
 // generic simplifications
 (ADDV x (NEGV y)) => (SUBV x y)
index bda94004a4315af7fb2f9fc80a4e2674e7601d57..462cf8f70111e195f62adac1e310c2ec31fecd19 100644 (file)
 //
 // Notes:
 //   - the generic rules have already matched single powers of two so we ignore them here
-//   - isPowerOfTwo32 asserts that its argument is greater than 0
+//   - isPowerOfTwo asserts that its argument is greater than 0
 //   - c&(c-1) = clear rightmost bit
 //   - c&^(c-1) = isolate rightmost bit
 
 // c = 2Ë£ + 2ʸ => c - 2Ë£ = 2ʸ
-(MULL(D|W)const <t> x [c]) && isPowerOfTwo32(c&(c-1))
+(MULL(D|W)const <t> x [c]) && isPowerOfTwo(c&(c-1))
   => ((ADD|ADDW) (SL(D|W)const <t> x [uint8(log32(c&(c-1)))])
                  (SL(D|W)const <t> x [uint8(log32(c&^(c-1)))]))
 
 // c = 2ʸ - 2Ë£ => c + 2Ë£ = 2ʸ
-(MULL(D|W)const <t> x [c]) && isPowerOfTwo32(c+(c&^(c-1)))
+(MULL(D|W)const <t> x [c]) && isPowerOfTwo(c+(c&^(c-1)))
   => ((SUB|SUBW) (SL(D|W)const <t> x [uint8(log32(c+(c&^(c-1))))])
                  (SL(D|W)const <t> x [uint8(log32(c&^(c-1)))]))
 
 // c = 2Ë£ - 2ʸ => -c + 2Ë£ = 2ʸ
-(MULL(D|W)const <t> x [c]) && isPowerOfTwo32(-c+(-c&^(-c-1)))
+(MULL(D|W)const <t> x [c]) && isPowerOfTwo(-c+(-c&^(-c-1)))
   => ((SUB|SUBW) (SL(D|W)const <t> x [uint8(log32(-c&^(-c-1)))])
                  (SL(D|W)const <t> x [uint8(log32(-c+(-c&^(-c-1))))]))
 
index 65cd98548452646e449c1b1588f83f3d56715a68..3f4e41e68cfc790ecaf584117c3919af787f00a1 100644 (file)
 (Or(8|16|32|64) <t> (Com(8|16|32|64) x) (Com(8|16|32|64) y)) => (Com(8|16|32|64) (And(8|16|32|64) <t> x y))
 
 // Convert multiplication by a power of two to a shift.
-(Mul8  <t> n (Const8  [c])) && isPowerOfTwo8(c) => (Lsh8x64  <t> n (Const64 <typ.UInt64> [log8(c)]))
-(Mul16 <t> n (Const16 [c])) && isPowerOfTwo16(c) => (Lsh16x64 <t> n (Const64 <typ.UInt64> [log16(c)]))
-(Mul32 <t> n (Const32 [c])) && isPowerOfTwo32(c) => (Lsh32x64 <t> n (Const64 <typ.UInt64> [log32(c)]))
-(Mul64 <t> n (Const64 [c])) && isPowerOfTwo64(c) => (Lsh64x64 <t> n (Const64 <typ.UInt64> [log64(c)]))
-(Mul8  <t> n (Const8  [c])) && t.IsSigned() && isPowerOfTwo8(-c)  => (Neg8  (Lsh8x64  <t> n (Const64 <typ.UInt64> [log8(-c)])))
-(Mul16 <t> n (Const16 [c])) && t.IsSigned() && isPowerOfTwo16(-c) => (Neg16 (Lsh16x64 <t> n (Const64 <typ.UInt64> [log16(-c)])))
-(Mul32 <t> n (Const32 [c])) && t.IsSigned() && isPowerOfTwo32(-c) => (Neg32 (Lsh32x64 <t> n (Const64 <typ.UInt64> [log32(-c)])))
-(Mul64 <t> n (Const64 [c])) && t.IsSigned() && isPowerOfTwo64(-c) => (Neg64 (Lsh64x64 <t> n (Const64 <typ.UInt64> [log64(-c)])))
+(Mul8  <t> n (Const8  [c])) && isPowerOfTwo(c) => (Lsh8x64  <t> n (Const64 <typ.UInt64> [log8(c)]))
+(Mul16 <t> n (Const16 [c])) && isPowerOfTwo(c) => (Lsh16x64 <t> n (Const64 <typ.UInt64> [log16(c)]))
+(Mul32 <t> n (Const32 [c])) && isPowerOfTwo(c) => (Lsh32x64 <t> n (Const64 <typ.UInt64> [log32(c)]))
+(Mul64 <t> n (Const64 [c])) && isPowerOfTwo(c) => (Lsh64x64 <t> n (Const64 <typ.UInt64> [log64(c)]))
+(Mul8  <t> n (Const8  [c])) && t.IsSigned() && isPowerOfTwo(-c) => (Neg8  (Lsh8x64  <t> n (Const64 <typ.UInt64> [log8(-c)])))
+(Mul16 <t> n (Const16 [c])) && t.IsSigned() && isPowerOfTwo(-c) => (Neg16 (Lsh16x64 <t> n (Const64 <typ.UInt64> [log16(-c)])))
+(Mul32 <t> n (Const32 [c])) && t.IsSigned() && isPowerOfTwo(-c) => (Neg32 (Lsh32x64 <t> n (Const64 <typ.UInt64> [log32(-c)])))
+(Mul64 <t> n (Const64 [c])) && t.IsSigned() && isPowerOfTwo(-c) => (Neg64 (Lsh64x64 <t> n (Const64 <typ.UInt64> [log64(-c)])))
 
 (Mod8  (Const8  [c]) (Const8  [d])) && d != 0 => (Const8  [c % d])
 (Mod16 (Const16 [c]) (Const16 [d])) && d != 0 => (Const16 [c % d])
 // See ../magic.go for a detailed description of these algorithms.
 
 // Unsigned divide by power of 2.  Strength reduce to a shift.
-(Div8u  n (Const8  [c])) && isPowerOfTwo8(c)  => (Rsh8Ux64  n (Const64 <typ.UInt64> [log8(c)]))
-(Div16u n (Const16 [c])) && isPowerOfTwo16(c) => (Rsh16Ux64 n (Const64 <typ.UInt64> [log16(c)]))
-(Div32u n (Const32 [c])) && isPowerOfTwo32(c) => (Rsh32Ux64 n (Const64 <typ.UInt64> [log32(c)]))
-(Div64u n (Const64 [c])) && isPowerOfTwo64(c) => (Rsh64Ux64 n (Const64 <typ.UInt64> [log64(c)]))
+(Div8u  n (Const8  [c])) && isPowerOfTwo(c) => (Rsh8Ux64  n (Const64 <typ.UInt64> [log8(c)]))
+(Div16u n (Const16 [c])) && isPowerOfTwo(c) => (Rsh16Ux64 n (Const64 <typ.UInt64> [log16(c)]))
+(Div32u n (Const32 [c])) && isPowerOfTwo(c) => (Rsh32Ux64 n (Const64 <typ.UInt64> [log32(c)]))
+(Div64u n (Const64 [c])) && isPowerOfTwo(c) => (Rsh64Ux64 n (Const64 <typ.UInt64> [log64(c)]))
 (Div64u n (Const64 [-1<<63]))                 => (Rsh64Ux64 n (Const64 <typ.UInt64> [63]))
 
 // Signed non-negative divide by power of 2.
-(Div8  n (Const8  [c])) && isNonNegative(n) && isPowerOfTwo8(c)  => (Rsh8Ux64  n (Const64 <typ.UInt64> [log8(c)]))
-(Div16 n (Const16 [c])) && isNonNegative(n) && isPowerOfTwo16(c) => (Rsh16Ux64 n (Const64 <typ.UInt64> [log16(c)]))
-(Div32 n (Const32 [c])) && isNonNegative(n) && isPowerOfTwo32(c) => (Rsh32Ux64 n (Const64 <typ.UInt64> [log32(c)]))
-(Div64 n (Const64 [c])) && isNonNegative(n) && isPowerOfTwo64(c) => (Rsh64Ux64 n (Const64 <typ.UInt64> [log64(c)]))
+(Div8  n (Const8  [c])) && isNonNegative(n) && isPowerOfTwo(c) => (Rsh8Ux64  n (Const64 <typ.UInt64> [log8(c)]))
+(Div16 n (Const16 [c])) && isNonNegative(n) && isPowerOfTwo(c) => (Rsh16Ux64 n (Const64 <typ.UInt64> [log16(c)]))
+(Div32 n (Const32 [c])) && isNonNegative(n) && isPowerOfTwo(c) => (Rsh32Ux64 n (Const64 <typ.UInt64> [log32(c)]))
+(Div64 n (Const64 [c])) && isNonNegative(n) && isPowerOfTwo(c) => (Rsh64Ux64 n (Const64 <typ.UInt64> [log64(c)]))
 (Div64 n (Const64 [-1<<63])) && isNonNegative(n)                 => (Const64 [0])
 
 // Unsigned divide, not a power of 2.  Strength reduce to a multiply.
 // n / c =       n >> log(c) if n >= 0
 //       = (n+c-1) >> log(c) if n < 0
 // We conditionally add c-1 by adding n>>63>>(64-log(c)) (first shift signed, second shift unsigned).
-(Div8  <t> n (Const8  [c])) && isPowerOfTwo8(c) =>
+(Div8  <t> n (Const8  [c])) && isPowerOfTwo(c) =>
   (Rsh8x64
     (Add8  <t> n (Rsh8Ux64  <t> (Rsh8x64  <t> n (Const64 <typ.UInt64> [ 7])) (Const64 <typ.UInt64> [int64( 8-log8(c))])))
     (Const64 <typ.UInt64> [int64(log8(c))]))
-(Div16 <t> n (Const16 [c])) && isPowerOfTwo16(c) =>
+(Div16 <t> n (Const16 [c])) && isPowerOfTwo(c) =>
   (Rsh16x64
     (Add16 <t> n (Rsh16Ux64 <t> (Rsh16x64 <t> n (Const64 <typ.UInt64> [15])) (Const64 <typ.UInt64> [int64(16-log16(c))])))
     (Const64 <typ.UInt64> [int64(log16(c))]))
-(Div32 <t> n (Const32 [c])) && isPowerOfTwo32(c) =>
+(Div32 <t> n (Const32 [c])) && isPowerOfTwo(c) =>
   (Rsh32x64
     (Add32 <t> n (Rsh32Ux64 <t> (Rsh32x64 <t> n (Const64 <typ.UInt64> [31])) (Const64 <typ.UInt64> [int64(32-log32(c))])))
     (Const64 <typ.UInt64> [int64(log32(c))]))
-(Div64 <t> n (Const64 [c])) && isPowerOfTwo64(c) =>
+(Div64 <t> n (Const64 [c])) && isPowerOfTwo(c) =>
   (Rsh64x64
     (Add64 <t> n (Rsh64Ux64 <t> (Rsh64x64 <t> n (Const64 <typ.UInt64> [63])) (Const64 <typ.UInt64> [int64(64-log64(c))])))
     (Const64 <typ.UInt64> [int64(log64(c))]))
       (Const64 <typ.UInt64> [63])))
 
 // Unsigned mod by power of 2 constant.
-(Mod8u  <t> n (Const8  [c])) && isPowerOfTwo8(c)  => (And8  n (Const8  <t> [c-1]))
-(Mod16u <t> n (Const16 [c])) && isPowerOfTwo16(c) => (And16 n (Const16 <t> [c-1]))
-(Mod32u <t> n (Const32 [c])) && isPowerOfTwo32(c) => (And32 n (Const32 <t> [c-1]))
-(Mod64u <t> n (Const64 [c])) && isPowerOfTwo64(c) => (And64 n (Const64 <t> [c-1]))
+(Mod8u  <t> n (Const8  [c])) && isPowerOfTwo(c) => (And8  n (Const8  <t> [c-1]))
+(Mod16u <t> n (Const16 [c])) && isPowerOfTwo(c) => (And16 n (Const16 <t> [c-1]))
+(Mod32u <t> n (Const32 [c])) && isPowerOfTwo(c) => (And32 n (Const32 <t> [c-1]))
+(Mod64u <t> n (Const64 [c])) && isPowerOfTwo(c) => (And64 n (Const64 <t> [c-1]))
 (Mod64u <t> n (Const64 [-1<<63]))                 => (And64 n (Const64 <t> [1<<63-1]))
 
 // Signed non-negative mod by power of 2 constant.
-(Mod8  <t> n (Const8  [c])) && isNonNegative(n) && isPowerOfTwo8(c)  => (And8  n (Const8  <t> [c-1]))
-(Mod16 <t> n (Const16 [c])) && isNonNegative(n) && isPowerOfTwo16(c) => (And16 n (Const16 <t> [c-1]))
-(Mod32 <t> n (Const32 [c])) && isNonNegative(n) && isPowerOfTwo32(c) => (And32 n (Const32 <t> [c-1]))
-(Mod64 <t> n (Const64 [c])) && isNonNegative(n) && isPowerOfTwo64(c) => (And64 n (Const64 <t> [c-1]))
+(Mod8  <t> n (Const8  [c])) && isNonNegative(n) && isPowerOfTwo(c) => (And8  n (Const8  <t> [c-1]))
+(Mod16 <t> n (Const16 [c])) && isNonNegative(n) && isPowerOfTwo(c) => (And16 n (Const16 <t> [c-1]))
+(Mod32 <t> n (Const32 [c])) && isNonNegative(n) && isPowerOfTwo(c) => (And32 n (Const32 <t> [c-1]))
+(Mod64 <t> n (Const64 [c])) && isNonNegative(n) && isPowerOfTwo(c) => (And64 n (Const64 <t> [c-1]))
 (Mod64 n (Const64 [-1<<63])) && isNonNegative(n)                   => n
 
 // Signed mod by negative constant.
index 55417db8a6f32cf434be767c42b0a40dc8463e00..687f6a8537a019496526609e2fcd52fab670acc4 100644 (file)
@@ -475,16 +475,7 @@ func log2uint32(n int64) int64 {
 }
 
 // isPowerOfTwoX functions report whether n is a power of 2.
-func isPowerOfTwo8(n int8) bool {
-       return n > 0 && n&(n-1) == 0
-}
-func isPowerOfTwo16(n int16) bool {
-       return n > 0 && n&(n-1) == 0
-}
-func isPowerOfTwo32(n int32) bool {
-       return n > 0 && n&(n-1) == 0
-}
-func isPowerOfTwo64(n int64) bool {
+func isPowerOfTwo[T int8 | int16 | int32 | int64](n T) bool {
        return n > 0 && n&(n-1) == 0
 }
 
@@ -1820,7 +1811,7 @@ func (bfc arm64BitField) width() int64 {
 // checks if mask >> rshift applied at lsb is a valid arm64 bitfield op mask.
 func isARM64BFMask(lsb, mask, rshift int64) bool {
        shiftedMask := int64(uint64(mask) >> uint64(rshift))
-       return shiftedMask != 0 && isPowerOfTwo64(shiftedMask+1) && nto(shiftedMask)+lsb < 64
+       return shiftedMask != 0 && isPowerOfTwo(shiftedMask+1) && nto(shiftedMask)+lsb < 64
 }
 
 // returns the bitfield width of mask >> rshift for arm64 bitfield ops.
index b0512676c9e8c5e7f434ba57a2707a3ad53ddf09..ce74d75158d274c3d82d087305ff31da413e60ba 100644 (file)
@@ -5273,12 +5273,12 @@ func rewriteValue386_Op386MULLconst(v *Value) bool {
                return true
        }
        // match: (MULLconst [c] x)
-       // cond: isPowerOfTwo32(c+1) && c >= 15
+       // cond: isPowerOfTwo(c+1) && c >= 15
        // result: (SUBL (SHLLconst <v.Type> [int32(log32(c+1))] x) x)
        for {
                c := auxIntToInt32(v.AuxInt)
                x := v_0
-               if !(isPowerOfTwo32(c+1) && c >= 15) {
+               if !(isPowerOfTwo(c+1) && c >= 15) {
                        break
                }
                v.reset(Op386SUBL)
@@ -5289,12 +5289,12 @@ func rewriteValue386_Op386MULLconst(v *Value) bool {
                return true
        }
        // match: (MULLconst [c] x)
-       // cond: isPowerOfTwo32(c-1) && c >= 17
+       // cond: isPowerOfTwo(c-1) && c >= 17
        // result: (LEAL1 (SHLLconst <v.Type> [int32(log32(c-1))] x) x)
        for {
                c := auxIntToInt32(v.AuxInt)
                x := v_0
-               if !(isPowerOfTwo32(c-1) && c >= 17) {
+               if !(isPowerOfTwo(c-1) && c >= 17) {
                        break
                }
                v.reset(Op386LEAL1)
@@ -5305,12 +5305,12 @@ func rewriteValue386_Op386MULLconst(v *Value) bool {
                return true
        }
        // match: (MULLconst [c] x)
-       // cond: isPowerOfTwo32(c-2) && c >= 34
+       // cond: isPowerOfTwo(c-2) && c >= 34
        // result: (LEAL2 (SHLLconst <v.Type> [int32(log32(c-2))] x) x)
        for {
                c := auxIntToInt32(v.AuxInt)
                x := v_0
-               if !(isPowerOfTwo32(c-2) && c >= 34) {
+               if !(isPowerOfTwo(c-2) && c >= 34) {
                        break
                }
                v.reset(Op386LEAL2)
@@ -5321,12 +5321,12 @@ func rewriteValue386_Op386MULLconst(v *Value) bool {
                return true
        }
        // match: (MULLconst [c] x)
-       // cond: isPowerOfTwo32(c-4) && c >= 68
+       // cond: isPowerOfTwo(c-4) && c >= 68
        // result: (LEAL4 (SHLLconst <v.Type> [int32(log32(c-4))] x) x)
        for {
                c := auxIntToInt32(v.AuxInt)
                x := v_0
-               if !(isPowerOfTwo32(c-4) && c >= 68) {
+               if !(isPowerOfTwo(c-4) && c >= 68) {
                        break
                }
                v.reset(Op386LEAL4)
@@ -5337,12 +5337,12 @@ func rewriteValue386_Op386MULLconst(v *Value) bool {
                return true
        }
        // match: (MULLconst [c] x)
-       // cond: isPowerOfTwo32(c-8) && c >= 136
+       // cond: isPowerOfTwo(c-8) && c >= 136
        // result: (LEAL8 (SHLLconst <v.Type> [int32(log32(c-8))] x) x)
        for {
                c := auxIntToInt32(v.AuxInt)
                x := v_0
-               if !(isPowerOfTwo32(c-8) && c >= 136) {
+               if !(isPowerOfTwo(c-8) && c >= 136) {
                        break
                }
                v.reset(Op386LEAL8)
@@ -5353,12 +5353,12 @@ func rewriteValue386_Op386MULLconst(v *Value) bool {
                return true
        }
        // match: (MULLconst [c] x)
-       // cond: c%3 == 0 && isPowerOfTwo32(c/3)
+       // cond: c%3 == 0 && isPowerOfTwo(c/3)
        // result: (SHLLconst [int32(log32(c/3))] (LEAL2 <v.Type> x x))
        for {
                c := auxIntToInt32(v.AuxInt)
                x := v_0
-               if !(c%3 == 0 && isPowerOfTwo32(c/3)) {
+               if !(c%3 == 0 && isPowerOfTwo(c/3)) {
                        break
                }
                v.reset(Op386SHLLconst)
@@ -5369,12 +5369,12 @@ func rewriteValue386_Op386MULLconst(v *Value) bool {
                return true
        }
        // match: (MULLconst [c] x)
-       // cond: c%5 == 0 && isPowerOfTwo32(c/5)
+       // cond: c%5 == 0 && isPowerOfTwo(c/5)
        // result: (SHLLconst [int32(log32(c/5))] (LEAL4 <v.Type> x x))
        for {
                c := auxIntToInt32(v.AuxInt)
                x := v_0
-               if !(c%5 == 0 && isPowerOfTwo32(c/5)) {
+               if !(c%5 == 0 && isPowerOfTwo(c/5)) {
                        break
                }
                v.reset(Op386SHLLconst)
@@ -5385,12 +5385,12 @@ func rewriteValue386_Op386MULLconst(v *Value) bool {
                return true
        }
        // match: (MULLconst [c] x)
-       // cond: c%9 == 0 && isPowerOfTwo32(c/9)
+       // cond: c%9 == 0 && isPowerOfTwo(c/9)
        // result: (SHLLconst [int32(log32(c/9))] (LEAL8 <v.Type> x x))
        for {
                c := auxIntToInt32(v.AuxInt)
                x := v_0
-               if !(c%9 == 0 && isPowerOfTwo32(c/9)) {
+               if !(c%9 == 0 && isPowerOfTwo(c/9)) {
                        break
                }
                v.reset(Op386SHLLconst)
index b3a644cbed8a8da9e382be1ef409fafcbd14fcdd..77d53997f6e6e795bb7d84a0eafc0c5efae46b62 100644 (file)
@@ -13400,12 +13400,12 @@ func rewriteValueAMD64_OpAMD64MULLconst(v *Value) bool {
                return true
        }
        // match: (MULLconst [c] x)
-       // cond: isPowerOfTwo64(int64(c)+1) && c >= 15
+       // cond: isPowerOfTwo(int64(c)+1) && c >= 15
        // result: (SUBL (SHLLconst <v.Type> [int8(log64(int64(c)+1))] x) x)
        for {
                c := auxIntToInt32(v.AuxInt)
                x := v_0
-               if !(isPowerOfTwo64(int64(c)+1) && c >= 15) {
+               if !(isPowerOfTwo(int64(c)+1) && c >= 15) {
                        break
                }
                v.reset(OpAMD64SUBL)
@@ -13416,12 +13416,12 @@ func rewriteValueAMD64_OpAMD64MULLconst(v *Value) bool {
                return true
        }
        // match: (MULLconst [c] x)
-       // cond: isPowerOfTwo32(c-1) && c >= 17
+       // cond: isPowerOfTwo(c-1) && c >= 17
        // result: (LEAL1 (SHLLconst <v.Type> [int8(log32(c-1))] x) x)
        for {
                c := auxIntToInt32(v.AuxInt)
                x := v_0
-               if !(isPowerOfTwo32(c-1) && c >= 17) {
+               if !(isPowerOfTwo(c-1) && c >= 17) {
                        break
                }
                v.reset(OpAMD64LEAL1)
@@ -13432,12 +13432,12 @@ func rewriteValueAMD64_OpAMD64MULLconst(v *Value) bool {
                return true
        }
        // match: (MULLconst [c] x)
-       // cond: isPowerOfTwo32(c-2) && c >= 34
+       // cond: isPowerOfTwo(c-2) && c >= 34
        // result: (LEAL2 (SHLLconst <v.Type> [int8(log32(c-2))] x) x)
        for {
                c := auxIntToInt32(v.AuxInt)
                x := v_0
-               if !(isPowerOfTwo32(c-2) && c >= 34) {
+               if !(isPowerOfTwo(c-2) && c >= 34) {
                        break
                }
                v.reset(OpAMD64LEAL2)
@@ -13448,12 +13448,12 @@ func rewriteValueAMD64_OpAMD64MULLconst(v *Value) bool {
                return true
        }
        // match: (MULLconst [c] x)
-       // cond: isPowerOfTwo32(c-4) && c >= 68
+       // cond: isPowerOfTwo(c-4) && c >= 68
        // result: (LEAL4 (SHLLconst <v.Type> [int8(log32(c-4))] x) x)
        for {
                c := auxIntToInt32(v.AuxInt)
                x := v_0
-               if !(isPowerOfTwo32(c-4) && c >= 68) {
+               if !(isPowerOfTwo(c-4) && c >= 68) {
                        break
                }
                v.reset(OpAMD64LEAL4)
@@ -13464,12 +13464,12 @@ func rewriteValueAMD64_OpAMD64MULLconst(v *Value) bool {
                return true
        }
        // match: (MULLconst [c] x)
-       // cond: isPowerOfTwo32(c-8) && c >= 136
+       // cond: isPowerOfTwo(c-8) && c >= 136
        // result: (LEAL8 (SHLLconst <v.Type> [int8(log32(c-8))] x) x)
        for {
                c := auxIntToInt32(v.AuxInt)
                x := v_0
-               if !(isPowerOfTwo32(c-8) && c >= 136) {
+               if !(isPowerOfTwo(c-8) && c >= 136) {
                        break
                }
                v.reset(OpAMD64LEAL8)
@@ -13480,12 +13480,12 @@ func rewriteValueAMD64_OpAMD64MULLconst(v *Value) bool {
                return true
        }
        // match: (MULLconst [c] x)
-       // cond: c%3 == 0 && isPowerOfTwo32(c/3)
+       // cond: c%3 == 0 && isPowerOfTwo(c/3)
        // result: (SHLLconst [int8(log32(c/3))] (LEAL2 <v.Type> x x))
        for {
                c := auxIntToInt32(v.AuxInt)
                x := v_0
-               if !(c%3 == 0 && isPowerOfTwo32(c/3)) {
+               if !(c%3 == 0 && isPowerOfTwo(c/3)) {
                        break
                }
                v.reset(OpAMD64SHLLconst)
@@ -13496,12 +13496,12 @@ func rewriteValueAMD64_OpAMD64MULLconst(v *Value) bool {
                return true
        }
        // match: (MULLconst [c] x)
-       // cond: c%5 == 0 && isPowerOfTwo32(c/5)
+       // cond: c%5 == 0 && isPowerOfTwo(c/5)
        // result: (SHLLconst [int8(log32(c/5))] (LEAL4 <v.Type> x x))
        for {
                c := auxIntToInt32(v.AuxInt)
                x := v_0
-               if !(c%5 == 0 && isPowerOfTwo32(c/5)) {
+               if !(c%5 == 0 && isPowerOfTwo(c/5)) {
                        break
                }
                v.reset(OpAMD64SHLLconst)
@@ -13512,12 +13512,12 @@ func rewriteValueAMD64_OpAMD64MULLconst(v *Value) bool {
                return true
        }
        // match: (MULLconst [c] x)
-       // cond: c%9 == 0 && isPowerOfTwo32(c/9)
+       // cond: c%9 == 0 && isPowerOfTwo(c/9)
        // result: (SHLLconst [int8(log32(c/9))] (LEAL8 <v.Type> x x))
        for {
                c := auxIntToInt32(v.AuxInt)
                x := v_0
-               if !(c%9 == 0 && isPowerOfTwo32(c/9)) {
+               if !(c%9 == 0 && isPowerOfTwo(c/9)) {
                        break
                }
                v.reset(OpAMD64SHLLconst)
@@ -13847,12 +13847,12 @@ func rewriteValueAMD64_OpAMD64MULQconst(v *Value) bool {
                return true
        }
        // match: (MULQconst [c] x)
-       // cond: isPowerOfTwo64(int64(c)+1) && c >= 15
+       // cond: isPowerOfTwo(int64(c)+1) && c >= 15
        // result: (SUBQ (SHLQconst <v.Type> [int8(log64(int64(c)+1))] x) x)
        for {
                c := auxIntToInt32(v.AuxInt)
                x := v_0
-               if !(isPowerOfTwo64(int64(c)+1) && c >= 15) {
+               if !(isPowerOfTwo(int64(c)+1) && c >= 15) {
                        break
                }
                v.reset(OpAMD64SUBQ)
@@ -13863,12 +13863,12 @@ func rewriteValueAMD64_OpAMD64MULQconst(v *Value) bool {
                return true
        }
        // match: (MULQconst [c] x)
-       // cond: isPowerOfTwo32(c-1) && c >= 17
+       // cond: isPowerOfTwo(c-1) && c >= 17
        // result: (LEAQ1 (SHLQconst <v.Type> [int8(log32(c-1))] x) x)
        for {
                c := auxIntToInt32(v.AuxInt)
                x := v_0
-               if !(isPowerOfTwo32(c-1) && c >= 17) {
+               if !(isPowerOfTwo(c-1) && c >= 17) {
                        break
                }
                v.reset(OpAMD64LEAQ1)
@@ -13879,12 +13879,12 @@ func rewriteValueAMD64_OpAMD64MULQconst(v *Value) bool {
                return true
        }
        // match: (MULQconst [c] x)
-       // cond: isPowerOfTwo32(c-2) && c >= 34
+       // cond: isPowerOfTwo(c-2) && c >= 34
        // result: (LEAQ2 (SHLQconst <v.Type> [int8(log32(c-2))] x) x)
        for {
                c := auxIntToInt32(v.AuxInt)
                x := v_0
-               if !(isPowerOfTwo32(c-2) && c >= 34) {
+               if !(isPowerOfTwo(c-2) && c >= 34) {
                        break
                }
                v.reset(OpAMD64LEAQ2)
@@ -13895,12 +13895,12 @@ func rewriteValueAMD64_OpAMD64MULQconst(v *Value) bool {
                return true
        }
        // match: (MULQconst [c] x)
-       // cond: isPowerOfTwo32(c-4) && c >= 68
+       // cond: isPowerOfTwo(c-4) && c >= 68
        // result: (LEAQ4 (SHLQconst <v.Type> [int8(log32(c-4))] x) x)
        for {
                c := auxIntToInt32(v.AuxInt)
                x := v_0
-               if !(isPowerOfTwo32(c-4) && c >= 68) {
+               if !(isPowerOfTwo(c-4) && c >= 68) {
                        break
                }
                v.reset(OpAMD64LEAQ4)
@@ -13911,12 +13911,12 @@ func rewriteValueAMD64_OpAMD64MULQconst(v *Value) bool {
                return true
        }
        // match: (MULQconst [c] x)
-       // cond: isPowerOfTwo32(c-8) && c >= 136
+       // cond: isPowerOfTwo(c-8) && c >= 136
        // result: (LEAQ8 (SHLQconst <v.Type> [int8(log32(c-8))] x) x)
        for {
                c := auxIntToInt32(v.AuxInt)
                x := v_0
-               if !(isPowerOfTwo32(c-8) && c >= 136) {
+               if !(isPowerOfTwo(c-8) && c >= 136) {
                        break
                }
                v.reset(OpAMD64LEAQ8)
@@ -13927,12 +13927,12 @@ func rewriteValueAMD64_OpAMD64MULQconst(v *Value) bool {
                return true
        }
        // match: (MULQconst [c] x)
-       // cond: c%3 == 0 && isPowerOfTwo32(c/3)
+       // cond: c%3 == 0 && isPowerOfTwo(c/3)
        // result: (SHLQconst [int8(log32(c/3))] (LEAQ2 <v.Type> x x))
        for {
                c := auxIntToInt32(v.AuxInt)
                x := v_0
-               if !(c%3 == 0 && isPowerOfTwo32(c/3)) {
+               if !(c%3 == 0 && isPowerOfTwo(c/3)) {
                        break
                }
                v.reset(OpAMD64SHLQconst)
@@ -13943,12 +13943,12 @@ func rewriteValueAMD64_OpAMD64MULQconst(v *Value) bool {
                return true
        }
        // match: (MULQconst [c] x)
-       // cond: c%5 == 0 && isPowerOfTwo32(c/5)
+       // cond: c%5 == 0 && isPowerOfTwo(c/5)
        // result: (SHLQconst [int8(log32(c/5))] (LEAQ4 <v.Type> x x))
        for {
                c := auxIntToInt32(v.AuxInt)
                x := v_0
-               if !(c%5 == 0 && isPowerOfTwo32(c/5)) {
+               if !(c%5 == 0 && isPowerOfTwo(c/5)) {
                        break
                }
                v.reset(OpAMD64SHLQconst)
@@ -13959,12 +13959,12 @@ func rewriteValueAMD64_OpAMD64MULQconst(v *Value) bool {
                return true
        }
        // match: (MULQconst [c] x)
-       // cond: c%9 == 0 && isPowerOfTwo32(c/9)
+       // cond: c%9 == 0 && isPowerOfTwo(c/9)
        // result: (SHLQconst [int8(log32(c/9))] (LEAQ8 <v.Type> x x))
        for {
                c := auxIntToInt32(v.AuxInt)
                x := v_0
-               if !(c%9 == 0 && isPowerOfTwo32(c/9)) {
+               if !(c%9 == 0 && isPowerOfTwo(c/9)) {
                        break
                }
                v.reset(OpAMD64SHLQconst)
index 971c9a5d552acaf1b1af4931fffb57fa9dde8313..09be5ccf685b617a5df63b217b198385091fea50 100644 (file)
@@ -7009,7 +7009,7 @@ func rewriteValueARM_OpARMMUL(v *Value) bool {
                break
        }
        // match: (MUL x (MOVWconst [c]))
-       // cond: isPowerOfTwo32(c)
+       // cond: isPowerOfTwo(c)
        // result: (SLLconst [int32(log32(c))] x)
        for {
                for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
@@ -7018,7 +7018,7 @@ func rewriteValueARM_OpARMMUL(v *Value) bool {
                                continue
                        }
                        c := auxIntToInt32(v_1.AuxInt)
-                       if !(isPowerOfTwo32(c)) {
+                       if !(isPowerOfTwo(c)) {
                                continue
                        }
                        v.reset(OpARMSLLconst)
@@ -7029,7 +7029,7 @@ func rewriteValueARM_OpARMMUL(v *Value) bool {
                break
        }
        // match: (MUL x (MOVWconst [c]))
-       // cond: isPowerOfTwo32(c-1) && c >= 3
+       // cond: isPowerOfTwo(c-1) && c >= 3
        // result: (ADDshiftLL x x [int32(log32(c-1))])
        for {
                for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
@@ -7038,7 +7038,7 @@ func rewriteValueARM_OpARMMUL(v *Value) bool {
                                continue
                        }
                        c := auxIntToInt32(v_1.AuxInt)
-                       if !(isPowerOfTwo32(c-1) && c >= 3) {
+                       if !(isPowerOfTwo(c-1) && c >= 3) {
                                continue
                        }
                        v.reset(OpARMADDshiftLL)
@@ -7049,7 +7049,7 @@ func rewriteValueARM_OpARMMUL(v *Value) bool {
                break
        }
        // match: (MUL x (MOVWconst [c]))
-       // cond: isPowerOfTwo32(c+1) && c >= 7
+       // cond: isPowerOfTwo(c+1) && c >= 7
        // result: (RSBshiftLL x x [int32(log32(c+1))])
        for {
                for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
@@ -7058,7 +7058,7 @@ func rewriteValueARM_OpARMMUL(v *Value) bool {
                                continue
                        }
                        c := auxIntToInt32(v_1.AuxInt)
-                       if !(isPowerOfTwo32(c+1) && c >= 7) {
+                       if !(isPowerOfTwo(c+1) && c >= 7) {
                                continue
                        }
                        v.reset(OpARMRSBshiftLL)
@@ -7069,7 +7069,7 @@ func rewriteValueARM_OpARMMUL(v *Value) bool {
                break
        }
        // match: (MUL x (MOVWconst [c]))
-       // cond: c%3 == 0 && isPowerOfTwo32(c/3)
+       // cond: c%3 == 0 && isPowerOfTwo(c/3)
        // result: (SLLconst [int32(log32(c/3))] (ADDshiftLL <x.Type> x x [1]))
        for {
                for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
@@ -7078,7 +7078,7 @@ func rewriteValueARM_OpARMMUL(v *Value) bool {
                                continue
                        }
                        c := auxIntToInt32(v_1.AuxInt)
-                       if !(c%3 == 0 && isPowerOfTwo32(c/3)) {
+                       if !(c%3 == 0 && isPowerOfTwo(c/3)) {
                                continue
                        }
                        v.reset(OpARMSLLconst)
@@ -7092,7 +7092,7 @@ func rewriteValueARM_OpARMMUL(v *Value) bool {
                break
        }
        // match: (MUL x (MOVWconst [c]))
-       // cond: c%5 == 0 && isPowerOfTwo32(c/5)
+       // cond: c%5 == 0 && isPowerOfTwo(c/5)
        // result: (SLLconst [int32(log32(c/5))] (ADDshiftLL <x.Type> x x [2]))
        for {
                for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
@@ -7101,7 +7101,7 @@ func rewriteValueARM_OpARMMUL(v *Value) bool {
                                continue
                        }
                        c := auxIntToInt32(v_1.AuxInt)
-                       if !(c%5 == 0 && isPowerOfTwo32(c/5)) {
+                       if !(c%5 == 0 && isPowerOfTwo(c/5)) {
                                continue
                        }
                        v.reset(OpARMSLLconst)
@@ -7115,7 +7115,7 @@ func rewriteValueARM_OpARMMUL(v *Value) bool {
                break
        }
        // match: (MUL x (MOVWconst [c]))
-       // cond: c%7 == 0 && isPowerOfTwo32(c/7)
+       // cond: c%7 == 0 && isPowerOfTwo(c/7)
        // result: (SLLconst [int32(log32(c/7))] (RSBshiftLL <x.Type> x x [3]))
        for {
                for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
@@ -7124,7 +7124,7 @@ func rewriteValueARM_OpARMMUL(v *Value) bool {
                                continue
                        }
                        c := auxIntToInt32(v_1.AuxInt)
-                       if !(c%7 == 0 && isPowerOfTwo32(c/7)) {
+                       if !(c%7 == 0 && isPowerOfTwo(c/7)) {
                                continue
                        }
                        v.reset(OpARMSLLconst)
@@ -7138,7 +7138,7 @@ func rewriteValueARM_OpARMMUL(v *Value) bool {
                break
        }
        // match: (MUL x (MOVWconst [c]))
-       // cond: c%9 == 0 && isPowerOfTwo32(c/9)
+       // cond: c%9 == 0 && isPowerOfTwo(c/9)
        // result: (SLLconst [int32(log32(c/9))] (ADDshiftLL <x.Type> x x [3]))
        for {
                for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
@@ -7147,7 +7147,7 @@ func rewriteValueARM_OpARMMUL(v *Value) bool {
                                continue
                        }
                        c := auxIntToInt32(v_1.AuxInt)
-                       if !(c%9 == 0 && isPowerOfTwo32(c/9)) {
+                       if !(c%9 == 0 && isPowerOfTwo(c/9)) {
                                continue
                        }
                        v.reset(OpARMSLLconst)
@@ -7225,7 +7225,7 @@ func rewriteValueARM_OpARMMULA(v *Value) bool {
                return true
        }
        // match: (MULA x (MOVWconst [c]) a)
-       // cond: isPowerOfTwo32(c)
+       // cond: isPowerOfTwo(c)
        // result: (ADD (SLLconst <x.Type> [int32(log32(c))] x) a)
        for {
                x := v_0
@@ -7234,7 +7234,7 @@ func rewriteValueARM_OpARMMULA(v *Value) bool {
                }
                c := auxIntToInt32(v_1.AuxInt)
                a := v_2
-               if !(isPowerOfTwo32(c)) {
+               if !(isPowerOfTwo(c)) {
                        break
                }
                v.reset(OpARMADD)
@@ -7245,7 +7245,7 @@ func rewriteValueARM_OpARMMULA(v *Value) bool {
                return true
        }
        // match: (MULA x (MOVWconst [c]) a)
-       // cond: isPowerOfTwo32(c-1) && c >= 3
+       // cond: isPowerOfTwo(c-1) && c >= 3
        // result: (ADD (ADDshiftLL <x.Type> x x [int32(log32(c-1))]) a)
        for {
                x := v_0
@@ -7254,7 +7254,7 @@ func rewriteValueARM_OpARMMULA(v *Value) bool {
                }
                c := auxIntToInt32(v_1.AuxInt)
                a := v_2
-               if !(isPowerOfTwo32(c-1) && c >= 3) {
+               if !(isPowerOfTwo(c-1) && c >= 3) {
                        break
                }
                v.reset(OpARMADD)
@@ -7265,7 +7265,7 @@ func rewriteValueARM_OpARMMULA(v *Value) bool {
                return true
        }
        // match: (MULA x (MOVWconst [c]) a)
-       // cond: isPowerOfTwo32(c+1) && c >= 7
+       // cond: isPowerOfTwo(c+1) && c >= 7
        // result: (ADD (RSBshiftLL <x.Type> x x [int32(log32(c+1))]) a)
        for {
                x := v_0
@@ -7274,7 +7274,7 @@ func rewriteValueARM_OpARMMULA(v *Value) bool {
                }
                c := auxIntToInt32(v_1.AuxInt)
                a := v_2
-               if !(isPowerOfTwo32(c+1) && c >= 7) {
+               if !(isPowerOfTwo(c+1) && c >= 7) {
                        break
                }
                v.reset(OpARMADD)
@@ -7285,7 +7285,7 @@ func rewriteValueARM_OpARMMULA(v *Value) bool {
                return true
        }
        // match: (MULA x (MOVWconst [c]) a)
-       // cond: c%3 == 0 && isPowerOfTwo32(c/3)
+       // cond: c%3 == 0 && isPowerOfTwo(c/3)
        // result: (ADD (SLLconst <x.Type> [int32(log32(c/3))] (ADDshiftLL <x.Type> x x [1])) a)
        for {
                x := v_0
@@ -7294,7 +7294,7 @@ func rewriteValueARM_OpARMMULA(v *Value) bool {
                }
                c := auxIntToInt32(v_1.AuxInt)
                a := v_2
-               if !(c%3 == 0 && isPowerOfTwo32(c/3)) {
+               if !(c%3 == 0 && isPowerOfTwo(c/3)) {
                        break
                }
                v.reset(OpARMADD)
@@ -7308,7 +7308,7 @@ func rewriteValueARM_OpARMMULA(v *Value) bool {
                return true
        }
        // match: (MULA x (MOVWconst [c]) a)
-       // cond: c%5 == 0 && isPowerOfTwo32(c/5)
+       // cond: c%5 == 0 && isPowerOfTwo(c/5)
        // result: (ADD (SLLconst <x.Type> [int32(log32(c/5))] (ADDshiftLL <x.Type> x x [2])) a)
        for {
                x := v_0
@@ -7317,7 +7317,7 @@ func rewriteValueARM_OpARMMULA(v *Value) bool {
                }
                c := auxIntToInt32(v_1.AuxInt)
                a := v_2
-               if !(c%5 == 0 && isPowerOfTwo32(c/5)) {
+               if !(c%5 == 0 && isPowerOfTwo(c/5)) {
                        break
                }
                v.reset(OpARMADD)
@@ -7331,7 +7331,7 @@ func rewriteValueARM_OpARMMULA(v *Value) bool {
                return true
        }
        // match: (MULA x (MOVWconst [c]) a)
-       // cond: c%7 == 0 && isPowerOfTwo32(c/7)
+       // cond: c%7 == 0 && isPowerOfTwo(c/7)
        // result: (ADD (SLLconst <x.Type> [int32(log32(c/7))] (RSBshiftLL <x.Type> x x [3])) a)
        for {
                x := v_0
@@ -7340,7 +7340,7 @@ func rewriteValueARM_OpARMMULA(v *Value) bool {
                }
                c := auxIntToInt32(v_1.AuxInt)
                a := v_2
-               if !(c%7 == 0 && isPowerOfTwo32(c/7)) {
+               if !(c%7 == 0 && isPowerOfTwo(c/7)) {
                        break
                }
                v.reset(OpARMADD)
@@ -7354,7 +7354,7 @@ func rewriteValueARM_OpARMMULA(v *Value) bool {
                return true
        }
        // match: (MULA x (MOVWconst [c]) a)
-       // cond: c%9 == 0 && isPowerOfTwo32(c/9)
+       // cond: c%9 == 0 && isPowerOfTwo(c/9)
        // result: (ADD (SLLconst <x.Type> [int32(log32(c/9))] (ADDshiftLL <x.Type> x x [3])) a)
        for {
                x := v_0
@@ -7363,7 +7363,7 @@ func rewriteValueARM_OpARMMULA(v *Value) bool {
                }
                c := auxIntToInt32(v_1.AuxInt)
                a := v_2
-               if !(c%9 == 0 && isPowerOfTwo32(c/9)) {
+               if !(c%9 == 0 && isPowerOfTwo(c/9)) {
                        break
                }
                v.reset(OpARMADD)
@@ -7416,7 +7416,7 @@ func rewriteValueARM_OpARMMULA(v *Value) bool {
                return true
        }
        // match: (MULA (MOVWconst [c]) x a)
-       // cond: isPowerOfTwo32(c)
+       // cond: isPowerOfTwo(c)
        // result: (ADD (SLLconst <x.Type> [int32(log32(c))] x) a)
        for {
                if v_0.Op != OpARMMOVWconst {
@@ -7425,7 +7425,7 @@ func rewriteValueARM_OpARMMULA(v *Value) bool {
                c := auxIntToInt32(v_0.AuxInt)
                x := v_1
                a := v_2
-               if !(isPowerOfTwo32(c)) {
+               if !(isPowerOfTwo(c)) {
                        break
                }
                v.reset(OpARMADD)
@@ -7436,7 +7436,7 @@ func rewriteValueARM_OpARMMULA(v *Value) bool {
                return true
        }
        // match: (MULA (MOVWconst [c]) x a)
-       // cond: isPowerOfTwo32(c-1) && c >= 3
+       // cond: isPowerOfTwo(c-1) && c >= 3
        // result: (ADD (ADDshiftLL <x.Type> x x [int32(log32(c-1))]) a)
        for {
                if v_0.Op != OpARMMOVWconst {
@@ -7445,7 +7445,7 @@ func rewriteValueARM_OpARMMULA(v *Value) bool {
                c := auxIntToInt32(v_0.AuxInt)
                x := v_1
                a := v_2
-               if !(isPowerOfTwo32(c-1) && c >= 3) {
+               if !(isPowerOfTwo(c-1) && c >= 3) {
                        break
                }
                v.reset(OpARMADD)
@@ -7456,7 +7456,7 @@ func rewriteValueARM_OpARMMULA(v *Value) bool {
                return true
        }
        // match: (MULA (MOVWconst [c]) x a)
-       // cond: isPowerOfTwo32(c+1) && c >= 7
+       // cond: isPowerOfTwo(c+1) && c >= 7
        // result: (ADD (RSBshiftLL <x.Type> x x [int32(log32(c+1))]) a)
        for {
                if v_0.Op != OpARMMOVWconst {
@@ -7465,7 +7465,7 @@ func rewriteValueARM_OpARMMULA(v *Value) bool {
                c := auxIntToInt32(v_0.AuxInt)
                x := v_1
                a := v_2
-               if !(isPowerOfTwo32(c+1) && c >= 7) {
+               if !(isPowerOfTwo(c+1) && c >= 7) {
                        break
                }
                v.reset(OpARMADD)
@@ -7476,7 +7476,7 @@ func rewriteValueARM_OpARMMULA(v *Value) bool {
                return true
        }
        // match: (MULA (MOVWconst [c]) x a)
-       // cond: c%3 == 0 && isPowerOfTwo32(c/3)
+       // cond: c%3 == 0 && isPowerOfTwo(c/3)
        // result: (ADD (SLLconst <x.Type> [int32(log32(c/3))] (ADDshiftLL <x.Type> x x [1])) a)
        for {
                if v_0.Op != OpARMMOVWconst {
@@ -7485,7 +7485,7 @@ func rewriteValueARM_OpARMMULA(v *Value) bool {
                c := auxIntToInt32(v_0.AuxInt)
                x := v_1
                a := v_2
-               if !(c%3 == 0 && isPowerOfTwo32(c/3)) {
+               if !(c%3 == 0 && isPowerOfTwo(c/3)) {
                        break
                }
                v.reset(OpARMADD)
@@ -7499,7 +7499,7 @@ func rewriteValueARM_OpARMMULA(v *Value) bool {
                return true
        }
        // match: (MULA (MOVWconst [c]) x a)
-       // cond: c%5 == 0 && isPowerOfTwo32(c/5)
+       // cond: c%5 == 0 && isPowerOfTwo(c/5)
        // result: (ADD (SLLconst <x.Type> [int32(log32(c/5))] (ADDshiftLL <x.Type> x x [2])) a)
        for {
                if v_0.Op != OpARMMOVWconst {
@@ -7508,7 +7508,7 @@ func rewriteValueARM_OpARMMULA(v *Value) bool {
                c := auxIntToInt32(v_0.AuxInt)
                x := v_1
                a := v_2
-               if !(c%5 == 0 && isPowerOfTwo32(c/5)) {
+               if !(c%5 == 0 && isPowerOfTwo(c/5)) {
                        break
                }
                v.reset(OpARMADD)
@@ -7522,7 +7522,7 @@ func rewriteValueARM_OpARMMULA(v *Value) bool {
                return true
        }
        // match: (MULA (MOVWconst [c]) x a)
-       // cond: c%7 == 0 && isPowerOfTwo32(c/7)
+       // cond: c%7 == 0 && isPowerOfTwo(c/7)
        // result: (ADD (SLLconst <x.Type> [int32(log32(c/7))] (RSBshiftLL <x.Type> x x [3])) a)
        for {
                if v_0.Op != OpARMMOVWconst {
@@ -7531,7 +7531,7 @@ func rewriteValueARM_OpARMMULA(v *Value) bool {
                c := auxIntToInt32(v_0.AuxInt)
                x := v_1
                a := v_2
-               if !(c%7 == 0 && isPowerOfTwo32(c/7)) {
+               if !(c%7 == 0 && isPowerOfTwo(c/7)) {
                        break
                }
                v.reset(OpARMADD)
@@ -7545,7 +7545,7 @@ func rewriteValueARM_OpARMMULA(v *Value) bool {
                return true
        }
        // match: (MULA (MOVWconst [c]) x a)
-       // cond: c%9 == 0 && isPowerOfTwo32(c/9)
+       // cond: c%9 == 0 && isPowerOfTwo(c/9)
        // result: (ADD (SLLconst <x.Type> [int32(log32(c/9))] (ADDshiftLL <x.Type> x x [3])) a)
        for {
                if v_0.Op != OpARMMOVWconst {
@@ -7554,7 +7554,7 @@ func rewriteValueARM_OpARMMULA(v *Value) bool {
                c := auxIntToInt32(v_0.AuxInt)
                x := v_1
                a := v_2
-               if !(c%9 == 0 && isPowerOfTwo32(c/9)) {
+               if !(c%9 == 0 && isPowerOfTwo(c/9)) {
                        break
                }
                v.reset(OpARMADD)
@@ -7679,7 +7679,7 @@ func rewriteValueARM_OpARMMULS(v *Value) bool {
                return true
        }
        // match: (MULS x (MOVWconst [c]) a)
-       // cond: isPowerOfTwo32(c)
+       // cond: isPowerOfTwo(c)
        // result: (RSB (SLLconst <x.Type> [int32(log32(c))] x) a)
        for {
                x := v_0
@@ -7688,7 +7688,7 @@ func rewriteValueARM_OpARMMULS(v *Value) bool {
                }
                c := auxIntToInt32(v_1.AuxInt)
                a := v_2
-               if !(isPowerOfTwo32(c)) {
+               if !(isPowerOfTwo(c)) {
                        break
                }
                v.reset(OpARMRSB)
@@ -7699,7 +7699,7 @@ func rewriteValueARM_OpARMMULS(v *Value) bool {
                return true
        }
        // match: (MULS x (MOVWconst [c]) a)
-       // cond: isPowerOfTwo32(c-1) && c >= 3
+       // cond: isPowerOfTwo(c-1) && c >= 3
        // result: (RSB (ADDshiftLL <x.Type> x x [int32(log32(c-1))]) a)
        for {
                x := v_0
@@ -7708,7 +7708,7 @@ func rewriteValueARM_OpARMMULS(v *Value) bool {
                }
                c := auxIntToInt32(v_1.AuxInt)
                a := v_2
-               if !(isPowerOfTwo32(c-1) && c >= 3) {
+               if !(isPowerOfTwo(c-1) && c >= 3) {
                        break
                }
                v.reset(OpARMRSB)
@@ -7719,7 +7719,7 @@ func rewriteValueARM_OpARMMULS(v *Value) bool {
                return true
        }
        // match: (MULS x (MOVWconst [c]) a)
-       // cond: isPowerOfTwo32(c+1) && c >= 7
+       // cond: isPowerOfTwo(c+1) && c >= 7
        // result: (RSB (RSBshiftLL <x.Type> x x [int32(log32(c+1))]) a)
        for {
                x := v_0
@@ -7728,7 +7728,7 @@ func rewriteValueARM_OpARMMULS(v *Value) bool {
                }
                c := auxIntToInt32(v_1.AuxInt)
                a := v_2
-               if !(isPowerOfTwo32(c+1) && c >= 7) {
+               if !(isPowerOfTwo(c+1) && c >= 7) {
                        break
                }
                v.reset(OpARMRSB)
@@ -7739,7 +7739,7 @@ func rewriteValueARM_OpARMMULS(v *Value) bool {
                return true
        }
        // match: (MULS x (MOVWconst [c]) a)
-       // cond: c%3 == 0 && isPowerOfTwo32(c/3)
+       // cond: c%3 == 0 && isPowerOfTwo(c/3)
        // result: (RSB (SLLconst <x.Type> [int32(log32(c/3))] (ADDshiftLL <x.Type> x x [1])) a)
        for {
                x := v_0
@@ -7748,7 +7748,7 @@ func rewriteValueARM_OpARMMULS(v *Value) bool {
                }
                c := auxIntToInt32(v_1.AuxInt)
                a := v_2
-               if !(c%3 == 0 && isPowerOfTwo32(c/3)) {
+               if !(c%3 == 0 && isPowerOfTwo(c/3)) {
                        break
                }
                v.reset(OpARMRSB)
@@ -7762,7 +7762,7 @@ func rewriteValueARM_OpARMMULS(v *Value) bool {
                return true
        }
        // match: (MULS x (MOVWconst [c]) a)
-       // cond: c%5 == 0 && isPowerOfTwo32(c/5)
+       // cond: c%5 == 0 && isPowerOfTwo(c/5)
        // result: (RSB (SLLconst <x.Type> [int32(log32(c/5))] (ADDshiftLL <x.Type> x x [2])) a)
        for {
                x := v_0
@@ -7771,7 +7771,7 @@ func rewriteValueARM_OpARMMULS(v *Value) bool {
                }
                c := auxIntToInt32(v_1.AuxInt)
                a := v_2
-               if !(c%5 == 0 && isPowerOfTwo32(c/5)) {
+               if !(c%5 == 0 && isPowerOfTwo(c/5)) {
                        break
                }
                v.reset(OpARMRSB)
@@ -7785,7 +7785,7 @@ func rewriteValueARM_OpARMMULS(v *Value) bool {
                return true
        }
        // match: (MULS x (MOVWconst [c]) a)
-       // cond: c%7 == 0 && isPowerOfTwo32(c/7)
+       // cond: c%7 == 0 && isPowerOfTwo(c/7)
        // result: (RSB (SLLconst <x.Type> [int32(log32(c/7))] (RSBshiftLL <x.Type> x x [3])) a)
        for {
                x := v_0
@@ -7794,7 +7794,7 @@ func rewriteValueARM_OpARMMULS(v *Value) bool {
                }
                c := auxIntToInt32(v_1.AuxInt)
                a := v_2
-               if !(c%7 == 0 && isPowerOfTwo32(c/7)) {
+               if !(c%7 == 0 && isPowerOfTwo(c/7)) {
                        break
                }
                v.reset(OpARMRSB)
@@ -7808,7 +7808,7 @@ func rewriteValueARM_OpARMMULS(v *Value) bool {
                return true
        }
        // match: (MULS x (MOVWconst [c]) a)
-       // cond: c%9 == 0 && isPowerOfTwo32(c/9)
+       // cond: c%9 == 0 && isPowerOfTwo(c/9)
        // result: (RSB (SLLconst <x.Type> [int32(log32(c/9))] (ADDshiftLL <x.Type> x x [3])) a)
        for {
                x := v_0
@@ -7817,7 +7817,7 @@ func rewriteValueARM_OpARMMULS(v *Value) bool {
                }
                c := auxIntToInt32(v_1.AuxInt)
                a := v_2
-               if !(c%9 == 0 && isPowerOfTwo32(c/9)) {
+               if !(c%9 == 0 && isPowerOfTwo(c/9)) {
                        break
                }
                v.reset(OpARMRSB)
@@ -7870,7 +7870,7 @@ func rewriteValueARM_OpARMMULS(v *Value) bool {
                return true
        }
        // match: (MULS (MOVWconst [c]) x a)
-       // cond: isPowerOfTwo32(c)
+       // cond: isPowerOfTwo(c)
        // result: (RSB (SLLconst <x.Type> [int32(log32(c))] x) a)
        for {
                if v_0.Op != OpARMMOVWconst {
@@ -7879,7 +7879,7 @@ func rewriteValueARM_OpARMMULS(v *Value) bool {
                c := auxIntToInt32(v_0.AuxInt)
                x := v_1
                a := v_2
-               if !(isPowerOfTwo32(c)) {
+               if !(isPowerOfTwo(c)) {
                        break
                }
                v.reset(OpARMRSB)
@@ -7890,7 +7890,7 @@ func rewriteValueARM_OpARMMULS(v *Value) bool {
                return true
        }
        // match: (MULS (MOVWconst [c]) x a)
-       // cond: isPowerOfTwo32(c-1) && c >= 3
+       // cond: isPowerOfTwo(c-1) && c >= 3
        // result: (RSB (ADDshiftLL <x.Type> x x [int32(log32(c-1))]) a)
        for {
                if v_0.Op != OpARMMOVWconst {
@@ -7899,7 +7899,7 @@ func rewriteValueARM_OpARMMULS(v *Value) bool {
                c := auxIntToInt32(v_0.AuxInt)
                x := v_1
                a := v_2
-               if !(isPowerOfTwo32(c-1) && c >= 3) {
+               if !(isPowerOfTwo(c-1) && c >= 3) {
                        break
                }
                v.reset(OpARMRSB)
@@ -7910,7 +7910,7 @@ func rewriteValueARM_OpARMMULS(v *Value) bool {
                return true
        }
        // match: (MULS (MOVWconst [c]) x a)
-       // cond: isPowerOfTwo32(c+1) && c >= 7
+       // cond: isPowerOfTwo(c+1) && c >= 7
        // result: (RSB (RSBshiftLL <x.Type> x x [int32(log32(c+1))]) a)
        for {
                if v_0.Op != OpARMMOVWconst {
@@ -7919,7 +7919,7 @@ func rewriteValueARM_OpARMMULS(v *Value) bool {
                c := auxIntToInt32(v_0.AuxInt)
                x := v_1
                a := v_2
-               if !(isPowerOfTwo32(c+1) && c >= 7) {
+               if !(isPowerOfTwo(c+1) && c >= 7) {
                        break
                }
                v.reset(OpARMRSB)
@@ -7930,7 +7930,7 @@ func rewriteValueARM_OpARMMULS(v *Value) bool {
                return true
        }
        // match: (MULS (MOVWconst [c]) x a)
-       // cond: c%3 == 0 && isPowerOfTwo32(c/3)
+       // cond: c%3 == 0 && isPowerOfTwo(c/3)
        // result: (RSB (SLLconst <x.Type> [int32(log32(c/3))] (ADDshiftLL <x.Type> x x [1])) a)
        for {
                if v_0.Op != OpARMMOVWconst {
@@ -7939,7 +7939,7 @@ func rewriteValueARM_OpARMMULS(v *Value) bool {
                c := auxIntToInt32(v_0.AuxInt)
                x := v_1
                a := v_2
-               if !(c%3 == 0 && isPowerOfTwo32(c/3)) {
+               if !(c%3 == 0 && isPowerOfTwo(c/3)) {
                        break
                }
                v.reset(OpARMRSB)
@@ -7953,7 +7953,7 @@ func rewriteValueARM_OpARMMULS(v *Value) bool {
                return true
        }
        // match: (MULS (MOVWconst [c]) x a)
-       // cond: c%5 == 0 && isPowerOfTwo32(c/5)
+       // cond: c%5 == 0 && isPowerOfTwo(c/5)
        // result: (RSB (SLLconst <x.Type> [int32(log32(c/5))] (ADDshiftLL <x.Type> x x [2])) a)
        for {
                if v_0.Op != OpARMMOVWconst {
@@ -7962,7 +7962,7 @@ func rewriteValueARM_OpARMMULS(v *Value) bool {
                c := auxIntToInt32(v_0.AuxInt)
                x := v_1
                a := v_2
-               if !(c%5 == 0 && isPowerOfTwo32(c/5)) {
+               if !(c%5 == 0 && isPowerOfTwo(c/5)) {
                        break
                }
                v.reset(OpARMRSB)
@@ -7976,7 +7976,7 @@ func rewriteValueARM_OpARMMULS(v *Value) bool {
                return true
        }
        // match: (MULS (MOVWconst [c]) x a)
-       // cond: c%7 == 0 && isPowerOfTwo32(c/7)
+       // cond: c%7 == 0 && isPowerOfTwo(c/7)
        // result: (RSB (SLLconst <x.Type> [int32(log32(c/7))] (RSBshiftLL <x.Type> x x [3])) a)
        for {
                if v_0.Op != OpARMMOVWconst {
@@ -7985,7 +7985,7 @@ func rewriteValueARM_OpARMMULS(v *Value) bool {
                c := auxIntToInt32(v_0.AuxInt)
                x := v_1
                a := v_2
-               if !(c%7 == 0 && isPowerOfTwo32(c/7)) {
+               if !(c%7 == 0 && isPowerOfTwo(c/7)) {
                        break
                }
                v.reset(OpARMRSB)
@@ -7999,7 +7999,7 @@ func rewriteValueARM_OpARMMULS(v *Value) bool {
                return true
        }
        // match: (MULS (MOVWconst [c]) x a)
-       // cond: c%9 == 0 && isPowerOfTwo32(c/9)
+       // cond: c%9 == 0 && isPowerOfTwo(c/9)
        // result: (RSB (SLLconst <x.Type> [int32(log32(c/9))] (ADDshiftLL <x.Type> x x [3])) a)
        for {
                if v_0.Op != OpARMMOVWconst {
@@ -8008,7 +8008,7 @@ func rewriteValueARM_OpARMMULS(v *Value) bool {
                c := auxIntToInt32(v_0.AuxInt)
                x := v_1
                a := v_2
-               if !(c%9 == 0 && isPowerOfTwo32(c/9)) {
+               if !(c%9 == 0 && isPowerOfTwo(c/9)) {
                        break
                }
                v.reset(OpARMRSB)
@@ -15734,7 +15734,7 @@ func rewriteValueARM_OpSelect0(v *Value) bool {
                return true
        }
        // match: (Select0 (CALLudiv x (MOVWconst [c])))
-       // cond: isPowerOfTwo32(c)
+       // cond: isPowerOfTwo(c)
        // result: (SRLconst [int32(log32(c))] x)
        for {
                if v_0.Op != OpARMCALLudiv {
@@ -15747,7 +15747,7 @@ func rewriteValueARM_OpSelect0(v *Value) bool {
                        break
                }
                c := auxIntToInt32(v_0_1.AuxInt)
-               if !(isPowerOfTwo32(c)) {
+               if !(isPowerOfTwo(c)) {
                        break
                }
                v.reset(OpARMSRLconst)
@@ -15800,7 +15800,7 @@ func rewriteValueARM_OpSelect1(v *Value) bool {
                return true
        }
        // match: (Select1 (CALLudiv x (MOVWconst [c])))
-       // cond: isPowerOfTwo32(c)
+       // cond: isPowerOfTwo(c)
        // result: (ANDconst [c-1] x)
        for {
                if v_0.Op != OpARMCALLudiv {
@@ -15813,7 +15813,7 @@ func rewriteValueARM_OpSelect1(v *Value) bool {
                        break
                }
                c := auxIntToInt32(v_0_1.AuxInt)
-               if !(isPowerOfTwo32(c)) {
+               if !(isPowerOfTwo(c)) {
                        break
                }
                v.reset(OpARMANDconst)
index e3e469349f9962176a54eafc675079368d19fa86..571046b5b8331ce7d158831911b1fbfeac42949f 100644 (file)
@@ -6813,7 +6813,7 @@ func rewriteValueARM64_OpARM64MADD(v *Value) bool {
                return true
        }
        // match: (MADD a x (MOVDconst [c]))
-       // cond: isPowerOfTwo64(c)
+       // cond: isPowerOfTwo(c)
        // result: (ADDshiftLL a x [log64(c)])
        for {
                a := v_0
@@ -6822,7 +6822,7 @@ func rewriteValueARM64_OpARM64MADD(v *Value) bool {
                        break
                }
                c := auxIntToInt64(v_2.AuxInt)
-               if !(isPowerOfTwo64(c)) {
+               if !(isPowerOfTwo(c)) {
                        break
                }
                v.reset(OpARM64ADDshiftLL)
@@ -6831,7 +6831,7 @@ func rewriteValueARM64_OpARM64MADD(v *Value) bool {
                return true
        }
        // match: (MADD a x (MOVDconst [c]))
-       // cond: isPowerOfTwo64(c-1) && c>=3
+       // cond: isPowerOfTwo(c-1) && c>=3
        // result: (ADD a (ADDshiftLL <x.Type> x x [log64(c-1)]))
        for {
                a := v_0
@@ -6840,7 +6840,7 @@ func rewriteValueARM64_OpARM64MADD(v *Value) bool {
                        break
                }
                c := auxIntToInt64(v_2.AuxInt)
-               if !(isPowerOfTwo64(c-1) && c >= 3) {
+               if !(isPowerOfTwo(c-1) && c >= 3) {
                        break
                }
                v.reset(OpARM64ADD)
@@ -6851,7 +6851,7 @@ func rewriteValueARM64_OpARM64MADD(v *Value) bool {
                return true
        }
        // match: (MADD a x (MOVDconst [c]))
-       // cond: isPowerOfTwo64(c+1) && c>=7
+       // cond: isPowerOfTwo(c+1) && c>=7
        // result: (SUB a (SUBshiftLL <x.Type> x x [log64(c+1)]))
        for {
                a := v_0
@@ -6860,7 +6860,7 @@ func rewriteValueARM64_OpARM64MADD(v *Value) bool {
                        break
                }
                c := auxIntToInt64(v_2.AuxInt)
-               if !(isPowerOfTwo64(c+1) && c >= 7) {
+               if !(isPowerOfTwo(c+1) && c >= 7) {
                        break
                }
                v.reset(OpARM64SUB)
@@ -6871,7 +6871,7 @@ func rewriteValueARM64_OpARM64MADD(v *Value) bool {
                return true
        }
        // match: (MADD a x (MOVDconst [c]))
-       // cond: c%3 == 0 && isPowerOfTwo64(c/3)
+       // cond: c%3 == 0 && isPowerOfTwo(c/3)
        // result: (SUBshiftLL a (SUBshiftLL <x.Type> x x [2]) [log64(c/3)])
        for {
                a := v_0
@@ -6880,7 +6880,7 @@ func rewriteValueARM64_OpARM64MADD(v *Value) bool {
                        break
                }
                c := auxIntToInt64(v_2.AuxInt)
-               if !(c%3 == 0 && isPowerOfTwo64(c/3)) {
+               if !(c%3 == 0 && isPowerOfTwo(c/3)) {
                        break
                }
                v.reset(OpARM64SUBshiftLL)
@@ -6892,7 +6892,7 @@ func rewriteValueARM64_OpARM64MADD(v *Value) bool {
                return true
        }
        // match: (MADD a x (MOVDconst [c]))
-       // cond: c%5 == 0 && isPowerOfTwo64(c/5)
+       // cond: c%5 == 0 && isPowerOfTwo(c/5)
        // result: (ADDshiftLL a (ADDshiftLL <x.Type> x x [2]) [log64(c/5)])
        for {
                a := v_0
@@ -6901,7 +6901,7 @@ func rewriteValueARM64_OpARM64MADD(v *Value) bool {
                        break
                }
                c := auxIntToInt64(v_2.AuxInt)
-               if !(c%5 == 0 && isPowerOfTwo64(c/5)) {
+               if !(c%5 == 0 && isPowerOfTwo(c/5)) {
                        break
                }
                v.reset(OpARM64ADDshiftLL)
@@ -6913,7 +6913,7 @@ func rewriteValueARM64_OpARM64MADD(v *Value) bool {
                return true
        }
        // match: (MADD a x (MOVDconst [c]))
-       // cond: c%7 == 0 && isPowerOfTwo64(c/7)
+       // cond: c%7 == 0 && isPowerOfTwo(c/7)
        // result: (SUBshiftLL a (SUBshiftLL <x.Type> x x [3]) [log64(c/7)])
        for {
                a := v_0
@@ -6922,7 +6922,7 @@ func rewriteValueARM64_OpARM64MADD(v *Value) bool {
                        break
                }
                c := auxIntToInt64(v_2.AuxInt)
-               if !(c%7 == 0 && isPowerOfTwo64(c/7)) {
+               if !(c%7 == 0 && isPowerOfTwo(c/7)) {
                        break
                }
                v.reset(OpARM64SUBshiftLL)
@@ -6934,7 +6934,7 @@ func rewriteValueARM64_OpARM64MADD(v *Value) bool {
                return true
        }
        // match: (MADD a x (MOVDconst [c]))
-       // cond: c%9 == 0 && isPowerOfTwo64(c/9)
+       // cond: c%9 == 0 && isPowerOfTwo(c/9)
        // result: (ADDshiftLL a (ADDshiftLL <x.Type> x x [3]) [log64(c/9)])
        for {
                a := v_0
@@ -6943,7 +6943,7 @@ func rewriteValueARM64_OpARM64MADD(v *Value) bool {
                        break
                }
                c := auxIntToInt64(v_2.AuxInt)
-               if !(c%9 == 0 && isPowerOfTwo64(c/9)) {
+               if !(c%9 == 0 && isPowerOfTwo(c/9)) {
                        break
                }
                v.reset(OpARM64ADDshiftLL)
@@ -6989,7 +6989,7 @@ func rewriteValueARM64_OpARM64MADD(v *Value) bool {
                return true
        }
        // match: (MADD a (MOVDconst [c]) x)
-       // cond: isPowerOfTwo64(c)
+       // cond: isPowerOfTwo(c)
        // result: (ADDshiftLL a x [log64(c)])
        for {
                a := v_0
@@ -6998,7 +6998,7 @@ func rewriteValueARM64_OpARM64MADD(v *Value) bool {
                }
                c := auxIntToInt64(v_1.AuxInt)
                x := v_2
-               if !(isPowerOfTwo64(c)) {
+               if !(isPowerOfTwo(c)) {
                        break
                }
                v.reset(OpARM64ADDshiftLL)
@@ -7007,7 +7007,7 @@ func rewriteValueARM64_OpARM64MADD(v *Value) bool {
                return true
        }
        // match: (MADD a (MOVDconst [c]) x)
-       // cond: isPowerOfTwo64(c-1) && c>=3
+       // cond: isPowerOfTwo(c-1) && c>=3
        // result: (ADD a (ADDshiftLL <x.Type> x x [log64(c-1)]))
        for {
                a := v_0
@@ -7016,7 +7016,7 @@ func rewriteValueARM64_OpARM64MADD(v *Value) bool {
                }
                c := auxIntToInt64(v_1.AuxInt)
                x := v_2
-               if !(isPowerOfTwo64(c-1) && c >= 3) {
+               if !(isPowerOfTwo(c-1) && c >= 3) {
                        break
                }
                v.reset(OpARM64ADD)
@@ -7027,7 +7027,7 @@ func rewriteValueARM64_OpARM64MADD(v *Value) bool {
                return true
        }
        // match: (MADD a (MOVDconst [c]) x)
-       // cond: isPowerOfTwo64(c+1) && c>=7
+       // cond: isPowerOfTwo(c+1) && c>=7
        // result: (SUB a (SUBshiftLL <x.Type> x x [log64(c+1)]))
        for {
                a := v_0
@@ -7036,7 +7036,7 @@ func rewriteValueARM64_OpARM64MADD(v *Value) bool {
                }
                c := auxIntToInt64(v_1.AuxInt)
                x := v_2
-               if !(isPowerOfTwo64(c+1) && c >= 7) {
+               if !(isPowerOfTwo(c+1) && c >= 7) {
                        break
                }
                v.reset(OpARM64SUB)
@@ -7047,7 +7047,7 @@ func rewriteValueARM64_OpARM64MADD(v *Value) bool {
                return true
        }
        // match: (MADD a (MOVDconst [c]) x)
-       // cond: c%3 == 0 && isPowerOfTwo64(c/3)
+       // cond: c%3 == 0 && isPowerOfTwo(c/3)
        // result: (SUBshiftLL a (SUBshiftLL <x.Type> x x [2]) [log64(c/3)])
        for {
                a := v_0
@@ -7056,7 +7056,7 @@ func rewriteValueARM64_OpARM64MADD(v *Value) bool {
                }
                c := auxIntToInt64(v_1.AuxInt)
                x := v_2
-               if !(c%3 == 0 && isPowerOfTwo64(c/3)) {
+               if !(c%3 == 0 && isPowerOfTwo(c/3)) {
                        break
                }
                v.reset(OpARM64SUBshiftLL)
@@ -7068,7 +7068,7 @@ func rewriteValueARM64_OpARM64MADD(v *Value) bool {
                return true
        }
        // match: (MADD a (MOVDconst [c]) x)
-       // cond: c%5 == 0 && isPowerOfTwo64(c/5)
+       // cond: c%5 == 0 && isPowerOfTwo(c/5)
        // result: (ADDshiftLL a (ADDshiftLL <x.Type> x x [2]) [log64(c/5)])
        for {
                a := v_0
@@ -7077,7 +7077,7 @@ func rewriteValueARM64_OpARM64MADD(v *Value) bool {
                }
                c := auxIntToInt64(v_1.AuxInt)
                x := v_2
-               if !(c%5 == 0 && isPowerOfTwo64(c/5)) {
+               if !(c%5 == 0 && isPowerOfTwo(c/5)) {
                        break
                }
                v.reset(OpARM64ADDshiftLL)
@@ -7089,7 +7089,7 @@ func rewriteValueARM64_OpARM64MADD(v *Value) bool {
                return true
        }
        // match: (MADD a (MOVDconst [c]) x)
-       // cond: c%7 == 0 && isPowerOfTwo64(c/7)
+       // cond: c%7 == 0 && isPowerOfTwo(c/7)
        // result: (SUBshiftLL a (SUBshiftLL <x.Type> x x [3]) [log64(c/7)])
        for {
                a := v_0
@@ -7098,7 +7098,7 @@ func rewriteValueARM64_OpARM64MADD(v *Value) bool {
                }
                c := auxIntToInt64(v_1.AuxInt)
                x := v_2
-               if !(c%7 == 0 && isPowerOfTwo64(c/7)) {
+               if !(c%7 == 0 && isPowerOfTwo(c/7)) {
                        break
                }
                v.reset(OpARM64SUBshiftLL)
@@ -7110,7 +7110,7 @@ func rewriteValueARM64_OpARM64MADD(v *Value) bool {
                return true
        }
        // match: (MADD a (MOVDconst [c]) x)
-       // cond: c%9 == 0 && isPowerOfTwo64(c/9)
+       // cond: c%9 == 0 && isPowerOfTwo(c/9)
        // result: (ADDshiftLL a (ADDshiftLL <x.Type> x x [3]) [log64(c/9)])
        for {
                a := v_0
@@ -7119,7 +7119,7 @@ func rewriteValueARM64_OpARM64MADD(v *Value) bool {
                }
                c := auxIntToInt64(v_1.AuxInt)
                x := v_2
-               if !(c%9 == 0 && isPowerOfTwo64(c/9)) {
+               if !(c%9 == 0 && isPowerOfTwo(c/9)) {
                        break
                }
                v.reset(OpARM64ADDshiftLL)
@@ -7225,7 +7225,7 @@ func rewriteValueARM64_OpARM64MADDW(v *Value) bool {
                return true
        }
        // match: (MADDW a x (MOVDconst [c]))
-       // cond: isPowerOfTwo64(c)
+       // cond: isPowerOfTwo(c)
        // result: (MOVWUreg (ADDshiftLL <a.Type> a x [log64(c)]))
        for {
                a := v_0
@@ -7234,7 +7234,7 @@ func rewriteValueARM64_OpARM64MADDW(v *Value) bool {
                        break
                }
                c := auxIntToInt64(v_2.AuxInt)
-               if !(isPowerOfTwo64(c)) {
+               if !(isPowerOfTwo(c)) {
                        break
                }
                v.reset(OpARM64MOVWUreg)
@@ -7245,7 +7245,7 @@ func rewriteValueARM64_OpARM64MADDW(v *Value) bool {
                return true
        }
        // match: (MADDW a x (MOVDconst [c]))
-       // cond: isPowerOfTwo64(c-1) && int32(c)>=3
+       // cond: isPowerOfTwo(c-1) && int32(c)>=3
        // result: (MOVWUreg (ADD <a.Type> a (ADDshiftLL <x.Type> x x [log64(c-1)])))
        for {
                a := v_0
@@ -7254,7 +7254,7 @@ func rewriteValueARM64_OpARM64MADDW(v *Value) bool {
                        break
                }
                c := auxIntToInt64(v_2.AuxInt)
-               if !(isPowerOfTwo64(c-1) && int32(c) >= 3) {
+               if !(isPowerOfTwo(c-1) && int32(c) >= 3) {
                        break
                }
                v.reset(OpARM64MOVWUreg)
@@ -7267,7 +7267,7 @@ func rewriteValueARM64_OpARM64MADDW(v *Value) bool {
                return true
        }
        // match: (MADDW a x (MOVDconst [c]))
-       // cond: isPowerOfTwo64(c+1) && int32(c)>=7
+       // cond: isPowerOfTwo(c+1) && int32(c)>=7
        // result: (MOVWUreg (SUB <a.Type> a (SUBshiftLL <x.Type> x x [log64(c+1)])))
        for {
                a := v_0
@@ -7276,7 +7276,7 @@ func rewriteValueARM64_OpARM64MADDW(v *Value) bool {
                        break
                }
                c := auxIntToInt64(v_2.AuxInt)
-               if !(isPowerOfTwo64(c+1) && int32(c) >= 7) {
+               if !(isPowerOfTwo(c+1) && int32(c) >= 7) {
                        break
                }
                v.reset(OpARM64MOVWUreg)
@@ -7289,7 +7289,7 @@ func rewriteValueARM64_OpARM64MADDW(v *Value) bool {
                return true
        }
        // match: (MADDW a x (MOVDconst [c]))
-       // cond: c%3 == 0 && isPowerOfTwo64(c/3) && is32Bit(c)
+       // cond: c%3 == 0 && isPowerOfTwo(c/3) && is32Bit(c)
        // result: (MOVWUreg (SUBshiftLL <a.Type> a (SUBshiftLL <x.Type> x x [2]) [log64(c/3)]))
        for {
                a := v_0
@@ -7298,7 +7298,7 @@ func rewriteValueARM64_OpARM64MADDW(v *Value) bool {
                        break
                }
                c := auxIntToInt64(v_2.AuxInt)
-               if !(c%3 == 0 && isPowerOfTwo64(c/3) && is32Bit(c)) {
+               if !(c%3 == 0 && isPowerOfTwo(c/3) && is32Bit(c)) {
                        break
                }
                v.reset(OpARM64MOVWUreg)
@@ -7312,7 +7312,7 @@ func rewriteValueARM64_OpARM64MADDW(v *Value) bool {
                return true
        }
        // match: (MADDW a x (MOVDconst [c]))
-       // cond: c%5 == 0 && isPowerOfTwo64(c/5) && is32Bit(c)
+       // cond: c%5 == 0 && isPowerOfTwo(c/5) && is32Bit(c)
        // result: (MOVWUreg (ADDshiftLL <a.Type> a (ADDshiftLL <x.Type> x x [2]) [log64(c/5)]))
        for {
                a := v_0
@@ -7321,7 +7321,7 @@ func rewriteValueARM64_OpARM64MADDW(v *Value) bool {
                        break
                }
                c := auxIntToInt64(v_2.AuxInt)
-               if !(c%5 == 0 && isPowerOfTwo64(c/5) && is32Bit(c)) {
+               if !(c%5 == 0 && isPowerOfTwo(c/5) && is32Bit(c)) {
                        break
                }
                v.reset(OpARM64MOVWUreg)
@@ -7335,7 +7335,7 @@ func rewriteValueARM64_OpARM64MADDW(v *Value) bool {
                return true
        }
        // match: (MADDW a x (MOVDconst [c]))
-       // cond: c%7 == 0 && isPowerOfTwo64(c/7) && is32Bit(c)
+       // cond: c%7 == 0 && isPowerOfTwo(c/7) && is32Bit(c)
        // result: (MOVWUreg (SUBshiftLL <a.Type> a (SUBshiftLL <x.Type> x x [3]) [log64(c/7)]))
        for {
                a := v_0
@@ -7344,7 +7344,7 @@ func rewriteValueARM64_OpARM64MADDW(v *Value) bool {
                        break
                }
                c := auxIntToInt64(v_2.AuxInt)
-               if !(c%7 == 0 && isPowerOfTwo64(c/7) && is32Bit(c)) {
+               if !(c%7 == 0 && isPowerOfTwo(c/7) && is32Bit(c)) {
                        break
                }
                v.reset(OpARM64MOVWUreg)
@@ -7358,7 +7358,7 @@ func rewriteValueARM64_OpARM64MADDW(v *Value) bool {
                return true
        }
        // match: (MADDW a x (MOVDconst [c]))
-       // cond: c%9 == 0 && isPowerOfTwo64(c/9) && is32Bit(c)
+       // cond: c%9 == 0 && isPowerOfTwo(c/9) && is32Bit(c)
        // result: (MOVWUreg (ADDshiftLL <a.Type> a (ADDshiftLL <x.Type> x x [3]) [log64(c/9)]))
        for {
                a := v_0
@@ -7367,7 +7367,7 @@ func rewriteValueARM64_OpARM64MADDW(v *Value) bool {
                        break
                }
                c := auxIntToInt64(v_2.AuxInt)
-               if !(c%9 == 0 && isPowerOfTwo64(c/9) && is32Bit(c)) {
+               if !(c%9 == 0 && isPowerOfTwo(c/9) && is32Bit(c)) {
                        break
                }
                v.reset(OpARM64MOVWUreg)
@@ -7435,7 +7435,7 @@ func rewriteValueARM64_OpARM64MADDW(v *Value) bool {
                return true
        }
        // match: (MADDW a (MOVDconst [c]) x)
-       // cond: isPowerOfTwo64(c)
+       // cond: isPowerOfTwo(c)
        // result: (MOVWUreg (ADDshiftLL <a.Type> a x [log64(c)]))
        for {
                a := v_0
@@ -7444,7 +7444,7 @@ func rewriteValueARM64_OpARM64MADDW(v *Value) bool {
                }
                c := auxIntToInt64(v_1.AuxInt)
                x := v_2
-               if !(isPowerOfTwo64(c)) {
+               if !(isPowerOfTwo(c)) {
                        break
                }
                v.reset(OpARM64MOVWUreg)
@@ -7455,7 +7455,7 @@ func rewriteValueARM64_OpARM64MADDW(v *Value) bool {
                return true
        }
        // match: (MADDW a (MOVDconst [c]) x)
-       // cond: isPowerOfTwo64(c-1) && int32(c)>=3
+       // cond: isPowerOfTwo(c-1) && int32(c)>=3
        // result: (MOVWUreg (ADD <a.Type> a (ADDshiftLL <x.Type> x x [log64(c-1)])))
        for {
                a := v_0
@@ -7464,7 +7464,7 @@ func rewriteValueARM64_OpARM64MADDW(v *Value) bool {
                }
                c := auxIntToInt64(v_1.AuxInt)
                x := v_2
-               if !(isPowerOfTwo64(c-1) && int32(c) >= 3) {
+               if !(isPowerOfTwo(c-1) && int32(c) >= 3) {
                        break
                }
                v.reset(OpARM64MOVWUreg)
@@ -7477,7 +7477,7 @@ func rewriteValueARM64_OpARM64MADDW(v *Value) bool {
                return true
        }
        // match: (MADDW a (MOVDconst [c]) x)
-       // cond: isPowerOfTwo64(c+1) && int32(c)>=7
+       // cond: isPowerOfTwo(c+1) && int32(c)>=7
        // result: (MOVWUreg (SUB <a.Type> a (SUBshiftLL <x.Type> x x [log64(c+1)])))
        for {
                a := v_0
@@ -7486,7 +7486,7 @@ func rewriteValueARM64_OpARM64MADDW(v *Value) bool {
                }
                c := auxIntToInt64(v_1.AuxInt)
                x := v_2
-               if !(isPowerOfTwo64(c+1) && int32(c) >= 7) {
+               if !(isPowerOfTwo(c+1) && int32(c) >= 7) {
                        break
                }
                v.reset(OpARM64MOVWUreg)
@@ -7499,7 +7499,7 @@ func rewriteValueARM64_OpARM64MADDW(v *Value) bool {
                return true
        }
        // match: (MADDW a (MOVDconst [c]) x)
-       // cond: c%3 == 0 && isPowerOfTwo64(c/3) && is32Bit(c)
+       // cond: c%3 == 0 && isPowerOfTwo(c/3) && is32Bit(c)
        // result: (MOVWUreg (SUBshiftLL <a.Type> a (SUBshiftLL <x.Type> x x [2]) [log64(c/3)]))
        for {
                a := v_0
@@ -7508,7 +7508,7 @@ func rewriteValueARM64_OpARM64MADDW(v *Value) bool {
                }
                c := auxIntToInt64(v_1.AuxInt)
                x := v_2
-               if !(c%3 == 0 && isPowerOfTwo64(c/3) && is32Bit(c)) {
+               if !(c%3 == 0 && isPowerOfTwo(c/3) && is32Bit(c)) {
                        break
                }
                v.reset(OpARM64MOVWUreg)
@@ -7522,7 +7522,7 @@ func rewriteValueARM64_OpARM64MADDW(v *Value) bool {
                return true
        }
        // match: (MADDW a (MOVDconst [c]) x)
-       // cond: c%5 == 0 && isPowerOfTwo64(c/5) && is32Bit(c)
+       // cond: c%5 == 0 && isPowerOfTwo(c/5) && is32Bit(c)
        // result: (MOVWUreg (ADDshiftLL <a.Type> a (ADDshiftLL <x.Type> x x [2]) [log64(c/5)]))
        for {
                a := v_0
@@ -7531,7 +7531,7 @@ func rewriteValueARM64_OpARM64MADDW(v *Value) bool {
                }
                c := auxIntToInt64(v_1.AuxInt)
                x := v_2
-               if !(c%5 == 0 && isPowerOfTwo64(c/5) && is32Bit(c)) {
+               if !(c%5 == 0 && isPowerOfTwo(c/5) && is32Bit(c)) {
                        break
                }
                v.reset(OpARM64MOVWUreg)
@@ -7545,7 +7545,7 @@ func rewriteValueARM64_OpARM64MADDW(v *Value) bool {
                return true
        }
        // match: (MADDW a (MOVDconst [c]) x)
-       // cond: c%7 == 0 && isPowerOfTwo64(c/7) && is32Bit(c)
+       // cond: c%7 == 0 && isPowerOfTwo(c/7) && is32Bit(c)
        // result: (MOVWUreg (SUBshiftLL <a.Type> a (SUBshiftLL <x.Type> x x [3]) [log64(c/7)]))
        for {
                a := v_0
@@ -7554,7 +7554,7 @@ func rewriteValueARM64_OpARM64MADDW(v *Value) bool {
                }
                c := auxIntToInt64(v_1.AuxInt)
                x := v_2
-               if !(c%7 == 0 && isPowerOfTwo64(c/7) && is32Bit(c)) {
+               if !(c%7 == 0 && isPowerOfTwo(c/7) && is32Bit(c)) {
                        break
                }
                v.reset(OpARM64MOVWUreg)
@@ -7568,7 +7568,7 @@ func rewriteValueARM64_OpARM64MADDW(v *Value) bool {
                return true
        }
        // match: (MADDW a (MOVDconst [c]) x)
-       // cond: c%9 == 0 && isPowerOfTwo64(c/9) && is32Bit(c)
+       // cond: c%9 == 0 && isPowerOfTwo(c/9) && is32Bit(c)
        // result: (MOVWUreg (ADDshiftLL <a.Type> a (ADDshiftLL <x.Type> x x [3]) [log64(c/9)]))
        for {
                a := v_0
@@ -7577,7 +7577,7 @@ func rewriteValueARM64_OpARM64MADDW(v *Value) bool {
                }
                c := auxIntToInt64(v_1.AuxInt)
                x := v_2
-               if !(c%9 == 0 && isPowerOfTwo64(c/9) && is32Bit(c)) {
+               if !(c%9 == 0 && isPowerOfTwo(c/9) && is32Bit(c)) {
                        break
                }
                v.reset(OpARM64MOVWUreg)
@@ -7674,7 +7674,7 @@ func rewriteValueARM64_OpARM64MNEG(v *Value) bool {
                break
        }
        // match: (MNEG x (MOVDconst [c]))
-       // cond: isPowerOfTwo64(c)
+       // cond: isPowerOfTwo(c)
        // result: (NEG (SLLconst <x.Type> [log64(c)] x))
        for {
                for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
@@ -7683,7 +7683,7 @@ func rewriteValueARM64_OpARM64MNEG(v *Value) bool {
                                continue
                        }
                        c := auxIntToInt64(v_1.AuxInt)
-                       if !(isPowerOfTwo64(c)) {
+                       if !(isPowerOfTwo(c)) {
                                continue
                        }
                        v.reset(OpARM64NEG)
@@ -7696,7 +7696,7 @@ func rewriteValueARM64_OpARM64MNEG(v *Value) bool {
                break
        }
        // match: (MNEG x (MOVDconst [c]))
-       // cond: isPowerOfTwo64(c-1) && c >= 3
+       // cond: isPowerOfTwo(c-1) && c >= 3
        // result: (NEG (ADDshiftLL <x.Type> x x [log64(c-1)]))
        for {
                for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
@@ -7705,7 +7705,7 @@ func rewriteValueARM64_OpARM64MNEG(v *Value) bool {
                                continue
                        }
                        c := auxIntToInt64(v_1.AuxInt)
-                       if !(isPowerOfTwo64(c-1) && c >= 3) {
+                       if !(isPowerOfTwo(c-1) && c >= 3) {
                                continue
                        }
                        v.reset(OpARM64NEG)
@@ -7718,7 +7718,7 @@ func rewriteValueARM64_OpARM64MNEG(v *Value) bool {
                break
        }
        // match: (MNEG x (MOVDconst [c]))
-       // cond: isPowerOfTwo64(c+1) && c >= 7
+       // cond: isPowerOfTwo(c+1) && c >= 7
        // result: (NEG (ADDshiftLL <x.Type> (NEG <x.Type> x) x [log64(c+1)]))
        for {
                for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
@@ -7727,7 +7727,7 @@ func rewriteValueARM64_OpARM64MNEG(v *Value) bool {
                                continue
                        }
                        c := auxIntToInt64(v_1.AuxInt)
-                       if !(isPowerOfTwo64(c+1) && c >= 7) {
+                       if !(isPowerOfTwo(c+1) && c >= 7) {
                                continue
                        }
                        v.reset(OpARM64NEG)
@@ -7742,7 +7742,7 @@ func rewriteValueARM64_OpARM64MNEG(v *Value) bool {
                break
        }
        // match: (MNEG x (MOVDconst [c]))
-       // cond: c%3 == 0 && isPowerOfTwo64(c/3)
+       // cond: c%3 == 0 && isPowerOfTwo(c/3)
        // result: (SLLconst <x.Type> [log64(c/3)] (SUBshiftLL <x.Type> x x [2]))
        for {
                for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
@@ -7751,7 +7751,7 @@ func rewriteValueARM64_OpARM64MNEG(v *Value) bool {
                                continue
                        }
                        c := auxIntToInt64(v_1.AuxInt)
-                       if !(c%3 == 0 && isPowerOfTwo64(c/3)) {
+                       if !(c%3 == 0 && isPowerOfTwo(c/3)) {
                                continue
                        }
                        v.reset(OpARM64SLLconst)
@@ -7766,7 +7766,7 @@ func rewriteValueARM64_OpARM64MNEG(v *Value) bool {
                break
        }
        // match: (MNEG x (MOVDconst [c]))
-       // cond: c%5 == 0 && isPowerOfTwo64(c/5)
+       // cond: c%5 == 0 && isPowerOfTwo(c/5)
        // result: (NEG (SLLconst <x.Type> [log64(c/5)] (ADDshiftLL <x.Type> x x [2])))
        for {
                for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
@@ -7775,7 +7775,7 @@ func rewriteValueARM64_OpARM64MNEG(v *Value) bool {
                                continue
                        }
                        c := auxIntToInt64(v_1.AuxInt)
-                       if !(c%5 == 0 && isPowerOfTwo64(c/5)) {
+                       if !(c%5 == 0 && isPowerOfTwo(c/5)) {
                                continue
                        }
                        v.reset(OpARM64NEG)
@@ -7791,7 +7791,7 @@ func rewriteValueARM64_OpARM64MNEG(v *Value) bool {
                break
        }
        // match: (MNEG x (MOVDconst [c]))
-       // cond: c%7 == 0 && isPowerOfTwo64(c/7)
+       // cond: c%7 == 0 && isPowerOfTwo(c/7)
        // result: (SLLconst <x.Type> [log64(c/7)] (SUBshiftLL <x.Type> x x [3]))
        for {
                for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
@@ -7800,7 +7800,7 @@ func rewriteValueARM64_OpARM64MNEG(v *Value) bool {
                                continue
                        }
                        c := auxIntToInt64(v_1.AuxInt)
-                       if !(c%7 == 0 && isPowerOfTwo64(c/7)) {
+                       if !(c%7 == 0 && isPowerOfTwo(c/7)) {
                                continue
                        }
                        v.reset(OpARM64SLLconst)
@@ -7815,7 +7815,7 @@ func rewriteValueARM64_OpARM64MNEG(v *Value) bool {
                break
        }
        // match: (MNEG x (MOVDconst [c]))
-       // cond: c%9 == 0 && isPowerOfTwo64(c/9)
+       // cond: c%9 == 0 && isPowerOfTwo(c/9)
        // result: (NEG (SLLconst <x.Type> [log64(c/9)] (ADDshiftLL <x.Type> x x [3])))
        for {
                for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
@@ -7824,7 +7824,7 @@ func rewriteValueARM64_OpARM64MNEG(v *Value) bool {
                                continue
                        }
                        c := auxIntToInt64(v_1.AuxInt)
-                       if !(c%9 == 0 && isPowerOfTwo64(c/9)) {
+                       if !(c%9 == 0 && isPowerOfTwo(c/9)) {
                                continue
                        }
                        v.reset(OpARM64NEG)
@@ -7922,7 +7922,7 @@ func rewriteValueARM64_OpARM64MNEGW(v *Value) bool {
                break
        }
        // match: (MNEGW x (MOVDconst [c]))
-       // cond: isPowerOfTwo64(c)
+       // cond: isPowerOfTwo(c)
        // result: (NEG (SLLconst <x.Type> [log64(c)] x))
        for {
                for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
@@ -7931,7 +7931,7 @@ func rewriteValueARM64_OpARM64MNEGW(v *Value) bool {
                                continue
                        }
                        c := auxIntToInt64(v_1.AuxInt)
-                       if !(isPowerOfTwo64(c)) {
+                       if !(isPowerOfTwo(c)) {
                                continue
                        }
                        v.reset(OpARM64NEG)
@@ -7944,7 +7944,7 @@ func rewriteValueARM64_OpARM64MNEGW(v *Value) bool {
                break
        }
        // match: (MNEGW x (MOVDconst [c]))
-       // cond: isPowerOfTwo64(c-1) && int32(c) >= 3
+       // cond: isPowerOfTwo(c-1) && int32(c) >= 3
        // result: (MOVWUreg (NEG <x.Type> (ADDshiftLL <x.Type> x x [log64(c-1)])))
        for {
                for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
@@ -7953,7 +7953,7 @@ func rewriteValueARM64_OpARM64MNEGW(v *Value) bool {
                                continue
                        }
                        c := auxIntToInt64(v_1.AuxInt)
-                       if !(isPowerOfTwo64(c-1) && int32(c) >= 3) {
+                       if !(isPowerOfTwo(c-1) && int32(c) >= 3) {
                                continue
                        }
                        v.reset(OpARM64MOVWUreg)
@@ -7968,7 +7968,7 @@ func rewriteValueARM64_OpARM64MNEGW(v *Value) bool {
                break
        }
        // match: (MNEGW x (MOVDconst [c]))
-       // cond: isPowerOfTwo64(c+1) && int32(c) >= 7
+       // cond: isPowerOfTwo(c+1) && int32(c) >= 7
        // result: (MOVWUreg (NEG <x.Type> (ADDshiftLL <x.Type> (NEG <x.Type> x) x [log64(c+1)])))
        for {
                for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
@@ -7977,7 +7977,7 @@ func rewriteValueARM64_OpARM64MNEGW(v *Value) bool {
                                continue
                        }
                        c := auxIntToInt64(v_1.AuxInt)
-                       if !(isPowerOfTwo64(c+1) && int32(c) >= 7) {
+                       if !(isPowerOfTwo(c+1) && int32(c) >= 7) {
                                continue
                        }
                        v.reset(OpARM64MOVWUreg)
@@ -7994,7 +7994,7 @@ func rewriteValueARM64_OpARM64MNEGW(v *Value) bool {
                break
        }
        // match: (MNEGW x (MOVDconst [c]))
-       // cond: c%3 == 0 && isPowerOfTwo64(c/3) && is32Bit(c)
+       // cond: c%3 == 0 && isPowerOfTwo(c/3) && is32Bit(c)
        // result: (MOVWUreg (SLLconst <x.Type> [log64(c/3)] (SUBshiftLL <x.Type> x x [2])))
        for {
                for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
@@ -8003,7 +8003,7 @@ func rewriteValueARM64_OpARM64MNEGW(v *Value) bool {
                                continue
                        }
                        c := auxIntToInt64(v_1.AuxInt)
-                       if !(c%3 == 0 && isPowerOfTwo64(c/3) && is32Bit(c)) {
+                       if !(c%3 == 0 && isPowerOfTwo(c/3) && is32Bit(c)) {
                                continue
                        }
                        v.reset(OpARM64MOVWUreg)
@@ -8019,7 +8019,7 @@ func rewriteValueARM64_OpARM64MNEGW(v *Value) bool {
                break
        }
        // match: (MNEGW x (MOVDconst [c]))
-       // cond: c%5 == 0 && isPowerOfTwo64(c/5) && is32Bit(c)
+       // cond: c%5 == 0 && isPowerOfTwo(c/5) && is32Bit(c)
        // result: (MOVWUreg (NEG <x.Type> (SLLconst <x.Type> [log64(c/5)] (ADDshiftLL <x.Type> x x [2]))))
        for {
                for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
@@ -8028,7 +8028,7 @@ func rewriteValueARM64_OpARM64MNEGW(v *Value) bool {
                                continue
                        }
                        c := auxIntToInt64(v_1.AuxInt)
-                       if !(c%5 == 0 && isPowerOfTwo64(c/5) && is32Bit(c)) {
+                       if !(c%5 == 0 && isPowerOfTwo(c/5) && is32Bit(c)) {
                                continue
                        }
                        v.reset(OpARM64MOVWUreg)
@@ -8046,7 +8046,7 @@ func rewriteValueARM64_OpARM64MNEGW(v *Value) bool {
                break
        }
        // match: (MNEGW x (MOVDconst [c]))
-       // cond: c%7 == 0 && isPowerOfTwo64(c/7) && is32Bit(c)
+       // cond: c%7 == 0 && isPowerOfTwo(c/7) && is32Bit(c)
        // result: (MOVWUreg (SLLconst <x.Type> [log64(c/7)] (SUBshiftLL <x.Type> x x [3])))
        for {
                for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
@@ -8055,7 +8055,7 @@ func rewriteValueARM64_OpARM64MNEGW(v *Value) bool {
                                continue
                        }
                        c := auxIntToInt64(v_1.AuxInt)
-                       if !(c%7 == 0 && isPowerOfTwo64(c/7) && is32Bit(c)) {
+                       if !(c%7 == 0 && isPowerOfTwo(c/7) && is32Bit(c)) {
                                continue
                        }
                        v.reset(OpARM64MOVWUreg)
@@ -8071,7 +8071,7 @@ func rewriteValueARM64_OpARM64MNEGW(v *Value) bool {
                break
        }
        // match: (MNEGW x (MOVDconst [c]))
-       // cond: c%9 == 0 && isPowerOfTwo64(c/9) && is32Bit(c)
+       // cond: c%9 == 0 && isPowerOfTwo(c/9) && is32Bit(c)
        // result: (MOVWUreg (NEG <x.Type> (SLLconst <x.Type> [log64(c/9)] (ADDshiftLL <x.Type> x x [3]))))
        for {
                for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
@@ -8080,7 +8080,7 @@ func rewriteValueARM64_OpARM64MNEGW(v *Value) bool {
                                continue
                        }
                        c := auxIntToInt64(v_1.AuxInt)
-                       if !(c%9 == 0 && isPowerOfTwo64(c/9) && is32Bit(c)) {
+                       if !(c%9 == 0 && isPowerOfTwo(c/9) && is32Bit(c)) {
                                continue
                        }
                        v.reset(OpARM64MOVWUreg)
@@ -12549,7 +12549,7 @@ func rewriteValueARM64_OpARM64MSUB(v *Value) bool {
                return true
        }
        // match: (MSUB a x (MOVDconst [c]))
-       // cond: isPowerOfTwo64(c)
+       // cond: isPowerOfTwo(c)
        // result: (SUBshiftLL a x [log64(c)])
        for {
                a := v_0
@@ -12558,7 +12558,7 @@ func rewriteValueARM64_OpARM64MSUB(v *Value) bool {
                        break
                }
                c := auxIntToInt64(v_2.AuxInt)
-               if !(isPowerOfTwo64(c)) {
+               if !(isPowerOfTwo(c)) {
                        break
                }
                v.reset(OpARM64SUBshiftLL)
@@ -12567,7 +12567,7 @@ func rewriteValueARM64_OpARM64MSUB(v *Value) bool {
                return true
        }
        // match: (MSUB a x (MOVDconst [c]))
-       // cond: isPowerOfTwo64(c-1) && c>=3
+       // cond: isPowerOfTwo(c-1) && c>=3
        // result: (SUB a (ADDshiftLL <x.Type> x x [log64(c-1)]))
        for {
                a := v_0
@@ -12576,7 +12576,7 @@ func rewriteValueARM64_OpARM64MSUB(v *Value) bool {
                        break
                }
                c := auxIntToInt64(v_2.AuxInt)
-               if !(isPowerOfTwo64(c-1) && c >= 3) {
+               if !(isPowerOfTwo(c-1) && c >= 3) {
                        break
                }
                v.reset(OpARM64SUB)
@@ -12587,7 +12587,7 @@ func rewriteValueARM64_OpARM64MSUB(v *Value) bool {
                return true
        }
        // match: (MSUB a x (MOVDconst [c]))
-       // cond: isPowerOfTwo64(c+1) && c>=7
+       // cond: isPowerOfTwo(c+1) && c>=7
        // result: (ADD a (SUBshiftLL <x.Type> x x [log64(c+1)]))
        for {
                a := v_0
@@ -12596,7 +12596,7 @@ func rewriteValueARM64_OpARM64MSUB(v *Value) bool {
                        break
                }
                c := auxIntToInt64(v_2.AuxInt)
-               if !(isPowerOfTwo64(c+1) && c >= 7) {
+               if !(isPowerOfTwo(c+1) && c >= 7) {
                        break
                }
                v.reset(OpARM64ADD)
@@ -12607,7 +12607,7 @@ func rewriteValueARM64_OpARM64MSUB(v *Value) bool {
                return true
        }
        // match: (MSUB a x (MOVDconst [c]))
-       // cond: c%3 == 0 && isPowerOfTwo64(c/3)
+       // cond: c%3 == 0 && isPowerOfTwo(c/3)
        // result: (ADDshiftLL a (SUBshiftLL <x.Type> x x [2]) [log64(c/3)])
        for {
                a := v_0
@@ -12616,7 +12616,7 @@ func rewriteValueARM64_OpARM64MSUB(v *Value) bool {
                        break
                }
                c := auxIntToInt64(v_2.AuxInt)
-               if !(c%3 == 0 && isPowerOfTwo64(c/3)) {
+               if !(c%3 == 0 && isPowerOfTwo(c/3)) {
                        break
                }
                v.reset(OpARM64ADDshiftLL)
@@ -12628,7 +12628,7 @@ func rewriteValueARM64_OpARM64MSUB(v *Value) bool {
                return true
        }
        // match: (MSUB a x (MOVDconst [c]))
-       // cond: c%5 == 0 && isPowerOfTwo64(c/5)
+       // cond: c%5 == 0 && isPowerOfTwo(c/5)
        // result: (SUBshiftLL a (ADDshiftLL <x.Type> x x [2]) [log64(c/5)])
        for {
                a := v_0
@@ -12637,7 +12637,7 @@ func rewriteValueARM64_OpARM64MSUB(v *Value) bool {
                        break
                }
                c := auxIntToInt64(v_2.AuxInt)
-               if !(c%5 == 0 && isPowerOfTwo64(c/5)) {
+               if !(c%5 == 0 && isPowerOfTwo(c/5)) {
                        break
                }
                v.reset(OpARM64SUBshiftLL)
@@ -12649,7 +12649,7 @@ func rewriteValueARM64_OpARM64MSUB(v *Value) bool {
                return true
        }
        // match: (MSUB a x (MOVDconst [c]))
-       // cond: c%7 == 0 && isPowerOfTwo64(c/7)
+       // cond: c%7 == 0 && isPowerOfTwo(c/7)
        // result: (ADDshiftLL a (SUBshiftLL <x.Type> x x [3]) [log64(c/7)])
        for {
                a := v_0
@@ -12658,7 +12658,7 @@ func rewriteValueARM64_OpARM64MSUB(v *Value) bool {
                        break
                }
                c := auxIntToInt64(v_2.AuxInt)
-               if !(c%7 == 0 && isPowerOfTwo64(c/7)) {
+               if !(c%7 == 0 && isPowerOfTwo(c/7)) {
                        break
                }
                v.reset(OpARM64ADDshiftLL)
@@ -12670,7 +12670,7 @@ func rewriteValueARM64_OpARM64MSUB(v *Value) bool {
                return true
        }
        // match: (MSUB a x (MOVDconst [c]))
-       // cond: c%9 == 0 && isPowerOfTwo64(c/9)
+       // cond: c%9 == 0 && isPowerOfTwo(c/9)
        // result: (SUBshiftLL a (ADDshiftLL <x.Type> x x [3]) [log64(c/9)])
        for {
                a := v_0
@@ -12679,7 +12679,7 @@ func rewriteValueARM64_OpARM64MSUB(v *Value) bool {
                        break
                }
                c := auxIntToInt64(v_2.AuxInt)
-               if !(c%9 == 0 && isPowerOfTwo64(c/9)) {
+               if !(c%9 == 0 && isPowerOfTwo(c/9)) {
                        break
                }
                v.reset(OpARM64SUBshiftLL)
@@ -12725,7 +12725,7 @@ func rewriteValueARM64_OpARM64MSUB(v *Value) bool {
                return true
        }
        // match: (MSUB a (MOVDconst [c]) x)
-       // cond: isPowerOfTwo64(c)
+       // cond: isPowerOfTwo(c)
        // result: (SUBshiftLL a x [log64(c)])
        for {
                a := v_0
@@ -12734,7 +12734,7 @@ func rewriteValueARM64_OpARM64MSUB(v *Value) bool {
                }
                c := auxIntToInt64(v_1.AuxInt)
                x := v_2
-               if !(isPowerOfTwo64(c)) {
+               if !(isPowerOfTwo(c)) {
                        break
                }
                v.reset(OpARM64SUBshiftLL)
@@ -12743,7 +12743,7 @@ func rewriteValueARM64_OpARM64MSUB(v *Value) bool {
                return true
        }
        // match: (MSUB a (MOVDconst [c]) x)
-       // cond: isPowerOfTwo64(c-1) && c>=3
+       // cond: isPowerOfTwo(c-1) && c>=3
        // result: (SUB a (ADDshiftLL <x.Type> x x [log64(c-1)]))
        for {
                a := v_0
@@ -12752,7 +12752,7 @@ func rewriteValueARM64_OpARM64MSUB(v *Value) bool {
                }
                c := auxIntToInt64(v_1.AuxInt)
                x := v_2
-               if !(isPowerOfTwo64(c-1) && c >= 3) {
+               if !(isPowerOfTwo(c-1) && c >= 3) {
                        break
                }
                v.reset(OpARM64SUB)
@@ -12763,7 +12763,7 @@ func rewriteValueARM64_OpARM64MSUB(v *Value) bool {
                return true
        }
        // match: (MSUB a (MOVDconst [c]) x)
-       // cond: isPowerOfTwo64(c+1) && c>=7
+       // cond: isPowerOfTwo(c+1) && c>=7
        // result: (ADD a (SUBshiftLL <x.Type> x x [log64(c+1)]))
        for {
                a := v_0
@@ -12772,7 +12772,7 @@ func rewriteValueARM64_OpARM64MSUB(v *Value) bool {
                }
                c := auxIntToInt64(v_1.AuxInt)
                x := v_2
-               if !(isPowerOfTwo64(c+1) && c >= 7) {
+               if !(isPowerOfTwo(c+1) && c >= 7) {
                        break
                }
                v.reset(OpARM64ADD)
@@ -12783,7 +12783,7 @@ func rewriteValueARM64_OpARM64MSUB(v *Value) bool {
                return true
        }
        // match: (MSUB a (MOVDconst [c]) x)
-       // cond: c%3 == 0 && isPowerOfTwo64(c/3)
+       // cond: c%3 == 0 && isPowerOfTwo(c/3)
        // result: (ADDshiftLL a (SUBshiftLL <x.Type> x x [2]) [log64(c/3)])
        for {
                a := v_0
@@ -12792,7 +12792,7 @@ func rewriteValueARM64_OpARM64MSUB(v *Value) bool {
                }
                c := auxIntToInt64(v_1.AuxInt)
                x := v_2
-               if !(c%3 == 0 && isPowerOfTwo64(c/3)) {
+               if !(c%3 == 0 && isPowerOfTwo(c/3)) {
                        break
                }
                v.reset(OpARM64ADDshiftLL)
@@ -12804,7 +12804,7 @@ func rewriteValueARM64_OpARM64MSUB(v *Value) bool {
                return true
        }
        // match: (MSUB a (MOVDconst [c]) x)
-       // cond: c%5 == 0 && isPowerOfTwo64(c/5)
+       // cond: c%5 == 0 && isPowerOfTwo(c/5)
        // result: (SUBshiftLL a (ADDshiftLL <x.Type> x x [2]) [log64(c/5)])
        for {
                a := v_0
@@ -12813,7 +12813,7 @@ func rewriteValueARM64_OpARM64MSUB(v *Value) bool {
                }
                c := auxIntToInt64(v_1.AuxInt)
                x := v_2
-               if !(c%5 == 0 && isPowerOfTwo64(c/5)) {
+               if !(c%5 == 0 && isPowerOfTwo(c/5)) {
                        break
                }
                v.reset(OpARM64SUBshiftLL)
@@ -12825,7 +12825,7 @@ func rewriteValueARM64_OpARM64MSUB(v *Value) bool {
                return true
        }
        // match: (MSUB a (MOVDconst [c]) x)
-       // cond: c%7 == 0 && isPowerOfTwo64(c/7)
+       // cond: c%7 == 0 && isPowerOfTwo(c/7)
        // result: (ADDshiftLL a (SUBshiftLL <x.Type> x x [3]) [log64(c/7)])
        for {
                a := v_0
@@ -12834,7 +12834,7 @@ func rewriteValueARM64_OpARM64MSUB(v *Value) bool {
                }
                c := auxIntToInt64(v_1.AuxInt)
                x := v_2
-               if !(c%7 == 0 && isPowerOfTwo64(c/7)) {
+               if !(c%7 == 0 && isPowerOfTwo(c/7)) {
                        break
                }
                v.reset(OpARM64ADDshiftLL)
@@ -12846,7 +12846,7 @@ func rewriteValueARM64_OpARM64MSUB(v *Value) bool {
                return true
        }
        // match: (MSUB a (MOVDconst [c]) x)
-       // cond: c%9 == 0 && isPowerOfTwo64(c/9)
+       // cond: c%9 == 0 && isPowerOfTwo(c/9)
        // result: (SUBshiftLL a (ADDshiftLL <x.Type> x x [3]) [log64(c/9)])
        for {
                a := v_0
@@ -12855,7 +12855,7 @@ func rewriteValueARM64_OpARM64MSUB(v *Value) bool {
                }
                c := auxIntToInt64(v_1.AuxInt)
                x := v_2
-               if !(c%9 == 0 && isPowerOfTwo64(c/9)) {
+               if !(c%9 == 0 && isPowerOfTwo(c/9)) {
                        break
                }
                v.reset(OpARM64SUBshiftLL)
@@ -12961,7 +12961,7 @@ func rewriteValueARM64_OpARM64MSUBW(v *Value) bool {
                return true
        }
        // match: (MSUBW a x (MOVDconst [c]))
-       // cond: isPowerOfTwo64(c)
+       // cond: isPowerOfTwo(c)
        // result: (MOVWUreg (SUBshiftLL <a.Type> a x [log64(c)]))
        for {
                a := v_0
@@ -12970,7 +12970,7 @@ func rewriteValueARM64_OpARM64MSUBW(v *Value) bool {
                        break
                }
                c := auxIntToInt64(v_2.AuxInt)
-               if !(isPowerOfTwo64(c)) {
+               if !(isPowerOfTwo(c)) {
                        break
                }
                v.reset(OpARM64MOVWUreg)
@@ -12981,7 +12981,7 @@ func rewriteValueARM64_OpARM64MSUBW(v *Value) bool {
                return true
        }
        // match: (MSUBW a x (MOVDconst [c]))
-       // cond: isPowerOfTwo64(c-1) && int32(c)>=3
+       // cond: isPowerOfTwo(c-1) && int32(c)>=3
        // result: (MOVWUreg (SUB <a.Type> a (ADDshiftLL <x.Type> x x [log64(c-1)])))
        for {
                a := v_0
@@ -12990,7 +12990,7 @@ func rewriteValueARM64_OpARM64MSUBW(v *Value) bool {
                        break
                }
                c := auxIntToInt64(v_2.AuxInt)
-               if !(isPowerOfTwo64(c-1) && int32(c) >= 3) {
+               if !(isPowerOfTwo(c-1) && int32(c) >= 3) {
                        break
                }
                v.reset(OpARM64MOVWUreg)
@@ -13003,7 +13003,7 @@ func rewriteValueARM64_OpARM64MSUBW(v *Value) bool {
                return true
        }
        // match: (MSUBW a x (MOVDconst [c]))
-       // cond: isPowerOfTwo64(c+1) && int32(c)>=7
+       // cond: isPowerOfTwo(c+1) && int32(c)>=7
        // result: (MOVWUreg (ADD <a.Type> a (SUBshiftLL <x.Type> x x [log64(c+1)])))
        for {
                a := v_0
@@ -13012,7 +13012,7 @@ func rewriteValueARM64_OpARM64MSUBW(v *Value) bool {
                        break
                }
                c := auxIntToInt64(v_2.AuxInt)
-               if !(isPowerOfTwo64(c+1) && int32(c) >= 7) {
+               if !(isPowerOfTwo(c+1) && int32(c) >= 7) {
                        break
                }
                v.reset(OpARM64MOVWUreg)
@@ -13025,7 +13025,7 @@ func rewriteValueARM64_OpARM64MSUBW(v *Value) bool {
                return true
        }
        // match: (MSUBW a x (MOVDconst [c]))
-       // cond: c%3 == 0 && isPowerOfTwo64(c/3) && is32Bit(c)
+       // cond: c%3 == 0 && isPowerOfTwo(c/3) && is32Bit(c)
        // result: (MOVWUreg (ADDshiftLL <a.Type> a (SUBshiftLL <x.Type> x x [2]) [log64(c/3)]))
        for {
                a := v_0
@@ -13034,7 +13034,7 @@ func rewriteValueARM64_OpARM64MSUBW(v *Value) bool {
                        break
                }
                c := auxIntToInt64(v_2.AuxInt)
-               if !(c%3 == 0 && isPowerOfTwo64(c/3) && is32Bit(c)) {
+               if !(c%3 == 0 && isPowerOfTwo(c/3) && is32Bit(c)) {
                        break
                }
                v.reset(OpARM64MOVWUreg)
@@ -13048,7 +13048,7 @@ func rewriteValueARM64_OpARM64MSUBW(v *Value) bool {
                return true
        }
        // match: (MSUBW a x (MOVDconst [c]))
-       // cond: c%5 == 0 && isPowerOfTwo64(c/5) && is32Bit(c)
+       // cond: c%5 == 0 && isPowerOfTwo(c/5) && is32Bit(c)
        // result: (MOVWUreg (SUBshiftLL <a.Type> a (ADDshiftLL <x.Type> x x [2]) [log64(c/5)]))
        for {
                a := v_0
@@ -13057,7 +13057,7 @@ func rewriteValueARM64_OpARM64MSUBW(v *Value) bool {
                        break
                }
                c := auxIntToInt64(v_2.AuxInt)
-               if !(c%5 == 0 && isPowerOfTwo64(c/5) && is32Bit(c)) {
+               if !(c%5 == 0 && isPowerOfTwo(c/5) && is32Bit(c)) {
                        break
                }
                v.reset(OpARM64MOVWUreg)
@@ -13071,7 +13071,7 @@ func rewriteValueARM64_OpARM64MSUBW(v *Value) bool {
                return true
        }
        // match: (MSUBW a x (MOVDconst [c]))
-       // cond: c%7 == 0 && isPowerOfTwo64(c/7) && is32Bit(c)
+       // cond: c%7 == 0 && isPowerOfTwo(c/7) && is32Bit(c)
        // result: (MOVWUreg (ADDshiftLL <a.Type> a (SUBshiftLL <x.Type> x x [3]) [log64(c/7)]))
        for {
                a := v_0
@@ -13080,7 +13080,7 @@ func rewriteValueARM64_OpARM64MSUBW(v *Value) bool {
                        break
                }
                c := auxIntToInt64(v_2.AuxInt)
-               if !(c%7 == 0 && isPowerOfTwo64(c/7) && is32Bit(c)) {
+               if !(c%7 == 0 && isPowerOfTwo(c/7) && is32Bit(c)) {
                        break
                }
                v.reset(OpARM64MOVWUreg)
@@ -13094,7 +13094,7 @@ func rewriteValueARM64_OpARM64MSUBW(v *Value) bool {
                return true
        }
        // match: (MSUBW a x (MOVDconst [c]))
-       // cond: c%9 == 0 && isPowerOfTwo64(c/9) && is32Bit(c)
+       // cond: c%9 == 0 && isPowerOfTwo(c/9) && is32Bit(c)
        // result: (MOVWUreg (SUBshiftLL <a.Type> a (ADDshiftLL <x.Type> x x [3]) [log64(c/9)]))
        for {
                a := v_0
@@ -13103,7 +13103,7 @@ func rewriteValueARM64_OpARM64MSUBW(v *Value) bool {
                        break
                }
                c := auxIntToInt64(v_2.AuxInt)
-               if !(c%9 == 0 && isPowerOfTwo64(c/9) && is32Bit(c)) {
+               if !(c%9 == 0 && isPowerOfTwo(c/9) && is32Bit(c)) {
                        break
                }
                v.reset(OpARM64MOVWUreg)
@@ -13171,7 +13171,7 @@ func rewriteValueARM64_OpARM64MSUBW(v *Value) bool {
                return true
        }
        // match: (MSUBW a (MOVDconst [c]) x)
-       // cond: isPowerOfTwo64(c)
+       // cond: isPowerOfTwo(c)
        // result: (MOVWUreg (SUBshiftLL <a.Type> a x [log64(c)]))
        for {
                a := v_0
@@ -13180,7 +13180,7 @@ func rewriteValueARM64_OpARM64MSUBW(v *Value) bool {
                }
                c := auxIntToInt64(v_1.AuxInt)
                x := v_2
-               if !(isPowerOfTwo64(c)) {
+               if !(isPowerOfTwo(c)) {
                        break
                }
                v.reset(OpARM64MOVWUreg)
@@ -13191,7 +13191,7 @@ func rewriteValueARM64_OpARM64MSUBW(v *Value) bool {
                return true
        }
        // match: (MSUBW a (MOVDconst [c]) x)
-       // cond: isPowerOfTwo64(c-1) && int32(c)>=3
+       // cond: isPowerOfTwo(c-1) && int32(c)>=3
        // result: (MOVWUreg (SUB <a.Type> a (ADDshiftLL <x.Type> x x [log64(c-1)])))
        for {
                a := v_0
@@ -13200,7 +13200,7 @@ func rewriteValueARM64_OpARM64MSUBW(v *Value) bool {
                }
                c := auxIntToInt64(v_1.AuxInt)
                x := v_2
-               if !(isPowerOfTwo64(c-1) && int32(c) >= 3) {
+               if !(isPowerOfTwo(c-1) && int32(c) >= 3) {
                        break
                }
                v.reset(OpARM64MOVWUreg)
@@ -13213,7 +13213,7 @@ func rewriteValueARM64_OpARM64MSUBW(v *Value) bool {
                return true
        }
        // match: (MSUBW a (MOVDconst [c]) x)
-       // cond: isPowerOfTwo64(c+1) && int32(c)>=7
+       // cond: isPowerOfTwo(c+1) && int32(c)>=7
        // result: (MOVWUreg (ADD <a.Type> a (SUBshiftLL <x.Type> x x [log64(c+1)])))
        for {
                a := v_0
@@ -13222,7 +13222,7 @@ func rewriteValueARM64_OpARM64MSUBW(v *Value) bool {
                }
                c := auxIntToInt64(v_1.AuxInt)
                x := v_2
-               if !(isPowerOfTwo64(c+1) && int32(c) >= 7) {
+               if !(isPowerOfTwo(c+1) && int32(c) >= 7) {
                        break
                }
                v.reset(OpARM64MOVWUreg)
@@ -13235,7 +13235,7 @@ func rewriteValueARM64_OpARM64MSUBW(v *Value) bool {
                return true
        }
        // match: (MSUBW a (MOVDconst [c]) x)
-       // cond: c%3 == 0 && isPowerOfTwo64(c/3) && is32Bit(c)
+       // cond: c%3 == 0 && isPowerOfTwo(c/3) && is32Bit(c)
        // result: (MOVWUreg (ADDshiftLL <a.Type> a (SUBshiftLL <x.Type> x x [2]) [log64(c/3)]))
        for {
                a := v_0
@@ -13244,7 +13244,7 @@ func rewriteValueARM64_OpARM64MSUBW(v *Value) bool {
                }
                c := auxIntToInt64(v_1.AuxInt)
                x := v_2
-               if !(c%3 == 0 && isPowerOfTwo64(c/3) && is32Bit(c)) {
+               if !(c%3 == 0 && isPowerOfTwo(c/3) && is32Bit(c)) {
                        break
                }
                v.reset(OpARM64MOVWUreg)
@@ -13258,7 +13258,7 @@ func rewriteValueARM64_OpARM64MSUBW(v *Value) bool {
                return true
        }
        // match: (MSUBW a (MOVDconst [c]) x)
-       // cond: c%5 == 0 && isPowerOfTwo64(c/5) && is32Bit(c)
+       // cond: c%5 == 0 && isPowerOfTwo(c/5) && is32Bit(c)
        // result: (MOVWUreg (SUBshiftLL <a.Type> a (ADDshiftLL <x.Type> x x [2]) [log64(c/5)]))
        for {
                a := v_0
@@ -13267,7 +13267,7 @@ func rewriteValueARM64_OpARM64MSUBW(v *Value) bool {
                }
                c := auxIntToInt64(v_1.AuxInt)
                x := v_2
-               if !(c%5 == 0 && isPowerOfTwo64(c/5) && is32Bit(c)) {
+               if !(c%5 == 0 && isPowerOfTwo(c/5) && is32Bit(c)) {
                        break
                }
                v.reset(OpARM64MOVWUreg)
@@ -13281,7 +13281,7 @@ func rewriteValueARM64_OpARM64MSUBW(v *Value) bool {
                return true
        }
        // match: (MSUBW a (MOVDconst [c]) x)
-       // cond: c%7 == 0 && isPowerOfTwo64(c/7) && is32Bit(c)
+       // cond: c%7 == 0 && isPowerOfTwo(c/7) && is32Bit(c)
        // result: (MOVWUreg (ADDshiftLL <a.Type> a (SUBshiftLL <x.Type> x x [3]) [log64(c/7)]))
        for {
                a := v_0
@@ -13290,7 +13290,7 @@ func rewriteValueARM64_OpARM64MSUBW(v *Value) bool {
                }
                c := auxIntToInt64(v_1.AuxInt)
                x := v_2
-               if !(c%7 == 0 && isPowerOfTwo64(c/7) && is32Bit(c)) {
+               if !(c%7 == 0 && isPowerOfTwo(c/7) && is32Bit(c)) {
                        break
                }
                v.reset(OpARM64MOVWUreg)
@@ -13304,7 +13304,7 @@ func rewriteValueARM64_OpARM64MSUBW(v *Value) bool {
                return true
        }
        // match: (MSUBW a (MOVDconst [c]) x)
-       // cond: c%9 == 0 && isPowerOfTwo64(c/9) && is32Bit(c)
+       // cond: c%9 == 0 && isPowerOfTwo(c/9) && is32Bit(c)
        // result: (MOVWUreg (SUBshiftLL <a.Type> a (ADDshiftLL <x.Type> x x [3]) [log64(c/9)]))
        for {
                a := v_0
@@ -13313,7 +13313,7 @@ func rewriteValueARM64_OpARM64MSUBW(v *Value) bool {
                }
                c := auxIntToInt64(v_1.AuxInt)
                x := v_2
-               if !(c%9 == 0 && isPowerOfTwo64(c/9) && is32Bit(c)) {
+               if !(c%9 == 0 && isPowerOfTwo(c/9) && is32Bit(c)) {
                        break
                }
                v.reset(OpARM64MOVWUreg)
@@ -13425,7 +13425,7 @@ func rewriteValueARM64_OpARM64MUL(v *Value) bool {
                break
        }
        // match: (MUL x (MOVDconst [c]))
-       // cond: isPowerOfTwo64(c)
+       // cond: isPowerOfTwo(c)
        // result: (SLLconst [log64(c)] x)
        for {
                for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
@@ -13434,7 +13434,7 @@ func rewriteValueARM64_OpARM64MUL(v *Value) bool {
                                continue
                        }
                        c := auxIntToInt64(v_1.AuxInt)
-                       if !(isPowerOfTwo64(c)) {
+                       if !(isPowerOfTwo(c)) {
                                continue
                        }
                        v.reset(OpARM64SLLconst)
@@ -13445,7 +13445,7 @@ func rewriteValueARM64_OpARM64MUL(v *Value) bool {
                break
        }
        // match: (MUL x (MOVDconst [c]))
-       // cond: isPowerOfTwo64(c-1) && c >= 3
+       // cond: isPowerOfTwo(c-1) && c >= 3
        // result: (ADDshiftLL x x [log64(c-1)])
        for {
                for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
@@ -13454,7 +13454,7 @@ func rewriteValueARM64_OpARM64MUL(v *Value) bool {
                                continue
                        }
                        c := auxIntToInt64(v_1.AuxInt)
-                       if !(isPowerOfTwo64(c-1) && c >= 3) {
+                       if !(isPowerOfTwo(c-1) && c >= 3) {
                                continue
                        }
                        v.reset(OpARM64ADDshiftLL)
@@ -13465,7 +13465,7 @@ func rewriteValueARM64_OpARM64MUL(v *Value) bool {
                break
        }
        // match: (MUL x (MOVDconst [c]))
-       // cond: isPowerOfTwo64(c+1) && c >= 7
+       // cond: isPowerOfTwo(c+1) && c >= 7
        // result: (ADDshiftLL (NEG <x.Type> x) x [log64(c+1)])
        for {
                for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
@@ -13474,7 +13474,7 @@ func rewriteValueARM64_OpARM64MUL(v *Value) bool {
                                continue
                        }
                        c := auxIntToInt64(v_1.AuxInt)
-                       if !(isPowerOfTwo64(c+1) && c >= 7) {
+                       if !(isPowerOfTwo(c+1) && c >= 7) {
                                continue
                        }
                        v.reset(OpARM64ADDshiftLL)
@@ -13487,7 +13487,7 @@ func rewriteValueARM64_OpARM64MUL(v *Value) bool {
                break
        }
        // match: (MUL x (MOVDconst [c]))
-       // cond: c%3 == 0 && isPowerOfTwo64(c/3)
+       // cond: c%3 == 0 && isPowerOfTwo(c/3)
        // result: (SLLconst [log64(c/3)] (ADDshiftLL <x.Type> x x [1]))
        for {
                for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
@@ -13496,7 +13496,7 @@ func rewriteValueARM64_OpARM64MUL(v *Value) bool {
                                continue
                        }
                        c := auxIntToInt64(v_1.AuxInt)
-                       if !(c%3 == 0 && isPowerOfTwo64(c/3)) {
+                       if !(c%3 == 0 && isPowerOfTwo(c/3)) {
                                continue
                        }
                        v.reset(OpARM64SLLconst)
@@ -13510,7 +13510,7 @@ func rewriteValueARM64_OpARM64MUL(v *Value) bool {
                break
        }
        // match: (MUL x (MOVDconst [c]))
-       // cond: c%5 == 0 && isPowerOfTwo64(c/5)
+       // cond: c%5 == 0 && isPowerOfTwo(c/5)
        // result: (SLLconst [log64(c/5)] (ADDshiftLL <x.Type> x x [2]))
        for {
                for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
@@ -13519,7 +13519,7 @@ func rewriteValueARM64_OpARM64MUL(v *Value) bool {
                                continue
                        }
                        c := auxIntToInt64(v_1.AuxInt)
-                       if !(c%5 == 0 && isPowerOfTwo64(c/5)) {
+                       if !(c%5 == 0 && isPowerOfTwo(c/5)) {
                                continue
                        }
                        v.reset(OpARM64SLLconst)
@@ -13533,7 +13533,7 @@ func rewriteValueARM64_OpARM64MUL(v *Value) bool {
                break
        }
        // match: (MUL x (MOVDconst [c]))
-       // cond: c%7 == 0 && isPowerOfTwo64(c/7)
+       // cond: c%7 == 0 && isPowerOfTwo(c/7)
        // result: (SLLconst [log64(c/7)] (ADDshiftLL <x.Type> (NEG <x.Type> x) x [3]))
        for {
                for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
@@ -13542,7 +13542,7 @@ func rewriteValueARM64_OpARM64MUL(v *Value) bool {
                                continue
                        }
                        c := auxIntToInt64(v_1.AuxInt)
-                       if !(c%7 == 0 && isPowerOfTwo64(c/7)) {
+                       if !(c%7 == 0 && isPowerOfTwo(c/7)) {
                                continue
                        }
                        v.reset(OpARM64SLLconst)
@@ -13558,7 +13558,7 @@ func rewriteValueARM64_OpARM64MUL(v *Value) bool {
                break
        }
        // match: (MUL x (MOVDconst [c]))
-       // cond: c%9 == 0 && isPowerOfTwo64(c/9)
+       // cond: c%9 == 0 && isPowerOfTwo(c/9)
        // result: (SLLconst [log64(c/9)] (ADDshiftLL <x.Type> x x [3]))
        for {
                for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
@@ -13567,7 +13567,7 @@ func rewriteValueARM64_OpARM64MUL(v *Value) bool {
                                continue
                        }
                        c := auxIntToInt64(v_1.AuxInt)
-                       if !(c%9 == 0 && isPowerOfTwo64(c/9)) {
+                       if !(c%9 == 0 && isPowerOfTwo(c/9)) {
                                continue
                        }
                        v.reset(OpARM64SLLconst)
@@ -13678,7 +13678,7 @@ func rewriteValueARM64_OpARM64MULW(v *Value) bool {
                break
        }
        // match: (MULW x (MOVDconst [c]))
-       // cond: isPowerOfTwo64(c)
+       // cond: isPowerOfTwo(c)
        // result: (MOVWUreg (SLLconst <x.Type> [log64(c)] x))
        for {
                for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
@@ -13687,7 +13687,7 @@ func rewriteValueARM64_OpARM64MULW(v *Value) bool {
                                continue
                        }
                        c := auxIntToInt64(v_1.AuxInt)
-                       if !(isPowerOfTwo64(c)) {
+                       if !(isPowerOfTwo(c)) {
                                continue
                        }
                        v.reset(OpARM64MOVWUreg)
@@ -13700,7 +13700,7 @@ func rewriteValueARM64_OpARM64MULW(v *Value) bool {
                break
        }
        // match: (MULW x (MOVDconst [c]))
-       // cond: isPowerOfTwo64(c-1) && int32(c) >= 3
+       // cond: isPowerOfTwo(c-1) && int32(c) >= 3
        // result: (MOVWUreg (ADDshiftLL <x.Type> x x [log64(c-1)]))
        for {
                for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
@@ -13709,7 +13709,7 @@ func rewriteValueARM64_OpARM64MULW(v *Value) bool {
                                continue
                        }
                        c := auxIntToInt64(v_1.AuxInt)
-                       if !(isPowerOfTwo64(c-1) && int32(c) >= 3) {
+                       if !(isPowerOfTwo(c-1) && int32(c) >= 3) {
                                continue
                        }
                        v.reset(OpARM64MOVWUreg)
@@ -13722,7 +13722,7 @@ func rewriteValueARM64_OpARM64MULW(v *Value) bool {
                break
        }
        // match: (MULW x (MOVDconst [c]))
-       // cond: isPowerOfTwo64(c+1) && int32(c) >= 7
+       // cond: isPowerOfTwo(c+1) && int32(c) >= 7
        // result: (MOVWUreg (ADDshiftLL <x.Type> (NEG <x.Type> x) x [log64(c+1)]))
        for {
                for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
@@ -13731,7 +13731,7 @@ func rewriteValueARM64_OpARM64MULW(v *Value) bool {
                                continue
                        }
                        c := auxIntToInt64(v_1.AuxInt)
-                       if !(isPowerOfTwo64(c+1) && int32(c) >= 7) {
+                       if !(isPowerOfTwo(c+1) && int32(c) >= 7) {
                                continue
                        }
                        v.reset(OpARM64MOVWUreg)
@@ -13746,7 +13746,7 @@ func rewriteValueARM64_OpARM64MULW(v *Value) bool {
                break
        }
        // match: (MULW x (MOVDconst [c]))
-       // cond: c%3 == 0 && isPowerOfTwo64(c/3) && is32Bit(c)
+       // cond: c%3 == 0 && isPowerOfTwo(c/3) && is32Bit(c)
        // result: (MOVWUreg (SLLconst <x.Type> [log64(c/3)] (ADDshiftLL <x.Type> x x [1])))
        for {
                for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
@@ -13755,7 +13755,7 @@ func rewriteValueARM64_OpARM64MULW(v *Value) bool {
                                continue
                        }
                        c := auxIntToInt64(v_1.AuxInt)
-                       if !(c%3 == 0 && isPowerOfTwo64(c/3) && is32Bit(c)) {
+                       if !(c%3 == 0 && isPowerOfTwo(c/3) && is32Bit(c)) {
                                continue
                        }
                        v.reset(OpARM64MOVWUreg)
@@ -13771,7 +13771,7 @@ func rewriteValueARM64_OpARM64MULW(v *Value) bool {
                break
        }
        // match: (MULW x (MOVDconst [c]))
-       // cond: c%5 == 0 && isPowerOfTwo64(c/5) && is32Bit(c)
+       // cond: c%5 == 0 && isPowerOfTwo(c/5) && is32Bit(c)
        // result: (MOVWUreg (SLLconst <x.Type> [log64(c/5)] (ADDshiftLL <x.Type> x x [2])))
        for {
                for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
@@ -13780,7 +13780,7 @@ func rewriteValueARM64_OpARM64MULW(v *Value) bool {
                                continue
                        }
                        c := auxIntToInt64(v_1.AuxInt)
-                       if !(c%5 == 0 && isPowerOfTwo64(c/5) && is32Bit(c)) {
+                       if !(c%5 == 0 && isPowerOfTwo(c/5) && is32Bit(c)) {
                                continue
                        }
                        v.reset(OpARM64MOVWUreg)
@@ -13796,7 +13796,7 @@ func rewriteValueARM64_OpARM64MULW(v *Value) bool {
                break
        }
        // match: (MULW x (MOVDconst [c]))
-       // cond: c%7 == 0 && isPowerOfTwo64(c/7) && is32Bit(c)
+       // cond: c%7 == 0 && isPowerOfTwo(c/7) && is32Bit(c)
        // result: (MOVWUreg (SLLconst <x.Type> [log64(c/7)] (ADDshiftLL <x.Type> (NEG <x.Type> x) x [3])))
        for {
                for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
@@ -13805,7 +13805,7 @@ func rewriteValueARM64_OpARM64MULW(v *Value) bool {
                                continue
                        }
                        c := auxIntToInt64(v_1.AuxInt)
-                       if !(c%7 == 0 && isPowerOfTwo64(c/7) && is32Bit(c)) {
+                       if !(c%7 == 0 && isPowerOfTwo(c/7) && is32Bit(c)) {
                                continue
                        }
                        v.reset(OpARM64MOVWUreg)
@@ -13823,7 +13823,7 @@ func rewriteValueARM64_OpARM64MULW(v *Value) bool {
                break
        }
        // match: (MULW x (MOVDconst [c]))
-       // cond: c%9 == 0 && isPowerOfTwo64(c/9) && is32Bit(c)
+       // cond: c%9 == 0 && isPowerOfTwo(c/9) && is32Bit(c)
        // result: (MOVWUreg (SLLconst <x.Type> [log64(c/9)] (ADDshiftLL <x.Type> x x [3])))
        for {
                for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
@@ -13832,7 +13832,7 @@ func rewriteValueARM64_OpARM64MULW(v *Value) bool {
                                continue
                        }
                        c := auxIntToInt64(v_1.AuxInt)
-                       if !(c%9 == 0 && isPowerOfTwo64(c/9) && is32Bit(c)) {
+                       if !(c%9 == 0 && isPowerOfTwo(c/9) && is32Bit(c)) {
                                continue
                        }
                        v.reset(OpARM64MOVWUreg)
@@ -17155,7 +17155,7 @@ func rewriteValueARM64_OpARM64UDIV(v *Value) bool {
                return true
        }
        // match: (UDIV x (MOVDconst [c]))
-       // cond: isPowerOfTwo64(c)
+       // cond: isPowerOfTwo(c)
        // result: (SRLconst [log64(c)] x)
        for {
                x := v_0
@@ -17163,7 +17163,7 @@ func rewriteValueARM64_OpARM64UDIV(v *Value) bool {
                        break
                }
                c := auxIntToInt64(v_1.AuxInt)
-               if !(isPowerOfTwo64(c)) {
+               if !(isPowerOfTwo(c)) {
                        break
                }
                v.reset(OpARM64SRLconst)
@@ -17213,7 +17213,7 @@ func rewriteValueARM64_OpARM64UDIVW(v *Value) bool {
                return true
        }
        // match: (UDIVW x (MOVDconst [c]))
-       // cond: isPowerOfTwo64(c) && is32Bit(c)
+       // cond: isPowerOfTwo(c) && is32Bit(c)
        // result: (SRLconst [log64(c)] (MOVWUreg <v.Type> x))
        for {
                x := v_0
@@ -17221,7 +17221,7 @@ func rewriteValueARM64_OpARM64UDIVW(v *Value) bool {
                        break
                }
                c := auxIntToInt64(v_1.AuxInt)
-               if !(isPowerOfTwo64(c) && is32Bit(c)) {
+               if !(isPowerOfTwo(c) && is32Bit(c)) {
                        break
                }
                v.reset(OpARM64SRLconst)
@@ -17283,7 +17283,7 @@ func rewriteValueARM64_OpARM64UMOD(v *Value) bool {
                return true
        }
        // match: (UMOD x (MOVDconst [c]))
-       // cond: isPowerOfTwo64(c)
+       // cond: isPowerOfTwo(c)
        // result: (ANDconst [c-1] x)
        for {
                x := v_0
@@ -17291,7 +17291,7 @@ func rewriteValueARM64_OpARM64UMOD(v *Value) bool {
                        break
                }
                c := auxIntToInt64(v_1.AuxInt)
-               if !(isPowerOfTwo64(c)) {
+               if !(isPowerOfTwo(c)) {
                        break
                }
                v.reset(OpARM64ANDconst)
@@ -17356,7 +17356,7 @@ func rewriteValueARM64_OpARM64UMODW(v *Value) bool {
                return true
        }
        // match: (UMODW x (MOVDconst [c]))
-       // cond: isPowerOfTwo64(c) && is32Bit(c)
+       // cond: isPowerOfTwo(c) && is32Bit(c)
        // result: (ANDconst [c-1] x)
        for {
                x := v_0
@@ -17364,7 +17364,7 @@ func rewriteValueARM64_OpARM64UMODW(v *Value) bool {
                        break
                }
                c := auxIntToInt64(v_1.AuxInt)
-               if !(isPowerOfTwo64(c) && is32Bit(c)) {
+               if !(isPowerOfTwo(c) && is32Bit(c)) {
                        break
                }
                v.reset(OpARM64ANDconst)
index 99690d324cdf90811f3723d0a430c83624aa3669..f4080d1ac728369f890a2a23c9cfb3df3be6fc9d 100644 (file)
@@ -1559,7 +1559,7 @@ func rewriteValueLOONG64_OpLOONG64DIVVU(v *Value) bool {
                return true
        }
        // match: (DIVVU x (MOVVconst [c]))
-       // cond: isPowerOfTwo64(c)
+       // cond: isPowerOfTwo(c)
        // result: (SRLVconst [log64(c)] x)
        for {
                x := v_0
@@ -1567,7 +1567,7 @@ func rewriteValueLOONG64_OpLOONG64DIVVU(v *Value) bool {
                        break
                }
                c := auxIntToInt64(v_1.AuxInt)
-               if !(isPowerOfTwo64(c)) {
+               if !(isPowerOfTwo(c)) {
                        break
                }
                v.reset(OpLOONG64SRLVconst)
@@ -3550,7 +3550,7 @@ func rewriteValueLOONG64_OpLOONG64MULV(v *Value) bool {
                break
        }
        // match: (MULV x (MOVVconst [c]))
-       // cond: isPowerOfTwo64(c)
+       // cond: isPowerOfTwo(c)
        // result: (SLLVconst [log64(c)] x)
        for {
                for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
@@ -3559,7 +3559,7 @@ func rewriteValueLOONG64_OpLOONG64MULV(v *Value) bool {
                                continue
                        }
                        c := auxIntToInt64(v_1.AuxInt)
-                       if !(isPowerOfTwo64(c)) {
+                       if !(isPowerOfTwo(c)) {
                                continue
                        }
                        v.reset(OpLOONG64SLLVconst)
@@ -3772,7 +3772,7 @@ func rewriteValueLOONG64_OpLOONG64REMVU(v *Value) bool {
                return true
        }
        // match: (REMVU x (MOVVconst [c]))
-       // cond: isPowerOfTwo64(c)
+       // cond: isPowerOfTwo(c)
        // result: (ANDconst [c-1] x)
        for {
                x := v_0
@@ -3780,7 +3780,7 @@ func rewriteValueLOONG64_OpLOONG64REMVU(v *Value) bool {
                        break
                }
                c := auxIntToInt64(v_1.AuxInt)
-               if !(isPowerOfTwo64(c)) {
+               if !(isPowerOfTwo(c)) {
                        break
                }
                v.reset(OpLOONG64ANDconst)
index 6a259f5a475172334fbbb7b94f6130f607f8ee46..045ebb955af871b3419cd9fb06518545374ef6da 100644 (file)
@@ -3977,7 +3977,7 @@ func rewriteValueMIPS_OpMIPSMUL(v *Value) bool {
                break
        }
        // match: (MUL (MOVWconst [c]) x )
-       // cond: isPowerOfTwo64(int64(uint32(c)))
+       // cond: isPowerOfTwo(int64(uint32(c)))
        // result: (SLLconst [int32(log2uint32(int64(c)))] x)
        for {
                for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
@@ -3986,7 +3986,7 @@ func rewriteValueMIPS_OpMIPSMUL(v *Value) bool {
                        }
                        c := auxIntToInt32(v_0.AuxInt)
                        x := v_1
-                       if !(isPowerOfTwo64(int64(uint32(c)))) {
+                       if !(isPowerOfTwo(int64(uint32(c)))) {
                                continue
                        }
                        v.reset(OpMIPSSLLconst)
@@ -6496,7 +6496,7 @@ func rewriteValueMIPS_OpSelect0(v *Value) bool {
                break
        }
        // match: (Select0 (MULTU (MOVWconst [c]) x ))
-       // cond: isPowerOfTwo64(int64(uint32(c)))
+       // cond: isPowerOfTwo(int64(uint32(c)))
        // result: (SRLconst [int32(32-log2uint32(int64(c)))] x)
        for {
                if v_0.Op != OpMIPSMULTU {
@@ -6511,7 +6511,7 @@ func rewriteValueMIPS_OpSelect0(v *Value) bool {
                        }
                        c := auxIntToInt32(v_0_0.AuxInt)
                        x := v_0_1
-                       if !(isPowerOfTwo64(int64(uint32(c)))) {
+                       if !(isPowerOfTwo(int64(uint32(c)))) {
                                continue
                        }
                        v.reset(OpMIPSSRLconst)
@@ -6692,7 +6692,7 @@ func rewriteValueMIPS_OpSelect1(v *Value) bool {
                break
        }
        // match: (Select1 (MULTU (MOVWconst [c]) x ))
-       // cond: isPowerOfTwo64(int64(uint32(c)))
+       // cond: isPowerOfTwo(int64(uint32(c)))
        // result: (SLLconst [int32(log2uint32(int64(c)))] x)
        for {
                if v_0.Op != OpMIPSMULTU {
@@ -6707,7 +6707,7 @@ func rewriteValueMIPS_OpSelect1(v *Value) bool {
                        }
                        c := auxIntToInt32(v_0_0.AuxInt)
                        x := v_0_1
-                       if !(isPowerOfTwo64(int64(uint32(c)))) {
+                       if !(isPowerOfTwo(int64(uint32(c)))) {
                                continue
                        }
                        v.reset(OpMIPSSLLconst)
index 764465d0b726044c422919baefaf529c9339f7fb..bad8016cb4b04af4c08df21cf80b153617f3182a 100644 (file)
@@ -7385,7 +7385,7 @@ func rewriteValueMIPS64_OpSelect0(v *Value) bool {
                return true
        }
        // match: (Select0 (DIVVU x (MOVVconst [c])))
-       // cond: isPowerOfTwo64(c)
+       // cond: isPowerOfTwo(c)
        // result: (ANDconst [c-1] x)
        for {
                if v_0.Op != OpMIPS64DIVVU {
@@ -7398,7 +7398,7 @@ func rewriteValueMIPS64_OpSelect0(v *Value) bool {
                        break
                }
                c := auxIntToInt64(v_0_1.AuxInt)
-               if !(isPowerOfTwo64(c)) {
+               if !(isPowerOfTwo(c)) {
                        break
                }
                v.reset(OpMIPS64ANDconst)
@@ -7584,7 +7584,7 @@ func rewriteValueMIPS64_OpSelect1(v *Value) bool {
                break
        }
        // match: (Select1 (MULVU x (MOVVconst [c])))
-       // cond: isPowerOfTwo64(c)
+       // cond: isPowerOfTwo(c)
        // result: (SLLVconst [log64(c)] x)
        for {
                if v_0.Op != OpMIPS64MULVU {
@@ -7599,7 +7599,7 @@ func rewriteValueMIPS64_OpSelect1(v *Value) bool {
                                continue
                        }
                        c := auxIntToInt64(v_0_1.AuxInt)
-                       if !(isPowerOfTwo64(c)) {
+                       if !(isPowerOfTwo(c)) {
                                continue
                        }
                        v.reset(OpMIPS64SLLVconst)
@@ -7625,7 +7625,7 @@ func rewriteValueMIPS64_OpSelect1(v *Value) bool {
                return true
        }
        // match: (Select1 (DIVVU x (MOVVconst [c])))
-       // cond: isPowerOfTwo64(c)
+       // cond: isPowerOfTwo(c)
        // result: (SRLVconst [log64(c)] x)
        for {
                if v_0.Op != OpMIPS64DIVVU {
@@ -7638,7 +7638,7 @@ func rewriteValueMIPS64_OpSelect1(v *Value) bool {
                        break
                }
                c := auxIntToInt64(v_0_1.AuxInt)
-               if !(isPowerOfTwo64(c)) {
+               if !(isPowerOfTwo(c)) {
                        break
                }
                v.reset(OpMIPS64SRLVconst)
index 2f38289ab9f542bcd50787592b7a8502e0beebfc..1816d2e27eeb3cd68d598dc4f328f12e45bf0dc5 100644 (file)
@@ -10833,13 +10833,13 @@ func rewriteValueS390X_OpS390XMULLDconst(v *Value) bool {
        v_0 := v.Args[0]
        b := v.Block
        // match: (MULLDconst <t> x [c])
-       // cond: isPowerOfTwo32(c&(c-1))
+       // cond: isPowerOfTwo(c&(c-1))
        // result: (ADD (SLDconst <t> x [uint8(log32(c&(c-1)))]) (SLDconst <t> x [uint8(log32(c&^(c-1)))]))
        for {
                t := v.Type
                c := auxIntToInt32(v.AuxInt)
                x := v_0
-               if !(isPowerOfTwo32(c & (c - 1))) {
+               if !(isPowerOfTwo(c & (c - 1))) {
                        break
                }
                v.reset(OpS390XADD)
@@ -10853,13 +10853,13 @@ func rewriteValueS390X_OpS390XMULLDconst(v *Value) bool {
                return true
        }
        // match: (MULLDconst <t> x [c])
-       // cond: isPowerOfTwo32(c+(c&^(c-1)))
+       // cond: isPowerOfTwo(c+(c&^(c-1)))
        // result: (SUB (SLDconst <t> x [uint8(log32(c+(c&^(c-1))))]) (SLDconst <t> x [uint8(log32(c&^(c-1)))]))
        for {
                t := v.Type
                c := auxIntToInt32(v.AuxInt)
                x := v_0
-               if !(isPowerOfTwo32(c + (c &^ (c - 1)))) {
+               if !(isPowerOfTwo(c + (c &^ (c - 1)))) {
                        break
                }
                v.reset(OpS390XSUB)
@@ -10873,13 +10873,13 @@ func rewriteValueS390X_OpS390XMULLDconst(v *Value) bool {
                return true
        }
        // match: (MULLDconst <t> x [c])
-       // cond: isPowerOfTwo32(-c+(-c&^(-c-1)))
+       // cond: isPowerOfTwo(-c+(-c&^(-c-1)))
        // result: (SUB (SLDconst <t> x [uint8(log32(-c&^(-c-1)))]) (SLDconst <t> x [uint8(log32(-c+(-c&^(-c-1))))]))
        for {
                t := v.Type
                c := auxIntToInt32(v.AuxInt)
                x := v_0
-               if !(isPowerOfTwo32(-c + (-c &^ (-c - 1)))) {
+               if !(isPowerOfTwo(-c + (-c &^ (-c - 1)))) {
                        break
                }
                v.reset(OpS390XSUB)
@@ -11060,13 +11060,13 @@ func rewriteValueS390X_OpS390XMULLWconst(v *Value) bool {
        v_0 := v.Args[0]
        b := v.Block
        // match: (MULLWconst <t> x [c])
-       // cond: isPowerOfTwo32(c&(c-1))
+       // cond: isPowerOfTwo(c&(c-1))
        // result: (ADDW (SLWconst <t> x [uint8(log32(c&(c-1)))]) (SLWconst <t> x [uint8(log32(c&^(c-1)))]))
        for {
                t := v.Type
                c := auxIntToInt32(v.AuxInt)
                x := v_0
-               if !(isPowerOfTwo32(c & (c - 1))) {
+               if !(isPowerOfTwo(c & (c - 1))) {
                        break
                }
                v.reset(OpS390XADDW)
@@ -11080,13 +11080,13 @@ func rewriteValueS390X_OpS390XMULLWconst(v *Value) bool {
                return true
        }
        // match: (MULLWconst <t> x [c])
-       // cond: isPowerOfTwo32(c+(c&^(c-1)))
+       // cond: isPowerOfTwo(c+(c&^(c-1)))
        // result: (SUBW (SLWconst <t> x [uint8(log32(c+(c&^(c-1))))]) (SLWconst <t> x [uint8(log32(c&^(c-1)))]))
        for {
                t := v.Type
                c := auxIntToInt32(v.AuxInt)
                x := v_0
-               if !(isPowerOfTwo32(c + (c &^ (c - 1)))) {
+               if !(isPowerOfTwo(c + (c &^ (c - 1)))) {
                        break
                }
                v.reset(OpS390XSUBW)
@@ -11100,13 +11100,13 @@ func rewriteValueS390X_OpS390XMULLWconst(v *Value) bool {
                return true
        }
        // match: (MULLWconst <t> x [c])
-       // cond: isPowerOfTwo32(-c+(-c&^(-c-1)))
+       // cond: isPowerOfTwo(-c+(-c&^(-c-1)))
        // result: (SUBW (SLWconst <t> x [uint8(log32(-c&^(-c-1)))]) (SLWconst <t> x [uint8(log32(-c+(-c&^(-c-1))))]))
        for {
                t := v.Type
                c := auxIntToInt32(v.AuxInt)
                x := v_0
-               if !(isPowerOfTwo32(-c + (-c &^ (-c - 1)))) {
+               if !(isPowerOfTwo(-c + (-c &^ (-c - 1)))) {
                        break
                }
                v.reset(OpS390XSUBW)
index beeb548ad70dda8400d7d332780716d2fbea0fd0..dee39eb261ab1378cf007b388b42702973b55df8 100644 (file)
@@ -6188,7 +6188,7 @@ func rewriteValuegeneric_OpDiv16(v *Value) bool {
                return true
        }
        // match: (Div16 n (Const16 [c]))
-       // cond: isNonNegative(n) && isPowerOfTwo16(c)
+       // cond: isNonNegative(n) && isPowerOfTwo(c)
        // result: (Rsh16Ux64 n (Const64 <typ.UInt64> [log16(c)]))
        for {
                n := v_0
@@ -6196,7 +6196,7 @@ func rewriteValuegeneric_OpDiv16(v *Value) bool {
                        break
                }
                c := auxIntToInt16(v_1.AuxInt)
-               if !(isNonNegative(n) && isPowerOfTwo16(c)) {
+               if !(isNonNegative(n) && isPowerOfTwo(c)) {
                        break
                }
                v.reset(OpRsh16Ux64)
@@ -6245,7 +6245,7 @@ func rewriteValuegeneric_OpDiv16(v *Value) bool {
                return true
        }
        // match: (Div16 <t> n (Const16 [c]))
-       // cond: isPowerOfTwo16(c)
+       // cond: isPowerOfTwo(c)
        // result: (Rsh16x64 (Add16 <t> n (Rsh16Ux64 <t> (Rsh16x64 <t> n (Const64 <typ.UInt64> [15])) (Const64 <typ.UInt64> [int64(16-log16(c))]))) (Const64 <typ.UInt64> [int64(log16(c))]))
        for {
                t := v.Type
@@ -6254,7 +6254,7 @@ func rewriteValuegeneric_OpDiv16(v *Value) bool {
                        break
                }
                c := auxIntToInt16(v_1.AuxInt)
-               if !(isPowerOfTwo16(c)) {
+               if !(isPowerOfTwo(c)) {
                        break
                }
                v.reset(OpRsh16x64)
@@ -6333,7 +6333,7 @@ func rewriteValuegeneric_OpDiv16u(v *Value) bool {
                return true
        }
        // match: (Div16u n (Const16 [c]))
-       // cond: isPowerOfTwo16(c)
+       // cond: isPowerOfTwo(c)
        // result: (Rsh16Ux64 n (Const64 <typ.UInt64> [log16(c)]))
        for {
                n := v_0
@@ -6341,7 +6341,7 @@ func rewriteValuegeneric_OpDiv16u(v *Value) bool {
                        break
                }
                c := auxIntToInt16(v_1.AuxInt)
-               if !(isPowerOfTwo16(c)) {
+               if !(isPowerOfTwo(c)) {
                        break
                }
                v.reset(OpRsh16Ux64)
@@ -6492,7 +6492,7 @@ func rewriteValuegeneric_OpDiv32(v *Value) bool {
                return true
        }
        // match: (Div32 n (Const32 [c]))
-       // cond: isNonNegative(n) && isPowerOfTwo32(c)
+       // cond: isNonNegative(n) && isPowerOfTwo(c)
        // result: (Rsh32Ux64 n (Const64 <typ.UInt64> [log32(c)]))
        for {
                n := v_0
@@ -6500,7 +6500,7 @@ func rewriteValuegeneric_OpDiv32(v *Value) bool {
                        break
                }
                c := auxIntToInt32(v_1.AuxInt)
-               if !(isNonNegative(n) && isPowerOfTwo32(c)) {
+               if !(isNonNegative(n) && isPowerOfTwo(c)) {
                        break
                }
                v.reset(OpRsh32Ux64)
@@ -6549,7 +6549,7 @@ func rewriteValuegeneric_OpDiv32(v *Value) bool {
                return true
        }
        // match: (Div32 <t> n (Const32 [c]))
-       // cond: isPowerOfTwo32(c)
+       // cond: isPowerOfTwo(c)
        // result: (Rsh32x64 (Add32 <t> n (Rsh32Ux64 <t> (Rsh32x64 <t> n (Const64 <typ.UInt64> [31])) (Const64 <typ.UInt64> [int64(32-log32(c))]))) (Const64 <typ.UInt64> [int64(log32(c))]))
        for {
                t := v.Type
@@ -6558,7 +6558,7 @@ func rewriteValuegeneric_OpDiv32(v *Value) bool {
                        break
                }
                c := auxIntToInt32(v_1.AuxInt)
-               if !(isPowerOfTwo32(c)) {
+               if !(isPowerOfTwo(c)) {
                        break
                }
                v.reset(OpRsh32x64)
@@ -6743,7 +6743,7 @@ func rewriteValuegeneric_OpDiv32u(v *Value) bool {
                return true
        }
        // match: (Div32u n (Const32 [c]))
-       // cond: isPowerOfTwo32(c)
+       // cond: isPowerOfTwo(c)
        // result: (Rsh32Ux64 n (Const64 <typ.UInt64> [log32(c)]))
        for {
                n := v_0
@@ -6751,7 +6751,7 @@ func rewriteValuegeneric_OpDiv32u(v *Value) bool {
                        break
                }
                c := auxIntToInt32(v_1.AuxInt)
-               if !(isPowerOfTwo32(c)) {
+               if !(isPowerOfTwo(c)) {
                        break
                }
                v.reset(OpRsh32Ux64)
@@ -6951,7 +6951,7 @@ func rewriteValuegeneric_OpDiv64(v *Value) bool {
                return true
        }
        // match: (Div64 n (Const64 [c]))
-       // cond: isNonNegative(n) && isPowerOfTwo64(c)
+       // cond: isNonNegative(n) && isPowerOfTwo(c)
        // result: (Rsh64Ux64 n (Const64 <typ.UInt64> [log64(c)]))
        for {
                n := v_0
@@ -6959,7 +6959,7 @@ func rewriteValuegeneric_OpDiv64(v *Value) bool {
                        break
                }
                c := auxIntToInt64(v_1.AuxInt)
-               if !(isNonNegative(n) && isPowerOfTwo64(c)) {
+               if !(isNonNegative(n) && isPowerOfTwo(c)) {
                        break
                }
                v.reset(OpRsh64Ux64)
@@ -7020,7 +7020,7 @@ func rewriteValuegeneric_OpDiv64(v *Value) bool {
                return true
        }
        // match: (Div64 <t> n (Const64 [c]))
-       // cond: isPowerOfTwo64(c)
+       // cond: isPowerOfTwo(c)
        // result: (Rsh64x64 (Add64 <t> n (Rsh64Ux64 <t> (Rsh64x64 <t> n (Const64 <typ.UInt64> [63])) (Const64 <typ.UInt64> [int64(64-log64(c))]))) (Const64 <typ.UInt64> [int64(log64(c))]))
        for {
                t := v.Type
@@ -7029,7 +7029,7 @@ func rewriteValuegeneric_OpDiv64(v *Value) bool {
                        break
                }
                c := auxIntToInt64(v_1.AuxInt)
-               if !(isPowerOfTwo64(c)) {
+               if !(isPowerOfTwo(c)) {
                        break
                }
                v.reset(OpRsh64x64)
@@ -7182,7 +7182,7 @@ func rewriteValuegeneric_OpDiv64u(v *Value) bool {
                return true
        }
        // match: (Div64u n (Const64 [c]))
-       // cond: isPowerOfTwo64(c)
+       // cond: isPowerOfTwo(c)
        // result: (Rsh64Ux64 n (Const64 <typ.UInt64> [log64(c)]))
        for {
                n := v_0
@@ -7190,7 +7190,7 @@ func rewriteValuegeneric_OpDiv64u(v *Value) bool {
                        break
                }
                c := auxIntToInt64(v_1.AuxInt)
-               if !(isPowerOfTwo64(c)) {
+               if !(isPowerOfTwo(c)) {
                        break
                }
                v.reset(OpRsh64Ux64)
@@ -7374,7 +7374,7 @@ func rewriteValuegeneric_OpDiv8(v *Value) bool {
                return true
        }
        // match: (Div8 n (Const8 [c]))
-       // cond: isNonNegative(n) && isPowerOfTwo8(c)
+       // cond: isNonNegative(n) && isPowerOfTwo(c)
        // result: (Rsh8Ux64 n (Const64 <typ.UInt64> [log8(c)]))
        for {
                n := v_0
@@ -7382,7 +7382,7 @@ func rewriteValuegeneric_OpDiv8(v *Value) bool {
                        break
                }
                c := auxIntToInt8(v_1.AuxInt)
-               if !(isNonNegative(n) && isPowerOfTwo8(c)) {
+               if !(isNonNegative(n) && isPowerOfTwo(c)) {
                        break
                }
                v.reset(OpRsh8Ux64)
@@ -7431,7 +7431,7 @@ func rewriteValuegeneric_OpDiv8(v *Value) bool {
                return true
        }
        // match: (Div8 <t> n (Const8 [c]))
-       // cond: isPowerOfTwo8(c)
+       // cond: isPowerOfTwo(c)
        // result: (Rsh8x64 (Add8 <t> n (Rsh8Ux64 <t> (Rsh8x64 <t> n (Const64 <typ.UInt64> [ 7])) (Const64 <typ.UInt64> [int64( 8-log8(c))]))) (Const64 <typ.UInt64> [int64(log8(c))]))
        for {
                t := v.Type
@@ -7440,7 +7440,7 @@ func rewriteValuegeneric_OpDiv8(v *Value) bool {
                        break
                }
                c := auxIntToInt8(v_1.AuxInt)
-               if !(isPowerOfTwo8(c)) {
+               if !(isPowerOfTwo(c)) {
                        break
                }
                v.reset(OpRsh8x64)
@@ -7518,7 +7518,7 @@ func rewriteValuegeneric_OpDiv8u(v *Value) bool {
                return true
        }
        // match: (Div8u n (Const8 [c]))
-       // cond: isPowerOfTwo8(c)
+       // cond: isPowerOfTwo(c)
        // result: (Rsh8Ux64 n (Const64 <typ.UInt64> [log8(c)]))
        for {
                n := v_0
@@ -7526,7 +7526,7 @@ func rewriteValuegeneric_OpDiv8u(v *Value) bool {
                        break
                }
                c := auxIntToInt8(v_1.AuxInt)
-               if !(isPowerOfTwo8(c)) {
+               if !(isPowerOfTwo(c)) {
                        break
                }
                v.reset(OpRsh8Ux64)
@@ -15436,7 +15436,7 @@ func rewriteValuegeneric_OpMod16(v *Value) bool {
                return true
        }
        // match: (Mod16 <t> n (Const16 [c]))
-       // cond: isNonNegative(n) && isPowerOfTwo16(c)
+       // cond: isNonNegative(n) && isPowerOfTwo(c)
        // result: (And16 n (Const16 <t> [c-1]))
        for {
                t := v.Type
@@ -15445,7 +15445,7 @@ func rewriteValuegeneric_OpMod16(v *Value) bool {
                        break
                }
                c := auxIntToInt16(v_1.AuxInt)
-               if !(isNonNegative(n) && isPowerOfTwo16(c)) {
+               if !(isNonNegative(n) && isPowerOfTwo(c)) {
                        break
                }
                v.reset(OpAnd16)
@@ -15523,7 +15523,7 @@ func rewriteValuegeneric_OpMod16u(v *Value) bool {
                return true
        }
        // match: (Mod16u <t> n (Const16 [c]))
-       // cond: isPowerOfTwo16(c)
+       // cond: isPowerOfTwo(c)
        // result: (And16 n (Const16 <t> [c-1]))
        for {
                t := v.Type
@@ -15532,7 +15532,7 @@ func rewriteValuegeneric_OpMod16u(v *Value) bool {
                        break
                }
                c := auxIntToInt16(v_1.AuxInt)
-               if !(isPowerOfTwo16(c)) {
+               if !(isPowerOfTwo(c)) {
                        break
                }
                v.reset(OpAnd16)
@@ -15590,7 +15590,7 @@ func rewriteValuegeneric_OpMod32(v *Value) bool {
                return true
        }
        // match: (Mod32 <t> n (Const32 [c]))
-       // cond: isNonNegative(n) && isPowerOfTwo32(c)
+       // cond: isNonNegative(n) && isPowerOfTwo(c)
        // result: (And32 n (Const32 <t> [c-1]))
        for {
                t := v.Type
@@ -15599,7 +15599,7 @@ func rewriteValuegeneric_OpMod32(v *Value) bool {
                        break
                }
                c := auxIntToInt32(v_1.AuxInt)
-               if !(isNonNegative(n) && isPowerOfTwo32(c)) {
+               if !(isNonNegative(n) && isPowerOfTwo(c)) {
                        break
                }
                v.reset(OpAnd32)
@@ -15677,7 +15677,7 @@ func rewriteValuegeneric_OpMod32u(v *Value) bool {
                return true
        }
        // match: (Mod32u <t> n (Const32 [c]))
-       // cond: isPowerOfTwo32(c)
+       // cond: isPowerOfTwo(c)
        // result: (And32 n (Const32 <t> [c-1]))
        for {
                t := v.Type
@@ -15686,7 +15686,7 @@ func rewriteValuegeneric_OpMod32u(v *Value) bool {
                        break
                }
                c := auxIntToInt32(v_1.AuxInt)
-               if !(isPowerOfTwo32(c)) {
+               if !(isPowerOfTwo(c)) {
                        break
                }
                v.reset(OpAnd32)
@@ -15744,7 +15744,7 @@ func rewriteValuegeneric_OpMod64(v *Value) bool {
                return true
        }
        // match: (Mod64 <t> n (Const64 [c]))
-       // cond: isNonNegative(n) && isPowerOfTwo64(c)
+       // cond: isNonNegative(n) && isPowerOfTwo(c)
        // result: (And64 n (Const64 <t> [c-1]))
        for {
                t := v.Type
@@ -15753,7 +15753,7 @@ func rewriteValuegeneric_OpMod64(v *Value) bool {
                        break
                }
                c := auxIntToInt64(v_1.AuxInt)
-               if !(isNonNegative(n) && isPowerOfTwo64(c)) {
+               if !(isNonNegative(n) && isPowerOfTwo(c)) {
                        break
                }
                v.reset(OpAnd64)
@@ -15842,7 +15842,7 @@ func rewriteValuegeneric_OpMod64u(v *Value) bool {
                return true
        }
        // match: (Mod64u <t> n (Const64 [c]))
-       // cond: isPowerOfTwo64(c)
+       // cond: isPowerOfTwo(c)
        // result: (And64 n (Const64 <t> [c-1]))
        for {
                t := v.Type
@@ -15851,7 +15851,7 @@ func rewriteValuegeneric_OpMod64u(v *Value) bool {
                        break
                }
                c := auxIntToInt64(v_1.AuxInt)
-               if !(isPowerOfTwo64(c)) {
+               if !(isPowerOfTwo(c)) {
                        break
                }
                v.reset(OpAnd64)
@@ -15923,7 +15923,7 @@ func rewriteValuegeneric_OpMod8(v *Value) bool {
                return true
        }
        // match: (Mod8 <t> n (Const8 [c]))
-       // cond: isNonNegative(n) && isPowerOfTwo8(c)
+       // cond: isNonNegative(n) && isPowerOfTwo(c)
        // result: (And8 n (Const8 <t> [c-1]))
        for {
                t := v.Type
@@ -15932,7 +15932,7 @@ func rewriteValuegeneric_OpMod8(v *Value) bool {
                        break
                }
                c := auxIntToInt8(v_1.AuxInt)
-               if !(isNonNegative(n) && isPowerOfTwo8(c)) {
+               if !(isNonNegative(n) && isPowerOfTwo(c)) {
                        break
                }
                v.reset(OpAnd8)
@@ -16010,7 +16010,7 @@ func rewriteValuegeneric_OpMod8u(v *Value) bool {
                return true
        }
        // match: (Mod8u <t> n (Const8 [c]))
-       // cond: isPowerOfTwo8(c)
+       // cond: isPowerOfTwo(c)
        // result: (And8 n (Const8 <t> [c-1]))
        for {
                t := v.Type
@@ -16019,7 +16019,7 @@ func rewriteValuegeneric_OpMod8u(v *Value) bool {
                        break
                }
                c := auxIntToInt8(v_1.AuxInt)
-               if !(isPowerOfTwo8(c)) {
+               if !(isPowerOfTwo(c)) {
                        break
                }
                v.reset(OpAnd8)
@@ -17443,7 +17443,7 @@ func rewriteValuegeneric_OpMul16(v *Value) bool {
                break
        }
        // match: (Mul16 <t> n (Const16 [c]))
-       // cond: isPowerOfTwo16(c)
+       // cond: isPowerOfTwo(c)
        // result: (Lsh16x64 <t> n (Const64 <typ.UInt64> [log16(c)]))
        for {
                t := v.Type
@@ -17453,7 +17453,7 @@ func rewriteValuegeneric_OpMul16(v *Value) bool {
                                continue
                        }
                        c := auxIntToInt16(v_1.AuxInt)
-                       if !(isPowerOfTwo16(c)) {
+                       if !(isPowerOfTwo(c)) {
                                continue
                        }
                        v.reset(OpLsh16x64)
@@ -17466,7 +17466,7 @@ func rewriteValuegeneric_OpMul16(v *Value) bool {
                break
        }
        // match: (Mul16 <t> n (Const16 [c]))
-       // cond: t.IsSigned() && isPowerOfTwo16(-c)
+       // cond: t.IsSigned() && isPowerOfTwo(-c)
        // result: (Neg16 (Lsh16x64 <t> n (Const64 <typ.UInt64> [log16(-c)])))
        for {
                t := v.Type
@@ -17476,7 +17476,7 @@ func rewriteValuegeneric_OpMul16(v *Value) bool {
                                continue
                        }
                        c := auxIntToInt16(v_1.AuxInt)
-                       if !(t.IsSigned() && isPowerOfTwo16(-c)) {
+                       if !(t.IsSigned() && isPowerOfTwo(-c)) {
                                continue
                        }
                        v.reset(OpNeg16)
@@ -17616,7 +17616,7 @@ func rewriteValuegeneric_OpMul32(v *Value) bool {
                break
        }
        // match: (Mul32 <t> n (Const32 [c]))
-       // cond: isPowerOfTwo32(c)
+       // cond: isPowerOfTwo(c)
        // result: (Lsh32x64 <t> n (Const64 <typ.UInt64> [log32(c)]))
        for {
                t := v.Type
@@ -17626,7 +17626,7 @@ func rewriteValuegeneric_OpMul32(v *Value) bool {
                                continue
                        }
                        c := auxIntToInt32(v_1.AuxInt)
-                       if !(isPowerOfTwo32(c)) {
+                       if !(isPowerOfTwo(c)) {
                                continue
                        }
                        v.reset(OpLsh32x64)
@@ -17639,7 +17639,7 @@ func rewriteValuegeneric_OpMul32(v *Value) bool {
                break
        }
        // match: (Mul32 <t> n (Const32 [c]))
-       // cond: t.IsSigned() && isPowerOfTwo32(-c)
+       // cond: t.IsSigned() && isPowerOfTwo(-c)
        // result: (Neg32 (Lsh32x64 <t> n (Const64 <typ.UInt64> [log32(-c)])))
        for {
                t := v.Type
@@ -17649,7 +17649,7 @@ func rewriteValuegeneric_OpMul32(v *Value) bool {
                                continue
                        }
                        c := auxIntToInt32(v_1.AuxInt)
-                       if !(t.IsSigned() && isPowerOfTwo32(-c)) {
+                       if !(t.IsSigned() && isPowerOfTwo(-c)) {
                                continue
                        }
                        v.reset(OpNeg32)
@@ -17891,7 +17891,7 @@ func rewriteValuegeneric_OpMul64(v *Value) bool {
                break
        }
        // match: (Mul64 <t> n (Const64 [c]))
-       // cond: isPowerOfTwo64(c)
+       // cond: isPowerOfTwo(c)
        // result: (Lsh64x64 <t> n (Const64 <typ.UInt64> [log64(c)]))
        for {
                t := v.Type
@@ -17901,7 +17901,7 @@ func rewriteValuegeneric_OpMul64(v *Value) bool {
                                continue
                        }
                        c := auxIntToInt64(v_1.AuxInt)
-                       if !(isPowerOfTwo64(c)) {
+                       if !(isPowerOfTwo(c)) {
                                continue
                        }
                        v.reset(OpLsh64x64)
@@ -17914,7 +17914,7 @@ func rewriteValuegeneric_OpMul64(v *Value) bool {
                break
        }
        // match: (Mul64 <t> n (Const64 [c]))
-       // cond: t.IsSigned() && isPowerOfTwo64(-c)
+       // cond: t.IsSigned() && isPowerOfTwo(-c)
        // result: (Neg64 (Lsh64x64 <t> n (Const64 <typ.UInt64> [log64(-c)])))
        for {
                t := v.Type
@@ -17924,7 +17924,7 @@ func rewriteValuegeneric_OpMul64(v *Value) bool {
                                continue
                        }
                        c := auxIntToInt64(v_1.AuxInt)
-                       if !(t.IsSigned() && isPowerOfTwo64(-c)) {
+                       if !(t.IsSigned() && isPowerOfTwo(-c)) {
                                continue
                        }
                        v.reset(OpNeg64)
@@ -18166,7 +18166,7 @@ func rewriteValuegeneric_OpMul8(v *Value) bool {
                break
        }
        // match: (Mul8 <t> n (Const8 [c]))
-       // cond: isPowerOfTwo8(c)
+       // cond: isPowerOfTwo(c)
        // result: (Lsh8x64 <t> n (Const64 <typ.UInt64> [log8(c)]))
        for {
                t := v.Type
@@ -18176,7 +18176,7 @@ func rewriteValuegeneric_OpMul8(v *Value) bool {
                                continue
                        }
                        c := auxIntToInt8(v_1.AuxInt)
-                       if !(isPowerOfTwo8(c)) {
+                       if !(isPowerOfTwo(c)) {
                                continue
                        }
                        v.reset(OpLsh8x64)
@@ -18189,7 +18189,7 @@ func rewriteValuegeneric_OpMul8(v *Value) bool {
                break
        }
        // match: (Mul8 <t> n (Const8 [c]))
-       // cond: t.IsSigned() && isPowerOfTwo8(-c)
+       // cond: t.IsSigned() && isPowerOfTwo(-c)
        // result: (Neg8 (Lsh8x64 <t> n (Const64 <typ.UInt64> [log8(-c)])))
        for {
                t := v.Type
@@ -18199,7 +18199,7 @@ func rewriteValuegeneric_OpMul8(v *Value) bool {
                                continue
                        }
                        c := auxIntToInt8(v_1.AuxInt)
-                       if !(t.IsSigned() && isPowerOfTwo8(-c)) {
+                       if !(t.IsSigned() && isPowerOfTwo(-c)) {
                                continue
                        }
                        v.reset(OpNeg8)