(SUBconst [c] x) && !isARMImmRot(uint32(c)) && isARMImmRot(uint32(-c)) -> (ADDconst [int64(int32(-c))] x)
(ANDconst [c] x) && !isARMImmRot(uint32(c)) && isARMImmRot(^uint32(c)) -> (BICconst [int64(int32(^uint32(c)))] x)
(BICconst [c] x) && !isARMImmRot(uint32(c)) && isARMImmRot(^uint32(c)) -> (ANDconst [int64(int32(^uint32(c)))] x)
+(ADDconst [c] x) && objabi.GOARM==7 && !isARMImmRot(uint32(c)) && uint32(c)>0xffff && uint32(-c)<=0xffff -> (SUBconst [int64(int32(-c))] x)
+(SUBconst [c] x) && objabi.GOARM==7 && !isARMImmRot(uint32(c)) && uint32(c)>0xffff && uint32(-c)<=0xffff -> (ANDconst [int64(int32(-c))] x)
+(ANDconst [c] x) && objabi.GOARM==7 && !isARMImmRot(uint32(c)) && uint32(c)>0xffff && ^uint32(c)<=0xffff -> (BICconst [int64(int32(^uint32(c)))] x)
+(BICconst [c] x) && objabi.GOARM==7 && !isARMImmRot(uint32(c)) && uint32(c)>0xffff && ^uint32(c)<=0xffff -> (ANDconst [int64(int32(^uint32(c)))] x)
(ADDconst [c] (MOVWconst [d])) -> (MOVWconst [int64(int32(c+d))])
(ADDconst [c] (ADDconst [d] x)) -> (ADDconst [int64(int32(c+d))] x)
(ADDconst [c] (SUBconst [d] x)) -> (ADDconst [int64(int32(c-d))] x)
v.AddArg(x)
return true
}
+ // match: (ADDconst [c] x)
+ // cond: objabi.GOARM==7 && !isARMImmRot(uint32(c)) && uint32(c)>0xffff && uint32(-c)<=0xffff
+ // result: (SUBconst [int64(int32(-c))] x)
+ for {
+ c := v.AuxInt
+ x := v.Args[0]
+ if !(objabi.GOARM == 7 && !isARMImmRot(uint32(c)) && uint32(c) > 0xffff && uint32(-c) <= 0xffff) {
+ break
+ }
+ v.reset(OpARMSUBconst)
+ v.AuxInt = int64(int32(-c))
+ v.AddArg(x)
+ return true
+ }
// match: (ADDconst [c] (MOVWconst [d]))
// cond:
// result: (MOVWconst [int64(int32(c+d))])
v.AddArg(x)
return true
}
+ // match: (ANDconst [c] x)
+ // cond: objabi.GOARM==7 && !isARMImmRot(uint32(c)) && uint32(c)>0xffff && ^uint32(c)<=0xffff
+ // result: (BICconst [int64(int32(^uint32(c)))] x)
+ for {
+ c := v.AuxInt
+ x := v.Args[0]
+ if !(objabi.GOARM == 7 && !isARMImmRot(uint32(c)) && uint32(c) > 0xffff && ^uint32(c) <= 0xffff) {
+ break
+ }
+ v.reset(OpARMBICconst)
+ v.AuxInt = int64(int32(^uint32(c)))
+ v.AddArg(x)
+ return true
+ }
// match: (ANDconst [c] (MOVWconst [d]))
// cond:
// result: (MOVWconst [c&d])
v.AddArg(x)
return true
}
+ // match: (BICconst [c] x)
+ // cond: objabi.GOARM==7 && !isARMImmRot(uint32(c)) && uint32(c)>0xffff && ^uint32(c)<=0xffff
+ // result: (ANDconst [int64(int32(^uint32(c)))] x)
+ for {
+ c := v.AuxInt
+ x := v.Args[0]
+ if !(objabi.GOARM == 7 && !isARMImmRot(uint32(c)) && uint32(c) > 0xffff && ^uint32(c) <= 0xffff) {
+ break
+ }
+ v.reset(OpARMANDconst)
+ v.AuxInt = int64(int32(^uint32(c)))
+ v.AddArg(x)
+ return true
+ }
// match: (BICconst [c] (MOVWconst [d]))
// cond:
// result: (MOVWconst [d&^c])
v.AddArg(x)
return true
}
+ // match: (SUBconst [c] x)
+ // cond: objabi.GOARM==7 && !isARMImmRot(uint32(c)) && uint32(c)>0xffff && uint32(-c)<=0xffff
+ // result: (ANDconst [int64(int32(-c))] x)
+ for {
+ c := v.AuxInt
+ x := v.Args[0]
+ if !(objabi.GOARM == 7 && !isARMImmRot(uint32(c)) && uint32(c) > 0xffff && uint32(-c) <= 0xffff) {
+ break
+ }
+ v.reset(OpARMANDconst)
+ v.AuxInt = int64(int32(-c))
+ v.AddArg(x)
+ return true
+ }
// match: (SUBconst [c] (MOVWconst [d]))
// cond:
// result: (MOVWconst [int64(int32(d-c))])