diff --git a/src/cmd/compile/internal/ssa/_gen/AMD64.rules b/src/cmd/compile/internal/ssa/_gen/AMD64.rules
index dff5c93..8155951 100644
--- a/src/cmd/compile/internal/ssa/_gen/AMD64.rules
+++ b/src/cmd/compile/internal/ssa/_gen/AMD64.rules
@@ -1873,10 +1873,10 @@
// remove flags → bool → flags roundtrip
// Only do it if the flag generating instruction is local otherwise the likelihood flagalloc won't undo this optimization and makes things worse are slim.
-(NE t:(TESTQ x:(MOVBQZX s:(SET(EQ|NE|L|G|LE|GE|A|B|AE|BE|EQF|NEF|GF|GEF) flags)) x) yes no) && t.Block == s.Block => ((EQ|NE|LT|GT|LE|GE|UGT|ULT|UGE|ULE|EQF|NEF|UGE|UGT) flags yes no)
-(NE t:(TESTL x:(MOVBQZX s:(SET(EQ|NE|L|G|LE|GE|A|B|AE|BE|EQF|NEF|GF|GEF) flags)) x) yes no) && t.Block == s.Block => ((EQ|NE|LT|GT|LE|GE|UGT|ULT|UGE|ULE|EQF|NEF|UGE|UGT) flags yes no)
-(NE t:(TESTW x:(MOVBQZX s:(SET(EQ|NE|L|G|LE|GE|A|B|AE|BE|EQF|NEF|GF|GEF) flags)) x) yes no) && t.Block == s.Block => ((EQ|NE|LT|GT|LE|GE|UGT|ULT|UGE|ULE|EQF|NEF|UGE|UGT) flags yes no)
-(NE t:(TESTB s:(SET(EQ|NE|L|G|LE|GE|A|B|AE|BE|EQF|NEF|GF|GEF) flags) s) yes no) && t.Block == s.Block => ((EQ|NE|LT|GT|LE|GE|UGT|ULT|UGE|ULE|EQF|NEF|UGE|UGT) flags yes no)
+(NE t:(TESTQ x:(MOVBQZX s:(SET(EQ|NE|L|G|LE|GE|A|B|AE|BE|EQF|NEF|GF|GEF) flags)) x) yes no) && t.Block == s.Block => ((EQ|NE|LT|GT|LE|GE|UGT|ULT|UGE|ULE|EQF|NEF|UGT|UGE) flags yes no)
+(NE t:(TESTL x:(MOVBQZX s:(SET(EQ|NE|L|G|LE|GE|A|B|AE|BE|EQF|NEF|GF|GEF) flags)) x) yes no) && t.Block == s.Block => ((EQ|NE|LT|GT|LE|GE|UGT|ULT|UGE|ULE|EQF|NEF|UGT|UGE) flags yes no)
+(NE t:(TESTW x:(MOVBQZX s:(SET(EQ|NE|L|G|LE|GE|A|B|AE|BE|EQF|NEF|GF|GEF) flags)) x) yes no) && t.Block == s.Block => ((EQ|NE|LT|GT|LE|GE|UGT|ULT|UGE|ULE|EQF|NEF|UGT|UGE) flags yes no)
+(NE t:(TESTB s:(SET(EQ|NE|L|G|LE|GE|A|B|AE|BE|EQF|NEF|GF|GEF) flags) s) yes no) && t.Block == s.Block => ((EQ|NE|LT|GT|LE|GE|UGT|ULT|UGE|ULE|EQF|NEF|UGT|UGE) flags yes no)
(CMOVQNE yes no t:(TESTQ x:(MOVBQZX s:(SET(EQ|NE|L|G|LE|GE|A|B|AE|BE|EQF|NEF|GF|GEF) flags)) x)) && t.Block == s.Block => (CMOVQ(EQ|NE|LT|GT|LE|GE|HI|CS|CC|LS|EQF|NEF|GTF|GEF) yes no flags)
(CMOVQNE yes no t:(TESTL x:(MOVBQZX s:(SET(EQ|NE|L|G|LE|GE|A|B|AE|BE|EQF|NEF|GF|GEF) flags)) x)) && t.Block == s.Block => (CMOVQ(EQ|NE|LT|GT|LE|GE|HI|CS|CC|LS|EQF|NEF|GTF|GEF) yes no flags)
diff --git a/src/cmd/compile/internal/ssa/rewriteAMD64.go b/src/cmd/compile/internal/ssa/rewriteAMD64.go
index 9a45de3..147fd98 100644
--- a/src/cmd/compile/internal/ssa/rewriteAMD64.go
+++ b/src/cmd/compile/internal/ssa/rewriteAMD64.go
@@ -108729,7 +108729,7 @@
}
// match: (NE t:(TESTQ x:(MOVBQZX s:(SETGF flags)) x) yes no)
// cond: t.Block == s.Block
- // result: (UGE flags yes no)
+ // result: (UGT flags yes no)
for b.Controls[0].Op == OpAMD64TESTQ {
t := b.Controls[0]
_ = t.Args[1]
@@ -108748,14 +108748,14 @@
if x != t_1 || !(t.Block == s.Block) {
continue
}
- b.resetWithControl(BlockAMD64UGE, flags)
+ b.resetWithControl(BlockAMD64UGT, flags)
return true
}
break
}
// match: (NE t:(TESTQ x:(MOVBQZX s:(SETGEF flags)) x) yes no)
// cond: t.Block == s.Block
- // result: (UGT flags yes no)
+ // result: (UGE flags yes no)
for b.Controls[0].Op == OpAMD64TESTQ {
t := b.Controls[0]
_ = t.Args[1]
@@ -108774,7 +108774,7 @@
if x != t_1 || !(t.Block == s.Block) {
continue
}
- b.resetWithControl(BlockAMD64UGT, flags)
+ b.resetWithControl(BlockAMD64UGE, flags)
return true
}
break
@@ -109093,7 +109093,7 @@
}
// match: (NE t:(TESTL x:(MOVBQZX s:(SETGF flags)) x) yes no)
// cond: t.Block == s.Block
- // result: (UGE flags yes no)
+ // result: (UGT flags yes no)
for b.Controls[0].Op == OpAMD64TESTL {
t := b.Controls[0]
_ = t.Args[1]
@@ -109112,14 +109112,14 @@
if x != t_1 || !(t.Block == s.Block) {
continue
}
- b.resetWithControl(BlockAMD64UGE, flags)
+ b.resetWithControl(BlockAMD64UGT, flags)
return true
}
break
}
// match: (NE t:(TESTL x:(MOVBQZX s:(SETGEF flags)) x) yes no)
// cond: t.Block == s.Block
- // result: (UGT flags yes no)
+ // result: (UGE flags yes no)
for b.Controls[0].Op == OpAMD64TESTL {
t := b.Controls[0]
_ = t.Args[1]
@@ -109138,7 +109138,7 @@
if x != t_1 || !(t.Block == s.Block) {
continue
}
- b.resetWithControl(BlockAMD64UGT, flags)
+ b.resetWithControl(BlockAMD64UGE, flags)
return true
}
break
@@ -109457,7 +109457,7 @@
}
// match: (NE t:(TESTW x:(MOVBQZX s:(SETGF flags)) x) yes no)
// cond: t.Block == s.Block
- // result: (UGE flags yes no)
+ // result: (UGT flags yes no)
for b.Controls[0].Op == OpAMD64TESTW {
t := b.Controls[0]
_ = t.Args[1]
@@ -109476,14 +109476,14 @@
if x != t_1 || !(t.Block == s.Block) {
continue
}
- b.resetWithControl(BlockAMD64UGE, flags)
+ b.resetWithControl(BlockAMD64UGT, flags)
return true
}
break
}
// match: (NE t:(TESTW x:(MOVBQZX s:(SETGEF flags)) x) yes no)
// cond: t.Block == s.Block
- // result: (UGT flags yes no)
+ // result: (UGE flags yes no)
for b.Controls[0].Op == OpAMD64TESTW {
t := b.Controls[0]
_ = t.Args[1]
@@ -109502,7 +109502,7 @@
if x != t_1 || !(t.Block == s.Block) {
continue
}
- b.resetWithControl(BlockAMD64UGT, flags)
+ b.resetWithControl(BlockAMD64UGE, flags)
return true
}
break
@@ -109773,7 +109773,7 @@
}
// match: (NE t:(TESTB s:(SETGF flags) s) yes no)
// cond: t.Block == s.Block
- // result: (UGE flags yes no)
+ // result: (UGT flags yes no)
for b.Controls[0].Op == OpAMD64TESTB {
t := b.Controls[0]
_ = t.Args[1]
@@ -109788,14 +109788,14 @@
if s != t_1 || !(t.Block == s.Block) {
continue
}
- b.resetWithControl(BlockAMD64UGE, flags)
+ b.resetWithControl(BlockAMD64UGT, flags)
return true
}
break
}
// match: (NE t:(TESTB s:(SETGEF flags) s) yes no)
// cond: t.Block == s.Block
- // result: (UGT flags yes no)
+ // result: (UGE flags yes no)
for b.Controls[0].Op == OpAMD64TESTB {
t := b.Controls[0]
_ = t.Args[1]
@@ -109810,7 +109810,7 @@
if s != t_1 || !(t.Block == s.Block) {
continue
}
- b.resetWithControl(BlockAMD64UGT, flags)
+ b.resetWithControl(BlockAMD64UGE, flags)
return true
}
break