(TBNZ [0] (GreaterThanF cc) yes no) => (FGT cc yes no)
(TBNZ [0] (GreaterEqualF cc) yes no) => (FGE cc yes no)
+(TB(Z|NZ) [0] (XORconst [1] x) yes no) => (TB(NZ|Z) [0] x yes no)
+
((EQ|NE|LT|LE|GT|GE) (CMPconst [0] z:(AND x y)) yes no) && z.Uses == 1 => ((EQ|NE|LT|LE|GT|GE) (TST x y) yes no)
((EQ|NE|LT|LE|GT|GE) (CMPconst [0] x:(ANDconst [c] y)) yes no) && x.Uses == 1 => ((EQ|NE|LT|LE|GT|GE) (TSTconst [c] y) yes no)
((EQ|NE|LT|LE|GT|GE) (CMPWconst [0] z:(AND x y)) yes no) && z.Uses == 1 => ((EQ|NE|LT|LE|GT|GE) (TSTW x y) yes no)
b.resetWithControl(BlockARM64FGE, cc)
return true
}
+ // match: (TBNZ [0] (XORconst [1] x) yes no)
+ // result: (TBZ [0] x yes no)
+ for b.Controls[0].Op == OpARM64XORconst {
+ v_0 := b.Controls[0]
+ if auxIntToInt64(v_0.AuxInt) != 1 {
+ break
+ }
+ x := v_0.Args[0]
+ if auxIntToInt64(b.AuxInt) != 0 {
+ break
+ }
+ b.resetWithControl(BlockARM64TBZ, x)
+ b.AuxInt = int64ToAuxInt(0)
+ return true
+ }
+ case BlockARM64TBZ:
+ // match: (TBZ [0] (XORconst [1] x) yes no)
+ // result: (TBNZ [0] x yes no)
+ for b.Controls[0].Op == OpARM64XORconst {
+ v_0 := b.Controls[0]
+ if auxIntToInt64(v_0.AuxInt) != 1 {
+ break
+ }
+ x := v_0.Args[0]
+ if auxIntToInt64(b.AuxInt) != 0 {
+ break
+ }
+ b.resetWithControl(BlockARM64TBNZ, x)
+ b.AuxInt = int64ToAuxInt(0)
+ return true
+ }
case BlockARM64UGE:
// match: (UGE (FlagConstant [fc]) yes no)
// cond: fc.uge()
*p = b
}
}
+
+func boolCompare1(p, q *bool) int {
+ // arm64:-"EOR [$]1"
+ if *p == *q {
+ return 5
+ }
+ return 7
+}
+func boolCompare2(p, q *bool) int {
+ // arm64:-"EOR [$]1"
+ if *p != *q {
+ return 5
+ }
+ return 7
+}