in src/cmd/compile/internal/ssa/rewriteS390X.go [16022:17915]
func rewriteBlockS390X(b *Block) bool {
typ := &b.Func.Config.Types
switch b.Kind {
case BlockS390XBRC:
// match: (BRC {c} x:(CMP _ _) yes no)
// cond: c&s390x.Unordered != 0
// result: (BRC {c&^s390x.Unordered} x yes no)
for b.Controls[0].Op == OpS390XCMP {
x := b.Controls[0]
c := auxToS390xCCMask(b.Aux)
if !(c&s390x.Unordered != 0) {
break
}
b.resetWithControl(BlockS390XBRC, x)
b.Aux = s390xCCMaskToAux(c &^ s390x.Unordered)
return true
}
// match: (BRC {c} x:(CMPW _ _) yes no)
// cond: c&s390x.Unordered != 0
// result: (BRC {c&^s390x.Unordered} x yes no)
for b.Controls[0].Op == OpS390XCMPW {
x := b.Controls[0]
c := auxToS390xCCMask(b.Aux)
if !(c&s390x.Unordered != 0) {
break
}
b.resetWithControl(BlockS390XBRC, x)
b.Aux = s390xCCMaskToAux(c &^ s390x.Unordered)
return true
}
// match: (BRC {c} x:(CMPU _ _) yes no)
// cond: c&s390x.Unordered != 0
// result: (BRC {c&^s390x.Unordered} x yes no)
for b.Controls[0].Op == OpS390XCMPU {
x := b.Controls[0]
c := auxToS390xCCMask(b.Aux)
if !(c&s390x.Unordered != 0) {
break
}
b.resetWithControl(BlockS390XBRC, x)
b.Aux = s390xCCMaskToAux(c &^ s390x.Unordered)
return true
}
// match: (BRC {c} x:(CMPWU _ _) yes no)
// cond: c&s390x.Unordered != 0
// result: (BRC {c&^s390x.Unordered} x yes no)
for b.Controls[0].Op == OpS390XCMPWU {
x := b.Controls[0]
c := auxToS390xCCMask(b.Aux)
if !(c&s390x.Unordered != 0) {
break
}
b.resetWithControl(BlockS390XBRC, x)
b.Aux = s390xCCMaskToAux(c &^ s390x.Unordered)
return true
}
// match: (BRC {c} x:(CMPconst _) yes no)
// cond: c&s390x.Unordered != 0
// result: (BRC {c&^s390x.Unordered} x yes no)
for b.Controls[0].Op == OpS390XCMPconst {
x := b.Controls[0]
c := auxToS390xCCMask(b.Aux)
if !(c&s390x.Unordered != 0) {
break
}
b.resetWithControl(BlockS390XBRC, x)
b.Aux = s390xCCMaskToAux(c &^ s390x.Unordered)
return true
}
// match: (BRC {c} x:(CMPWconst _) yes no)
// cond: c&s390x.Unordered != 0
// result: (BRC {c&^s390x.Unordered} x yes no)
for b.Controls[0].Op == OpS390XCMPWconst {
x := b.Controls[0]
c := auxToS390xCCMask(b.Aux)
if !(c&s390x.Unordered != 0) {
break
}
b.resetWithControl(BlockS390XBRC, x)
b.Aux = s390xCCMaskToAux(c &^ s390x.Unordered)
return true
}
// match: (BRC {c} x:(CMPUconst _) yes no)
// cond: c&s390x.Unordered != 0
// result: (BRC {c&^s390x.Unordered} x yes no)
for b.Controls[0].Op == OpS390XCMPUconst {
x := b.Controls[0]
c := auxToS390xCCMask(b.Aux)
if !(c&s390x.Unordered != 0) {
break
}
b.resetWithControl(BlockS390XBRC, x)
b.Aux = s390xCCMaskToAux(c &^ s390x.Unordered)
return true
}
// match: (BRC {c} x:(CMPWUconst _) yes no)
// cond: c&s390x.Unordered != 0
// result: (BRC {c&^s390x.Unordered} x yes no)
for b.Controls[0].Op == OpS390XCMPWUconst {
x := b.Controls[0]
c := auxToS390xCCMask(b.Aux)
if !(c&s390x.Unordered != 0) {
break
}
b.resetWithControl(BlockS390XBRC, x)
b.Aux = s390xCCMaskToAux(c &^ s390x.Unordered)
return true
}
// match: (BRC {c} (CMP x y) yes no)
// result: (CGRJ {c&^s390x.Unordered} x y yes no)
for b.Controls[0].Op == OpS390XCMP {
v_0 := b.Controls[0]
y := v_0.Args[1]
x := v_0.Args[0]
c := auxToS390xCCMask(b.Aux)
b.resetWithControl2(BlockS390XCGRJ, x, y)
b.Aux = s390xCCMaskToAux(c &^ s390x.Unordered)
return true
}
// match: (BRC {c} (CMPW x y) yes no)
// result: (CRJ {c&^s390x.Unordered} x y yes no)
for b.Controls[0].Op == OpS390XCMPW {
v_0 := b.Controls[0]
y := v_0.Args[1]
x := v_0.Args[0]
c := auxToS390xCCMask(b.Aux)
b.resetWithControl2(BlockS390XCRJ, x, y)
b.Aux = s390xCCMaskToAux(c &^ s390x.Unordered)
return true
}
// match: (BRC {c} (CMPU x y) yes no)
// result: (CLGRJ {c&^s390x.Unordered} x y yes no)
for b.Controls[0].Op == OpS390XCMPU {
v_0 := b.Controls[0]
y := v_0.Args[1]
x := v_0.Args[0]
c := auxToS390xCCMask(b.Aux)
b.resetWithControl2(BlockS390XCLGRJ, x, y)
b.Aux = s390xCCMaskToAux(c &^ s390x.Unordered)
return true
}
// match: (BRC {c} (CMPWU x y) yes no)
// result: (CLRJ {c&^s390x.Unordered} x y yes no)
for b.Controls[0].Op == OpS390XCMPWU {
v_0 := b.Controls[0]
y := v_0.Args[1]
x := v_0.Args[0]
c := auxToS390xCCMask(b.Aux)
b.resetWithControl2(BlockS390XCLRJ, x, y)
b.Aux = s390xCCMaskToAux(c &^ s390x.Unordered)
return true
}
// match: (BRC {c} (CMPconst x [y]) yes no)
// cond: y == int32( int8(y))
// result: (CGIJ {c&^s390x.Unordered} x [ int8(y)] yes no)
for b.Controls[0].Op == OpS390XCMPconst {
v_0 := b.Controls[0]
y := auxIntToInt32(v_0.AuxInt)
x := v_0.Args[0]
c := auxToS390xCCMask(b.Aux)
if !(y == int32(int8(y))) {
break
}
b.resetWithControl(BlockS390XCGIJ, x)
b.AuxInt = int8ToAuxInt(int8(y))
b.Aux = s390xCCMaskToAux(c &^ s390x.Unordered)
return true
}
// match: (BRC {c} (CMPWconst x [y]) yes no)
// cond: y == int32( int8(y))
// result: (CIJ {c&^s390x.Unordered} x [ int8(y)] yes no)
for b.Controls[0].Op == OpS390XCMPWconst {
v_0 := b.Controls[0]
y := auxIntToInt32(v_0.AuxInt)
x := v_0.Args[0]
c := auxToS390xCCMask(b.Aux)
if !(y == int32(int8(y))) {
break
}
b.resetWithControl(BlockS390XCIJ, x)
b.AuxInt = int8ToAuxInt(int8(y))
b.Aux = s390xCCMaskToAux(c &^ s390x.Unordered)
return true
}
// match: (BRC {c} (CMPUconst x [y]) yes no)
// cond: y == int32(uint8(y))
// result: (CLGIJ {c&^s390x.Unordered} x [uint8(y)] yes no)
for b.Controls[0].Op == OpS390XCMPUconst {
v_0 := b.Controls[0]
y := auxIntToInt32(v_0.AuxInt)
x := v_0.Args[0]
c := auxToS390xCCMask(b.Aux)
if !(y == int32(uint8(y))) {
break
}
b.resetWithControl(BlockS390XCLGIJ, x)
b.AuxInt = uint8ToAuxInt(uint8(y))
b.Aux = s390xCCMaskToAux(c &^ s390x.Unordered)
return true
}
// match: (BRC {c} (CMPWUconst x [y]) yes no)
// cond: y == int32(uint8(y))
// result: (CLIJ {c&^s390x.Unordered} x [uint8(y)] yes no)
for b.Controls[0].Op == OpS390XCMPWUconst {
v_0 := b.Controls[0]
y := auxIntToInt32(v_0.AuxInt)
x := v_0.Args[0]
c := auxToS390xCCMask(b.Aux)
if !(y == int32(uint8(y))) {
break
}
b.resetWithControl(BlockS390XCLIJ, x)
b.AuxInt = uint8ToAuxInt(uint8(y))
b.Aux = s390xCCMaskToAux(c &^ s390x.Unordered)
return true
}
// match: (BRC {s390x.Less} (CMPconst x [ 128]) yes no)
// result: (CGIJ {s390x.LessOrEqual} x [ 127] yes no)
for b.Controls[0].Op == OpS390XCMPconst {
v_0 := b.Controls[0]
if auxIntToInt32(v_0.AuxInt) != 128 {
break
}
x := v_0.Args[0]
if auxToS390xCCMask(b.Aux) != s390x.Less {
break
}
b.resetWithControl(BlockS390XCGIJ, x)
b.AuxInt = int8ToAuxInt(127)
b.Aux = s390xCCMaskToAux(s390x.LessOrEqual)
return true
}
// match: (BRC {s390x.Less} (CMPWconst x [ 128]) yes no)
// result: (CIJ {s390x.LessOrEqual} x [ 127] yes no)
for b.Controls[0].Op == OpS390XCMPWconst {
v_0 := b.Controls[0]
if auxIntToInt32(v_0.AuxInt) != 128 {
break
}
x := v_0.Args[0]
if auxToS390xCCMask(b.Aux) != s390x.Less {
break
}
b.resetWithControl(BlockS390XCIJ, x)
b.AuxInt = int8ToAuxInt(127)
b.Aux = s390xCCMaskToAux(s390x.LessOrEqual)
return true
}
// match: (BRC {s390x.LessOrEqual} (CMPconst x [-129]) yes no)
// result: (CGIJ {s390x.Less} x [-128] yes no)
for b.Controls[0].Op == OpS390XCMPconst {
v_0 := b.Controls[0]
if auxIntToInt32(v_0.AuxInt) != -129 {
break
}
x := v_0.Args[0]
if auxToS390xCCMask(b.Aux) != s390x.LessOrEqual {
break
}
b.resetWithControl(BlockS390XCGIJ, x)
b.AuxInt = int8ToAuxInt(-128)
b.Aux = s390xCCMaskToAux(s390x.Less)
return true
}
// match: (BRC {s390x.LessOrEqual} (CMPWconst x [-129]) yes no)
// result: (CIJ {s390x.Less} x [-128] yes no)
for b.Controls[0].Op == OpS390XCMPWconst {
v_0 := b.Controls[0]
if auxIntToInt32(v_0.AuxInt) != -129 {
break
}
x := v_0.Args[0]
if auxToS390xCCMask(b.Aux) != s390x.LessOrEqual {
break
}
b.resetWithControl(BlockS390XCIJ, x)
b.AuxInt = int8ToAuxInt(-128)
b.Aux = s390xCCMaskToAux(s390x.Less)
return true
}
// match: (BRC {s390x.Greater} (CMPconst x [-129]) yes no)
// result: (CGIJ {s390x.GreaterOrEqual} x [-128] yes no)
for b.Controls[0].Op == OpS390XCMPconst {
v_0 := b.Controls[0]
if auxIntToInt32(v_0.AuxInt) != -129 {
break
}
x := v_0.Args[0]
if auxToS390xCCMask(b.Aux) != s390x.Greater {
break
}
b.resetWithControl(BlockS390XCGIJ, x)
b.AuxInt = int8ToAuxInt(-128)
b.Aux = s390xCCMaskToAux(s390x.GreaterOrEqual)
return true
}
// match: (BRC {s390x.Greater} (CMPWconst x [-129]) yes no)
// result: (CIJ {s390x.GreaterOrEqual} x [-128] yes no)
for b.Controls[0].Op == OpS390XCMPWconst {
v_0 := b.Controls[0]
if auxIntToInt32(v_0.AuxInt) != -129 {
break
}
x := v_0.Args[0]
if auxToS390xCCMask(b.Aux) != s390x.Greater {
break
}
b.resetWithControl(BlockS390XCIJ, x)
b.AuxInt = int8ToAuxInt(-128)
b.Aux = s390xCCMaskToAux(s390x.GreaterOrEqual)
return true
}
// match: (BRC {s390x.GreaterOrEqual} (CMPconst x [ 128]) yes no)
// result: (CGIJ {s390x.Greater} x [ 127] yes no)
for b.Controls[0].Op == OpS390XCMPconst {
v_0 := b.Controls[0]
if auxIntToInt32(v_0.AuxInt) != 128 {
break
}
x := v_0.Args[0]
if auxToS390xCCMask(b.Aux) != s390x.GreaterOrEqual {
break
}
b.resetWithControl(BlockS390XCGIJ, x)
b.AuxInt = int8ToAuxInt(127)
b.Aux = s390xCCMaskToAux(s390x.Greater)
return true
}
// match: (BRC {s390x.GreaterOrEqual} (CMPWconst x [ 128]) yes no)
// result: (CIJ {s390x.Greater} x [ 127] yes no)
for b.Controls[0].Op == OpS390XCMPWconst {
v_0 := b.Controls[0]
if auxIntToInt32(v_0.AuxInt) != 128 {
break
}
x := v_0.Args[0]
if auxToS390xCCMask(b.Aux) != s390x.GreaterOrEqual {
break
}
b.resetWithControl(BlockS390XCIJ, x)
b.AuxInt = int8ToAuxInt(127)
b.Aux = s390xCCMaskToAux(s390x.Greater)
return true
}
// match: (BRC {s390x.Less} (CMPWUconst x [256]) yes no)
// result: (CLIJ {s390x.LessOrEqual} x [255] yes no)
for b.Controls[0].Op == OpS390XCMPWUconst {
v_0 := b.Controls[0]
if auxIntToInt32(v_0.AuxInt) != 256 {
break
}
x := v_0.Args[0]
if auxToS390xCCMask(b.Aux) != s390x.Less {
break
}
b.resetWithControl(BlockS390XCLIJ, x)
b.AuxInt = uint8ToAuxInt(255)
b.Aux = s390xCCMaskToAux(s390x.LessOrEqual)
return true
}
// match: (BRC {s390x.Less} (CMPUconst x [256]) yes no)
// result: (CLGIJ {s390x.LessOrEqual} x [255] yes no)
for b.Controls[0].Op == OpS390XCMPUconst {
v_0 := b.Controls[0]
if auxIntToInt32(v_0.AuxInt) != 256 {
break
}
x := v_0.Args[0]
if auxToS390xCCMask(b.Aux) != s390x.Less {
break
}
b.resetWithControl(BlockS390XCLGIJ, x)
b.AuxInt = uint8ToAuxInt(255)
b.Aux = s390xCCMaskToAux(s390x.LessOrEqual)
return true
}
// match: (BRC {s390x.GreaterOrEqual} (CMPWUconst x [256]) yes no)
// result: (CLIJ {s390x.Greater} x [255] yes no)
for b.Controls[0].Op == OpS390XCMPWUconst {
v_0 := b.Controls[0]
if auxIntToInt32(v_0.AuxInt) != 256 {
break
}
x := v_0.Args[0]
if auxToS390xCCMask(b.Aux) != s390x.GreaterOrEqual {
break
}
b.resetWithControl(BlockS390XCLIJ, x)
b.AuxInt = uint8ToAuxInt(255)
b.Aux = s390xCCMaskToAux(s390x.Greater)
return true
}
// match: (BRC {s390x.GreaterOrEqual} (CMPUconst x [256]) yes no)
// result: (CLGIJ {s390x.Greater} x [255] yes no)
for b.Controls[0].Op == OpS390XCMPUconst {
v_0 := b.Controls[0]
if auxIntToInt32(v_0.AuxInt) != 256 {
break
}
x := v_0.Args[0]
if auxToS390xCCMask(b.Aux) != s390x.GreaterOrEqual {
break
}
b.resetWithControl(BlockS390XCLGIJ, x)
b.AuxInt = uint8ToAuxInt(255)
b.Aux = s390xCCMaskToAux(s390x.Greater)
return true
}
// match: (BRC {c} (CMPconst x [y]) yes no)
// cond: y == int32(uint8(y)) && (c == s390x.Equal || c == s390x.LessOrGreater)
// result: (CLGIJ {c} x [uint8(y)] yes no)
for b.Controls[0].Op == OpS390XCMPconst {
v_0 := b.Controls[0]
y := auxIntToInt32(v_0.AuxInt)
x := v_0.Args[0]
c := auxToS390xCCMask(b.Aux)
if !(y == int32(uint8(y)) && (c == s390x.Equal || c == s390x.LessOrGreater)) {
break
}
b.resetWithControl(BlockS390XCLGIJ, x)
b.AuxInt = uint8ToAuxInt(uint8(y))
b.Aux = s390xCCMaskToAux(c)
return true
}
// match: (BRC {c} (CMPWconst x [y]) yes no)
// cond: y == int32(uint8(y)) && (c == s390x.Equal || c == s390x.LessOrGreater)
// result: (CLIJ {c} x [uint8(y)] yes no)
for b.Controls[0].Op == OpS390XCMPWconst {
v_0 := b.Controls[0]
y := auxIntToInt32(v_0.AuxInt)
x := v_0.Args[0]
c := auxToS390xCCMask(b.Aux)
if !(y == int32(uint8(y)) && (c == s390x.Equal || c == s390x.LessOrGreater)) {
break
}
b.resetWithControl(BlockS390XCLIJ, x)
b.AuxInt = uint8ToAuxInt(uint8(y))
b.Aux = s390xCCMaskToAux(c)
return true
}
// match: (BRC {c} (CMPUconst x [y]) yes no)
// cond: y == int32( int8(y)) && (c == s390x.Equal || c == s390x.LessOrGreater)
// result: (CGIJ {c} x [ int8(y)] yes no)
for b.Controls[0].Op == OpS390XCMPUconst {
v_0 := b.Controls[0]
y := auxIntToInt32(v_0.AuxInt)
x := v_0.Args[0]
c := auxToS390xCCMask(b.Aux)
if !(y == int32(int8(y)) && (c == s390x.Equal || c == s390x.LessOrGreater)) {
break
}
b.resetWithControl(BlockS390XCGIJ, x)
b.AuxInt = int8ToAuxInt(int8(y))
b.Aux = s390xCCMaskToAux(c)
return true
}
// match: (BRC {c} (CMPWUconst x [y]) yes no)
// cond: y == int32( int8(y)) && (c == s390x.Equal || c == s390x.LessOrGreater)
// result: (CIJ {c} x [ int8(y)] yes no)
for b.Controls[0].Op == OpS390XCMPWUconst {
v_0 := b.Controls[0]
y := auxIntToInt32(v_0.AuxInt)
x := v_0.Args[0]
c := auxToS390xCCMask(b.Aux)
if !(y == int32(int8(y)) && (c == s390x.Equal || c == s390x.LessOrGreater)) {
break
}
b.resetWithControl(BlockS390XCIJ, x)
b.AuxInt = int8ToAuxInt(int8(y))
b.Aux = s390xCCMaskToAux(c)
return true
}
// match: (BRC {c} (InvertFlags cmp) yes no)
// result: (BRC {c.ReverseComparison()} cmp yes no)
for b.Controls[0].Op == OpS390XInvertFlags {
v_0 := b.Controls[0]
cmp := v_0.Args[0]
c := auxToS390xCCMask(b.Aux)
b.resetWithControl(BlockS390XBRC, cmp)
b.Aux = s390xCCMaskToAux(c.ReverseComparison())
return true
}
// match: (BRC {c} (FlagEQ) yes no)
// cond: c&s390x.Equal != 0
// result: (First yes no)
for b.Controls[0].Op == OpS390XFlagEQ {
c := auxToS390xCCMask(b.Aux)
if !(c&s390x.Equal != 0) {
break
}
b.Reset(BlockFirst)
return true
}
// match: (BRC {c} (FlagLT) yes no)
// cond: c&s390x.Less != 0
// result: (First yes no)
for b.Controls[0].Op == OpS390XFlagLT {
c := auxToS390xCCMask(b.Aux)
if !(c&s390x.Less != 0) {
break
}
b.Reset(BlockFirst)
return true
}
// match: (BRC {c} (FlagGT) yes no)
// cond: c&s390x.Greater != 0
// result: (First yes no)
for b.Controls[0].Op == OpS390XFlagGT {
c := auxToS390xCCMask(b.Aux)
if !(c&s390x.Greater != 0) {
break
}
b.Reset(BlockFirst)
return true
}
// match: (BRC {c} (FlagOV) yes no)
// cond: c&s390x.Unordered != 0
// result: (First yes no)
for b.Controls[0].Op == OpS390XFlagOV {
c := auxToS390xCCMask(b.Aux)
if !(c&s390x.Unordered != 0) {
break
}
b.Reset(BlockFirst)
return true
}
// match: (BRC {c} (FlagEQ) yes no)
// cond: c&s390x.Equal == 0
// result: (First no yes)
for b.Controls[0].Op == OpS390XFlagEQ {
c := auxToS390xCCMask(b.Aux)
if !(c&s390x.Equal == 0) {
break
}
b.Reset(BlockFirst)
b.swapSuccessors()
return true
}
// match: (BRC {c} (FlagLT) yes no)
// cond: c&s390x.Less == 0
// result: (First no yes)
for b.Controls[0].Op == OpS390XFlagLT {
c := auxToS390xCCMask(b.Aux)
if !(c&s390x.Less == 0) {
break
}
b.Reset(BlockFirst)
b.swapSuccessors()
return true
}
// match: (BRC {c} (FlagGT) yes no)
// cond: c&s390x.Greater == 0
// result: (First no yes)
for b.Controls[0].Op == OpS390XFlagGT {
c := auxToS390xCCMask(b.Aux)
if !(c&s390x.Greater == 0) {
break
}
b.Reset(BlockFirst)
b.swapSuccessors()
return true
}
// match: (BRC {c} (FlagOV) yes no)
// cond: c&s390x.Unordered == 0
// result: (First no yes)
for b.Controls[0].Op == OpS390XFlagOV {
c := auxToS390xCCMask(b.Aux)
if !(c&s390x.Unordered == 0) {
break
}
b.Reset(BlockFirst)
b.swapSuccessors()
return true
}
case BlockS390XCGIJ:
// match: (CGIJ {c} (MOVDconst [x]) [y] yes no)
// cond: c&s390x.Equal != 0 && int64(x) == int64(y)
// result: (First yes no)
for b.Controls[0].Op == OpS390XMOVDconst {
v_0 := b.Controls[0]
x := auxIntToInt64(v_0.AuxInt)
y := auxIntToInt8(b.AuxInt)
c := auxToS390xCCMask(b.Aux)
if !(c&s390x.Equal != 0 && int64(x) == int64(y)) {
break
}
b.Reset(BlockFirst)
return true
}
// match: (CGIJ {c} (MOVDconst [x]) [y] yes no)
// cond: c&s390x.Less != 0 && int64(x) < int64(y)
// result: (First yes no)
for b.Controls[0].Op == OpS390XMOVDconst {
v_0 := b.Controls[0]
x := auxIntToInt64(v_0.AuxInt)
y := auxIntToInt8(b.AuxInt)
c := auxToS390xCCMask(b.Aux)
if !(c&s390x.Less != 0 && int64(x) < int64(y)) {
break
}
b.Reset(BlockFirst)
return true
}
// match: (CGIJ {c} (MOVDconst [x]) [y] yes no)
// cond: c&s390x.Greater != 0 && int64(x) > int64(y)
// result: (First yes no)
for b.Controls[0].Op == OpS390XMOVDconst {
v_0 := b.Controls[0]
x := auxIntToInt64(v_0.AuxInt)
y := auxIntToInt8(b.AuxInt)
c := auxToS390xCCMask(b.Aux)
if !(c&s390x.Greater != 0 && int64(x) > int64(y)) {
break
}
b.Reset(BlockFirst)
return true
}
// match: (CGIJ {c} (MOVDconst [x]) [y] yes no)
// cond: c&s390x.Equal == 0 && int64(x) == int64(y)
// result: (First no yes)
for b.Controls[0].Op == OpS390XMOVDconst {
v_0 := b.Controls[0]
x := auxIntToInt64(v_0.AuxInt)
y := auxIntToInt8(b.AuxInt)
c := auxToS390xCCMask(b.Aux)
if !(c&s390x.Equal == 0 && int64(x) == int64(y)) {
break
}
b.Reset(BlockFirst)
b.swapSuccessors()
return true
}
// match: (CGIJ {c} (MOVDconst [x]) [y] yes no)
// cond: c&s390x.Less == 0 && int64(x) < int64(y)
// result: (First no yes)
for b.Controls[0].Op == OpS390XMOVDconst {
v_0 := b.Controls[0]
x := auxIntToInt64(v_0.AuxInt)
y := auxIntToInt8(b.AuxInt)
c := auxToS390xCCMask(b.Aux)
if !(c&s390x.Less == 0 && int64(x) < int64(y)) {
break
}
b.Reset(BlockFirst)
b.swapSuccessors()
return true
}
// match: (CGIJ {c} (MOVDconst [x]) [y] yes no)
// cond: c&s390x.Greater == 0 && int64(x) > int64(y)
// result: (First no yes)
for b.Controls[0].Op == OpS390XMOVDconst {
v_0 := b.Controls[0]
x := auxIntToInt64(v_0.AuxInt)
y := auxIntToInt8(b.AuxInt)
c := auxToS390xCCMask(b.Aux)
if !(c&s390x.Greater == 0 && int64(x) > int64(y)) {
break
}
b.Reset(BlockFirst)
b.swapSuccessors()
return true
}
// match: (CGIJ {s390x.Equal} (Select0 (ADDE (MOVDconst [0]) (MOVDconst [0]) carry)) [0])
// result: (BRC {s390x.NoCarry} carry)
for b.Controls[0].Op == OpSelect0 {
v_0 := b.Controls[0]
v_0_0 := v_0.Args[0]
if v_0_0.Op != OpS390XADDE {
break
}
carry := v_0_0.Args[2]
v_0_0_0 := v_0_0.Args[0]
if v_0_0_0.Op != OpS390XMOVDconst || auxIntToInt64(v_0_0_0.AuxInt) != 0 {
break
}
v_0_0_1 := v_0_0.Args[1]
if v_0_0_1.Op != OpS390XMOVDconst || auxIntToInt64(v_0_0_1.AuxInt) != 0 || auxIntToInt8(b.AuxInt) != 0 || auxToS390xCCMask(b.Aux) != s390x.Equal {
break
}
b.resetWithControl(BlockS390XBRC, carry)
b.Aux = s390xCCMaskToAux(s390x.NoCarry)
return true
}
// match: (CGIJ {s390x.Equal} (Select0 (ADDE (MOVDconst [0]) (MOVDconst [0]) carry)) [1])
// result: (BRC {s390x.Carry} carry)
for b.Controls[0].Op == OpSelect0 {
v_0 := b.Controls[0]
v_0_0 := v_0.Args[0]
if v_0_0.Op != OpS390XADDE {
break
}
carry := v_0_0.Args[2]
v_0_0_0 := v_0_0.Args[0]
if v_0_0_0.Op != OpS390XMOVDconst || auxIntToInt64(v_0_0_0.AuxInt) != 0 {
break
}
v_0_0_1 := v_0_0.Args[1]
if v_0_0_1.Op != OpS390XMOVDconst || auxIntToInt64(v_0_0_1.AuxInt) != 0 || auxIntToInt8(b.AuxInt) != 1 || auxToS390xCCMask(b.Aux) != s390x.Equal {
break
}
b.resetWithControl(BlockS390XBRC, carry)
b.Aux = s390xCCMaskToAux(s390x.Carry)
return true
}
// match: (CGIJ {s390x.LessOrGreater} (Select0 (ADDE (MOVDconst [0]) (MOVDconst [0]) carry)) [0])
// result: (BRC {s390x.Carry} carry)
for b.Controls[0].Op == OpSelect0 {
v_0 := b.Controls[0]
v_0_0 := v_0.Args[0]
if v_0_0.Op != OpS390XADDE {
break
}
carry := v_0_0.Args[2]
v_0_0_0 := v_0_0.Args[0]
if v_0_0_0.Op != OpS390XMOVDconst || auxIntToInt64(v_0_0_0.AuxInt) != 0 {
break
}
v_0_0_1 := v_0_0.Args[1]
if v_0_0_1.Op != OpS390XMOVDconst || auxIntToInt64(v_0_0_1.AuxInt) != 0 || auxIntToInt8(b.AuxInt) != 0 || auxToS390xCCMask(b.Aux) != s390x.LessOrGreater {
break
}
b.resetWithControl(BlockS390XBRC, carry)
b.Aux = s390xCCMaskToAux(s390x.Carry)
return true
}
// match: (CGIJ {s390x.LessOrGreater} (Select0 (ADDE (MOVDconst [0]) (MOVDconst [0]) carry)) [1])
// result: (BRC {s390x.NoCarry} carry)
for b.Controls[0].Op == OpSelect0 {
v_0 := b.Controls[0]
v_0_0 := v_0.Args[0]
if v_0_0.Op != OpS390XADDE {
break
}
carry := v_0_0.Args[2]
v_0_0_0 := v_0_0.Args[0]
if v_0_0_0.Op != OpS390XMOVDconst || auxIntToInt64(v_0_0_0.AuxInt) != 0 {
break
}
v_0_0_1 := v_0_0.Args[1]
if v_0_0_1.Op != OpS390XMOVDconst || auxIntToInt64(v_0_0_1.AuxInt) != 0 || auxIntToInt8(b.AuxInt) != 1 || auxToS390xCCMask(b.Aux) != s390x.LessOrGreater {
break
}
b.resetWithControl(BlockS390XBRC, carry)
b.Aux = s390xCCMaskToAux(s390x.NoCarry)
return true
}
// match: (CGIJ {s390x.Greater} (Select0 (ADDE (MOVDconst [0]) (MOVDconst [0]) carry)) [0])
// result: (BRC {s390x.Carry} carry)
for b.Controls[0].Op == OpSelect0 {
v_0 := b.Controls[0]
v_0_0 := v_0.Args[0]
if v_0_0.Op != OpS390XADDE {
break
}
carry := v_0_0.Args[2]
v_0_0_0 := v_0_0.Args[0]
if v_0_0_0.Op != OpS390XMOVDconst || auxIntToInt64(v_0_0_0.AuxInt) != 0 {
break
}
v_0_0_1 := v_0_0.Args[1]
if v_0_0_1.Op != OpS390XMOVDconst || auxIntToInt64(v_0_0_1.AuxInt) != 0 || auxIntToInt8(b.AuxInt) != 0 || auxToS390xCCMask(b.Aux) != s390x.Greater {
break
}
b.resetWithControl(BlockS390XBRC, carry)
b.Aux = s390xCCMaskToAux(s390x.Carry)
return true
}
// match: (CGIJ {s390x.Equal} (NEG (Select0 (SUBE (MOVDconst [0]) (MOVDconst [0]) borrow))) [0])
// result: (BRC {s390x.NoBorrow} borrow)
for b.Controls[0].Op == OpS390XNEG {
v_0 := b.Controls[0]
v_0_0 := v_0.Args[0]
if v_0_0.Op != OpSelect0 {
break
}
v_0_0_0 := v_0_0.Args[0]
if v_0_0_0.Op != OpS390XSUBE {
break
}
borrow := v_0_0_0.Args[2]
v_0_0_0_0 := v_0_0_0.Args[0]
if v_0_0_0_0.Op != OpS390XMOVDconst || auxIntToInt64(v_0_0_0_0.AuxInt) != 0 {
break
}
v_0_0_0_1 := v_0_0_0.Args[1]
if v_0_0_0_1.Op != OpS390XMOVDconst || auxIntToInt64(v_0_0_0_1.AuxInt) != 0 || auxIntToInt8(b.AuxInt) != 0 || auxToS390xCCMask(b.Aux) != s390x.Equal {
break
}
b.resetWithControl(BlockS390XBRC, borrow)
b.Aux = s390xCCMaskToAux(s390x.NoBorrow)
return true
}
// match: (CGIJ {s390x.Equal} (NEG (Select0 (SUBE (MOVDconst [0]) (MOVDconst [0]) borrow))) [1])
// result: (BRC {s390x.Borrow} borrow)
for b.Controls[0].Op == OpS390XNEG {
v_0 := b.Controls[0]
v_0_0 := v_0.Args[0]
if v_0_0.Op != OpSelect0 {
break
}
v_0_0_0 := v_0_0.Args[0]
if v_0_0_0.Op != OpS390XSUBE {
break
}
borrow := v_0_0_0.Args[2]
v_0_0_0_0 := v_0_0_0.Args[0]
if v_0_0_0_0.Op != OpS390XMOVDconst || auxIntToInt64(v_0_0_0_0.AuxInt) != 0 {
break
}
v_0_0_0_1 := v_0_0_0.Args[1]
if v_0_0_0_1.Op != OpS390XMOVDconst || auxIntToInt64(v_0_0_0_1.AuxInt) != 0 || auxIntToInt8(b.AuxInt) != 1 || auxToS390xCCMask(b.Aux) != s390x.Equal {
break
}
b.resetWithControl(BlockS390XBRC, borrow)
b.Aux = s390xCCMaskToAux(s390x.Borrow)
return true
}
// match: (CGIJ {s390x.LessOrGreater} (NEG (Select0 (SUBE (MOVDconst [0]) (MOVDconst [0]) borrow))) [0])
// result: (BRC {s390x.Borrow} borrow)
for b.Controls[0].Op == OpS390XNEG {
v_0 := b.Controls[0]
v_0_0 := v_0.Args[0]
if v_0_0.Op != OpSelect0 {
break
}
v_0_0_0 := v_0_0.Args[0]
if v_0_0_0.Op != OpS390XSUBE {
break
}
borrow := v_0_0_0.Args[2]
v_0_0_0_0 := v_0_0_0.Args[0]
if v_0_0_0_0.Op != OpS390XMOVDconst || auxIntToInt64(v_0_0_0_0.AuxInt) != 0 {
break
}
v_0_0_0_1 := v_0_0_0.Args[1]
if v_0_0_0_1.Op != OpS390XMOVDconst || auxIntToInt64(v_0_0_0_1.AuxInt) != 0 || auxIntToInt8(b.AuxInt) != 0 || auxToS390xCCMask(b.Aux) != s390x.LessOrGreater {
break
}
b.resetWithControl(BlockS390XBRC, borrow)
b.Aux = s390xCCMaskToAux(s390x.Borrow)
return true
}
// match: (CGIJ {s390x.LessOrGreater} (NEG (Select0 (SUBE (MOVDconst [0]) (MOVDconst [0]) borrow))) [1])
// result: (BRC {s390x.NoBorrow} borrow)
for b.Controls[0].Op == OpS390XNEG {
v_0 := b.Controls[0]
v_0_0 := v_0.Args[0]
if v_0_0.Op != OpSelect0 {
break
}
v_0_0_0 := v_0_0.Args[0]
if v_0_0_0.Op != OpS390XSUBE {
break
}
borrow := v_0_0_0.Args[2]
v_0_0_0_0 := v_0_0_0.Args[0]
if v_0_0_0_0.Op != OpS390XMOVDconst || auxIntToInt64(v_0_0_0_0.AuxInt) != 0 {
break
}
v_0_0_0_1 := v_0_0_0.Args[1]
if v_0_0_0_1.Op != OpS390XMOVDconst || auxIntToInt64(v_0_0_0_1.AuxInt) != 0 || auxIntToInt8(b.AuxInt) != 1 || auxToS390xCCMask(b.Aux) != s390x.LessOrGreater {
break
}
b.resetWithControl(BlockS390XBRC, borrow)
b.Aux = s390xCCMaskToAux(s390x.NoBorrow)
return true
}
// match: (CGIJ {s390x.Greater} (NEG (Select0 (SUBE (MOVDconst [0]) (MOVDconst [0]) borrow))) [0])
// result: (BRC {s390x.Borrow} borrow)
for b.Controls[0].Op == OpS390XNEG {
v_0 := b.Controls[0]
v_0_0 := v_0.Args[0]
if v_0_0.Op != OpSelect0 {
break
}
v_0_0_0 := v_0_0.Args[0]
if v_0_0_0.Op != OpS390XSUBE {
break
}
borrow := v_0_0_0.Args[2]
v_0_0_0_0 := v_0_0_0.Args[0]
if v_0_0_0_0.Op != OpS390XMOVDconst || auxIntToInt64(v_0_0_0_0.AuxInt) != 0 {
break
}
v_0_0_0_1 := v_0_0_0.Args[1]
if v_0_0_0_1.Op != OpS390XMOVDconst || auxIntToInt64(v_0_0_0_1.AuxInt) != 0 || auxIntToInt8(b.AuxInt) != 0 || auxToS390xCCMask(b.Aux) != s390x.Greater {
break
}
b.resetWithControl(BlockS390XBRC, borrow)
b.Aux = s390xCCMaskToAux(s390x.Borrow)
return true
}
case BlockS390XCGRJ:
// match: (CGRJ {c} x (MOVDconst [y]) yes no)
// cond: is8Bit(y)
// result: (CGIJ {c} x [ int8(y)] yes no)
for b.Controls[1].Op == OpS390XMOVDconst {
x := b.Controls[0]
v_1 := b.Controls[1]
y := auxIntToInt64(v_1.AuxInt)
c := auxToS390xCCMask(b.Aux)
if !(is8Bit(y)) {
break
}
b.resetWithControl(BlockS390XCGIJ, x)
b.AuxInt = int8ToAuxInt(int8(y))
b.Aux = s390xCCMaskToAux(c)
return true
}
// match: (CGRJ {c} (MOVDconst [x]) y yes no)
// cond: is8Bit(x)
// result: (CGIJ {c.ReverseComparison()} y [ int8(x)] yes no)
for b.Controls[0].Op == OpS390XMOVDconst {
v_0 := b.Controls[0]
x := auxIntToInt64(v_0.AuxInt)
y := b.Controls[1]
c := auxToS390xCCMask(b.Aux)
if !(is8Bit(x)) {
break
}
b.resetWithControl(BlockS390XCGIJ, y)
b.AuxInt = int8ToAuxInt(int8(x))
b.Aux = s390xCCMaskToAux(c.ReverseComparison())
return true
}
// match: (CGRJ {c} x (MOVDconst [y]) yes no)
// cond: !is8Bit(y) && is32Bit(y)
// result: (BRC {c} (CMPconst x [int32(y)]) yes no)
for b.Controls[1].Op == OpS390XMOVDconst {
x := b.Controls[0]
v_1 := b.Controls[1]
y := auxIntToInt64(v_1.AuxInt)
c := auxToS390xCCMask(b.Aux)
if !(!is8Bit(y) && is32Bit(y)) {
break
}
v0 := b.NewValue0(x.Pos, OpS390XCMPconst, types.TypeFlags)
v0.AuxInt = int32ToAuxInt(int32(y))
v0.AddArg(x)
b.resetWithControl(BlockS390XBRC, v0)
b.Aux = s390xCCMaskToAux(c)
return true
}
// match: (CGRJ {c} (MOVDconst [x]) y yes no)
// cond: !is8Bit(x) && is32Bit(x)
// result: (BRC {c.ReverseComparison()} (CMPconst y [int32(x)]) yes no)
for b.Controls[0].Op == OpS390XMOVDconst {
v_0 := b.Controls[0]
x := auxIntToInt64(v_0.AuxInt)
y := b.Controls[1]
c := auxToS390xCCMask(b.Aux)
if !(!is8Bit(x) && is32Bit(x)) {
break
}
v0 := b.NewValue0(v_0.Pos, OpS390XCMPconst, types.TypeFlags)
v0.AuxInt = int32ToAuxInt(int32(x))
v0.AddArg(y)
b.resetWithControl(BlockS390XBRC, v0)
b.Aux = s390xCCMaskToAux(c.ReverseComparison())
return true
}
// match: (CGRJ {c} x y yes no)
// cond: x == y && c&s390x.Equal != 0
// result: (First yes no)
for {
x := b.Controls[0]
y := b.Controls[1]
c := auxToS390xCCMask(b.Aux)
if !(x == y && c&s390x.Equal != 0) {
break
}
b.Reset(BlockFirst)
return true
}
// match: (CGRJ {c} x y yes no)
// cond: x == y && c&s390x.Equal == 0
// result: (First no yes)
for {
x := b.Controls[0]
y := b.Controls[1]
c := auxToS390xCCMask(b.Aux)
if !(x == y && c&s390x.Equal == 0) {
break
}
b.Reset(BlockFirst)
b.swapSuccessors()
return true
}
case BlockS390XCIJ:
// match: (CIJ {c} (MOVWreg x) [y] yes no)
// result: (CIJ {c} x [y] yes no)
for b.Controls[0].Op == OpS390XMOVWreg {
v_0 := b.Controls[0]
x := v_0.Args[0]
y := auxIntToInt8(b.AuxInt)
c := auxToS390xCCMask(b.Aux)
b.resetWithControl(BlockS390XCIJ, x)
b.AuxInt = int8ToAuxInt(y)
b.Aux = s390xCCMaskToAux(c)
return true
}
// match: (CIJ {c} (MOVWZreg x) [y] yes no)
// result: (CIJ {c} x [y] yes no)
for b.Controls[0].Op == OpS390XMOVWZreg {
v_0 := b.Controls[0]
x := v_0.Args[0]
y := auxIntToInt8(b.AuxInt)
c := auxToS390xCCMask(b.Aux)
b.resetWithControl(BlockS390XCIJ, x)
b.AuxInt = int8ToAuxInt(y)
b.Aux = s390xCCMaskToAux(c)
return true
}
// match: (CIJ {c} (MOVDconst [x]) [y] yes no)
// cond: c&s390x.Equal != 0 && int32(x) == int32(y)
// result: (First yes no)
for b.Controls[0].Op == OpS390XMOVDconst {
v_0 := b.Controls[0]
x := auxIntToInt64(v_0.AuxInt)
y := auxIntToInt8(b.AuxInt)
c := auxToS390xCCMask(b.Aux)
if !(c&s390x.Equal != 0 && int32(x) == int32(y)) {
break
}
b.Reset(BlockFirst)
return true
}
// match: (CIJ {c} (MOVDconst [x]) [y] yes no)
// cond: c&s390x.Less != 0 && int32(x) < int32(y)
// result: (First yes no)
for b.Controls[0].Op == OpS390XMOVDconst {
v_0 := b.Controls[0]
x := auxIntToInt64(v_0.AuxInt)
y := auxIntToInt8(b.AuxInt)
c := auxToS390xCCMask(b.Aux)
if !(c&s390x.Less != 0 && int32(x) < int32(y)) {
break
}
b.Reset(BlockFirst)
return true
}
// match: (CIJ {c} (MOVDconst [x]) [y] yes no)
// cond: c&s390x.Greater != 0 && int32(x) > int32(y)
// result: (First yes no)
for b.Controls[0].Op == OpS390XMOVDconst {
v_0 := b.Controls[0]
x := auxIntToInt64(v_0.AuxInt)
y := auxIntToInt8(b.AuxInt)
c := auxToS390xCCMask(b.Aux)
if !(c&s390x.Greater != 0 && int32(x) > int32(y)) {
break
}
b.Reset(BlockFirst)
return true
}
// match: (CIJ {c} (MOVDconst [x]) [y] yes no)
// cond: c&s390x.Equal == 0 && int32(x) == int32(y)
// result: (First no yes)
for b.Controls[0].Op == OpS390XMOVDconst {
v_0 := b.Controls[0]
x := auxIntToInt64(v_0.AuxInt)
y := auxIntToInt8(b.AuxInt)
c := auxToS390xCCMask(b.Aux)
if !(c&s390x.Equal == 0 && int32(x) == int32(y)) {
break
}
b.Reset(BlockFirst)
b.swapSuccessors()
return true
}
// match: (CIJ {c} (MOVDconst [x]) [y] yes no)
// cond: c&s390x.Less == 0 && int32(x) < int32(y)
// result: (First no yes)
for b.Controls[0].Op == OpS390XMOVDconst {
v_0 := b.Controls[0]
x := auxIntToInt64(v_0.AuxInt)
y := auxIntToInt8(b.AuxInt)
c := auxToS390xCCMask(b.Aux)
if !(c&s390x.Less == 0 && int32(x) < int32(y)) {
break
}
b.Reset(BlockFirst)
b.swapSuccessors()
return true
}
// match: (CIJ {c} (MOVDconst [x]) [y] yes no)
// cond: c&s390x.Greater == 0 && int32(x) > int32(y)
// result: (First no yes)
for b.Controls[0].Op == OpS390XMOVDconst {
v_0 := b.Controls[0]
x := auxIntToInt64(v_0.AuxInt)
y := auxIntToInt8(b.AuxInt)
c := auxToS390xCCMask(b.Aux)
if !(c&s390x.Greater == 0 && int32(x) > int32(y)) {
break
}
b.Reset(BlockFirst)
b.swapSuccessors()
return true
}
case BlockS390XCLGIJ:
// match: (CLGIJ {c} (MOVDconst [x]) [y] yes no)
// cond: c&s390x.Equal != 0 && uint64(x) == uint64(y)
// result: (First yes no)
for b.Controls[0].Op == OpS390XMOVDconst {
v_0 := b.Controls[0]
x := auxIntToInt64(v_0.AuxInt)
y := auxIntToUint8(b.AuxInt)
c := auxToS390xCCMask(b.Aux)
if !(c&s390x.Equal != 0 && uint64(x) == uint64(y)) {
break
}
b.Reset(BlockFirst)
return true
}
// match: (CLGIJ {c} (MOVDconst [x]) [y] yes no)
// cond: c&s390x.Less != 0 && uint64(x) < uint64(y)
// result: (First yes no)
for b.Controls[0].Op == OpS390XMOVDconst {
v_0 := b.Controls[0]
x := auxIntToInt64(v_0.AuxInt)
y := auxIntToUint8(b.AuxInt)
c := auxToS390xCCMask(b.Aux)
if !(c&s390x.Less != 0 && uint64(x) < uint64(y)) {
break
}
b.Reset(BlockFirst)
return true
}
// match: (CLGIJ {c} (MOVDconst [x]) [y] yes no)
// cond: c&s390x.Greater != 0 && uint64(x) > uint64(y)
// result: (First yes no)
for b.Controls[0].Op == OpS390XMOVDconst {
v_0 := b.Controls[0]
x := auxIntToInt64(v_0.AuxInt)
y := auxIntToUint8(b.AuxInt)
c := auxToS390xCCMask(b.Aux)
if !(c&s390x.Greater != 0 && uint64(x) > uint64(y)) {
break
}
b.Reset(BlockFirst)
return true
}
// match: (CLGIJ {c} (MOVDconst [x]) [y] yes no)
// cond: c&s390x.Equal == 0 && uint64(x) == uint64(y)
// result: (First no yes)
for b.Controls[0].Op == OpS390XMOVDconst {
v_0 := b.Controls[0]
x := auxIntToInt64(v_0.AuxInt)
y := auxIntToUint8(b.AuxInt)
c := auxToS390xCCMask(b.Aux)
if !(c&s390x.Equal == 0 && uint64(x) == uint64(y)) {
break
}
b.Reset(BlockFirst)
b.swapSuccessors()
return true
}
// match: (CLGIJ {c} (MOVDconst [x]) [y] yes no)
// cond: c&s390x.Less == 0 && uint64(x) < uint64(y)
// result: (First no yes)
for b.Controls[0].Op == OpS390XMOVDconst {
v_0 := b.Controls[0]
x := auxIntToInt64(v_0.AuxInt)
y := auxIntToUint8(b.AuxInt)
c := auxToS390xCCMask(b.Aux)
if !(c&s390x.Less == 0 && uint64(x) < uint64(y)) {
break
}
b.Reset(BlockFirst)
b.swapSuccessors()
return true
}
// match: (CLGIJ {c} (MOVDconst [x]) [y] yes no)
// cond: c&s390x.Greater == 0 && uint64(x) > uint64(y)
// result: (First no yes)
for b.Controls[0].Op == OpS390XMOVDconst {
v_0 := b.Controls[0]
x := auxIntToInt64(v_0.AuxInt)
y := auxIntToUint8(b.AuxInt)
c := auxToS390xCCMask(b.Aux)
if !(c&s390x.Greater == 0 && uint64(x) > uint64(y)) {
break
}
b.Reset(BlockFirst)
b.swapSuccessors()
return true
}
// match: (CLGIJ {s390x.GreaterOrEqual} _ [0] yes no)
// result: (First yes no)
for {
if auxIntToUint8(b.AuxInt) != 0 || auxToS390xCCMask(b.Aux) != s390x.GreaterOrEqual {
break
}
b.Reset(BlockFirst)
return true
}
// match: (CLGIJ {s390x.Less} _ [0] yes no)
// result: (First no yes)
for {
if auxIntToUint8(b.AuxInt) != 0 || auxToS390xCCMask(b.Aux) != s390x.Less {
break
}
b.Reset(BlockFirst)
b.swapSuccessors()
return true
}
// match: (CLGIJ {s390x.Equal} (Select0 (ADDE (MOVDconst [0]) (MOVDconst [0]) carry)) [0])
// result: (BRC {s390x.NoCarry} carry)
for b.Controls[0].Op == OpSelect0 {
v_0 := b.Controls[0]
v_0_0 := v_0.Args[0]
if v_0_0.Op != OpS390XADDE {
break
}
carry := v_0_0.Args[2]
v_0_0_0 := v_0_0.Args[0]
if v_0_0_0.Op != OpS390XMOVDconst || auxIntToInt64(v_0_0_0.AuxInt) != 0 {
break
}
v_0_0_1 := v_0_0.Args[1]
if v_0_0_1.Op != OpS390XMOVDconst || auxIntToInt64(v_0_0_1.AuxInt) != 0 || auxIntToUint8(b.AuxInt) != 0 || auxToS390xCCMask(b.Aux) != s390x.Equal {
break
}
b.resetWithControl(BlockS390XBRC, carry)
b.Aux = s390xCCMaskToAux(s390x.NoCarry)
return true
}
// match: (CLGIJ {s390x.Equal} (Select0 (ADDE (MOVDconst [0]) (MOVDconst [0]) carry)) [1])
// result: (BRC {s390x.Carry} carry)
for b.Controls[0].Op == OpSelect0 {
v_0 := b.Controls[0]
v_0_0 := v_0.Args[0]
if v_0_0.Op != OpS390XADDE {
break
}
carry := v_0_0.Args[2]
v_0_0_0 := v_0_0.Args[0]
if v_0_0_0.Op != OpS390XMOVDconst || auxIntToInt64(v_0_0_0.AuxInt) != 0 {
break
}
v_0_0_1 := v_0_0.Args[1]
if v_0_0_1.Op != OpS390XMOVDconst || auxIntToInt64(v_0_0_1.AuxInt) != 0 || auxIntToUint8(b.AuxInt) != 1 || auxToS390xCCMask(b.Aux) != s390x.Equal {
break
}
b.resetWithControl(BlockS390XBRC, carry)
b.Aux = s390xCCMaskToAux(s390x.Carry)
return true
}
// match: (CLGIJ {s390x.LessOrGreater} (Select0 (ADDE (MOVDconst [0]) (MOVDconst [0]) carry)) [0])
// result: (BRC {s390x.Carry} carry)
for b.Controls[0].Op == OpSelect0 {
v_0 := b.Controls[0]
v_0_0 := v_0.Args[0]
if v_0_0.Op != OpS390XADDE {
break
}
carry := v_0_0.Args[2]
v_0_0_0 := v_0_0.Args[0]
if v_0_0_0.Op != OpS390XMOVDconst || auxIntToInt64(v_0_0_0.AuxInt) != 0 {
break
}
v_0_0_1 := v_0_0.Args[1]
if v_0_0_1.Op != OpS390XMOVDconst || auxIntToInt64(v_0_0_1.AuxInt) != 0 || auxIntToUint8(b.AuxInt) != 0 || auxToS390xCCMask(b.Aux) != s390x.LessOrGreater {
break
}
b.resetWithControl(BlockS390XBRC, carry)
b.Aux = s390xCCMaskToAux(s390x.Carry)
return true
}
// match: (CLGIJ {s390x.LessOrGreater} (Select0 (ADDE (MOVDconst [0]) (MOVDconst [0]) carry)) [1])
// result: (BRC {s390x.NoCarry} carry)
for b.Controls[0].Op == OpSelect0 {
v_0 := b.Controls[0]
v_0_0 := v_0.Args[0]
if v_0_0.Op != OpS390XADDE {
break
}
carry := v_0_0.Args[2]
v_0_0_0 := v_0_0.Args[0]
if v_0_0_0.Op != OpS390XMOVDconst || auxIntToInt64(v_0_0_0.AuxInt) != 0 {
break
}
v_0_0_1 := v_0_0.Args[1]
if v_0_0_1.Op != OpS390XMOVDconst || auxIntToInt64(v_0_0_1.AuxInt) != 0 || auxIntToUint8(b.AuxInt) != 1 || auxToS390xCCMask(b.Aux) != s390x.LessOrGreater {
break
}
b.resetWithControl(BlockS390XBRC, carry)
b.Aux = s390xCCMaskToAux(s390x.NoCarry)
return true
}
// match: (CLGIJ {s390x.Greater} (Select0 (ADDE (MOVDconst [0]) (MOVDconst [0]) carry)) [0])
// result: (BRC {s390x.Carry} carry)
for b.Controls[0].Op == OpSelect0 {
v_0 := b.Controls[0]
v_0_0 := v_0.Args[0]
if v_0_0.Op != OpS390XADDE {
break
}
carry := v_0_0.Args[2]
v_0_0_0 := v_0_0.Args[0]
if v_0_0_0.Op != OpS390XMOVDconst || auxIntToInt64(v_0_0_0.AuxInt) != 0 {
break
}
v_0_0_1 := v_0_0.Args[1]
if v_0_0_1.Op != OpS390XMOVDconst || auxIntToInt64(v_0_0_1.AuxInt) != 0 || auxIntToUint8(b.AuxInt) != 0 || auxToS390xCCMask(b.Aux) != s390x.Greater {
break
}
b.resetWithControl(BlockS390XBRC, carry)
b.Aux = s390xCCMaskToAux(s390x.Carry)
return true
}
// match: (CLGIJ {s390x.Equal} (NEG (Select0 (SUBE (MOVDconst [0]) (MOVDconst [0]) borrow))) [0])
// result: (BRC {s390x.NoBorrow} borrow)
for b.Controls[0].Op == OpS390XNEG {
v_0 := b.Controls[0]
v_0_0 := v_0.Args[0]
if v_0_0.Op != OpSelect0 {
break
}
v_0_0_0 := v_0_0.Args[0]
if v_0_0_0.Op != OpS390XSUBE {
break
}
borrow := v_0_0_0.Args[2]
v_0_0_0_0 := v_0_0_0.Args[0]
if v_0_0_0_0.Op != OpS390XMOVDconst || auxIntToInt64(v_0_0_0_0.AuxInt) != 0 {
break
}
v_0_0_0_1 := v_0_0_0.Args[1]
if v_0_0_0_1.Op != OpS390XMOVDconst || auxIntToInt64(v_0_0_0_1.AuxInt) != 0 || auxIntToUint8(b.AuxInt) != 0 || auxToS390xCCMask(b.Aux) != s390x.Equal {
break
}
b.resetWithControl(BlockS390XBRC, borrow)
b.Aux = s390xCCMaskToAux(s390x.NoBorrow)
return true
}
// match: (CLGIJ {s390x.Equal} (NEG (Select0 (SUBE (MOVDconst [0]) (MOVDconst [0]) borrow))) [1])
// result: (BRC {s390x.Borrow} borrow)
for b.Controls[0].Op == OpS390XNEG {
v_0 := b.Controls[0]
v_0_0 := v_0.Args[0]
if v_0_0.Op != OpSelect0 {
break
}
v_0_0_0 := v_0_0.Args[0]
if v_0_0_0.Op != OpS390XSUBE {
break
}
borrow := v_0_0_0.Args[2]
v_0_0_0_0 := v_0_0_0.Args[0]
if v_0_0_0_0.Op != OpS390XMOVDconst || auxIntToInt64(v_0_0_0_0.AuxInt) != 0 {
break
}
v_0_0_0_1 := v_0_0_0.Args[1]
if v_0_0_0_1.Op != OpS390XMOVDconst || auxIntToInt64(v_0_0_0_1.AuxInt) != 0 || auxIntToUint8(b.AuxInt) != 1 || auxToS390xCCMask(b.Aux) != s390x.Equal {
break
}
b.resetWithControl(BlockS390XBRC, borrow)
b.Aux = s390xCCMaskToAux(s390x.Borrow)
return true
}
// match: (CLGIJ {s390x.LessOrGreater} (NEG (Select0 (SUBE (MOVDconst [0]) (MOVDconst [0]) borrow))) [0])
// result: (BRC {s390x.Borrow} borrow)
for b.Controls[0].Op == OpS390XNEG {
v_0 := b.Controls[0]
v_0_0 := v_0.Args[0]
if v_0_0.Op != OpSelect0 {
break
}
v_0_0_0 := v_0_0.Args[0]
if v_0_0_0.Op != OpS390XSUBE {
break
}
borrow := v_0_0_0.Args[2]
v_0_0_0_0 := v_0_0_0.Args[0]
if v_0_0_0_0.Op != OpS390XMOVDconst || auxIntToInt64(v_0_0_0_0.AuxInt) != 0 {
break
}
v_0_0_0_1 := v_0_0_0.Args[1]
if v_0_0_0_1.Op != OpS390XMOVDconst || auxIntToInt64(v_0_0_0_1.AuxInt) != 0 || auxIntToUint8(b.AuxInt) != 0 || auxToS390xCCMask(b.Aux) != s390x.LessOrGreater {
break
}
b.resetWithControl(BlockS390XBRC, borrow)
b.Aux = s390xCCMaskToAux(s390x.Borrow)
return true
}
// match: (CLGIJ {s390x.LessOrGreater} (NEG (Select0 (SUBE (MOVDconst [0]) (MOVDconst [0]) borrow))) [1])
// result: (BRC {s390x.NoBorrow} borrow)
for b.Controls[0].Op == OpS390XNEG {
v_0 := b.Controls[0]
v_0_0 := v_0.Args[0]
if v_0_0.Op != OpSelect0 {
break
}
v_0_0_0 := v_0_0.Args[0]
if v_0_0_0.Op != OpS390XSUBE {
break
}
borrow := v_0_0_0.Args[2]
v_0_0_0_0 := v_0_0_0.Args[0]
if v_0_0_0_0.Op != OpS390XMOVDconst || auxIntToInt64(v_0_0_0_0.AuxInt) != 0 {
break
}
v_0_0_0_1 := v_0_0_0.Args[1]
if v_0_0_0_1.Op != OpS390XMOVDconst || auxIntToInt64(v_0_0_0_1.AuxInt) != 0 || auxIntToUint8(b.AuxInt) != 1 || auxToS390xCCMask(b.Aux) != s390x.LessOrGreater {
break
}
b.resetWithControl(BlockS390XBRC, borrow)
b.Aux = s390xCCMaskToAux(s390x.NoBorrow)
return true
}
// match: (CLGIJ {s390x.Greater} (NEG (Select0 (SUBE (MOVDconst [0]) (MOVDconst [0]) borrow))) [0])
// result: (BRC {s390x.Borrow} borrow)
for b.Controls[0].Op == OpS390XNEG {
v_0 := b.Controls[0]
v_0_0 := v_0.Args[0]
if v_0_0.Op != OpSelect0 {
break
}
v_0_0_0 := v_0_0.Args[0]
if v_0_0_0.Op != OpS390XSUBE {
break
}
borrow := v_0_0_0.Args[2]
v_0_0_0_0 := v_0_0_0.Args[0]
if v_0_0_0_0.Op != OpS390XMOVDconst || auxIntToInt64(v_0_0_0_0.AuxInt) != 0 {
break
}
v_0_0_0_1 := v_0_0_0.Args[1]
if v_0_0_0_1.Op != OpS390XMOVDconst || auxIntToInt64(v_0_0_0_1.AuxInt) != 0 || auxIntToUint8(b.AuxInt) != 0 || auxToS390xCCMask(b.Aux) != s390x.Greater {
break
}
b.resetWithControl(BlockS390XBRC, borrow)
b.Aux = s390xCCMaskToAux(s390x.Borrow)
return true
}
case BlockS390XCLGRJ:
// match: (CLGRJ {c} x (MOVDconst [y]) yes no)
// cond: isU8Bit(y)
// result: (CLGIJ {c} x [uint8(y)] yes no)
for b.Controls[1].Op == OpS390XMOVDconst {
x := b.Controls[0]
v_1 := b.Controls[1]
y := auxIntToInt64(v_1.AuxInt)
c := auxToS390xCCMask(b.Aux)
if !(isU8Bit(y)) {
break
}
b.resetWithControl(BlockS390XCLGIJ, x)
b.AuxInt = uint8ToAuxInt(uint8(y))
b.Aux = s390xCCMaskToAux(c)
return true
}
// match: (CLGRJ {c} (MOVDconst [x]) y yes no)
// cond: isU8Bit(x)
// result: (CLGIJ {c.ReverseComparison()} y [uint8(x)] yes no)
for b.Controls[0].Op == OpS390XMOVDconst {
v_0 := b.Controls[0]
x := auxIntToInt64(v_0.AuxInt)
y := b.Controls[1]
c := auxToS390xCCMask(b.Aux)
if !(isU8Bit(x)) {
break
}
b.resetWithControl(BlockS390XCLGIJ, y)
b.AuxInt = uint8ToAuxInt(uint8(x))
b.Aux = s390xCCMaskToAux(c.ReverseComparison())
return true
}
// match: (CLGRJ {c} x (MOVDconst [y]) yes no)
// cond: !isU8Bit(y) && isU32Bit(y)
// result: (BRC {c} (CMPUconst x [int32(y)]) yes no)
for b.Controls[1].Op == OpS390XMOVDconst {
x := b.Controls[0]
v_1 := b.Controls[1]
y := auxIntToInt64(v_1.AuxInt)
c := auxToS390xCCMask(b.Aux)
if !(!isU8Bit(y) && isU32Bit(y)) {
break
}
v0 := b.NewValue0(x.Pos, OpS390XCMPUconst, types.TypeFlags)
v0.AuxInt = int32ToAuxInt(int32(y))
v0.AddArg(x)
b.resetWithControl(BlockS390XBRC, v0)
b.Aux = s390xCCMaskToAux(c)
return true
}
// match: (CLGRJ {c} (MOVDconst [x]) y yes no)
// cond: !isU8Bit(x) && isU32Bit(x)
// result: (BRC {c.ReverseComparison()} (CMPUconst y [int32(x)]) yes no)
for b.Controls[0].Op == OpS390XMOVDconst {
v_0 := b.Controls[0]
x := auxIntToInt64(v_0.AuxInt)
y := b.Controls[1]
c := auxToS390xCCMask(b.Aux)
if !(!isU8Bit(x) && isU32Bit(x)) {
break
}
v0 := b.NewValue0(v_0.Pos, OpS390XCMPUconst, types.TypeFlags)
v0.AuxInt = int32ToAuxInt(int32(x))
v0.AddArg(y)
b.resetWithControl(BlockS390XBRC, v0)
b.Aux = s390xCCMaskToAux(c.ReverseComparison())
return true
}
// match: (CLGRJ {c} x y yes no)
// cond: x == y && c&s390x.Equal != 0
// result: (First yes no)
for {
x := b.Controls[0]
y := b.Controls[1]
c := auxToS390xCCMask(b.Aux)
if !(x == y && c&s390x.Equal != 0) {
break
}
b.Reset(BlockFirst)
return true
}
// match: (CLGRJ {c} x y yes no)
// cond: x == y && c&s390x.Equal == 0
// result: (First no yes)
for {
x := b.Controls[0]
y := b.Controls[1]
c := auxToS390xCCMask(b.Aux)
if !(x == y && c&s390x.Equal == 0) {
break
}
b.Reset(BlockFirst)
b.swapSuccessors()
return true
}
case BlockS390XCLIJ:
// match: (CLIJ {s390x.LessOrGreater} (LOCGR {d} (MOVDconst [0]) (MOVDconst [x]) cmp) [0] yes no)
// cond: int32(x) != 0
// result: (BRC {d} cmp yes no)
for b.Controls[0].Op == OpS390XLOCGR {
v_0 := b.Controls[0]
d := auxToS390xCCMask(v_0.Aux)
cmp := v_0.Args[2]
v_0_0 := v_0.Args[0]
if v_0_0.Op != OpS390XMOVDconst || auxIntToInt64(v_0_0.AuxInt) != 0 {
break
}
v_0_1 := v_0.Args[1]
if v_0_1.Op != OpS390XMOVDconst {
break
}
x := auxIntToInt64(v_0_1.AuxInt)
if auxIntToUint8(b.AuxInt) != 0 || auxToS390xCCMask(b.Aux) != s390x.LessOrGreater || !(int32(x) != 0) {
break
}
b.resetWithControl(BlockS390XBRC, cmp)
b.Aux = s390xCCMaskToAux(d)
return true
}
// match: (CLIJ {c} (MOVWreg x) [y] yes no)
// result: (CLIJ {c} x [y] yes no)
for b.Controls[0].Op == OpS390XMOVWreg {
v_0 := b.Controls[0]
x := v_0.Args[0]
y := auxIntToUint8(b.AuxInt)
c := auxToS390xCCMask(b.Aux)
b.resetWithControl(BlockS390XCLIJ, x)
b.AuxInt = uint8ToAuxInt(y)
b.Aux = s390xCCMaskToAux(c)
return true
}
// match: (CLIJ {c} (MOVWZreg x) [y] yes no)
// result: (CLIJ {c} x [y] yes no)
for b.Controls[0].Op == OpS390XMOVWZreg {
v_0 := b.Controls[0]
x := v_0.Args[0]
y := auxIntToUint8(b.AuxInt)
c := auxToS390xCCMask(b.Aux)
b.resetWithControl(BlockS390XCLIJ, x)
b.AuxInt = uint8ToAuxInt(y)
b.Aux = s390xCCMaskToAux(c)
return true
}
// match: (CLIJ {c} (MOVDconst [x]) [y] yes no)
// cond: c&s390x.Equal != 0 && uint32(x) == uint32(y)
// result: (First yes no)
for b.Controls[0].Op == OpS390XMOVDconst {
v_0 := b.Controls[0]
x := auxIntToInt64(v_0.AuxInt)
y := auxIntToUint8(b.AuxInt)
c := auxToS390xCCMask(b.Aux)
if !(c&s390x.Equal != 0 && uint32(x) == uint32(y)) {
break
}
b.Reset(BlockFirst)
return true
}
// match: (CLIJ {c} (MOVDconst [x]) [y] yes no)
// cond: c&s390x.Less != 0 && uint32(x) < uint32(y)
// result: (First yes no)
for b.Controls[0].Op == OpS390XMOVDconst {
v_0 := b.Controls[0]
x := auxIntToInt64(v_0.AuxInt)
y := auxIntToUint8(b.AuxInt)
c := auxToS390xCCMask(b.Aux)
if !(c&s390x.Less != 0 && uint32(x) < uint32(y)) {
break
}
b.Reset(BlockFirst)
return true
}
// match: (CLIJ {c} (MOVDconst [x]) [y] yes no)
// cond: c&s390x.Greater != 0 && uint32(x) > uint32(y)
// result: (First yes no)
for b.Controls[0].Op == OpS390XMOVDconst {
v_0 := b.Controls[0]
x := auxIntToInt64(v_0.AuxInt)
y := auxIntToUint8(b.AuxInt)
c := auxToS390xCCMask(b.Aux)
if !(c&s390x.Greater != 0 && uint32(x) > uint32(y)) {
break
}
b.Reset(BlockFirst)
return true
}
// match: (CLIJ {c} (MOVDconst [x]) [y] yes no)
// cond: c&s390x.Equal == 0 && uint32(x) == uint32(y)
// result: (First no yes)
for b.Controls[0].Op == OpS390XMOVDconst {
v_0 := b.Controls[0]
x := auxIntToInt64(v_0.AuxInt)
y := auxIntToUint8(b.AuxInt)
c := auxToS390xCCMask(b.Aux)
if !(c&s390x.Equal == 0 && uint32(x) == uint32(y)) {
break
}
b.Reset(BlockFirst)
b.swapSuccessors()
return true
}
// match: (CLIJ {c} (MOVDconst [x]) [y] yes no)
// cond: c&s390x.Less == 0 && uint32(x) < uint32(y)
// result: (First no yes)
for b.Controls[0].Op == OpS390XMOVDconst {
v_0 := b.Controls[0]
x := auxIntToInt64(v_0.AuxInt)
y := auxIntToUint8(b.AuxInt)
c := auxToS390xCCMask(b.Aux)
if !(c&s390x.Less == 0 && uint32(x) < uint32(y)) {
break
}
b.Reset(BlockFirst)
b.swapSuccessors()
return true
}
// match: (CLIJ {c} (MOVDconst [x]) [y] yes no)
// cond: c&s390x.Greater == 0 && uint32(x) > uint32(y)
// result: (First no yes)
for b.Controls[0].Op == OpS390XMOVDconst {
v_0 := b.Controls[0]
x := auxIntToInt64(v_0.AuxInt)
y := auxIntToUint8(b.AuxInt)
c := auxToS390xCCMask(b.Aux)
if !(c&s390x.Greater == 0 && uint32(x) > uint32(y)) {
break
}
b.Reset(BlockFirst)
b.swapSuccessors()
return true
}
// match: (CLIJ {s390x.GreaterOrEqual} _ [0] yes no)
// result: (First yes no)
for {
if auxIntToUint8(b.AuxInt) != 0 || auxToS390xCCMask(b.Aux) != s390x.GreaterOrEqual {
break
}
b.Reset(BlockFirst)
return true
}
// match: (CLIJ {s390x.Less} _ [0] yes no)
// result: (First no yes)
for {
if auxIntToUint8(b.AuxInt) != 0 || auxToS390xCCMask(b.Aux) != s390x.Less {
break
}
b.Reset(BlockFirst)
b.swapSuccessors()
return true
}
case BlockS390XCLRJ:
// match: (CLRJ {c} x (MOVDconst [y]) yes no)
// cond: isU8Bit(y)
// result: (CLIJ {c} x [uint8(y)] yes no)
for b.Controls[1].Op == OpS390XMOVDconst {
x := b.Controls[0]
v_1 := b.Controls[1]
y := auxIntToInt64(v_1.AuxInt)
c := auxToS390xCCMask(b.Aux)
if !(isU8Bit(y)) {
break
}
b.resetWithControl(BlockS390XCLIJ, x)
b.AuxInt = uint8ToAuxInt(uint8(y))
b.Aux = s390xCCMaskToAux(c)
return true
}
// match: (CLRJ {c} (MOVDconst [x]) y yes no)
// cond: isU8Bit(x)
// result: (CLIJ {c.ReverseComparison()} y [uint8(x)] yes no)
for b.Controls[0].Op == OpS390XMOVDconst {
v_0 := b.Controls[0]
x := auxIntToInt64(v_0.AuxInt)
y := b.Controls[1]
c := auxToS390xCCMask(b.Aux)
if !(isU8Bit(x)) {
break
}
b.resetWithControl(BlockS390XCLIJ, y)
b.AuxInt = uint8ToAuxInt(uint8(x))
b.Aux = s390xCCMaskToAux(c.ReverseComparison())
return true
}
// match: (CLRJ {c} x (MOVDconst [y]) yes no)
// cond: !isU8Bit(y) && isU32Bit(y)
// result: (BRC {c} (CMPWUconst x [int32(y)]) yes no)
for b.Controls[1].Op == OpS390XMOVDconst {
x := b.Controls[0]
v_1 := b.Controls[1]
y := auxIntToInt64(v_1.AuxInt)
c := auxToS390xCCMask(b.Aux)
if !(!isU8Bit(y) && isU32Bit(y)) {
break
}
v0 := b.NewValue0(x.Pos, OpS390XCMPWUconst, types.TypeFlags)
v0.AuxInt = int32ToAuxInt(int32(y))
v0.AddArg(x)
b.resetWithControl(BlockS390XBRC, v0)
b.Aux = s390xCCMaskToAux(c)
return true
}
// match: (CLRJ {c} (MOVDconst [x]) y yes no)
// cond: !isU8Bit(x) && isU32Bit(x)
// result: (BRC {c.ReverseComparison()} (CMPWUconst y [int32(x)]) yes no)
for b.Controls[0].Op == OpS390XMOVDconst {
v_0 := b.Controls[0]
x := auxIntToInt64(v_0.AuxInt)
y := b.Controls[1]
c := auxToS390xCCMask(b.Aux)
if !(!isU8Bit(x) && isU32Bit(x)) {
break
}
v0 := b.NewValue0(v_0.Pos, OpS390XCMPWUconst, types.TypeFlags)
v0.AuxInt = int32ToAuxInt(int32(x))
v0.AddArg(y)
b.resetWithControl(BlockS390XBRC, v0)
b.Aux = s390xCCMaskToAux(c.ReverseComparison())
return true
}
// match: (CLRJ {c} x y yes no)
// cond: x == y && c&s390x.Equal != 0
// result: (First yes no)
for {
x := b.Controls[0]
y := b.Controls[1]
c := auxToS390xCCMask(b.Aux)
if !(x == y && c&s390x.Equal != 0) {
break
}
b.Reset(BlockFirst)
return true
}
// match: (CLRJ {c} x y yes no)
// cond: x == y && c&s390x.Equal == 0
// result: (First no yes)
for {
x := b.Controls[0]
y := b.Controls[1]
c := auxToS390xCCMask(b.Aux)
if !(x == y && c&s390x.Equal == 0) {
break
}
b.Reset(BlockFirst)
b.swapSuccessors()
return true
}
case BlockS390XCRJ:
// match: (CRJ {c} x (MOVDconst [y]) yes no)
// cond: is8Bit(y)
// result: (CIJ {c} x [ int8(y)] yes no)
for b.Controls[1].Op == OpS390XMOVDconst {
x := b.Controls[0]
v_1 := b.Controls[1]
y := auxIntToInt64(v_1.AuxInt)
c := auxToS390xCCMask(b.Aux)
if !(is8Bit(y)) {
break
}
b.resetWithControl(BlockS390XCIJ, x)
b.AuxInt = int8ToAuxInt(int8(y))
b.Aux = s390xCCMaskToAux(c)
return true
}
// match: (CRJ {c} (MOVDconst [x]) y yes no)
// cond: is8Bit(x)
// result: (CIJ {c.ReverseComparison()} y [ int8(x)] yes no)
for b.Controls[0].Op == OpS390XMOVDconst {
v_0 := b.Controls[0]
x := auxIntToInt64(v_0.AuxInt)
y := b.Controls[1]
c := auxToS390xCCMask(b.Aux)
if !(is8Bit(x)) {
break
}
b.resetWithControl(BlockS390XCIJ, y)
b.AuxInt = int8ToAuxInt(int8(x))
b.Aux = s390xCCMaskToAux(c.ReverseComparison())
return true
}
// match: (CRJ {c} x (MOVDconst [y]) yes no)
// cond: !is8Bit(y) && is32Bit(y)
// result: (BRC {c} (CMPWconst x [int32(y)]) yes no)
for b.Controls[1].Op == OpS390XMOVDconst {
x := b.Controls[0]
v_1 := b.Controls[1]
y := auxIntToInt64(v_1.AuxInt)
c := auxToS390xCCMask(b.Aux)
if !(!is8Bit(y) && is32Bit(y)) {
break
}
v0 := b.NewValue0(x.Pos, OpS390XCMPWconst, types.TypeFlags)
v0.AuxInt = int32ToAuxInt(int32(y))
v0.AddArg(x)
b.resetWithControl(BlockS390XBRC, v0)
b.Aux = s390xCCMaskToAux(c)
return true
}
// match: (CRJ {c} (MOVDconst [x]) y yes no)
// cond: !is8Bit(x) && is32Bit(x)
// result: (BRC {c.ReverseComparison()} (CMPWconst y [int32(x)]) yes no)
for b.Controls[0].Op == OpS390XMOVDconst {
v_0 := b.Controls[0]
x := auxIntToInt64(v_0.AuxInt)
y := b.Controls[1]
c := auxToS390xCCMask(b.Aux)
if !(!is8Bit(x) && is32Bit(x)) {
break
}
v0 := b.NewValue0(v_0.Pos, OpS390XCMPWconst, types.TypeFlags)
v0.AuxInt = int32ToAuxInt(int32(x))
v0.AddArg(y)
b.resetWithControl(BlockS390XBRC, v0)
b.Aux = s390xCCMaskToAux(c.ReverseComparison())
return true
}
// match: (CRJ {c} x y yes no)
// cond: x == y && c&s390x.Equal != 0
// result: (First yes no)
for {
x := b.Controls[0]
y := b.Controls[1]
c := auxToS390xCCMask(b.Aux)
if !(x == y && c&s390x.Equal != 0) {
break
}
b.Reset(BlockFirst)
return true
}
// match: (CRJ {c} x y yes no)
// cond: x == y && c&s390x.Equal == 0
// result: (First no yes)
for {
x := b.Controls[0]
y := b.Controls[1]
c := auxToS390xCCMask(b.Aux)
if !(x == y && c&s390x.Equal == 0) {
break
}
b.Reset(BlockFirst)
b.swapSuccessors()
return true
}
case BlockIf:
// match: (If cond yes no)
// result: (CLIJ {s390x.LessOrGreater} (MOVBZreg <typ.Bool> cond) [0] yes no)
for {
cond := b.Controls[0]
v0 := b.NewValue0(cond.Pos, OpS390XMOVBZreg, typ.Bool)
v0.AddArg(cond)
b.resetWithControl(BlockS390XCLIJ, v0)
b.AuxInt = uint8ToAuxInt(0)
b.Aux = s390xCCMaskToAux(s390x.LessOrGreater)
return true
}
}
return false
}