in src/cmd/compile/internal/ssa/rewriteARM64.go [27315:30271]
func rewriteBlockARM64(b *Block) bool {
switch b.Kind {
case BlockARM64EQ:
// match: (EQ (CMPWconst [0] x:(ANDconst [c] y)) yes no)
// cond: x.Uses == 1
// result: (EQ (TSTWconst [int32(c)] y) yes no)
for b.Controls[0].Op == OpARM64CMPWconst {
v_0 := b.Controls[0]
if auxIntToInt32(v_0.AuxInt) != 0 {
break
}
x := v_0.Args[0]
if x.Op != OpARM64ANDconst {
break
}
c := auxIntToInt64(x.AuxInt)
y := x.Args[0]
if !(x.Uses == 1) {
break
}
v0 := b.NewValue0(v_0.Pos, OpARM64TSTWconst, types.TypeFlags)
v0.AuxInt = int32ToAuxInt(int32(c))
v0.AddArg(y)
b.resetWithControl(BlockARM64EQ, v0)
return true
}
// match: (EQ (CMPconst [0] z:(AND x y)) yes no)
// cond: z.Uses == 1
// result: (EQ (TST x y) yes no)
for b.Controls[0].Op == OpARM64CMPconst {
v_0 := b.Controls[0]
if auxIntToInt64(v_0.AuxInt) != 0 {
break
}
z := v_0.Args[0]
if z.Op != OpARM64AND {
break
}
_ = z.Args[1]
z_0 := z.Args[0]
z_1 := z.Args[1]
for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
x := z_0
y := z_1
if !(z.Uses == 1) {
continue
}
v0 := b.NewValue0(v_0.Pos, OpARM64TST, types.TypeFlags)
v0.AddArg2(x, y)
b.resetWithControl(BlockARM64EQ, v0)
return true
}
break
}
// match: (EQ (CMPWconst [0] z:(AND x y)) yes no)
// cond: z.Uses == 1
// result: (EQ (TSTW x y) yes no)
for b.Controls[0].Op == OpARM64CMPWconst {
v_0 := b.Controls[0]
if auxIntToInt32(v_0.AuxInt) != 0 {
break
}
z := v_0.Args[0]
if z.Op != OpARM64AND {
break
}
_ = z.Args[1]
z_0 := z.Args[0]
z_1 := z.Args[1]
for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
x := z_0
y := z_1
if !(z.Uses == 1) {
continue
}
v0 := b.NewValue0(v_0.Pos, OpARM64TSTW, types.TypeFlags)
v0.AddArg2(x, y)
b.resetWithControl(BlockARM64EQ, v0)
return true
}
break
}
// match: (EQ (CMPconst [0] x:(ANDconst [c] y)) yes no)
// cond: x.Uses == 1
// result: (EQ (TSTconst [c] y) yes no)
for b.Controls[0].Op == OpARM64CMPconst {
v_0 := b.Controls[0]
if auxIntToInt64(v_0.AuxInt) != 0 {
break
}
x := v_0.Args[0]
if x.Op != OpARM64ANDconst {
break
}
c := auxIntToInt64(x.AuxInt)
y := x.Args[0]
if !(x.Uses == 1) {
break
}
v0 := b.NewValue0(v_0.Pos, OpARM64TSTconst, types.TypeFlags)
v0.AuxInt = int64ToAuxInt(c)
v0.AddArg(y)
b.resetWithControl(BlockARM64EQ, v0)
return true
}
// match: (EQ (CMPconst [0] x:(ADDconst [c] y)) yes no)
// cond: x.Uses == 1
// result: (EQ (CMNconst [c] y) yes no)
for b.Controls[0].Op == OpARM64CMPconst {
v_0 := b.Controls[0]
if auxIntToInt64(v_0.AuxInt) != 0 {
break
}
x := v_0.Args[0]
if x.Op != OpARM64ADDconst {
break
}
c := auxIntToInt64(x.AuxInt)
y := x.Args[0]
if !(x.Uses == 1) {
break
}
v0 := b.NewValue0(v_0.Pos, OpARM64CMNconst, types.TypeFlags)
v0.AuxInt = int64ToAuxInt(c)
v0.AddArg(y)
b.resetWithControl(BlockARM64EQ, v0)
return true
}
// match: (EQ (CMPWconst [0] x:(ADDconst [c] y)) yes no)
// cond: x.Uses == 1
// result: (EQ (CMNWconst [int32(c)] y) yes no)
for b.Controls[0].Op == OpARM64CMPWconst {
v_0 := b.Controls[0]
if auxIntToInt32(v_0.AuxInt) != 0 {
break
}
x := v_0.Args[0]
if x.Op != OpARM64ADDconst {
break
}
c := auxIntToInt64(x.AuxInt)
y := x.Args[0]
if !(x.Uses == 1) {
break
}
v0 := b.NewValue0(v_0.Pos, OpARM64CMNWconst, types.TypeFlags)
v0.AuxInt = int32ToAuxInt(int32(c))
v0.AddArg(y)
b.resetWithControl(BlockARM64EQ, v0)
return true
}
// match: (EQ (CMPconst [0] z:(ADD x y)) yes no)
// cond: z.Uses == 1
// result: (EQ (CMN x y) yes no)
for b.Controls[0].Op == OpARM64CMPconst {
v_0 := b.Controls[0]
if auxIntToInt64(v_0.AuxInt) != 0 {
break
}
z := v_0.Args[0]
if z.Op != OpARM64ADD {
break
}
_ = z.Args[1]
z_0 := z.Args[0]
z_1 := z.Args[1]
for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
x := z_0
y := z_1
if !(z.Uses == 1) {
continue
}
v0 := b.NewValue0(v_0.Pos, OpARM64CMN, types.TypeFlags)
v0.AddArg2(x, y)
b.resetWithControl(BlockARM64EQ, v0)
return true
}
break
}
// match: (EQ (CMPWconst [0] z:(ADD x y)) yes no)
// cond: z.Uses == 1
// result: (EQ (CMNW x y) yes no)
for b.Controls[0].Op == OpARM64CMPWconst {
v_0 := b.Controls[0]
if auxIntToInt32(v_0.AuxInt) != 0 {
break
}
z := v_0.Args[0]
if z.Op != OpARM64ADD {
break
}
_ = z.Args[1]
z_0 := z.Args[0]
z_1 := z.Args[1]
for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
x := z_0
y := z_1
if !(z.Uses == 1) {
continue
}
v0 := b.NewValue0(v_0.Pos, OpARM64CMNW, types.TypeFlags)
v0.AddArg2(x, y)
b.resetWithControl(BlockARM64EQ, v0)
return true
}
break
}
// match: (EQ (CMP x z:(NEG y)) yes no)
// cond: z.Uses == 1
// result: (EQ (CMN x y) yes no)
for b.Controls[0].Op == OpARM64CMP {
v_0 := b.Controls[0]
_ = v_0.Args[1]
x := v_0.Args[0]
z := v_0.Args[1]
if z.Op != OpARM64NEG {
break
}
y := z.Args[0]
if !(z.Uses == 1) {
break
}
v0 := b.NewValue0(v_0.Pos, OpARM64CMN, types.TypeFlags)
v0.AddArg2(x, y)
b.resetWithControl(BlockARM64EQ, v0)
return true
}
// match: (EQ (CMPW x z:(NEG y)) yes no)
// cond: z.Uses == 1
// result: (EQ (CMNW x y) yes no)
for b.Controls[0].Op == OpARM64CMPW {
v_0 := b.Controls[0]
_ = v_0.Args[1]
x := v_0.Args[0]
z := v_0.Args[1]
if z.Op != OpARM64NEG {
break
}
y := z.Args[0]
if !(z.Uses == 1) {
break
}
v0 := b.NewValue0(v_0.Pos, OpARM64CMNW, types.TypeFlags)
v0.AddArg2(x, y)
b.resetWithControl(BlockARM64EQ, v0)
return true
}
// match: (EQ (CMPconst [0] x) yes no)
// result: (Z x yes no)
for b.Controls[0].Op == OpARM64CMPconst {
v_0 := b.Controls[0]
if auxIntToInt64(v_0.AuxInt) != 0 {
break
}
x := v_0.Args[0]
b.resetWithControl(BlockARM64Z, x)
return true
}
// match: (EQ (CMPWconst [0] x) yes no)
// result: (ZW x yes no)
for b.Controls[0].Op == OpARM64CMPWconst {
v_0 := b.Controls[0]
if auxIntToInt32(v_0.AuxInt) != 0 {
break
}
x := v_0.Args[0]
b.resetWithControl(BlockARM64ZW, x)
return true
}
// match: (EQ (CMPconst [0] z:(MADD a x y)) yes no)
// cond: z.Uses==1
// result: (EQ (CMN a (MUL <x.Type> x y)) yes no)
for b.Controls[0].Op == OpARM64CMPconst {
v_0 := b.Controls[0]
if auxIntToInt64(v_0.AuxInt) != 0 {
break
}
z := v_0.Args[0]
if z.Op != OpARM64MADD {
break
}
y := z.Args[2]
a := z.Args[0]
x := z.Args[1]
if !(z.Uses == 1) {
break
}
v0 := b.NewValue0(v_0.Pos, OpARM64CMN, types.TypeFlags)
v1 := b.NewValue0(v_0.Pos, OpARM64MUL, x.Type)
v1.AddArg2(x, y)
v0.AddArg2(a, v1)
b.resetWithControl(BlockARM64EQ, v0)
return true
}
// match: (EQ (CMPconst [0] z:(MSUB a x y)) yes no)
// cond: z.Uses==1
// result: (EQ (CMP a (MUL <x.Type> x y)) yes no)
for b.Controls[0].Op == OpARM64CMPconst {
v_0 := b.Controls[0]
if auxIntToInt64(v_0.AuxInt) != 0 {
break
}
z := v_0.Args[0]
if z.Op != OpARM64MSUB {
break
}
y := z.Args[2]
a := z.Args[0]
x := z.Args[1]
if !(z.Uses == 1) {
break
}
v0 := b.NewValue0(v_0.Pos, OpARM64CMP, types.TypeFlags)
v1 := b.NewValue0(v_0.Pos, OpARM64MUL, x.Type)
v1.AddArg2(x, y)
v0.AddArg2(a, v1)
b.resetWithControl(BlockARM64EQ, v0)
return true
}
// match: (EQ (CMPWconst [0] z:(MADDW a x y)) yes no)
// cond: z.Uses==1
// result: (EQ (CMNW a (MULW <x.Type> x y)) yes no)
for b.Controls[0].Op == OpARM64CMPWconst {
v_0 := b.Controls[0]
if auxIntToInt32(v_0.AuxInt) != 0 {
break
}
z := v_0.Args[0]
if z.Op != OpARM64MADDW {
break
}
y := z.Args[2]
a := z.Args[0]
x := z.Args[1]
if !(z.Uses == 1) {
break
}
v0 := b.NewValue0(v_0.Pos, OpARM64CMNW, types.TypeFlags)
v1 := b.NewValue0(v_0.Pos, OpARM64MULW, x.Type)
v1.AddArg2(x, y)
v0.AddArg2(a, v1)
b.resetWithControl(BlockARM64EQ, v0)
return true
}
// match: (EQ (CMPWconst [0] z:(MSUBW a x y)) yes no)
// cond: z.Uses==1
// result: (EQ (CMPW a (MULW <x.Type> x y)) yes no)
for b.Controls[0].Op == OpARM64CMPWconst {
v_0 := b.Controls[0]
if auxIntToInt32(v_0.AuxInt) != 0 {
break
}
z := v_0.Args[0]
if z.Op != OpARM64MSUBW {
break
}
y := z.Args[2]
a := z.Args[0]
x := z.Args[1]
if !(z.Uses == 1) {
break
}
v0 := b.NewValue0(v_0.Pos, OpARM64CMPW, types.TypeFlags)
v1 := b.NewValue0(v_0.Pos, OpARM64MULW, x.Type)
v1.AddArg2(x, y)
v0.AddArg2(a, v1)
b.resetWithControl(BlockARM64EQ, v0)
return true
}
// match: (EQ (TSTconst [c] x) yes no)
// cond: oneBit(c)
// result: (TBZ [int64(ntz64(c))] x yes no)
for b.Controls[0].Op == OpARM64TSTconst {
v_0 := b.Controls[0]
c := auxIntToInt64(v_0.AuxInt)
x := v_0.Args[0]
if !(oneBit(c)) {
break
}
b.resetWithControl(BlockARM64TBZ, x)
b.AuxInt = int64ToAuxInt(int64(ntz64(c)))
return true
}
// match: (EQ (TSTWconst [c] x) yes no)
// cond: oneBit(int64(uint32(c)))
// result: (TBZ [int64(ntz64(int64(uint32(c))))] x yes no)
for b.Controls[0].Op == OpARM64TSTWconst {
v_0 := b.Controls[0]
c := auxIntToInt32(v_0.AuxInt)
x := v_0.Args[0]
if !(oneBit(int64(uint32(c)))) {
break
}
b.resetWithControl(BlockARM64TBZ, x)
b.AuxInt = int64ToAuxInt(int64(ntz64(int64(uint32(c)))))
return true
}
// match: (EQ (FlagConstant [fc]) yes no)
// cond: fc.eq()
// result: (First yes no)
for b.Controls[0].Op == OpARM64FlagConstant {
v_0 := b.Controls[0]
fc := auxIntToFlagConstant(v_0.AuxInt)
if !(fc.eq()) {
break
}
b.Reset(BlockFirst)
return true
}
// match: (EQ (FlagConstant [fc]) yes no)
// cond: !fc.eq()
// result: (First no yes)
for b.Controls[0].Op == OpARM64FlagConstant {
v_0 := b.Controls[0]
fc := auxIntToFlagConstant(v_0.AuxInt)
if !(!fc.eq()) {
break
}
b.Reset(BlockFirst)
b.swapSuccessors()
return true
}
// match: (EQ (InvertFlags cmp) yes no)
// result: (EQ cmp yes no)
for b.Controls[0].Op == OpARM64InvertFlags {
v_0 := b.Controls[0]
cmp := v_0.Args[0]
b.resetWithControl(BlockARM64EQ, cmp)
return true
}
case BlockARM64FGE:
// match: (FGE (InvertFlags cmp) yes no)
// result: (FLE cmp yes no)
for b.Controls[0].Op == OpARM64InvertFlags {
v_0 := b.Controls[0]
cmp := v_0.Args[0]
b.resetWithControl(BlockARM64FLE, cmp)
return true
}
case BlockARM64FGT:
// match: (FGT (InvertFlags cmp) yes no)
// result: (FLT cmp yes no)
for b.Controls[0].Op == OpARM64InvertFlags {
v_0 := b.Controls[0]
cmp := v_0.Args[0]
b.resetWithControl(BlockARM64FLT, cmp)
return true
}
case BlockARM64FLE:
// match: (FLE (InvertFlags cmp) yes no)
// result: (FGE cmp yes no)
for b.Controls[0].Op == OpARM64InvertFlags {
v_0 := b.Controls[0]
cmp := v_0.Args[0]
b.resetWithControl(BlockARM64FGE, cmp)
return true
}
case BlockARM64FLT:
// match: (FLT (InvertFlags cmp) yes no)
// result: (FGT cmp yes no)
for b.Controls[0].Op == OpARM64InvertFlags {
v_0 := b.Controls[0]
cmp := v_0.Args[0]
b.resetWithControl(BlockARM64FGT, cmp)
return true
}
case BlockARM64GE:
// match: (GE (CMPWconst [0] x:(ANDconst [c] y)) yes no)
// cond: x.Uses == 1
// result: (GE (TSTWconst [int32(c)] y) yes no)
for b.Controls[0].Op == OpARM64CMPWconst {
v_0 := b.Controls[0]
if auxIntToInt32(v_0.AuxInt) != 0 {
break
}
x := v_0.Args[0]
if x.Op != OpARM64ANDconst {
break
}
c := auxIntToInt64(x.AuxInt)
y := x.Args[0]
if !(x.Uses == 1) {
break
}
v0 := b.NewValue0(v_0.Pos, OpARM64TSTWconst, types.TypeFlags)
v0.AuxInt = int32ToAuxInt(int32(c))
v0.AddArg(y)
b.resetWithControl(BlockARM64GE, v0)
return true
}
// match: (GE (CMPconst [0] z:(AND x y)) yes no)
// cond: z.Uses == 1
// result: (GE (TST x y) yes no)
for b.Controls[0].Op == OpARM64CMPconst {
v_0 := b.Controls[0]
if auxIntToInt64(v_0.AuxInt) != 0 {
break
}
z := v_0.Args[0]
if z.Op != OpARM64AND {
break
}
_ = z.Args[1]
z_0 := z.Args[0]
z_1 := z.Args[1]
for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
x := z_0
y := z_1
if !(z.Uses == 1) {
continue
}
v0 := b.NewValue0(v_0.Pos, OpARM64TST, types.TypeFlags)
v0.AddArg2(x, y)
b.resetWithControl(BlockARM64GE, v0)
return true
}
break
}
// match: (GE (CMPWconst [0] z:(AND x y)) yes no)
// cond: z.Uses == 1
// result: (GE (TSTW x y) yes no)
for b.Controls[0].Op == OpARM64CMPWconst {
v_0 := b.Controls[0]
if auxIntToInt32(v_0.AuxInt) != 0 {
break
}
z := v_0.Args[0]
if z.Op != OpARM64AND {
break
}
_ = z.Args[1]
z_0 := z.Args[0]
z_1 := z.Args[1]
for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
x := z_0
y := z_1
if !(z.Uses == 1) {
continue
}
v0 := b.NewValue0(v_0.Pos, OpARM64TSTW, types.TypeFlags)
v0.AddArg2(x, y)
b.resetWithControl(BlockARM64GE, v0)
return true
}
break
}
// match: (GE (CMPconst [0] x:(ANDconst [c] y)) yes no)
// cond: x.Uses == 1
// result: (GE (TSTconst [c] y) yes no)
for b.Controls[0].Op == OpARM64CMPconst {
v_0 := b.Controls[0]
if auxIntToInt64(v_0.AuxInt) != 0 {
break
}
x := v_0.Args[0]
if x.Op != OpARM64ANDconst {
break
}
c := auxIntToInt64(x.AuxInt)
y := x.Args[0]
if !(x.Uses == 1) {
break
}
v0 := b.NewValue0(v_0.Pos, OpARM64TSTconst, types.TypeFlags)
v0.AuxInt = int64ToAuxInt(c)
v0.AddArg(y)
b.resetWithControl(BlockARM64GE, v0)
return true
}
// match: (GE (CMPconst [0] x:(ADDconst [c] y)) yes no)
// cond: x.Uses == 1
// result: (GEnoov (CMNconst [c] y) yes no)
for b.Controls[0].Op == OpARM64CMPconst {
v_0 := b.Controls[0]
if auxIntToInt64(v_0.AuxInt) != 0 {
break
}
x := v_0.Args[0]
if x.Op != OpARM64ADDconst {
break
}
c := auxIntToInt64(x.AuxInt)
y := x.Args[0]
if !(x.Uses == 1) {
break
}
v0 := b.NewValue0(v_0.Pos, OpARM64CMNconst, types.TypeFlags)
v0.AuxInt = int64ToAuxInt(c)
v0.AddArg(y)
b.resetWithControl(BlockARM64GEnoov, v0)
return true
}
// match: (GE (CMPWconst [0] x:(ADDconst [c] y)) yes no)
// cond: x.Uses == 1
// result: (GEnoov (CMNWconst [int32(c)] y) yes no)
for b.Controls[0].Op == OpARM64CMPWconst {
v_0 := b.Controls[0]
if auxIntToInt32(v_0.AuxInt) != 0 {
break
}
x := v_0.Args[0]
if x.Op != OpARM64ADDconst {
break
}
c := auxIntToInt64(x.AuxInt)
y := x.Args[0]
if !(x.Uses == 1) {
break
}
v0 := b.NewValue0(v_0.Pos, OpARM64CMNWconst, types.TypeFlags)
v0.AuxInt = int32ToAuxInt(int32(c))
v0.AddArg(y)
b.resetWithControl(BlockARM64GEnoov, v0)
return true
}
// match: (GE (CMPconst [0] z:(ADD x y)) yes no)
// cond: z.Uses == 1
// result: (GEnoov (CMN x y) yes no)
for b.Controls[0].Op == OpARM64CMPconst {
v_0 := b.Controls[0]
if auxIntToInt64(v_0.AuxInt) != 0 {
break
}
z := v_0.Args[0]
if z.Op != OpARM64ADD {
break
}
_ = z.Args[1]
z_0 := z.Args[0]
z_1 := z.Args[1]
for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
x := z_0
y := z_1
if !(z.Uses == 1) {
continue
}
v0 := b.NewValue0(v_0.Pos, OpARM64CMN, types.TypeFlags)
v0.AddArg2(x, y)
b.resetWithControl(BlockARM64GEnoov, v0)
return true
}
break
}
// match: (GE (CMPWconst [0] z:(ADD x y)) yes no)
// cond: z.Uses == 1
// result: (GEnoov (CMNW x y) yes no)
for b.Controls[0].Op == OpARM64CMPWconst {
v_0 := b.Controls[0]
if auxIntToInt32(v_0.AuxInt) != 0 {
break
}
z := v_0.Args[0]
if z.Op != OpARM64ADD {
break
}
_ = z.Args[1]
z_0 := z.Args[0]
z_1 := z.Args[1]
for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
x := z_0
y := z_1
if !(z.Uses == 1) {
continue
}
v0 := b.NewValue0(v_0.Pos, OpARM64CMNW, types.TypeFlags)
v0.AddArg2(x, y)
b.resetWithControl(BlockARM64GEnoov, v0)
return true
}
break
}
// match: (GE (CMPconst [0] z:(MADD a x y)) yes no)
// cond: z.Uses==1
// result: (GEnoov (CMN a (MUL <x.Type> x y)) yes no)
for b.Controls[0].Op == OpARM64CMPconst {
v_0 := b.Controls[0]
if auxIntToInt64(v_0.AuxInt) != 0 {
break
}
z := v_0.Args[0]
if z.Op != OpARM64MADD {
break
}
y := z.Args[2]
a := z.Args[0]
x := z.Args[1]
if !(z.Uses == 1) {
break
}
v0 := b.NewValue0(v_0.Pos, OpARM64CMN, types.TypeFlags)
v1 := b.NewValue0(v_0.Pos, OpARM64MUL, x.Type)
v1.AddArg2(x, y)
v0.AddArg2(a, v1)
b.resetWithControl(BlockARM64GEnoov, v0)
return true
}
// match: (GE (CMPconst [0] z:(MSUB a x y)) yes no)
// cond: z.Uses==1
// result: (GEnoov (CMP a (MUL <x.Type> x y)) yes no)
for b.Controls[0].Op == OpARM64CMPconst {
v_0 := b.Controls[0]
if auxIntToInt64(v_0.AuxInt) != 0 {
break
}
z := v_0.Args[0]
if z.Op != OpARM64MSUB {
break
}
y := z.Args[2]
a := z.Args[0]
x := z.Args[1]
if !(z.Uses == 1) {
break
}
v0 := b.NewValue0(v_0.Pos, OpARM64CMP, types.TypeFlags)
v1 := b.NewValue0(v_0.Pos, OpARM64MUL, x.Type)
v1.AddArg2(x, y)
v0.AddArg2(a, v1)
b.resetWithControl(BlockARM64GEnoov, v0)
return true
}
// match: (GE (CMPWconst [0] z:(MADDW a x y)) yes no)
// cond: z.Uses==1
// result: (GEnoov (CMNW a (MULW <x.Type> x y)) yes no)
for b.Controls[0].Op == OpARM64CMPWconst {
v_0 := b.Controls[0]
if auxIntToInt32(v_0.AuxInt) != 0 {
break
}
z := v_0.Args[0]
if z.Op != OpARM64MADDW {
break
}
y := z.Args[2]
a := z.Args[0]
x := z.Args[1]
if !(z.Uses == 1) {
break
}
v0 := b.NewValue0(v_0.Pos, OpARM64CMNW, types.TypeFlags)
v1 := b.NewValue0(v_0.Pos, OpARM64MULW, x.Type)
v1.AddArg2(x, y)
v0.AddArg2(a, v1)
b.resetWithControl(BlockARM64GEnoov, v0)
return true
}
// match: (GE (CMPWconst [0] z:(MSUBW a x y)) yes no)
// cond: z.Uses==1
// result: (GEnoov (CMPW a (MULW <x.Type> x y)) yes no)
for b.Controls[0].Op == OpARM64CMPWconst {
v_0 := b.Controls[0]
if auxIntToInt32(v_0.AuxInt) != 0 {
break
}
z := v_0.Args[0]
if z.Op != OpARM64MSUBW {
break
}
y := z.Args[2]
a := z.Args[0]
x := z.Args[1]
if !(z.Uses == 1) {
break
}
v0 := b.NewValue0(v_0.Pos, OpARM64CMPW, types.TypeFlags)
v1 := b.NewValue0(v_0.Pos, OpARM64MULW, x.Type)
v1.AddArg2(x, y)
v0.AddArg2(a, v1)
b.resetWithControl(BlockARM64GEnoov, v0)
return true
}
// match: (GE (CMPWconst [0] x) yes no)
// result: (TBZ [31] x yes no)
for b.Controls[0].Op == OpARM64CMPWconst {
v_0 := b.Controls[0]
if auxIntToInt32(v_0.AuxInt) != 0 {
break
}
x := v_0.Args[0]
b.resetWithControl(BlockARM64TBZ, x)
b.AuxInt = int64ToAuxInt(31)
return true
}
// match: (GE (CMPconst [0] x) yes no)
// result: (TBZ [63] x yes no)
for b.Controls[0].Op == OpARM64CMPconst {
v_0 := b.Controls[0]
if auxIntToInt64(v_0.AuxInt) != 0 {
break
}
x := v_0.Args[0]
b.resetWithControl(BlockARM64TBZ, x)
b.AuxInt = int64ToAuxInt(63)
return true
}
// match: (GE (FlagConstant [fc]) yes no)
// cond: fc.ge()
// result: (First yes no)
for b.Controls[0].Op == OpARM64FlagConstant {
v_0 := b.Controls[0]
fc := auxIntToFlagConstant(v_0.AuxInt)
if !(fc.ge()) {
break
}
b.Reset(BlockFirst)
return true
}
// match: (GE (FlagConstant [fc]) yes no)
// cond: !fc.ge()
// result: (First no yes)
for b.Controls[0].Op == OpARM64FlagConstant {
v_0 := b.Controls[0]
fc := auxIntToFlagConstant(v_0.AuxInt)
if !(!fc.ge()) {
break
}
b.Reset(BlockFirst)
b.swapSuccessors()
return true
}
// match: (GE (InvertFlags cmp) yes no)
// result: (LE cmp yes no)
for b.Controls[0].Op == OpARM64InvertFlags {
v_0 := b.Controls[0]
cmp := v_0.Args[0]
b.resetWithControl(BlockARM64LE, cmp)
return true
}
case BlockARM64GEnoov:
// match: (GEnoov (FlagConstant [fc]) yes no)
// cond: fc.geNoov()
// result: (First yes no)
for b.Controls[0].Op == OpARM64FlagConstant {
v_0 := b.Controls[0]
fc := auxIntToFlagConstant(v_0.AuxInt)
if !(fc.geNoov()) {
break
}
b.Reset(BlockFirst)
return true
}
// match: (GEnoov (FlagConstant [fc]) yes no)
// cond: !fc.geNoov()
// result: (First no yes)
for b.Controls[0].Op == OpARM64FlagConstant {
v_0 := b.Controls[0]
fc := auxIntToFlagConstant(v_0.AuxInt)
if !(!fc.geNoov()) {
break
}
b.Reset(BlockFirst)
b.swapSuccessors()
return true
}
// match: (GEnoov (InvertFlags cmp) yes no)
// result: (LEnoov cmp yes no)
for b.Controls[0].Op == OpARM64InvertFlags {
v_0 := b.Controls[0]
cmp := v_0.Args[0]
b.resetWithControl(BlockARM64LEnoov, cmp)
return true
}
case BlockARM64GT:
// match: (GT (CMPWconst [0] x:(ANDconst [c] y)) yes no)
// cond: x.Uses == 1
// result: (GT (TSTWconst [int32(c)] y) yes no)
for b.Controls[0].Op == OpARM64CMPWconst {
v_0 := b.Controls[0]
if auxIntToInt32(v_0.AuxInt) != 0 {
break
}
x := v_0.Args[0]
if x.Op != OpARM64ANDconst {
break
}
c := auxIntToInt64(x.AuxInt)
y := x.Args[0]
if !(x.Uses == 1) {
break
}
v0 := b.NewValue0(v_0.Pos, OpARM64TSTWconst, types.TypeFlags)
v0.AuxInt = int32ToAuxInt(int32(c))
v0.AddArg(y)
b.resetWithControl(BlockARM64GT, v0)
return true
}
// match: (GT (CMPconst [0] z:(AND x y)) yes no)
// cond: z.Uses == 1
// result: (GT (TST x y) yes no)
for b.Controls[0].Op == OpARM64CMPconst {
v_0 := b.Controls[0]
if auxIntToInt64(v_0.AuxInt) != 0 {
break
}
z := v_0.Args[0]
if z.Op != OpARM64AND {
break
}
_ = z.Args[1]
z_0 := z.Args[0]
z_1 := z.Args[1]
for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
x := z_0
y := z_1
if !(z.Uses == 1) {
continue
}
v0 := b.NewValue0(v_0.Pos, OpARM64TST, types.TypeFlags)
v0.AddArg2(x, y)
b.resetWithControl(BlockARM64GT, v0)
return true
}
break
}
// match: (GT (CMPWconst [0] z:(AND x y)) yes no)
// cond: z.Uses == 1
// result: (GT (TSTW x y) yes no)
for b.Controls[0].Op == OpARM64CMPWconst {
v_0 := b.Controls[0]
if auxIntToInt32(v_0.AuxInt) != 0 {
break
}
z := v_0.Args[0]
if z.Op != OpARM64AND {
break
}
_ = z.Args[1]
z_0 := z.Args[0]
z_1 := z.Args[1]
for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
x := z_0
y := z_1
if !(z.Uses == 1) {
continue
}
v0 := b.NewValue0(v_0.Pos, OpARM64TSTW, types.TypeFlags)
v0.AddArg2(x, y)
b.resetWithControl(BlockARM64GT, v0)
return true
}
break
}
// match: (GT (CMPconst [0] x:(ANDconst [c] y)) yes no)
// cond: x.Uses == 1
// result: (GT (TSTconst [c] y) yes no)
for b.Controls[0].Op == OpARM64CMPconst {
v_0 := b.Controls[0]
if auxIntToInt64(v_0.AuxInt) != 0 {
break
}
x := v_0.Args[0]
if x.Op != OpARM64ANDconst {
break
}
c := auxIntToInt64(x.AuxInt)
y := x.Args[0]
if !(x.Uses == 1) {
break
}
v0 := b.NewValue0(v_0.Pos, OpARM64TSTconst, types.TypeFlags)
v0.AuxInt = int64ToAuxInt(c)
v0.AddArg(y)
b.resetWithControl(BlockARM64GT, v0)
return true
}
// match: (GT (CMPconst [0] x:(ADDconst [c] y)) yes no)
// cond: x.Uses == 1
// result: (GTnoov (CMNconst [c] y) yes no)
for b.Controls[0].Op == OpARM64CMPconst {
v_0 := b.Controls[0]
if auxIntToInt64(v_0.AuxInt) != 0 {
break
}
x := v_0.Args[0]
if x.Op != OpARM64ADDconst {
break
}
c := auxIntToInt64(x.AuxInt)
y := x.Args[0]
if !(x.Uses == 1) {
break
}
v0 := b.NewValue0(v_0.Pos, OpARM64CMNconst, types.TypeFlags)
v0.AuxInt = int64ToAuxInt(c)
v0.AddArg(y)
b.resetWithControl(BlockARM64GTnoov, v0)
return true
}
// match: (GT (CMPWconst [0] x:(ADDconst [c] y)) yes no)
// cond: x.Uses == 1
// result: (GTnoov (CMNWconst [int32(c)] y) yes no)
for b.Controls[0].Op == OpARM64CMPWconst {
v_0 := b.Controls[0]
if auxIntToInt32(v_0.AuxInt) != 0 {
break
}
x := v_0.Args[0]
if x.Op != OpARM64ADDconst {
break
}
c := auxIntToInt64(x.AuxInt)
y := x.Args[0]
if !(x.Uses == 1) {
break
}
v0 := b.NewValue0(v_0.Pos, OpARM64CMNWconst, types.TypeFlags)
v0.AuxInt = int32ToAuxInt(int32(c))
v0.AddArg(y)
b.resetWithControl(BlockARM64GTnoov, v0)
return true
}
// match: (GT (CMPconst [0] z:(ADD x y)) yes no)
// cond: z.Uses == 1
// result: (GTnoov (CMN x y) yes no)
for b.Controls[0].Op == OpARM64CMPconst {
v_0 := b.Controls[0]
if auxIntToInt64(v_0.AuxInt) != 0 {
break
}
z := v_0.Args[0]
if z.Op != OpARM64ADD {
break
}
_ = z.Args[1]
z_0 := z.Args[0]
z_1 := z.Args[1]
for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
x := z_0
y := z_1
if !(z.Uses == 1) {
continue
}
v0 := b.NewValue0(v_0.Pos, OpARM64CMN, types.TypeFlags)
v0.AddArg2(x, y)
b.resetWithControl(BlockARM64GTnoov, v0)
return true
}
break
}
// match: (GT (CMPWconst [0] z:(ADD x y)) yes no)
// cond: z.Uses == 1
// result: (GTnoov (CMNW x y) yes no)
for b.Controls[0].Op == OpARM64CMPWconst {
v_0 := b.Controls[0]
if auxIntToInt32(v_0.AuxInt) != 0 {
break
}
z := v_0.Args[0]
if z.Op != OpARM64ADD {
break
}
_ = z.Args[1]
z_0 := z.Args[0]
z_1 := z.Args[1]
for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
x := z_0
y := z_1
if !(z.Uses == 1) {
continue
}
v0 := b.NewValue0(v_0.Pos, OpARM64CMNW, types.TypeFlags)
v0.AddArg2(x, y)
b.resetWithControl(BlockARM64GTnoov, v0)
return true
}
break
}
// match: (GT (CMPconst [0] z:(MADD a x y)) yes no)
// cond: z.Uses==1
// result: (GTnoov (CMN a (MUL <x.Type> x y)) yes no)
for b.Controls[0].Op == OpARM64CMPconst {
v_0 := b.Controls[0]
if auxIntToInt64(v_0.AuxInt) != 0 {
break
}
z := v_0.Args[0]
if z.Op != OpARM64MADD {
break
}
y := z.Args[2]
a := z.Args[0]
x := z.Args[1]
if !(z.Uses == 1) {
break
}
v0 := b.NewValue0(v_0.Pos, OpARM64CMN, types.TypeFlags)
v1 := b.NewValue0(v_0.Pos, OpARM64MUL, x.Type)
v1.AddArg2(x, y)
v0.AddArg2(a, v1)
b.resetWithControl(BlockARM64GTnoov, v0)
return true
}
// match: (GT (CMPconst [0] z:(MSUB a x y)) yes no)
// cond: z.Uses==1
// result: (GTnoov (CMP a (MUL <x.Type> x y)) yes no)
for b.Controls[0].Op == OpARM64CMPconst {
v_0 := b.Controls[0]
if auxIntToInt64(v_0.AuxInt) != 0 {
break
}
z := v_0.Args[0]
if z.Op != OpARM64MSUB {
break
}
y := z.Args[2]
a := z.Args[0]
x := z.Args[1]
if !(z.Uses == 1) {
break
}
v0 := b.NewValue0(v_0.Pos, OpARM64CMP, types.TypeFlags)
v1 := b.NewValue0(v_0.Pos, OpARM64MUL, x.Type)
v1.AddArg2(x, y)
v0.AddArg2(a, v1)
b.resetWithControl(BlockARM64GTnoov, v0)
return true
}
// match: (GT (CMPWconst [0] z:(MADDW a x y)) yes no)
// cond: z.Uses==1
// result: (GTnoov (CMNW a (MULW <x.Type> x y)) yes no)
for b.Controls[0].Op == OpARM64CMPWconst {
v_0 := b.Controls[0]
if auxIntToInt32(v_0.AuxInt) != 0 {
break
}
z := v_0.Args[0]
if z.Op != OpARM64MADDW {
break
}
y := z.Args[2]
a := z.Args[0]
x := z.Args[1]
if !(z.Uses == 1) {
break
}
v0 := b.NewValue0(v_0.Pos, OpARM64CMNW, types.TypeFlags)
v1 := b.NewValue0(v_0.Pos, OpARM64MULW, x.Type)
v1.AddArg2(x, y)
v0.AddArg2(a, v1)
b.resetWithControl(BlockARM64GTnoov, v0)
return true
}
// match: (GT (CMPWconst [0] z:(MSUBW a x y)) yes no)
// cond: z.Uses==1
// result: (GTnoov (CMPW a (MULW <x.Type> x y)) yes no)
for b.Controls[0].Op == OpARM64CMPWconst {
v_0 := b.Controls[0]
if auxIntToInt32(v_0.AuxInt) != 0 {
break
}
z := v_0.Args[0]
if z.Op != OpARM64MSUBW {
break
}
y := z.Args[2]
a := z.Args[0]
x := z.Args[1]
if !(z.Uses == 1) {
break
}
v0 := b.NewValue0(v_0.Pos, OpARM64CMPW, types.TypeFlags)
v1 := b.NewValue0(v_0.Pos, OpARM64MULW, x.Type)
v1.AddArg2(x, y)
v0.AddArg2(a, v1)
b.resetWithControl(BlockARM64GTnoov, v0)
return true
}
// match: (GT (FlagConstant [fc]) yes no)
// cond: fc.gt()
// result: (First yes no)
for b.Controls[0].Op == OpARM64FlagConstant {
v_0 := b.Controls[0]
fc := auxIntToFlagConstant(v_0.AuxInt)
if !(fc.gt()) {
break
}
b.Reset(BlockFirst)
return true
}
// match: (GT (FlagConstant [fc]) yes no)
// cond: !fc.gt()
// result: (First no yes)
for b.Controls[0].Op == OpARM64FlagConstant {
v_0 := b.Controls[0]
fc := auxIntToFlagConstant(v_0.AuxInt)
if !(!fc.gt()) {
break
}
b.Reset(BlockFirst)
b.swapSuccessors()
return true
}
// match: (GT (InvertFlags cmp) yes no)
// result: (LT cmp yes no)
for b.Controls[0].Op == OpARM64InvertFlags {
v_0 := b.Controls[0]
cmp := v_0.Args[0]
b.resetWithControl(BlockARM64LT, cmp)
return true
}
case BlockARM64GTnoov:
// match: (GTnoov (FlagConstant [fc]) yes no)
// cond: fc.gtNoov()
// result: (First yes no)
for b.Controls[0].Op == OpARM64FlagConstant {
v_0 := b.Controls[0]
fc := auxIntToFlagConstant(v_0.AuxInt)
if !(fc.gtNoov()) {
break
}
b.Reset(BlockFirst)
return true
}
// match: (GTnoov (FlagConstant [fc]) yes no)
// cond: !fc.gtNoov()
// result: (First no yes)
for b.Controls[0].Op == OpARM64FlagConstant {
v_0 := b.Controls[0]
fc := auxIntToFlagConstant(v_0.AuxInt)
if !(!fc.gtNoov()) {
break
}
b.Reset(BlockFirst)
b.swapSuccessors()
return true
}
// match: (GTnoov (InvertFlags cmp) yes no)
// result: (LTnoov cmp yes no)
for b.Controls[0].Op == OpARM64InvertFlags {
v_0 := b.Controls[0]
cmp := v_0.Args[0]
b.resetWithControl(BlockARM64LTnoov, cmp)
return true
}
case BlockIf:
// match: (If (Equal cc) yes no)
// result: (EQ cc yes no)
for b.Controls[0].Op == OpARM64Equal {
v_0 := b.Controls[0]
cc := v_0.Args[0]
b.resetWithControl(BlockARM64EQ, cc)
return true
}
// match: (If (NotEqual cc) yes no)
// result: (NE cc yes no)
for b.Controls[0].Op == OpARM64NotEqual {
v_0 := b.Controls[0]
cc := v_0.Args[0]
b.resetWithControl(BlockARM64NE, cc)
return true
}
// match: (If (LessThan cc) yes no)
// result: (LT cc yes no)
for b.Controls[0].Op == OpARM64LessThan {
v_0 := b.Controls[0]
cc := v_0.Args[0]
b.resetWithControl(BlockARM64LT, cc)
return true
}
// match: (If (LessThanU cc) yes no)
// result: (ULT cc yes no)
for b.Controls[0].Op == OpARM64LessThanU {
v_0 := b.Controls[0]
cc := v_0.Args[0]
b.resetWithControl(BlockARM64ULT, cc)
return true
}
// match: (If (LessEqual cc) yes no)
// result: (LE cc yes no)
for b.Controls[0].Op == OpARM64LessEqual {
v_0 := b.Controls[0]
cc := v_0.Args[0]
b.resetWithControl(BlockARM64LE, cc)
return true
}
// match: (If (LessEqualU cc) yes no)
// result: (ULE cc yes no)
for b.Controls[0].Op == OpARM64LessEqualU {
v_0 := b.Controls[0]
cc := v_0.Args[0]
b.resetWithControl(BlockARM64ULE, cc)
return true
}
// match: (If (GreaterThan cc) yes no)
// result: (GT cc yes no)
for b.Controls[0].Op == OpARM64GreaterThan {
v_0 := b.Controls[0]
cc := v_0.Args[0]
b.resetWithControl(BlockARM64GT, cc)
return true
}
// match: (If (GreaterThanU cc) yes no)
// result: (UGT cc yes no)
for b.Controls[0].Op == OpARM64GreaterThanU {
v_0 := b.Controls[0]
cc := v_0.Args[0]
b.resetWithControl(BlockARM64UGT, cc)
return true
}
// match: (If (GreaterEqual cc) yes no)
// result: (GE cc yes no)
for b.Controls[0].Op == OpARM64GreaterEqual {
v_0 := b.Controls[0]
cc := v_0.Args[0]
b.resetWithControl(BlockARM64GE, cc)
return true
}
// match: (If (GreaterEqualU cc) yes no)
// result: (UGE cc yes no)
for b.Controls[0].Op == OpARM64GreaterEqualU {
v_0 := b.Controls[0]
cc := v_0.Args[0]
b.resetWithControl(BlockARM64UGE, cc)
return true
}
// match: (If (LessThanF cc) yes no)
// result: (FLT cc yes no)
for b.Controls[0].Op == OpARM64LessThanF {
v_0 := b.Controls[0]
cc := v_0.Args[0]
b.resetWithControl(BlockARM64FLT, cc)
return true
}
// match: (If (LessEqualF cc) yes no)
// result: (FLE cc yes no)
for b.Controls[0].Op == OpARM64LessEqualF {
v_0 := b.Controls[0]
cc := v_0.Args[0]
b.resetWithControl(BlockARM64FLE, cc)
return true
}
// match: (If (GreaterThanF cc) yes no)
// result: (FGT cc yes no)
for b.Controls[0].Op == OpARM64GreaterThanF {
v_0 := b.Controls[0]
cc := v_0.Args[0]
b.resetWithControl(BlockARM64FGT, cc)
return true
}
// match: (If (GreaterEqualF cc) yes no)
// result: (FGE cc yes no)
for b.Controls[0].Op == OpARM64GreaterEqualF {
v_0 := b.Controls[0]
cc := v_0.Args[0]
b.resetWithControl(BlockARM64FGE, cc)
return true
}
// match: (If cond yes no)
// result: (NZ cond yes no)
for {
cond := b.Controls[0]
b.resetWithControl(BlockARM64NZ, cond)
return true
}
case BlockARM64LE:
// match: (LE (CMPWconst [0] x:(ANDconst [c] y)) yes no)
// cond: x.Uses == 1
// result: (LE (TSTWconst [int32(c)] y) yes no)
for b.Controls[0].Op == OpARM64CMPWconst {
v_0 := b.Controls[0]
if auxIntToInt32(v_0.AuxInt) != 0 {
break
}
x := v_0.Args[0]
if x.Op != OpARM64ANDconst {
break
}
c := auxIntToInt64(x.AuxInt)
y := x.Args[0]
if !(x.Uses == 1) {
break
}
v0 := b.NewValue0(v_0.Pos, OpARM64TSTWconst, types.TypeFlags)
v0.AuxInt = int32ToAuxInt(int32(c))
v0.AddArg(y)
b.resetWithControl(BlockARM64LE, v0)
return true
}
// match: (LE (CMPconst [0] z:(AND x y)) yes no)
// cond: z.Uses == 1
// result: (LE (TST x y) yes no)
for b.Controls[0].Op == OpARM64CMPconst {
v_0 := b.Controls[0]
if auxIntToInt64(v_0.AuxInt) != 0 {
break
}
z := v_0.Args[0]
if z.Op != OpARM64AND {
break
}
_ = z.Args[1]
z_0 := z.Args[0]
z_1 := z.Args[1]
for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
x := z_0
y := z_1
if !(z.Uses == 1) {
continue
}
v0 := b.NewValue0(v_0.Pos, OpARM64TST, types.TypeFlags)
v0.AddArg2(x, y)
b.resetWithControl(BlockARM64LE, v0)
return true
}
break
}
// match: (LE (CMPWconst [0] z:(AND x y)) yes no)
// cond: z.Uses == 1
// result: (LE (TSTW x y) yes no)
for b.Controls[0].Op == OpARM64CMPWconst {
v_0 := b.Controls[0]
if auxIntToInt32(v_0.AuxInt) != 0 {
break
}
z := v_0.Args[0]
if z.Op != OpARM64AND {
break
}
_ = z.Args[1]
z_0 := z.Args[0]
z_1 := z.Args[1]
for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
x := z_0
y := z_1
if !(z.Uses == 1) {
continue
}
v0 := b.NewValue0(v_0.Pos, OpARM64TSTW, types.TypeFlags)
v0.AddArg2(x, y)
b.resetWithControl(BlockARM64LE, v0)
return true
}
break
}
// match: (LE (CMPconst [0] x:(ANDconst [c] y)) yes no)
// cond: x.Uses == 1
// result: (LE (TSTconst [c] y) yes no)
for b.Controls[0].Op == OpARM64CMPconst {
v_0 := b.Controls[0]
if auxIntToInt64(v_0.AuxInt) != 0 {
break
}
x := v_0.Args[0]
if x.Op != OpARM64ANDconst {
break
}
c := auxIntToInt64(x.AuxInt)
y := x.Args[0]
if !(x.Uses == 1) {
break
}
v0 := b.NewValue0(v_0.Pos, OpARM64TSTconst, types.TypeFlags)
v0.AuxInt = int64ToAuxInt(c)
v0.AddArg(y)
b.resetWithControl(BlockARM64LE, v0)
return true
}
// match: (LE (CMPconst [0] x:(ADDconst [c] y)) yes no)
// cond: x.Uses == 1
// result: (LEnoov (CMNconst [c] y) yes no)
for b.Controls[0].Op == OpARM64CMPconst {
v_0 := b.Controls[0]
if auxIntToInt64(v_0.AuxInt) != 0 {
break
}
x := v_0.Args[0]
if x.Op != OpARM64ADDconst {
break
}
c := auxIntToInt64(x.AuxInt)
y := x.Args[0]
if !(x.Uses == 1) {
break
}
v0 := b.NewValue0(v_0.Pos, OpARM64CMNconst, types.TypeFlags)
v0.AuxInt = int64ToAuxInt(c)
v0.AddArg(y)
b.resetWithControl(BlockARM64LEnoov, v0)
return true
}
// match: (LE (CMPWconst [0] x:(ADDconst [c] y)) yes no)
// cond: x.Uses == 1
// result: (LEnoov (CMNWconst [int32(c)] y) yes no)
for b.Controls[0].Op == OpARM64CMPWconst {
v_0 := b.Controls[0]
if auxIntToInt32(v_0.AuxInt) != 0 {
break
}
x := v_0.Args[0]
if x.Op != OpARM64ADDconst {
break
}
c := auxIntToInt64(x.AuxInt)
y := x.Args[0]
if !(x.Uses == 1) {
break
}
v0 := b.NewValue0(v_0.Pos, OpARM64CMNWconst, types.TypeFlags)
v0.AuxInt = int32ToAuxInt(int32(c))
v0.AddArg(y)
b.resetWithControl(BlockARM64LEnoov, v0)
return true
}
// match: (LE (CMPconst [0] z:(ADD x y)) yes no)
// cond: z.Uses == 1
// result: (LEnoov (CMN x y) yes no)
for b.Controls[0].Op == OpARM64CMPconst {
v_0 := b.Controls[0]
if auxIntToInt64(v_0.AuxInt) != 0 {
break
}
z := v_0.Args[0]
if z.Op != OpARM64ADD {
break
}
_ = z.Args[1]
z_0 := z.Args[0]
z_1 := z.Args[1]
for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
x := z_0
y := z_1
if !(z.Uses == 1) {
continue
}
v0 := b.NewValue0(v_0.Pos, OpARM64CMN, types.TypeFlags)
v0.AddArg2(x, y)
b.resetWithControl(BlockARM64LEnoov, v0)
return true
}
break
}
// match: (LE (CMPWconst [0] z:(ADD x y)) yes no)
// cond: z.Uses == 1
// result: (LEnoov (CMNW x y) yes no)
for b.Controls[0].Op == OpARM64CMPWconst {
v_0 := b.Controls[0]
if auxIntToInt32(v_0.AuxInt) != 0 {
break
}
z := v_0.Args[0]
if z.Op != OpARM64ADD {
break
}
_ = z.Args[1]
z_0 := z.Args[0]
z_1 := z.Args[1]
for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
x := z_0
y := z_1
if !(z.Uses == 1) {
continue
}
v0 := b.NewValue0(v_0.Pos, OpARM64CMNW, types.TypeFlags)
v0.AddArg2(x, y)
b.resetWithControl(BlockARM64LEnoov, v0)
return true
}
break
}
// match: (LE (CMPconst [0] z:(MADD a x y)) yes no)
// cond: z.Uses==1
// result: (LEnoov (CMN a (MUL <x.Type> x y)) yes no)
for b.Controls[0].Op == OpARM64CMPconst {
v_0 := b.Controls[0]
if auxIntToInt64(v_0.AuxInt) != 0 {
break
}
z := v_0.Args[0]
if z.Op != OpARM64MADD {
break
}
y := z.Args[2]
a := z.Args[0]
x := z.Args[1]
if !(z.Uses == 1) {
break
}
v0 := b.NewValue0(v_0.Pos, OpARM64CMN, types.TypeFlags)
v1 := b.NewValue0(v_0.Pos, OpARM64MUL, x.Type)
v1.AddArg2(x, y)
v0.AddArg2(a, v1)
b.resetWithControl(BlockARM64LEnoov, v0)
return true
}
// match: (LE (CMPconst [0] z:(MSUB a x y)) yes no)
// cond: z.Uses==1
// result: (LEnoov (CMP a (MUL <x.Type> x y)) yes no)
for b.Controls[0].Op == OpARM64CMPconst {
v_0 := b.Controls[0]
if auxIntToInt64(v_0.AuxInt) != 0 {
break
}
z := v_0.Args[0]
if z.Op != OpARM64MSUB {
break
}
y := z.Args[2]
a := z.Args[0]
x := z.Args[1]
if !(z.Uses == 1) {
break
}
v0 := b.NewValue0(v_0.Pos, OpARM64CMP, types.TypeFlags)
v1 := b.NewValue0(v_0.Pos, OpARM64MUL, x.Type)
v1.AddArg2(x, y)
v0.AddArg2(a, v1)
b.resetWithControl(BlockARM64LEnoov, v0)
return true
}
// match: (LE (CMPWconst [0] z:(MADDW a x y)) yes no)
// cond: z.Uses==1
// result: (LEnoov (CMNW a (MULW <x.Type> x y)) yes no)
for b.Controls[0].Op == OpARM64CMPWconst {
v_0 := b.Controls[0]
if auxIntToInt32(v_0.AuxInt) != 0 {
break
}
z := v_0.Args[0]
if z.Op != OpARM64MADDW {
break
}
y := z.Args[2]
a := z.Args[0]
x := z.Args[1]
if !(z.Uses == 1) {
break
}
v0 := b.NewValue0(v_0.Pos, OpARM64CMNW, types.TypeFlags)
v1 := b.NewValue0(v_0.Pos, OpARM64MULW, x.Type)
v1.AddArg2(x, y)
v0.AddArg2(a, v1)
b.resetWithControl(BlockARM64LEnoov, v0)
return true
}
// match: (LE (CMPWconst [0] z:(MSUBW a x y)) yes no)
// cond: z.Uses==1
// result: (LEnoov (CMPW a (MULW <x.Type> x y)) yes no)
for b.Controls[0].Op == OpARM64CMPWconst {
v_0 := b.Controls[0]
if auxIntToInt32(v_0.AuxInt) != 0 {
break
}
z := v_0.Args[0]
if z.Op != OpARM64MSUBW {
break
}
y := z.Args[2]
a := z.Args[0]
x := z.Args[1]
if !(z.Uses == 1) {
break
}
v0 := b.NewValue0(v_0.Pos, OpARM64CMPW, types.TypeFlags)
v1 := b.NewValue0(v_0.Pos, OpARM64MULW, x.Type)
v1.AddArg2(x, y)
v0.AddArg2(a, v1)
b.resetWithControl(BlockARM64LEnoov, v0)
return true
}
// match: (LE (FlagConstant [fc]) yes no)
// cond: fc.le()
// result: (First yes no)
for b.Controls[0].Op == OpARM64FlagConstant {
v_0 := b.Controls[0]
fc := auxIntToFlagConstant(v_0.AuxInt)
if !(fc.le()) {
break
}
b.Reset(BlockFirst)
return true
}
// match: (LE (FlagConstant [fc]) yes no)
// cond: !fc.le()
// result: (First no yes)
for b.Controls[0].Op == OpARM64FlagConstant {
v_0 := b.Controls[0]
fc := auxIntToFlagConstant(v_0.AuxInt)
if !(!fc.le()) {
break
}
b.Reset(BlockFirst)
b.swapSuccessors()
return true
}
// match: (LE (InvertFlags cmp) yes no)
// result: (GE cmp yes no)
for b.Controls[0].Op == OpARM64InvertFlags {
v_0 := b.Controls[0]
cmp := v_0.Args[0]
b.resetWithControl(BlockARM64GE, cmp)
return true
}
case BlockARM64LEnoov:
// match: (LEnoov (FlagConstant [fc]) yes no)
// cond: fc.leNoov()
// result: (First yes no)
for b.Controls[0].Op == OpARM64FlagConstant {
v_0 := b.Controls[0]
fc := auxIntToFlagConstant(v_0.AuxInt)
if !(fc.leNoov()) {
break
}
b.Reset(BlockFirst)
return true
}
// match: (LEnoov (FlagConstant [fc]) yes no)
// cond: !fc.leNoov()
// result: (First no yes)
for b.Controls[0].Op == OpARM64FlagConstant {
v_0 := b.Controls[0]
fc := auxIntToFlagConstant(v_0.AuxInt)
if !(!fc.leNoov()) {
break
}
b.Reset(BlockFirst)
b.swapSuccessors()
return true
}
// match: (LEnoov (InvertFlags cmp) yes no)
// result: (GEnoov cmp yes no)
for b.Controls[0].Op == OpARM64InvertFlags {
v_0 := b.Controls[0]
cmp := v_0.Args[0]
b.resetWithControl(BlockARM64GEnoov, cmp)
return true
}
case BlockARM64LT:
// match: (LT (CMPWconst [0] x:(ANDconst [c] y)) yes no)
// cond: x.Uses == 1
// result: (LT (TSTWconst [int32(c)] y) yes no)
for b.Controls[0].Op == OpARM64CMPWconst {
v_0 := b.Controls[0]
if auxIntToInt32(v_0.AuxInt) != 0 {
break
}
x := v_0.Args[0]
if x.Op != OpARM64ANDconst {
break
}
c := auxIntToInt64(x.AuxInt)
y := x.Args[0]
if !(x.Uses == 1) {
break
}
v0 := b.NewValue0(v_0.Pos, OpARM64TSTWconst, types.TypeFlags)
v0.AuxInt = int32ToAuxInt(int32(c))
v0.AddArg(y)
b.resetWithControl(BlockARM64LT, v0)
return true
}
// match: (LT (CMPconst [0] z:(AND x y)) yes no)
// cond: z.Uses == 1
// result: (LT (TST x y) yes no)
for b.Controls[0].Op == OpARM64CMPconst {
v_0 := b.Controls[0]
if auxIntToInt64(v_0.AuxInt) != 0 {
break
}
z := v_0.Args[0]
if z.Op != OpARM64AND {
break
}
_ = z.Args[1]
z_0 := z.Args[0]
z_1 := z.Args[1]
for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
x := z_0
y := z_1
if !(z.Uses == 1) {
continue
}
v0 := b.NewValue0(v_0.Pos, OpARM64TST, types.TypeFlags)
v0.AddArg2(x, y)
b.resetWithControl(BlockARM64LT, v0)
return true
}
break
}
// match: (LT (CMPWconst [0] z:(AND x y)) yes no)
// cond: z.Uses == 1
// result: (LT (TSTW x y) yes no)
for b.Controls[0].Op == OpARM64CMPWconst {
v_0 := b.Controls[0]
if auxIntToInt32(v_0.AuxInt) != 0 {
break
}
z := v_0.Args[0]
if z.Op != OpARM64AND {
break
}
_ = z.Args[1]
z_0 := z.Args[0]
z_1 := z.Args[1]
for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
x := z_0
y := z_1
if !(z.Uses == 1) {
continue
}
v0 := b.NewValue0(v_0.Pos, OpARM64TSTW, types.TypeFlags)
v0.AddArg2(x, y)
b.resetWithControl(BlockARM64LT, v0)
return true
}
break
}
// match: (LT (CMPconst [0] x:(ANDconst [c] y)) yes no)
// cond: x.Uses == 1
// result: (LT (TSTconst [c] y) yes no)
for b.Controls[0].Op == OpARM64CMPconst {
v_0 := b.Controls[0]
if auxIntToInt64(v_0.AuxInt) != 0 {
break
}
x := v_0.Args[0]
if x.Op != OpARM64ANDconst {
break
}
c := auxIntToInt64(x.AuxInt)
y := x.Args[0]
if !(x.Uses == 1) {
break
}
v0 := b.NewValue0(v_0.Pos, OpARM64TSTconst, types.TypeFlags)
v0.AuxInt = int64ToAuxInt(c)
v0.AddArg(y)
b.resetWithControl(BlockARM64LT, v0)
return true
}
// match: (LT (CMPconst [0] x:(ADDconst [c] y)) yes no)
// cond: x.Uses == 1
// result: (LTnoov (CMNconst [c] y) yes no)
for b.Controls[0].Op == OpARM64CMPconst {
v_0 := b.Controls[0]
if auxIntToInt64(v_0.AuxInt) != 0 {
break
}
x := v_0.Args[0]
if x.Op != OpARM64ADDconst {
break
}
c := auxIntToInt64(x.AuxInt)
y := x.Args[0]
if !(x.Uses == 1) {
break
}
v0 := b.NewValue0(v_0.Pos, OpARM64CMNconst, types.TypeFlags)
v0.AuxInt = int64ToAuxInt(c)
v0.AddArg(y)
b.resetWithControl(BlockARM64LTnoov, v0)
return true
}
// match: (LT (CMPWconst [0] x:(ADDconst [c] y)) yes no)
// cond: x.Uses == 1
// result: (LTnoov (CMNWconst [int32(c)] y) yes no)
for b.Controls[0].Op == OpARM64CMPWconst {
v_0 := b.Controls[0]
if auxIntToInt32(v_0.AuxInt) != 0 {
break
}
x := v_0.Args[0]
if x.Op != OpARM64ADDconst {
break
}
c := auxIntToInt64(x.AuxInt)
y := x.Args[0]
if !(x.Uses == 1) {
break
}
v0 := b.NewValue0(v_0.Pos, OpARM64CMNWconst, types.TypeFlags)
v0.AuxInt = int32ToAuxInt(int32(c))
v0.AddArg(y)
b.resetWithControl(BlockARM64LTnoov, v0)
return true
}
// match: (LT (CMPconst [0] z:(ADD x y)) yes no)
// cond: z.Uses == 1
// result: (LTnoov (CMN x y) yes no)
for b.Controls[0].Op == OpARM64CMPconst {
v_0 := b.Controls[0]
if auxIntToInt64(v_0.AuxInt) != 0 {
break
}
z := v_0.Args[0]
if z.Op != OpARM64ADD {
break
}
_ = z.Args[1]
z_0 := z.Args[0]
z_1 := z.Args[1]
for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
x := z_0
y := z_1
if !(z.Uses == 1) {
continue
}
v0 := b.NewValue0(v_0.Pos, OpARM64CMN, types.TypeFlags)
v0.AddArg2(x, y)
b.resetWithControl(BlockARM64LTnoov, v0)
return true
}
break
}
// match: (LT (CMPWconst [0] z:(ADD x y)) yes no)
// cond: z.Uses == 1
// result: (LTnoov (CMNW x y) yes no)
for b.Controls[0].Op == OpARM64CMPWconst {
v_0 := b.Controls[0]
if auxIntToInt32(v_0.AuxInt) != 0 {
break
}
z := v_0.Args[0]
if z.Op != OpARM64ADD {
break
}
_ = z.Args[1]
z_0 := z.Args[0]
z_1 := z.Args[1]
for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
x := z_0
y := z_1
if !(z.Uses == 1) {
continue
}
v0 := b.NewValue0(v_0.Pos, OpARM64CMNW, types.TypeFlags)
v0.AddArg2(x, y)
b.resetWithControl(BlockARM64LTnoov, v0)
return true
}
break
}
// match: (LT (CMPconst [0] z:(MADD a x y)) yes no)
// cond: z.Uses==1
// result: (LTnoov (CMN a (MUL <x.Type> x y)) yes no)
for b.Controls[0].Op == OpARM64CMPconst {
v_0 := b.Controls[0]
if auxIntToInt64(v_0.AuxInt) != 0 {
break
}
z := v_0.Args[0]
if z.Op != OpARM64MADD {
break
}
y := z.Args[2]
a := z.Args[0]
x := z.Args[1]
if !(z.Uses == 1) {
break
}
v0 := b.NewValue0(v_0.Pos, OpARM64CMN, types.TypeFlags)
v1 := b.NewValue0(v_0.Pos, OpARM64MUL, x.Type)
v1.AddArg2(x, y)
v0.AddArg2(a, v1)
b.resetWithControl(BlockARM64LTnoov, v0)
return true
}
// match: (LT (CMPconst [0] z:(MSUB a x y)) yes no)
// cond: z.Uses==1
// result: (LTnoov (CMP a (MUL <x.Type> x y)) yes no)
for b.Controls[0].Op == OpARM64CMPconst {
v_0 := b.Controls[0]
if auxIntToInt64(v_0.AuxInt) != 0 {
break
}
z := v_0.Args[0]
if z.Op != OpARM64MSUB {
break
}
y := z.Args[2]
a := z.Args[0]
x := z.Args[1]
if !(z.Uses == 1) {
break
}
v0 := b.NewValue0(v_0.Pos, OpARM64CMP, types.TypeFlags)
v1 := b.NewValue0(v_0.Pos, OpARM64MUL, x.Type)
v1.AddArg2(x, y)
v0.AddArg2(a, v1)
b.resetWithControl(BlockARM64LTnoov, v0)
return true
}
// match: (LT (CMPWconst [0] z:(MADDW a x y)) yes no)
// cond: z.Uses==1
// result: (LTnoov (CMNW a (MULW <x.Type> x y)) yes no)
for b.Controls[0].Op == OpARM64CMPWconst {
v_0 := b.Controls[0]
if auxIntToInt32(v_0.AuxInt) != 0 {
break
}
z := v_0.Args[0]
if z.Op != OpARM64MADDW {
break
}
y := z.Args[2]
a := z.Args[0]
x := z.Args[1]
if !(z.Uses == 1) {
break
}
v0 := b.NewValue0(v_0.Pos, OpARM64CMNW, types.TypeFlags)
v1 := b.NewValue0(v_0.Pos, OpARM64MULW, x.Type)
v1.AddArg2(x, y)
v0.AddArg2(a, v1)
b.resetWithControl(BlockARM64LTnoov, v0)
return true
}
// match: (LT (CMPWconst [0] z:(MSUBW a x y)) yes no)
// cond: z.Uses==1
// result: (LTnoov (CMPW a (MULW <x.Type> x y)) yes no)
for b.Controls[0].Op == OpARM64CMPWconst {
v_0 := b.Controls[0]
if auxIntToInt32(v_0.AuxInt) != 0 {
break
}
z := v_0.Args[0]
if z.Op != OpARM64MSUBW {
break
}
y := z.Args[2]
a := z.Args[0]
x := z.Args[1]
if !(z.Uses == 1) {
break
}
v0 := b.NewValue0(v_0.Pos, OpARM64CMPW, types.TypeFlags)
v1 := b.NewValue0(v_0.Pos, OpARM64MULW, x.Type)
v1.AddArg2(x, y)
v0.AddArg2(a, v1)
b.resetWithControl(BlockARM64LTnoov, v0)
return true
}
// match: (LT (CMPWconst [0] x) yes no)
// result: (TBNZ [31] x yes no)
for b.Controls[0].Op == OpARM64CMPWconst {
v_0 := b.Controls[0]
if auxIntToInt32(v_0.AuxInt) != 0 {
break
}
x := v_0.Args[0]
b.resetWithControl(BlockARM64TBNZ, x)
b.AuxInt = int64ToAuxInt(31)
return true
}
// match: (LT (CMPconst [0] x) yes no)
// result: (TBNZ [63] x yes no)
for b.Controls[0].Op == OpARM64CMPconst {
v_0 := b.Controls[0]
if auxIntToInt64(v_0.AuxInt) != 0 {
break
}
x := v_0.Args[0]
b.resetWithControl(BlockARM64TBNZ, x)
b.AuxInt = int64ToAuxInt(63)
return true
}
// match: (LT (FlagConstant [fc]) yes no)
// cond: fc.lt()
// result: (First yes no)
for b.Controls[0].Op == OpARM64FlagConstant {
v_0 := b.Controls[0]
fc := auxIntToFlagConstant(v_0.AuxInt)
if !(fc.lt()) {
break
}
b.Reset(BlockFirst)
return true
}
// match: (LT (FlagConstant [fc]) yes no)
// cond: !fc.lt()
// result: (First no yes)
for b.Controls[0].Op == OpARM64FlagConstant {
v_0 := b.Controls[0]
fc := auxIntToFlagConstant(v_0.AuxInt)
if !(!fc.lt()) {
break
}
b.Reset(BlockFirst)
b.swapSuccessors()
return true
}
// match: (LT (InvertFlags cmp) yes no)
// result: (GT cmp yes no)
for b.Controls[0].Op == OpARM64InvertFlags {
v_0 := b.Controls[0]
cmp := v_0.Args[0]
b.resetWithControl(BlockARM64GT, cmp)
return true
}
case BlockARM64LTnoov:
// match: (LTnoov (FlagConstant [fc]) yes no)
// cond: fc.ltNoov()
// result: (First yes no)
for b.Controls[0].Op == OpARM64FlagConstant {
v_0 := b.Controls[0]
fc := auxIntToFlagConstant(v_0.AuxInt)
if !(fc.ltNoov()) {
break
}
b.Reset(BlockFirst)
return true
}
// match: (LTnoov (FlagConstant [fc]) yes no)
// cond: !fc.ltNoov()
// result: (First no yes)
for b.Controls[0].Op == OpARM64FlagConstant {
v_0 := b.Controls[0]
fc := auxIntToFlagConstant(v_0.AuxInt)
if !(!fc.ltNoov()) {
break
}
b.Reset(BlockFirst)
b.swapSuccessors()
return true
}
// match: (LTnoov (InvertFlags cmp) yes no)
// result: (GTnoov cmp yes no)
for b.Controls[0].Op == OpARM64InvertFlags {
v_0 := b.Controls[0]
cmp := v_0.Args[0]
b.resetWithControl(BlockARM64GTnoov, cmp)
return true
}
case BlockARM64NE:
// match: (NE (CMPWconst [0] x:(ANDconst [c] y)) yes no)
// cond: x.Uses == 1
// result: (NE (TSTWconst [int32(c)] y) yes no)
for b.Controls[0].Op == OpARM64CMPWconst {
v_0 := b.Controls[0]
if auxIntToInt32(v_0.AuxInt) != 0 {
break
}
x := v_0.Args[0]
if x.Op != OpARM64ANDconst {
break
}
c := auxIntToInt64(x.AuxInt)
y := x.Args[0]
if !(x.Uses == 1) {
break
}
v0 := b.NewValue0(v_0.Pos, OpARM64TSTWconst, types.TypeFlags)
v0.AuxInt = int32ToAuxInt(int32(c))
v0.AddArg(y)
b.resetWithControl(BlockARM64NE, v0)
return true
}
// match: (NE (CMPconst [0] z:(AND x y)) yes no)
// cond: z.Uses == 1
// result: (NE (TST x y) yes no)
for b.Controls[0].Op == OpARM64CMPconst {
v_0 := b.Controls[0]
if auxIntToInt64(v_0.AuxInt) != 0 {
break
}
z := v_0.Args[0]
if z.Op != OpARM64AND {
break
}
_ = z.Args[1]
z_0 := z.Args[0]
z_1 := z.Args[1]
for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
x := z_0
y := z_1
if !(z.Uses == 1) {
continue
}
v0 := b.NewValue0(v_0.Pos, OpARM64TST, types.TypeFlags)
v0.AddArg2(x, y)
b.resetWithControl(BlockARM64NE, v0)
return true
}
break
}
// match: (NE (CMPWconst [0] z:(AND x y)) yes no)
// cond: z.Uses == 1
// result: (NE (TSTW x y) yes no)
for b.Controls[0].Op == OpARM64CMPWconst {
v_0 := b.Controls[0]
if auxIntToInt32(v_0.AuxInt) != 0 {
break
}
z := v_0.Args[0]
if z.Op != OpARM64AND {
break
}
_ = z.Args[1]
z_0 := z.Args[0]
z_1 := z.Args[1]
for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
x := z_0
y := z_1
if !(z.Uses == 1) {
continue
}
v0 := b.NewValue0(v_0.Pos, OpARM64TSTW, types.TypeFlags)
v0.AddArg2(x, y)
b.resetWithControl(BlockARM64NE, v0)
return true
}
break
}
// match: (NE (CMPconst [0] x:(ANDconst [c] y)) yes no)
// cond: x.Uses == 1
// result: (NE (TSTconst [c] y) yes no)
for b.Controls[0].Op == OpARM64CMPconst {
v_0 := b.Controls[0]
if auxIntToInt64(v_0.AuxInt) != 0 {
break
}
x := v_0.Args[0]
if x.Op != OpARM64ANDconst {
break
}
c := auxIntToInt64(x.AuxInt)
y := x.Args[0]
if !(x.Uses == 1) {
break
}
v0 := b.NewValue0(v_0.Pos, OpARM64TSTconst, types.TypeFlags)
v0.AuxInt = int64ToAuxInt(c)
v0.AddArg(y)
b.resetWithControl(BlockARM64NE, v0)
return true
}
// match: (NE (CMPconst [0] x:(ADDconst [c] y)) yes no)
// cond: x.Uses == 1
// result: (NE (CMNconst [c] y) yes no)
for b.Controls[0].Op == OpARM64CMPconst {
v_0 := b.Controls[0]
if auxIntToInt64(v_0.AuxInt) != 0 {
break
}
x := v_0.Args[0]
if x.Op != OpARM64ADDconst {
break
}
c := auxIntToInt64(x.AuxInt)
y := x.Args[0]
if !(x.Uses == 1) {
break
}
v0 := b.NewValue0(v_0.Pos, OpARM64CMNconst, types.TypeFlags)
v0.AuxInt = int64ToAuxInt(c)
v0.AddArg(y)
b.resetWithControl(BlockARM64NE, v0)
return true
}
// match: (NE (CMPWconst [0] x:(ADDconst [c] y)) yes no)
// cond: x.Uses == 1
// result: (NE (CMNWconst [int32(c)] y) yes no)
for b.Controls[0].Op == OpARM64CMPWconst {
v_0 := b.Controls[0]
if auxIntToInt32(v_0.AuxInt) != 0 {
break
}
x := v_0.Args[0]
if x.Op != OpARM64ADDconst {
break
}
c := auxIntToInt64(x.AuxInt)
y := x.Args[0]
if !(x.Uses == 1) {
break
}
v0 := b.NewValue0(v_0.Pos, OpARM64CMNWconst, types.TypeFlags)
v0.AuxInt = int32ToAuxInt(int32(c))
v0.AddArg(y)
b.resetWithControl(BlockARM64NE, v0)
return true
}
// match: (NE (CMPconst [0] z:(ADD x y)) yes no)
// cond: z.Uses == 1
// result: (NE (CMN x y) yes no)
for b.Controls[0].Op == OpARM64CMPconst {
v_0 := b.Controls[0]
if auxIntToInt64(v_0.AuxInt) != 0 {
break
}
z := v_0.Args[0]
if z.Op != OpARM64ADD {
break
}
_ = z.Args[1]
z_0 := z.Args[0]
z_1 := z.Args[1]
for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
x := z_0
y := z_1
if !(z.Uses == 1) {
continue
}
v0 := b.NewValue0(v_0.Pos, OpARM64CMN, types.TypeFlags)
v0.AddArg2(x, y)
b.resetWithControl(BlockARM64NE, v0)
return true
}
break
}
// match: (NE (CMPWconst [0] z:(ADD x y)) yes no)
// cond: z.Uses == 1
// result: (NE (CMNW x y) yes no)
for b.Controls[0].Op == OpARM64CMPWconst {
v_0 := b.Controls[0]
if auxIntToInt32(v_0.AuxInt) != 0 {
break
}
z := v_0.Args[0]
if z.Op != OpARM64ADD {
break
}
_ = z.Args[1]
z_0 := z.Args[0]
z_1 := z.Args[1]
for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
x := z_0
y := z_1
if !(z.Uses == 1) {
continue
}
v0 := b.NewValue0(v_0.Pos, OpARM64CMNW, types.TypeFlags)
v0.AddArg2(x, y)
b.resetWithControl(BlockARM64NE, v0)
return true
}
break
}
// match: (NE (CMP x z:(NEG y)) yes no)
// cond: z.Uses == 1
// result: (NE (CMN x y) yes no)
for b.Controls[0].Op == OpARM64CMP {
v_0 := b.Controls[0]
_ = v_0.Args[1]
x := v_0.Args[0]
z := v_0.Args[1]
if z.Op != OpARM64NEG {
break
}
y := z.Args[0]
if !(z.Uses == 1) {
break
}
v0 := b.NewValue0(v_0.Pos, OpARM64CMN, types.TypeFlags)
v0.AddArg2(x, y)
b.resetWithControl(BlockARM64NE, v0)
return true
}
// match: (NE (CMPW x z:(NEG y)) yes no)
// cond: z.Uses == 1
// result: (NE (CMNW x y) yes no)
for b.Controls[0].Op == OpARM64CMPW {
v_0 := b.Controls[0]
_ = v_0.Args[1]
x := v_0.Args[0]
z := v_0.Args[1]
if z.Op != OpARM64NEG {
break
}
y := z.Args[0]
if !(z.Uses == 1) {
break
}
v0 := b.NewValue0(v_0.Pos, OpARM64CMNW, types.TypeFlags)
v0.AddArg2(x, y)
b.resetWithControl(BlockARM64NE, v0)
return true
}
// match: (NE (CMPconst [0] x) yes no)
// result: (NZ x yes no)
for b.Controls[0].Op == OpARM64CMPconst {
v_0 := b.Controls[0]
if auxIntToInt64(v_0.AuxInt) != 0 {
break
}
x := v_0.Args[0]
b.resetWithControl(BlockARM64NZ, x)
return true
}
// match: (NE (CMPWconst [0] x) yes no)
// result: (NZW x yes no)
for b.Controls[0].Op == OpARM64CMPWconst {
v_0 := b.Controls[0]
if auxIntToInt32(v_0.AuxInt) != 0 {
break
}
x := v_0.Args[0]
b.resetWithControl(BlockARM64NZW, x)
return true
}
// match: (NE (CMPconst [0] z:(MADD a x y)) yes no)
// cond: z.Uses==1
// result: (NE (CMN a (MUL <x.Type> x y)) yes no)
for b.Controls[0].Op == OpARM64CMPconst {
v_0 := b.Controls[0]
if auxIntToInt64(v_0.AuxInt) != 0 {
break
}
z := v_0.Args[0]
if z.Op != OpARM64MADD {
break
}
y := z.Args[2]
a := z.Args[0]
x := z.Args[1]
if !(z.Uses == 1) {
break
}
v0 := b.NewValue0(v_0.Pos, OpARM64CMN, types.TypeFlags)
v1 := b.NewValue0(v_0.Pos, OpARM64MUL, x.Type)
v1.AddArg2(x, y)
v0.AddArg2(a, v1)
b.resetWithControl(BlockARM64NE, v0)
return true
}
// match: (NE (CMPconst [0] z:(MSUB a x y)) yes no)
// cond: z.Uses==1
// result: (NE (CMP a (MUL <x.Type> x y)) yes no)
for b.Controls[0].Op == OpARM64CMPconst {
v_0 := b.Controls[0]
if auxIntToInt64(v_0.AuxInt) != 0 {
break
}
z := v_0.Args[0]
if z.Op != OpARM64MSUB {
break
}
y := z.Args[2]
a := z.Args[0]
x := z.Args[1]
if !(z.Uses == 1) {
break
}
v0 := b.NewValue0(v_0.Pos, OpARM64CMP, types.TypeFlags)
v1 := b.NewValue0(v_0.Pos, OpARM64MUL, x.Type)
v1.AddArg2(x, y)
v0.AddArg2(a, v1)
b.resetWithControl(BlockARM64NE, v0)
return true
}
// match: (NE (CMPWconst [0] z:(MADDW a x y)) yes no)
// cond: z.Uses==1
// result: (NE (CMNW a (MULW <x.Type> x y)) yes no)
for b.Controls[0].Op == OpARM64CMPWconst {
v_0 := b.Controls[0]
if auxIntToInt32(v_0.AuxInt) != 0 {
break
}
z := v_0.Args[0]
if z.Op != OpARM64MADDW {
break
}
y := z.Args[2]
a := z.Args[0]
x := z.Args[1]
if !(z.Uses == 1) {
break
}
v0 := b.NewValue0(v_0.Pos, OpARM64CMNW, types.TypeFlags)
v1 := b.NewValue0(v_0.Pos, OpARM64MULW, x.Type)
v1.AddArg2(x, y)
v0.AddArg2(a, v1)
b.resetWithControl(BlockARM64NE, v0)
return true
}
// match: (NE (CMPWconst [0] z:(MSUBW a x y)) yes no)
// cond: z.Uses==1
// result: (NE (CMPW a (MULW <x.Type> x y)) yes no)
for b.Controls[0].Op == OpARM64CMPWconst {
v_0 := b.Controls[0]
if auxIntToInt32(v_0.AuxInt) != 0 {
break
}
z := v_0.Args[0]
if z.Op != OpARM64MSUBW {
break
}
y := z.Args[2]
a := z.Args[0]
x := z.Args[1]
if !(z.Uses == 1) {
break
}
v0 := b.NewValue0(v_0.Pos, OpARM64CMPW, types.TypeFlags)
v1 := b.NewValue0(v_0.Pos, OpARM64MULW, x.Type)
v1.AddArg2(x, y)
v0.AddArg2(a, v1)
b.resetWithControl(BlockARM64NE, v0)
return true
}
// match: (NE (TSTconst [c] x) yes no)
// cond: oneBit(c)
// result: (TBNZ [int64(ntz64(c))] x yes no)
for b.Controls[0].Op == OpARM64TSTconst {
v_0 := b.Controls[0]
c := auxIntToInt64(v_0.AuxInt)
x := v_0.Args[0]
if !(oneBit(c)) {
break
}
b.resetWithControl(BlockARM64TBNZ, x)
b.AuxInt = int64ToAuxInt(int64(ntz64(c)))
return true
}
// match: (NE (TSTWconst [c] x) yes no)
// cond: oneBit(int64(uint32(c)))
// result: (TBNZ [int64(ntz64(int64(uint32(c))))] x yes no)
for b.Controls[0].Op == OpARM64TSTWconst {
v_0 := b.Controls[0]
c := auxIntToInt32(v_0.AuxInt)
x := v_0.Args[0]
if !(oneBit(int64(uint32(c)))) {
break
}
b.resetWithControl(BlockARM64TBNZ, x)
b.AuxInt = int64ToAuxInt(int64(ntz64(int64(uint32(c)))))
return true
}
// match: (NE (FlagConstant [fc]) yes no)
// cond: fc.ne()
// result: (First yes no)
for b.Controls[0].Op == OpARM64FlagConstant {
v_0 := b.Controls[0]
fc := auxIntToFlagConstant(v_0.AuxInt)
if !(fc.ne()) {
break
}
b.Reset(BlockFirst)
return true
}
// match: (NE (FlagConstant [fc]) yes no)
// cond: !fc.ne()
// result: (First no yes)
for b.Controls[0].Op == OpARM64FlagConstant {
v_0 := b.Controls[0]
fc := auxIntToFlagConstant(v_0.AuxInt)
if !(!fc.ne()) {
break
}
b.Reset(BlockFirst)
b.swapSuccessors()
return true
}
// match: (NE (InvertFlags cmp) yes no)
// result: (NE cmp yes no)
for b.Controls[0].Op == OpARM64InvertFlags {
v_0 := b.Controls[0]
cmp := v_0.Args[0]
b.resetWithControl(BlockARM64NE, cmp)
return true
}
case BlockARM64NZ:
// match: (NZ (Equal cc) yes no)
// result: (EQ cc yes no)
for b.Controls[0].Op == OpARM64Equal {
v_0 := b.Controls[0]
cc := v_0.Args[0]
b.resetWithControl(BlockARM64EQ, cc)
return true
}
// match: (NZ (NotEqual cc) yes no)
// result: (NE cc yes no)
for b.Controls[0].Op == OpARM64NotEqual {
v_0 := b.Controls[0]
cc := v_0.Args[0]
b.resetWithControl(BlockARM64NE, cc)
return true
}
// match: (NZ (LessThan cc) yes no)
// result: (LT cc yes no)
for b.Controls[0].Op == OpARM64LessThan {
v_0 := b.Controls[0]
cc := v_0.Args[0]
b.resetWithControl(BlockARM64LT, cc)
return true
}
// match: (NZ (LessThanU cc) yes no)
// result: (ULT cc yes no)
for b.Controls[0].Op == OpARM64LessThanU {
v_0 := b.Controls[0]
cc := v_0.Args[0]
b.resetWithControl(BlockARM64ULT, cc)
return true
}
// match: (NZ (LessEqual cc) yes no)
// result: (LE cc yes no)
for b.Controls[0].Op == OpARM64LessEqual {
v_0 := b.Controls[0]
cc := v_0.Args[0]
b.resetWithControl(BlockARM64LE, cc)
return true
}
// match: (NZ (LessEqualU cc) yes no)
// result: (ULE cc yes no)
for b.Controls[0].Op == OpARM64LessEqualU {
v_0 := b.Controls[0]
cc := v_0.Args[0]
b.resetWithControl(BlockARM64ULE, cc)
return true
}
// match: (NZ (GreaterThan cc) yes no)
// result: (GT cc yes no)
for b.Controls[0].Op == OpARM64GreaterThan {
v_0 := b.Controls[0]
cc := v_0.Args[0]
b.resetWithControl(BlockARM64GT, cc)
return true
}
// match: (NZ (GreaterThanU cc) yes no)
// result: (UGT cc yes no)
for b.Controls[0].Op == OpARM64GreaterThanU {
v_0 := b.Controls[0]
cc := v_0.Args[0]
b.resetWithControl(BlockARM64UGT, cc)
return true
}
// match: (NZ (GreaterEqual cc) yes no)
// result: (GE cc yes no)
for b.Controls[0].Op == OpARM64GreaterEqual {
v_0 := b.Controls[0]
cc := v_0.Args[0]
b.resetWithControl(BlockARM64GE, cc)
return true
}
// match: (NZ (GreaterEqualU cc) yes no)
// result: (UGE cc yes no)
for b.Controls[0].Op == OpARM64GreaterEqualU {
v_0 := b.Controls[0]
cc := v_0.Args[0]
b.resetWithControl(BlockARM64UGE, cc)
return true
}
// match: (NZ (LessThanF cc) yes no)
// result: (FLT cc yes no)
for b.Controls[0].Op == OpARM64LessThanF {
v_0 := b.Controls[0]
cc := v_0.Args[0]
b.resetWithControl(BlockARM64FLT, cc)
return true
}
// match: (NZ (LessEqualF cc) yes no)
// result: (FLE cc yes no)
for b.Controls[0].Op == OpARM64LessEqualF {
v_0 := b.Controls[0]
cc := v_0.Args[0]
b.resetWithControl(BlockARM64FLE, cc)
return true
}
// match: (NZ (GreaterThanF cc) yes no)
// result: (FGT cc yes no)
for b.Controls[0].Op == OpARM64GreaterThanF {
v_0 := b.Controls[0]
cc := v_0.Args[0]
b.resetWithControl(BlockARM64FGT, cc)
return true
}
// match: (NZ (GreaterEqualF cc) yes no)
// result: (FGE cc yes no)
for b.Controls[0].Op == OpARM64GreaterEqualF {
v_0 := b.Controls[0]
cc := v_0.Args[0]
b.resetWithControl(BlockARM64FGE, cc)
return true
}
// match: (NZ (ANDconst [c] x) yes no)
// cond: oneBit(c)
// result: (TBNZ [int64(ntz64(c))] x yes no)
for b.Controls[0].Op == OpARM64ANDconst {
v_0 := b.Controls[0]
c := auxIntToInt64(v_0.AuxInt)
x := v_0.Args[0]
if !(oneBit(c)) {
break
}
b.resetWithControl(BlockARM64TBNZ, x)
b.AuxInt = int64ToAuxInt(int64(ntz64(c)))
return true
}
// match: (NZ (MOVDconst [0]) yes no)
// result: (First no yes)
for b.Controls[0].Op == OpARM64MOVDconst {
v_0 := b.Controls[0]
if auxIntToInt64(v_0.AuxInt) != 0 {
break
}
b.Reset(BlockFirst)
b.swapSuccessors()
return true
}
// match: (NZ (MOVDconst [c]) yes no)
// cond: c != 0
// result: (First yes no)
for b.Controls[0].Op == OpARM64MOVDconst {
v_0 := b.Controls[0]
c := auxIntToInt64(v_0.AuxInt)
if !(c != 0) {
break
}
b.Reset(BlockFirst)
return true
}
case BlockARM64NZW:
// match: (NZW (ANDconst [c] x) yes no)
// cond: oneBit(int64(uint32(c)))
// result: (TBNZ [int64(ntz64(int64(uint32(c))))] x yes no)
for b.Controls[0].Op == OpARM64ANDconst {
v_0 := b.Controls[0]
c := auxIntToInt64(v_0.AuxInt)
x := v_0.Args[0]
if !(oneBit(int64(uint32(c)))) {
break
}
b.resetWithControl(BlockARM64TBNZ, x)
b.AuxInt = int64ToAuxInt(int64(ntz64(int64(uint32(c)))))
return true
}
// match: (NZW (MOVDconst [c]) yes no)
// cond: int32(c) == 0
// result: (First no yes)
for b.Controls[0].Op == OpARM64MOVDconst {
v_0 := b.Controls[0]
c := auxIntToInt64(v_0.AuxInt)
if !(int32(c) == 0) {
break
}
b.Reset(BlockFirst)
b.swapSuccessors()
return true
}
// match: (NZW (MOVDconst [c]) yes no)
// cond: int32(c) != 0
// result: (First yes no)
for b.Controls[0].Op == OpARM64MOVDconst {
v_0 := b.Controls[0]
c := auxIntToInt64(v_0.AuxInt)
if !(int32(c) != 0) {
break
}
b.Reset(BlockFirst)
return true
}
case BlockARM64UGE:
// match: (UGE (FlagConstant [fc]) yes no)
// cond: fc.uge()
// result: (First yes no)
for b.Controls[0].Op == OpARM64FlagConstant {
v_0 := b.Controls[0]
fc := auxIntToFlagConstant(v_0.AuxInt)
if !(fc.uge()) {
break
}
b.Reset(BlockFirst)
return true
}
// match: (UGE (FlagConstant [fc]) yes no)
// cond: !fc.uge()
// result: (First no yes)
for b.Controls[0].Op == OpARM64FlagConstant {
v_0 := b.Controls[0]
fc := auxIntToFlagConstant(v_0.AuxInt)
if !(!fc.uge()) {
break
}
b.Reset(BlockFirst)
b.swapSuccessors()
return true
}
// match: (UGE (InvertFlags cmp) yes no)
// result: (ULE cmp yes no)
for b.Controls[0].Op == OpARM64InvertFlags {
v_0 := b.Controls[0]
cmp := v_0.Args[0]
b.resetWithControl(BlockARM64ULE, cmp)
return true
}
case BlockARM64UGT:
// match: (UGT (FlagConstant [fc]) yes no)
// cond: fc.ugt()
// result: (First yes no)
for b.Controls[0].Op == OpARM64FlagConstant {
v_0 := b.Controls[0]
fc := auxIntToFlagConstant(v_0.AuxInt)
if !(fc.ugt()) {
break
}
b.Reset(BlockFirst)
return true
}
// match: (UGT (FlagConstant [fc]) yes no)
// cond: !fc.ugt()
// result: (First no yes)
for b.Controls[0].Op == OpARM64FlagConstant {
v_0 := b.Controls[0]
fc := auxIntToFlagConstant(v_0.AuxInt)
if !(!fc.ugt()) {
break
}
b.Reset(BlockFirst)
b.swapSuccessors()
return true
}
// match: (UGT (InvertFlags cmp) yes no)
// result: (ULT cmp yes no)
for b.Controls[0].Op == OpARM64InvertFlags {
v_0 := b.Controls[0]
cmp := v_0.Args[0]
b.resetWithControl(BlockARM64ULT, cmp)
return true
}
case BlockARM64ULE:
// match: (ULE (FlagConstant [fc]) yes no)
// cond: fc.ule()
// result: (First yes no)
for b.Controls[0].Op == OpARM64FlagConstant {
v_0 := b.Controls[0]
fc := auxIntToFlagConstant(v_0.AuxInt)
if !(fc.ule()) {
break
}
b.Reset(BlockFirst)
return true
}
// match: (ULE (FlagConstant [fc]) yes no)
// cond: !fc.ule()
// result: (First no yes)
for b.Controls[0].Op == OpARM64FlagConstant {
v_0 := b.Controls[0]
fc := auxIntToFlagConstant(v_0.AuxInt)
if !(!fc.ule()) {
break
}
b.Reset(BlockFirst)
b.swapSuccessors()
return true
}
// match: (ULE (InvertFlags cmp) yes no)
// result: (UGE cmp yes no)
for b.Controls[0].Op == OpARM64InvertFlags {
v_0 := b.Controls[0]
cmp := v_0.Args[0]
b.resetWithControl(BlockARM64UGE, cmp)
return true
}
case BlockARM64ULT:
// match: (ULT (FlagConstant [fc]) yes no)
// cond: fc.ult()
// result: (First yes no)
for b.Controls[0].Op == OpARM64FlagConstant {
v_0 := b.Controls[0]
fc := auxIntToFlagConstant(v_0.AuxInt)
if !(fc.ult()) {
break
}
b.Reset(BlockFirst)
return true
}
// match: (ULT (FlagConstant [fc]) yes no)
// cond: !fc.ult()
// result: (First no yes)
for b.Controls[0].Op == OpARM64FlagConstant {
v_0 := b.Controls[0]
fc := auxIntToFlagConstant(v_0.AuxInt)
if !(!fc.ult()) {
break
}
b.Reset(BlockFirst)
b.swapSuccessors()
return true
}
// match: (ULT (InvertFlags cmp) yes no)
// result: (UGT cmp yes no)
for b.Controls[0].Op == OpARM64InvertFlags {
v_0 := b.Controls[0]
cmp := v_0.Args[0]
b.resetWithControl(BlockARM64UGT, cmp)
return true
}
case BlockARM64Z:
// match: (Z (ANDconst [c] x) yes no)
// cond: oneBit(c)
// result: (TBZ [int64(ntz64(c))] x yes no)
for b.Controls[0].Op == OpARM64ANDconst {
v_0 := b.Controls[0]
c := auxIntToInt64(v_0.AuxInt)
x := v_0.Args[0]
if !(oneBit(c)) {
break
}
b.resetWithControl(BlockARM64TBZ, x)
b.AuxInt = int64ToAuxInt(int64(ntz64(c)))
return true
}
// match: (Z (MOVDconst [0]) yes no)
// result: (First yes no)
for b.Controls[0].Op == OpARM64MOVDconst {
v_0 := b.Controls[0]
if auxIntToInt64(v_0.AuxInt) != 0 {
break
}
b.Reset(BlockFirst)
return true
}
// match: (Z (MOVDconst [c]) yes no)
// cond: c != 0
// result: (First no yes)
for b.Controls[0].Op == OpARM64MOVDconst {
v_0 := b.Controls[0]
c := auxIntToInt64(v_0.AuxInt)
if !(c != 0) {
break
}
b.Reset(BlockFirst)
b.swapSuccessors()
return true
}
case BlockARM64ZW:
// match: (ZW (ANDconst [c] x) yes no)
// cond: oneBit(int64(uint32(c)))
// result: (TBZ [int64(ntz64(int64(uint32(c))))] x yes no)
for b.Controls[0].Op == OpARM64ANDconst {
v_0 := b.Controls[0]
c := auxIntToInt64(v_0.AuxInt)
x := v_0.Args[0]
if !(oneBit(int64(uint32(c)))) {
break
}
b.resetWithControl(BlockARM64TBZ, x)
b.AuxInt = int64ToAuxInt(int64(ntz64(int64(uint32(c)))))
return true
}
// match: (ZW (MOVDconst [c]) yes no)
// cond: int32(c) == 0
// result: (First yes no)
for b.Controls[0].Op == OpARM64MOVDconst {
v_0 := b.Controls[0]
c := auxIntToInt64(v_0.AuxInt)
if !(int32(c) == 0) {
break
}
b.Reset(BlockFirst)
return true
}
// match: (ZW (MOVDconst [c]) yes no)
// cond: int32(c) != 0
// result: (First no yes)
for b.Controls[0].Op == OpARM64MOVDconst {
v_0 := b.Controls[0]
c := auxIntToInt64(v_0.AuxInt)
if !(int32(c) != 0) {
break
}
b.Reset(BlockFirst)
b.swapSuccessors()
return true
}
}
return false
}