diff options
author | Michael Munday <mike.munday@ibm.com> | 2020-04-16 11:40:09 +0100 |
---|---|---|
committer | Michael Munday <mike.munday@ibm.com> | 2020-04-17 14:54:05 +0000 |
commit | b1cae8cd1d66714d7fe7e84eb6aea04986b797f1 (patch) | |
tree | 4cde6cd5a85b7d95cb4a5d1c13b2baf4cbd577bd /src/cmd/compile/internal/ssa/rewriteS390X.go | |
parent | 8ce21fae6009adc0d528945b09293ff2c4530364 (diff) | |
download | go-b1cae8cd1d66714d7fe7e84eb6aea04986b797f1.tar.gz go-b1cae8cd1d66714d7fe7e84eb6aea04986b797f1.zip |
cmd/compile: make some s390x rules use strongly typed aux values
This first pass makes the rules using the condition code mask
(CCMask) and rotate parameters (RotateParams) aux values strongly
typed. This required adding strongly typed aux handling to the
block rulegen.
More CLs like this to follow, but this is probably the most
complex.
Passes toolstash-check -all.
Change-Id: Ie513b07d527f0c1b398d7748331442dcb5f7b17d
Reviewed-on: https://go-review.googlesource.com/c/go/+/228518
Run-TryBot: Michael Munday <mike.munday@ibm.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
Diffstat (limited to 'src/cmd/compile/internal/ssa/rewriteS390X.go')
-rw-r--r-- | src/cmd/compile/internal/ssa/rewriteS390X.go | 794 |
1 files changed, 397 insertions, 397 deletions
diff --git a/src/cmd/compile/internal/ssa/rewriteS390X.go b/src/cmd/compile/internal/ssa/rewriteS390X.go index fda0bc6b34..29a6cb67fa 100644 --- a/src/cmd/compile/internal/ssa/rewriteS390X.go +++ b/src/cmd/compile/internal/ssa/rewriteS390X.go @@ -8082,9 +8082,9 @@ func rewriteValueS390X_OpS390XLOCGR(v *Value) bool { v_1 := v.Args[1] v_0 := v.Args[0] // match: (LOCGR {c} x y (InvertFlags cmp)) - // result: (LOCGR {c.(s390x.CCMask).ReverseComparison()} x y cmp) + // result: (LOCGR {c.ReverseComparison()} x y cmp) for { - c := v.Aux + c := auxToS390xCCMask(v.Aux) x := v_0 y := v_1 if v_2.Op != OpS390XInvertFlags { @@ -8092,101 +8092,101 @@ func rewriteValueS390X_OpS390XLOCGR(v *Value) bool { } cmp := v_2.Args[0] v.reset(OpS390XLOCGR) - v.Aux = c.(s390x.CCMask).ReverseComparison() + v.Aux = s390xCCMaskToAux(c.ReverseComparison()) v.AddArg3(x, y, cmp) return true } // match: (LOCGR {c} _ x (FlagEQ)) - // cond: c.(s390x.CCMask) & s390x.Equal != 0 + // cond: c&s390x.Equal != 0 // result: x for { - c := v.Aux + c := auxToS390xCCMask(v.Aux) x := v_1 - if v_2.Op != OpS390XFlagEQ || !(c.(s390x.CCMask)&s390x.Equal != 0) { + if v_2.Op != OpS390XFlagEQ || !(c&s390x.Equal != 0) { break } v.copyOf(x) return true } // match: (LOCGR {c} _ x (FlagLT)) - // cond: c.(s390x.CCMask) & s390x.Less != 0 + // cond: c&s390x.Less != 0 // result: x for { - c := v.Aux + c := auxToS390xCCMask(v.Aux) x := v_1 - if v_2.Op != OpS390XFlagLT || !(c.(s390x.CCMask)&s390x.Less != 0) { + if v_2.Op != OpS390XFlagLT || !(c&s390x.Less != 0) { break } v.copyOf(x) return true } // match: (LOCGR {c} _ x (FlagGT)) - // cond: c.(s390x.CCMask) & s390x.Greater != 0 + // cond: c&s390x.Greater != 0 // result: x for { - c := v.Aux + c := auxToS390xCCMask(v.Aux) x := v_1 - if v_2.Op != OpS390XFlagGT || !(c.(s390x.CCMask)&s390x.Greater != 0) { + if v_2.Op != OpS390XFlagGT || !(c&s390x.Greater != 0) { break } v.copyOf(x) return true } // match: (LOCGR {c} _ x (FlagOV)) - // cond: c.(s390x.CCMask) & s390x.Unordered != 0 + // cond: c&s390x.Unordered != 0 // result: x for { - c := v.Aux + c := auxToS390xCCMask(v.Aux) x := v_1 - if v_2.Op != OpS390XFlagOV || !(c.(s390x.CCMask)&s390x.Unordered != 0) { + if v_2.Op != OpS390XFlagOV || !(c&s390x.Unordered != 0) { break } v.copyOf(x) return true } // match: (LOCGR {c} x _ (FlagEQ)) - // cond: c.(s390x.CCMask) & s390x.Equal == 0 + // cond: c&s390x.Equal == 0 // result: x for { - c := v.Aux + c := auxToS390xCCMask(v.Aux) x := v_0 - if v_2.Op != OpS390XFlagEQ || !(c.(s390x.CCMask)&s390x.Equal == 0) { + if v_2.Op != OpS390XFlagEQ || !(c&s390x.Equal == 0) { break } v.copyOf(x) return true } // match: (LOCGR {c} x _ (FlagLT)) - // cond: c.(s390x.CCMask) & s390x.Less == 0 + // cond: c&s390x.Less == 0 // result: x for { - c := v.Aux + c := auxToS390xCCMask(v.Aux) x := v_0 - if v_2.Op != OpS390XFlagLT || !(c.(s390x.CCMask)&s390x.Less == 0) { + if v_2.Op != OpS390XFlagLT || !(c&s390x.Less == 0) { break } v.copyOf(x) return true } // match: (LOCGR {c} x _ (FlagGT)) - // cond: c.(s390x.CCMask) & s390x.Greater == 0 + // cond: c&s390x.Greater == 0 // result: x for { - c := v.Aux + c := auxToS390xCCMask(v.Aux) x := v_0 - if v_2.Op != OpS390XFlagGT || !(c.(s390x.CCMask)&s390x.Greater == 0) { + if v_2.Op != OpS390XFlagGT || !(c&s390x.Greater == 0) { break } v.copyOf(x) return true } // match: (LOCGR {c} x _ (FlagOV)) - // cond: c.(s390x.CCMask) & s390x.Unordered == 0 + // cond: c&s390x.Unordered == 0 // result: x for { - c := v.Aux + c := auxToS390xCCMask(v.Aux) x := v_0 - if v_2.Op != OpS390XFlagOV || !(c.(s390x.CCMask)&s390x.Unordered == 0) { + if v_2.Op != OpS390XFlagOV || !(c&s390x.Unordered == 0) { break } v.copyOf(x) @@ -8675,12 +8675,12 @@ func rewriteValueS390X_OpS390XMOVBZreg(v *Value) bool { if x_0.Op != OpS390XMOVDconst { break } - c := x_0.AuxInt + c := auxIntToInt64(x_0.AuxInt) x_1 := x.Args[1] if x_1.Op != OpS390XMOVDconst { break } - d := x_1.AuxInt + d := auxIntToInt64(x_1.AuxInt) if !(int64(uint8(c)) == c && int64(uint8(d)) == d && (!x.Type.IsSigned() || x.Type.Size() > 1)) { break } @@ -19021,365 +19021,365 @@ func rewriteBlockS390X(b *Block) bool { switch b.Kind { case BlockS390XBRC: // match: (BRC {c} (CMP x y) yes no) - // result: (CGRJ {c.(s390x.CCMask)&^s390x.Unordered} 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 := b.Aux + c := auxToS390xCCMask(b.Aux) b.resetWithControl2(BlockS390XCGRJ, x, y) - b.Aux = c.(s390x.CCMask) &^ s390x.Unordered + b.Aux = s390xCCMaskToAux(c &^ s390x.Unordered) return true } // match: (BRC {c} (CMPW x y) yes no) - // result: (CRJ {c.(s390x.CCMask)&^s390x.Unordered} 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 := b.Aux + c := auxToS390xCCMask(b.Aux) b.resetWithControl2(BlockS390XCRJ, x, y) - b.Aux = c.(s390x.CCMask) &^ s390x.Unordered + b.Aux = s390xCCMaskToAux(c &^ s390x.Unordered) return true } // match: (BRC {c} (CMPU x y) yes no) - // result: (CLGRJ {c.(s390x.CCMask)&^s390x.Unordered} 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 := b.Aux + c := auxToS390xCCMask(b.Aux) b.resetWithControl2(BlockS390XCLGRJ, x, y) - b.Aux = c.(s390x.CCMask) &^ s390x.Unordered + b.Aux = s390xCCMaskToAux(c &^ s390x.Unordered) return true } // match: (BRC {c} (CMPWU x y) yes no) - // result: (CLRJ {c.(s390x.CCMask)&^s390x.Unordered} 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 := b.Aux + c := auxToS390xCCMask(b.Aux) b.resetWithControl2(BlockS390XCLRJ, x, y) - b.Aux = c.(s390x.CCMask) &^ s390x.Unordered + b.Aux = s390xCCMaskToAux(c &^ s390x.Unordered) return true } // match: (BRC {c} (CMPconst x [y]) yes no) - // cond: is8Bit(y) - // result: (CGIJ {c.(s390x.CCMask)&^s390x.Unordered} x [int64(int8(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 := v_0.AuxInt + y := auxIntToInt32(v_0.AuxInt) x := v_0.Args[0] - c := b.Aux - if !(is8Bit(y)) { + c := auxToS390xCCMask(b.Aux) + if !(y == int32(int8(y))) { break } b.resetWithControl(BlockS390XCGIJ, x) - b.AuxInt = int64(int8(y)) - b.Aux = c.(s390x.CCMask) &^ s390x.Unordered + b.AuxInt = int8ToAuxInt(int8(y)) + b.Aux = s390xCCMaskToAux(c &^ s390x.Unordered) return true } // match: (BRC {c} (CMPWconst x [y]) yes no) - // cond: is8Bit(y) - // result: (CIJ {c.(s390x.CCMask)&^s390x.Unordered} x [int64(int8(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 := v_0.AuxInt + y := auxIntToInt32(v_0.AuxInt) x := v_0.Args[0] - c := b.Aux - if !(is8Bit(y)) { + c := auxToS390xCCMask(b.Aux) + if !(y == int32(int8(y))) { break } b.resetWithControl(BlockS390XCIJ, x) - b.AuxInt = int64(int8(y)) - b.Aux = c.(s390x.CCMask) &^ s390x.Unordered + b.AuxInt = int8ToAuxInt(int8(y)) + b.Aux = s390xCCMaskToAux(c &^ s390x.Unordered) return true } // match: (BRC {c} (CMPUconst x [y]) yes no) - // cond: isU8Bit(y) - // result: (CLGIJ {c.(s390x.CCMask)&^s390x.Unordered} x [int64(int8(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 := v_0.AuxInt + y := auxIntToInt32(v_0.AuxInt) x := v_0.Args[0] - c := b.Aux - if !(isU8Bit(y)) { + c := auxToS390xCCMask(b.Aux) + if !(y == int32(uint8(y))) { break } b.resetWithControl(BlockS390XCLGIJ, x) - b.AuxInt = int64(int8(y)) - b.Aux = c.(s390x.CCMask) &^ s390x.Unordered + b.AuxInt = uint8ToAuxInt(uint8(y)) + b.Aux = s390xCCMaskToAux(c &^ s390x.Unordered) return true } // match: (BRC {c} (CMPWUconst x [y]) yes no) - // cond: isU8Bit(y) - // result: (CLIJ {c.(s390x.CCMask)&^s390x.Unordered} x [int64(int8(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 := v_0.AuxInt + y := auxIntToInt32(v_0.AuxInt) x := v_0.Args[0] - c := b.Aux - if !(isU8Bit(y)) { + c := auxToS390xCCMask(b.Aux) + if !(y == int32(uint8(y))) { break } b.resetWithControl(BlockS390XCLIJ, x) - b.AuxInt = int64(int8(y)) - b.Aux = c.(s390x.CCMask) &^ s390x.Unordered + 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 v_0.AuxInt != 128 { + if auxIntToInt32(v_0.AuxInt) != 128 { break } x := v_0.Args[0] - if b.Aux != s390x.Less { + if auxToS390xCCMask(b.Aux) != s390x.Less { break } b.resetWithControl(BlockS390XCGIJ, x) - b.AuxInt = 127 - b.Aux = s390x.LessOrEqual + 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 v_0.AuxInt != 128 { + if auxIntToInt32(v_0.AuxInt) != 128 { break } x := v_0.Args[0] - if b.Aux != s390x.Less { + if auxToS390xCCMask(b.Aux) != s390x.Less { break } b.resetWithControl(BlockS390XCIJ, x) - b.AuxInt = 127 - b.Aux = s390x.LessOrEqual + 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 v_0.AuxInt != -129 { + if auxIntToInt32(v_0.AuxInt) != -129 { break } x := v_0.Args[0] - if b.Aux != s390x.LessOrEqual { + if auxToS390xCCMask(b.Aux) != s390x.LessOrEqual { break } b.resetWithControl(BlockS390XCGIJ, x) - b.AuxInt = -128 - b.Aux = s390x.Less + 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 v_0.AuxInt != -129 { + if auxIntToInt32(v_0.AuxInt) != -129 { break } x := v_0.Args[0] - if b.Aux != s390x.LessOrEqual { + if auxToS390xCCMask(b.Aux) != s390x.LessOrEqual { break } b.resetWithControl(BlockS390XCIJ, x) - b.AuxInt = -128 - b.Aux = s390x.Less + 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 v_0.AuxInt != -129 { + if auxIntToInt32(v_0.AuxInt) != -129 { break } x := v_0.Args[0] - if b.Aux != s390x.Greater { + if auxToS390xCCMask(b.Aux) != s390x.Greater { break } b.resetWithControl(BlockS390XCGIJ, x) - b.AuxInt = -128 - b.Aux = s390x.GreaterOrEqual + 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 v_0.AuxInt != -129 { + if auxIntToInt32(v_0.AuxInt) != -129 { break } x := v_0.Args[0] - if b.Aux != s390x.Greater { + if auxToS390xCCMask(b.Aux) != s390x.Greater { break } b.resetWithControl(BlockS390XCIJ, x) - b.AuxInt = -128 - b.Aux = s390x.GreaterOrEqual + 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 v_0.AuxInt != 128 { + if auxIntToInt32(v_0.AuxInt) != 128 { break } x := v_0.Args[0] - if b.Aux != s390x.GreaterOrEqual { + if auxToS390xCCMask(b.Aux) != s390x.GreaterOrEqual { break } b.resetWithControl(BlockS390XCGIJ, x) - b.AuxInt = 127 - b.Aux = s390x.Greater + 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 v_0.AuxInt != 128 { + if auxIntToInt32(v_0.AuxInt) != 128 { break } x := v_0.Args[0] - if b.Aux != s390x.GreaterOrEqual { + if auxToS390xCCMask(b.Aux) != s390x.GreaterOrEqual { break } b.resetWithControl(BlockS390XCIJ, x) - b.AuxInt = 127 - b.Aux = s390x.Greater + 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 [-1] yes no) + // result: (CLIJ {s390x.LessOrEqual} x [255] yes no) for b.Controls[0].Op == OpS390XCMPWUconst { v_0 := b.Controls[0] - if v_0.AuxInt != 256 { + if auxIntToInt32(v_0.AuxInt) != 256 { break } x := v_0.Args[0] - if b.Aux != s390x.Less { + if auxToS390xCCMask(b.Aux) != s390x.Less { break } b.resetWithControl(BlockS390XCLIJ, x) - b.AuxInt = -1 - b.Aux = s390x.LessOrEqual + 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 [-1] yes no) + // result: (CLGIJ {s390x.LessOrEqual} x [255] yes no) for b.Controls[0].Op == OpS390XCMPUconst { v_0 := b.Controls[0] - if v_0.AuxInt != 256 { + if auxIntToInt32(v_0.AuxInt) != 256 { break } x := v_0.Args[0] - if b.Aux != s390x.Less { + if auxToS390xCCMask(b.Aux) != s390x.Less { break } b.resetWithControl(BlockS390XCLGIJ, x) - b.AuxInt = -1 - b.Aux = s390x.LessOrEqual + 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 [-1] yes no) + // result: (CLIJ {s390x.Greater} x [255] yes no) for b.Controls[0].Op == OpS390XCMPWUconst { v_0 := b.Controls[0] - if v_0.AuxInt != 256 { + if auxIntToInt32(v_0.AuxInt) != 256 { break } x := v_0.Args[0] - if b.Aux != s390x.GreaterOrEqual { + if auxToS390xCCMask(b.Aux) != s390x.GreaterOrEqual { break } b.resetWithControl(BlockS390XCLIJ, x) - b.AuxInt = -1 - b.Aux = s390x.Greater + 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 [-1] yes no) + // result: (CLGIJ {s390x.Greater} x [255] yes no) for b.Controls[0].Op == OpS390XCMPUconst { v_0 := b.Controls[0] - if v_0.AuxInt != 256 { + if auxIntToInt32(v_0.AuxInt) != 256 { break } x := v_0.Args[0] - if b.Aux != s390x.GreaterOrEqual { + if auxToS390xCCMask(b.Aux) != s390x.GreaterOrEqual { break } b.resetWithControl(BlockS390XCLGIJ, x) - b.AuxInt = -1 - b.Aux = s390x.Greater + b.AuxInt = uint8ToAuxInt(255) + b.Aux = s390xCCMaskToAux(s390x.Greater) return true } // match: (BRC {c} (InvertFlags cmp) yes no) - // result: (BRC {c.(s390x.CCMask).ReverseComparison()} 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 := b.Aux + c := auxToS390xCCMask(b.Aux) b.resetWithControl(BlockS390XBRC, cmp) - b.Aux = c.(s390x.CCMask).ReverseComparison() + b.Aux = s390xCCMaskToAux(c.ReverseComparison()) return true } // match: (BRC {c} (FlagEQ) yes no) - // cond: c.(s390x.CCMask) & s390x.Equal != 0 + // cond: c&s390x.Equal != 0 // result: (First yes no) for b.Controls[0].Op == OpS390XFlagEQ { - c := b.Aux - if !(c.(s390x.CCMask)&s390x.Equal != 0) { + c := auxToS390xCCMask(b.Aux) + if !(c&s390x.Equal != 0) { break } b.Reset(BlockFirst) return true } // match: (BRC {c} (FlagLT) yes no) - // cond: c.(s390x.CCMask) & s390x.Less != 0 + // cond: c&s390x.Less != 0 // result: (First yes no) for b.Controls[0].Op == OpS390XFlagLT { - c := b.Aux - if !(c.(s390x.CCMask)&s390x.Less != 0) { + c := auxToS390xCCMask(b.Aux) + if !(c&s390x.Less != 0) { break } b.Reset(BlockFirst) return true } // match: (BRC {c} (FlagGT) yes no) - // cond: c.(s390x.CCMask) & s390x.Greater != 0 + // cond: c&s390x.Greater != 0 // result: (First yes no) for b.Controls[0].Op == OpS390XFlagGT { - c := b.Aux - if !(c.(s390x.CCMask)&s390x.Greater != 0) { + c := auxToS390xCCMask(b.Aux) + if !(c&s390x.Greater != 0) { break } b.Reset(BlockFirst) return true } // match: (BRC {c} (FlagOV) yes no) - // cond: c.(s390x.CCMask) & s390x.Unordered != 0 + // cond: c&s390x.Unordered != 0 // result: (First yes no) for b.Controls[0].Op == OpS390XFlagOV { - c := b.Aux - if !(c.(s390x.CCMask)&s390x.Unordered != 0) { + c := auxToS390xCCMask(b.Aux) + if !(c&s390x.Unordered != 0) { break } b.Reset(BlockFirst) return true } // match: (BRC {c} (FlagEQ) yes no) - // cond: c.(s390x.CCMask) & s390x.Equal == 0 + // cond: c&s390x.Equal == 0 // result: (First no yes) for b.Controls[0].Op == OpS390XFlagEQ { - c := b.Aux - if !(c.(s390x.CCMask)&s390x.Equal == 0) { + c := auxToS390xCCMask(b.Aux) + if !(c&s390x.Equal == 0) { break } b.Reset(BlockFirst) @@ -19387,11 +19387,11 @@ func rewriteBlockS390X(b *Block) bool { return true } // match: (BRC {c} (FlagLT) yes no) - // cond: c.(s390x.CCMask) & s390x.Less == 0 + // cond: c&s390x.Less == 0 // result: (First no yes) for b.Controls[0].Op == OpS390XFlagLT { - c := b.Aux - if !(c.(s390x.CCMask)&s390x.Less == 0) { + c := auxToS390xCCMask(b.Aux) + if !(c&s390x.Less == 0) { break } b.Reset(BlockFirst) @@ -19399,11 +19399,11 @@ func rewriteBlockS390X(b *Block) bool { return true } // match: (BRC {c} (FlagGT) yes no) - // cond: c.(s390x.CCMask) & s390x.Greater == 0 + // cond: c&s390x.Greater == 0 // result: (First no yes) for b.Controls[0].Op == OpS390XFlagGT { - c := b.Aux - if !(c.(s390x.CCMask)&s390x.Greater == 0) { + c := auxToS390xCCMask(b.Aux) + if !(c&s390x.Greater == 0) { break } b.Reset(BlockFirst) @@ -19411,11 +19411,11 @@ func rewriteBlockS390X(b *Block) bool { return true } // match: (BRC {c} (FlagOV) yes no) - // cond: c.(s390x.CCMask) & s390x.Unordered == 0 + // cond: c&s390x.Unordered == 0 // result: (First no yes) for b.Controls[0].Op == OpS390XFlagOV { - c := b.Aux - if !(c.(s390x.CCMask)&s390x.Unordered == 0) { + c := auxToS390xCCMask(b.Aux) + if !(c&s390x.Unordered == 0) { break } b.Reset(BlockFirst) @@ -19424,56 +19424,56 @@ func rewriteBlockS390X(b *Block) bool { } case BlockS390XCGIJ: // match: (CGIJ {c} (MOVDconst [x]) [y] yes no) - // cond: c.(s390x.CCMask)&s390x.Equal != 0 && int64(x) == int64( int8(y)) + // 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 := v_0.AuxInt - y := b.AuxInt - c := b.Aux - if !(c.(s390x.CCMask)&s390x.Equal != 0 && int64(x) == int64(int8(y))) { + 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.CCMask)&s390x.Less != 0 && int64(x) < int64( int8(y)) + // 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 := v_0.AuxInt - y := b.AuxInt - c := b.Aux - if !(c.(s390x.CCMask)&s390x.Less != 0 && int64(x) < int64(int8(y))) { + 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.CCMask)&s390x.Greater != 0 && int64(x) > int64( int8(y)) + // 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 := v_0.AuxInt - y := b.AuxInt - c := b.Aux - if !(c.(s390x.CCMask)&s390x.Greater != 0 && int64(x) > int64(int8(y))) { + 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.CCMask)&s390x.Equal == 0 && int64(x) == int64( int8(y)) + // 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 := v_0.AuxInt - y := b.AuxInt - c := b.Aux - if !(c.(s390x.CCMask)&s390x.Equal == 0 && int64(x) == int64(int8(y))) { + 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) @@ -19481,14 +19481,14 @@ func rewriteBlockS390X(b *Block) bool { return true } // match: (CGIJ {c} (MOVDconst [x]) [y] yes no) - // cond: c.(s390x.CCMask)&s390x.Less == 0 && int64(x) < int64( int8(y)) + // 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 := v_0.AuxInt - y := b.AuxInt - c := b.Aux - if !(c.(s390x.CCMask)&s390x.Less == 0 && int64(x) < int64(int8(y))) { + 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) @@ -19496,14 +19496,14 @@ func rewriteBlockS390X(b *Block) bool { return true } // match: (CGIJ {c} (MOVDconst [x]) [y] yes no) - // cond: c.(s390x.CCMask)&s390x.Greater == 0 && int64(x) > int64( int8(y)) + // 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 := v_0.AuxInt - y := b.AuxInt - c := b.Aux - if !(c.(s390x.CCMask)&s390x.Greater == 0 && int64(x) > int64(int8(y))) { + 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) @@ -19513,93 +19513,93 @@ func rewriteBlockS390X(b *Block) bool { case BlockS390XCGRJ: // match: (CGRJ {c} x (MOVDconst [y]) yes no) // cond: is8Bit(y) - // result: (CGIJ {c} x [int64(int8(y))] yes no) + // result: (CGIJ {c} x [ int8(y)] yes no) for b.Controls[1].Op == OpS390XMOVDconst { x := b.Controls[0] v_1 := b.Controls[1] - y := v_1.AuxInt - c := b.Aux + y := auxIntToInt64(v_1.AuxInt) + c := auxToS390xCCMask(b.Aux) if !(is8Bit(y)) { break } b.resetWithControl(BlockS390XCGIJ, x) - b.AuxInt = int64(int8(y)) - b.Aux = c + 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.(s390x.CCMask).ReverseComparison()} y [int64(int8(x))] yes no) + // result: (CGIJ {c.ReverseComparison()} y [ int8(x)] yes no) for b.Controls[0].Op == OpS390XMOVDconst { v_0 := b.Controls[0] - x := v_0.AuxInt + x := auxIntToInt64(v_0.AuxInt) y := b.Controls[1] - c := b.Aux + c := auxToS390xCCMask(b.Aux) if !(is8Bit(x)) { break } b.resetWithControl(BlockS390XCGIJ, y) - b.AuxInt = int64(int8(x)) - b.Aux = c.(s390x.CCMask).ReverseComparison() + 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 [int64(int32(y))]) yes no) + // 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 := v_1.AuxInt - c := b.Aux + 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 = int64(int32(y)) + v0.AuxInt = int32ToAuxInt(int32(y)) v0.AddArg(x) b.resetWithControl(BlockS390XBRC, v0) - b.Aux = c + b.Aux = s390xCCMaskToAux(c) return true } // match: (CGRJ {c} (MOVDconst [x]) y yes no) // cond: !is8Bit(x) && is32Bit(x) - // result: (BRC {c.(s390x.CCMask).ReverseComparison()} (CMPconst y [int64(int32(x))]) yes no) + // result: (BRC {c.ReverseComparison()} (CMPconst y [int32(x)]) yes no) for b.Controls[0].Op == OpS390XMOVDconst { v_0 := b.Controls[0] - x := v_0.AuxInt + x := auxIntToInt64(v_0.AuxInt) y := b.Controls[1] - c := b.Aux + c := auxToS390xCCMask(b.Aux) if !(!is8Bit(x) && is32Bit(x)) { break } v0 := b.NewValue0(v_0.Pos, OpS390XCMPconst, types.TypeFlags) - v0.AuxInt = int64(int32(x)) + v0.AuxInt = int32ToAuxInt(int32(x)) v0.AddArg(y) b.resetWithControl(BlockS390XBRC, v0) - b.Aux = c.(s390x.CCMask).ReverseComparison() + b.Aux = s390xCCMaskToAux(c.ReverseComparison()) return true } // match: (CGRJ {c} x y yes no) - // cond: x == y && c.(s390x.CCMask)&s390x.Equal != 0 + // cond: x == y && c&s390x.Equal != 0 // result: (First yes no) for { x := b.Controls[0] y := b.Controls[1] - c := b.Aux - if !(x == y && c.(s390x.CCMask)&s390x.Equal != 0) { + 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.CCMask)&s390x.Equal == 0 + // cond: x == y && c&s390x.Equal == 0 // result: (First no yes) for { x := b.Controls[0] y := b.Controls[1] - c := b.Aux - if !(x == y && c.(s390x.CCMask)&s390x.Equal == 0) { + c := auxToS390xCCMask(b.Aux) + if !(x == y && c&s390x.Equal == 0) { break } b.Reset(BlockFirst) @@ -19612,11 +19612,11 @@ func rewriteBlockS390X(b *Block) bool { for b.Controls[0].Op == OpS390XMOVWreg { v_0 := b.Controls[0] x := v_0.Args[0] - y := b.AuxInt - c := b.Aux + y := auxIntToInt8(b.AuxInt) + c := auxToS390xCCMask(b.Aux) b.resetWithControl(BlockS390XCIJ, x) - b.AuxInt = y - b.Aux = c + b.AuxInt = int8ToAuxInt(y) + b.Aux = s390xCCMaskToAux(c) return true } // match: (CIJ {c} (MOVWZreg x) [y] yes no) @@ -19624,64 +19624,64 @@ func rewriteBlockS390X(b *Block) bool { for b.Controls[0].Op == OpS390XMOVWZreg { v_0 := b.Controls[0] x := v_0.Args[0] - y := b.AuxInt - c := b.Aux + y := auxIntToInt8(b.AuxInt) + c := auxToS390xCCMask(b.Aux) b.resetWithControl(BlockS390XCIJ, x) - b.AuxInt = y - b.Aux = c + b.AuxInt = int8ToAuxInt(y) + b.Aux = s390xCCMaskToAux(c) return true } // match: (CIJ {c} (MOVDconst [x]) [y] yes no) - // cond: c.(s390x.CCMask)&s390x.Equal != 0 && int32(x) == int32( int8(y)) + // 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 := v_0.AuxInt - y := b.AuxInt - c := b.Aux - if !(c.(s390x.CCMask)&s390x.Equal != 0 && int32(x) == int32(int8(y))) { + 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.CCMask)&s390x.Less != 0 && int32(x) < int32( int8(y)) + // 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 := v_0.AuxInt - y := b.AuxInt - c := b.Aux - if !(c.(s390x.CCMask)&s390x.Less != 0 && int32(x) < int32(int8(y))) { + 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.CCMask)&s390x.Greater != 0 && int32(x) > int32( int8(y)) + // 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 := v_0.AuxInt - y := b.AuxInt - c := b.Aux - if !(c.(s390x.CCMask)&s390x.Greater != 0 && int32(x) > int32(int8(y))) { + 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.CCMask)&s390x.Equal == 0 && int32(x) == int32( int8(y)) + // 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 := v_0.AuxInt - y := b.AuxInt - c := b.Aux - if !(c.(s390x.CCMask)&s390x.Equal == 0 && int32(x) == int32(int8(y))) { + 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) @@ -19689,14 +19689,14 @@ func rewriteBlockS390X(b *Block) bool { return true } // match: (CIJ {c} (MOVDconst [x]) [y] yes no) - // cond: c.(s390x.CCMask)&s390x.Less == 0 && int32(x) < int32( int8(y)) + // 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 := v_0.AuxInt - y := b.AuxInt - c := b.Aux - if !(c.(s390x.CCMask)&s390x.Less == 0 && int32(x) < int32(int8(y))) { + 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) @@ -19704,14 +19704,14 @@ func rewriteBlockS390X(b *Block) bool { return true } // match: (CIJ {c} (MOVDconst [x]) [y] yes no) - // cond: c.(s390x.CCMask)&s390x.Greater == 0 && int32(x) > int32( int8(y)) + // 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 := v_0.AuxInt - y := b.AuxInt - c := b.Aux - if !(c.(s390x.CCMask)&s390x.Greater == 0 && int32(x) > int32(int8(y))) { + 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) @@ -19720,56 +19720,56 @@ func rewriteBlockS390X(b *Block) bool { } case BlockS390XCLGIJ: // match: (CLGIJ {c} (MOVDconst [x]) [y] yes no) - // cond: c.(s390x.CCMask)&s390x.Equal != 0 && uint64(x) == uint64(uint8(y)) + // 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 := v_0.AuxInt - y := b.AuxInt - c := b.Aux - if !(c.(s390x.CCMask)&s390x.Equal != 0 && uint64(x) == uint64(uint8(y))) { + 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.CCMask)&s390x.Less != 0 && uint64(x) < uint64(uint8(y)) + // 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 := v_0.AuxInt - y := b.AuxInt - c := b.Aux - if !(c.(s390x.CCMask)&s390x.Less != 0 && uint64(x) < uint64(uint8(y))) { + 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.CCMask)&s390x.Greater != 0 && uint64(x) > uint64(uint8(y)) + // 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 := v_0.AuxInt - y := b.AuxInt - c := b.Aux - if !(c.(s390x.CCMask)&s390x.Greater != 0 && uint64(x) > uint64(uint8(y))) { + 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.CCMask)&s390x.Equal == 0 && uint64(x) == uint64(uint8(y)) + // 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 := v_0.AuxInt - y := b.AuxInt - c := b.Aux - if !(c.(s390x.CCMask)&s390x.Equal == 0 && uint64(x) == uint64(uint8(y))) { + 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) @@ -19777,14 +19777,14 @@ func rewriteBlockS390X(b *Block) bool { return true } // match: (CLGIJ {c} (MOVDconst [x]) [y] yes no) - // cond: c.(s390x.CCMask)&s390x.Less == 0 && uint64(x) < uint64(uint8(y)) + // 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 := v_0.AuxInt - y := b.AuxInt - c := b.Aux - if !(c.(s390x.CCMask)&s390x.Less == 0 && uint64(x) < uint64(uint8(y))) { + 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) @@ -19792,14 +19792,14 @@ func rewriteBlockS390X(b *Block) bool { return true } // match: (CLGIJ {c} (MOVDconst [x]) [y] yes no) - // cond: c.(s390x.CCMask)&s390x.Greater == 0 && uint64(x) > uint64(uint8(y)) + // 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 := v_0.AuxInt - y := b.AuxInt - c := b.Aux - if !(c.(s390x.CCMask)&s390x.Greater == 0 && uint64(x) > uint64(uint8(y))) { + 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) @@ -19809,7 +19809,7 @@ func rewriteBlockS390X(b *Block) bool { // match: (CLGIJ {s390x.GreaterOrEqual} _ [0] yes no) // result: (First yes no) for { - if b.AuxInt != 0 || b.Aux != s390x.GreaterOrEqual { + if auxIntToUint8(b.AuxInt) != 0 || auxToS390xCCMask(b.Aux) != s390x.GreaterOrEqual { break } b.Reset(BlockFirst) @@ -19818,7 +19818,7 @@ func rewriteBlockS390X(b *Block) bool { // match: (CLGIJ {s390x.Less} _ [0] yes no) // result: (First no yes) for { - if b.AuxInt != 0 || b.Aux != s390x.Less { + if auxIntToUint8(b.AuxInt) != 0 || auxToS390xCCMask(b.Aux) != s390x.Less { break } b.Reset(BlockFirst) @@ -19828,93 +19828,93 @@ func rewriteBlockS390X(b *Block) bool { case BlockS390XCLGRJ: // match: (CLGRJ {c} x (MOVDconst [y]) yes no) // cond: isU8Bit(y) - // result: (CLGIJ {c} x [int64(int8(y))] yes no) + // result: (CLGIJ {c} x [uint8(y)] yes no) for b.Controls[1].Op == OpS390XMOVDconst { x := b.Controls[0] v_1 := b.Controls[1] - y := v_1.AuxInt - c := b.Aux + y := auxIntToInt64(v_1.AuxInt) + c := auxToS390xCCMask(b.Aux) if !(isU8Bit(y)) { break } b.resetWithControl(BlockS390XCLGIJ, x) - b.AuxInt = int64(int8(y)) - b.Aux = c + 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.(s390x.CCMask).ReverseComparison()} y [int64(int8(x))] yes no) + // result: (CLGIJ {c.ReverseComparison()} y [uint8(x)] yes no) for b.Controls[0].Op == OpS390XMOVDconst { v_0 := b.Controls[0] - x := v_0.AuxInt + x := auxIntToInt64(v_0.AuxInt) y := b.Controls[1] - c := b.Aux + c := auxToS390xCCMask(b.Aux) if !(isU8Bit(x)) { break } b.resetWithControl(BlockS390XCLGIJ, y) - b.AuxInt = int64(int8(x)) - b.Aux = c.(s390x.CCMask).ReverseComparison() + 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 [int64(int32(y))]) yes no) + // 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 := v_1.AuxInt - c := b.Aux + 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 = int64(int32(y)) + v0.AuxInt = int32ToAuxInt(int32(y)) v0.AddArg(x) b.resetWithControl(BlockS390XBRC, v0) - b.Aux = c + b.Aux = s390xCCMaskToAux(c) return true } // match: (CLGRJ {c} (MOVDconst [x]) y yes no) // cond: !isU8Bit(x) && isU32Bit(x) - // result: (BRC {c.(s390x.CCMask).ReverseComparison()} (CMPUconst y [int64(int32(x))]) yes no) + // result: (BRC {c.ReverseComparison()} (CMPUconst y [int32(x)]) yes no) for b.Controls[0].Op == OpS390XMOVDconst { v_0 := b.Controls[0] - x := v_0.AuxInt + x := auxIntToInt64(v_0.AuxInt) y := b.Controls[1] - c := b.Aux + c := auxToS390xCCMask(b.Aux) if !(!isU8Bit(x) && isU32Bit(x)) { break } v0 := b.NewValue0(v_0.Pos, OpS390XCMPUconst, types.TypeFlags) - v0.AuxInt = int64(int32(x)) + v0.AuxInt = int32ToAuxInt(int32(x)) v0.AddArg(y) b.resetWithControl(BlockS390XBRC, v0) - b.Aux = c.(s390x.CCMask).ReverseComparison() + b.Aux = s390xCCMaskToAux(c.ReverseComparison()) return true } // match: (CLGRJ {c} x y yes no) - // cond: x == y && c.(s390x.CCMask)&s390x.Equal != 0 + // cond: x == y && c&s390x.Equal != 0 // result: (First yes no) for { x := b.Controls[0] y := b.Controls[1] - c := b.Aux - if !(x == y && c.(s390x.CCMask)&s390x.Equal != 0) { + 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.CCMask)&s390x.Equal == 0 + // cond: x == y && c&s390x.Equal == 0 // result: (First no yes) for { x := b.Controls[0] y := b.Controls[1] - c := b.Aux - if !(x == y && c.(s390x.CCMask)&s390x.Equal == 0) { + c := auxToS390xCCMask(b.Aux) + if !(x == y && c&s390x.Equal == 0) { break } b.Reset(BlockFirst) @@ -19927,22 +19927,22 @@ func rewriteBlockS390X(b *Block) bool { // result: (BRC {d} cmp yes no) for b.Controls[0].Op == OpS390XLOCGR { v_0 := b.Controls[0] - d := v_0.Aux + d := auxToS390xCCMask(v_0.Aux) cmp := v_0.Args[2] v_0_0 := v_0.Args[0] - if v_0_0.Op != OpS390XMOVDconst || v_0_0.AuxInt != 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 := v_0_1.AuxInt - if b.AuxInt != 0 || b.Aux != s390x.LessOrGreater || !(int32(x) != 0) { + 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 = d + b.Aux = s390xCCMaskToAux(d) return true } // match: (CLIJ {c} (MOVWreg x) [y] yes no) @@ -19950,11 +19950,11 @@ func rewriteBlockS390X(b *Block) bool { for b.Controls[0].Op == OpS390XMOVWreg { v_0 := b.Controls[0] x := v_0.Args[0] - y := b.AuxInt - c := b.Aux + y := auxIntToUint8(b.AuxInt) + c := auxToS390xCCMask(b.Aux) b.resetWithControl(BlockS390XCLIJ, x) - b.AuxInt = y - b.Aux = c + b.AuxInt = uint8ToAuxInt(y) + b.Aux = s390xCCMaskToAux(c) return true } // match: (CLIJ {c} (MOVWZreg x) [y] yes no) @@ -19962,64 +19962,64 @@ func rewriteBlockS390X(b *Block) bool { for b.Controls[0].Op == OpS390XMOVWZreg { v_0 := b.Controls[0] x := v_0.Args[0] - y := b.AuxInt - c := b.Aux + y := auxIntToUint8(b.AuxInt) + c := auxToS390xCCMask(b.Aux) b.resetWithControl(BlockS390XCLIJ, x) - b.AuxInt = y - b.Aux = c + b.AuxInt = uint8ToAuxInt(y) + b.Aux = s390xCCMaskToAux(c) return true } // match: (CLIJ {c} (MOVDconst [x]) [y] yes no) - // cond: c.(s390x.CCMask)&s390x.Equal != 0 && uint32(x) == uint32(uint8(y)) + // 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 := v_0.AuxInt - y := b.AuxInt - c := b.Aux - if !(c.(s390x.CCMask)&s390x.Equal != 0 && uint32(x) == uint32(uint8(y))) { + 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.CCMask)&s390x.Less != 0 && uint32(x) < uint32(uint8(y)) + // 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 := v_0.AuxInt - y := b.AuxInt - c := b.Aux - if !(c.(s390x.CCMask)&s390x.Less != 0 && uint32(x) < uint32(uint8(y))) { + 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.CCMask)&s390x.Greater != 0 && uint32(x) > uint32(uint8(y)) + // 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 := v_0.AuxInt - y := b.AuxInt - c := b.Aux - if !(c.(s390x.CCMask)&s390x.Greater != 0 && uint32(x) > uint32(uint8(y))) { + 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.CCMask)&s390x.Equal == 0 && uint32(x) == uint32(uint8(y)) + // 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 := v_0.AuxInt - y := b.AuxInt - c := b.Aux - if !(c.(s390x.CCMask)&s390x.Equal == 0 && uint32(x) == uint32(uint8(y))) { + 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) @@ -20027,14 +20027,14 @@ func rewriteBlockS390X(b *Block) bool { return true } // match: (CLIJ {c} (MOVDconst [x]) [y] yes no) - // cond: c.(s390x.CCMask)&s390x.Less == 0 && uint32(x) < uint32(uint8(y)) + // 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 := v_0.AuxInt - y := b.AuxInt - c := b.Aux - if !(c.(s390x.CCMask)&s390x.Less == 0 && uint32(x) < uint32(uint8(y))) { + 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) @@ -20042,14 +20042,14 @@ func rewriteBlockS390X(b *Block) bool { return true } // match: (CLIJ {c} (MOVDconst [x]) [y] yes no) - // cond: c.(s390x.CCMask)&s390x.Greater == 0 && uint32(x) > uint32(uint8(y)) + // 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 := v_0.AuxInt - y := b.AuxInt - c := b.Aux - if !(c.(s390x.CCMask)&s390x.Greater == 0 && uint32(x) > uint32(uint8(y))) { + 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) @@ -20059,7 +20059,7 @@ func rewriteBlockS390X(b *Block) bool { // match: (CLIJ {s390x.GreaterOrEqual} _ [0] yes no) // result: (First yes no) for { - if b.AuxInt != 0 || b.Aux != s390x.GreaterOrEqual { + if auxIntToUint8(b.AuxInt) != 0 || auxToS390xCCMask(b.Aux) != s390x.GreaterOrEqual { break } b.Reset(BlockFirst) @@ -20068,7 +20068,7 @@ func rewriteBlockS390X(b *Block) bool { // match: (CLIJ {s390x.Less} _ [0] yes no) // result: (First no yes) for { - if b.AuxInt != 0 || b.Aux != s390x.Less { + if auxIntToUint8(b.AuxInt) != 0 || auxToS390xCCMask(b.Aux) != s390x.Less { break } b.Reset(BlockFirst) @@ -20078,93 +20078,93 @@ func rewriteBlockS390X(b *Block) bool { case BlockS390XCLRJ: // match: (CLRJ {c} x (MOVDconst [y]) yes no) // cond: isU8Bit(y) - // result: (CLIJ {c} x [int64(int8(y))] yes no) + // result: (CLIJ {c} x [uint8(y)] yes no) for b.Controls[1].Op == OpS390XMOVDconst { x := b.Controls[0] v_1 := b.Controls[1] - y := v_1.AuxInt - c := b.Aux + y := auxIntToInt64(v_1.AuxInt) + c := auxToS390xCCMask(b.Aux) if !(isU8Bit(y)) { break } b.resetWithControl(BlockS390XCLIJ, x) - b.AuxInt = int64(int8(y)) - b.Aux = c + 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.(s390x.CCMask).ReverseComparison()} y [int64(int8(x))] yes no) + // result: (CLIJ {c.ReverseComparison()} y [uint8(x)] yes no) for b.Controls[0].Op == OpS390XMOVDconst { v_0 := b.Controls[0] - x := v_0.AuxInt + x := auxIntToInt64(v_0.AuxInt) y := b.Controls[1] - c := b.Aux + c := auxToS390xCCMask(b.Aux) if !(isU8Bit(x)) { break } b.resetWithControl(BlockS390XCLIJ, y) - b.AuxInt = int64(int8(x)) - b.Aux = c.(s390x.CCMask).ReverseComparison() + 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 [int64(int32(y))]) yes no) + // 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 := v_1.AuxInt - c := b.Aux + 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 = int64(int32(y)) + v0.AuxInt = int32ToAuxInt(int32(y)) v0.AddArg(x) b.resetWithControl(BlockS390XBRC, v0) - b.Aux = c + b.Aux = s390xCCMaskToAux(c) return true } // match: (CLRJ {c} (MOVDconst [x]) y yes no) // cond: !isU8Bit(x) && isU32Bit(x) - // result: (BRC {c.(s390x.CCMask).ReverseComparison()} (CMPWUconst y [int64(int32(x))]) yes no) + // result: (BRC {c.ReverseComparison()} (CMPWUconst y [int32(x)]) yes no) for b.Controls[0].Op == OpS390XMOVDconst { v_0 := b.Controls[0] - x := v_0.AuxInt + x := auxIntToInt64(v_0.AuxInt) y := b.Controls[1] - c := b.Aux + c := auxToS390xCCMask(b.Aux) if !(!isU8Bit(x) && isU32Bit(x)) { break } v0 := b.NewValue0(v_0.Pos, OpS390XCMPWUconst, types.TypeFlags) - v0.AuxInt = int64(int32(x)) + v0.AuxInt = int32ToAuxInt(int32(x)) v0.AddArg(y) b.resetWithControl(BlockS390XBRC, v0) - b.Aux = c.(s390x.CCMask).ReverseComparison() + b.Aux = s390xCCMaskToAux(c.ReverseComparison()) return true } // match: (CLRJ {c} x y yes no) - // cond: x == y && c.(s390x.CCMask)&s390x.Equal != 0 + // cond: x == y && c&s390x.Equal != 0 // result: (First yes no) for { x := b.Controls[0] y := b.Controls[1] - c := b.Aux - if !(x == y && c.(s390x.CCMask)&s390x.Equal != 0) { + 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.CCMask)&s390x.Equal == 0 + // cond: x == y && c&s390x.Equal == 0 // result: (First no yes) for { x := b.Controls[0] y := b.Controls[1] - c := b.Aux - if !(x == y && c.(s390x.CCMask)&s390x.Equal == 0) { + c := auxToS390xCCMask(b.Aux) + if !(x == y && c&s390x.Equal == 0) { break } b.Reset(BlockFirst) @@ -20174,93 +20174,93 @@ func rewriteBlockS390X(b *Block) bool { case BlockS390XCRJ: // match: (CRJ {c} x (MOVDconst [y]) yes no) // cond: is8Bit(y) - // result: (CIJ {c} x [int64(int8(y))] yes no) + // result: (CIJ {c} x [ int8(y)] yes no) for b.Controls[1].Op == OpS390XMOVDconst { x := b.Controls[0] v_1 := b.Controls[1] - y := v_1.AuxInt - c := b.Aux + y := auxIntToInt64(v_1.AuxInt) + c := auxToS390xCCMask(b.Aux) if !(is8Bit(y)) { break } b.resetWithControl(BlockS390XCIJ, x) - b.AuxInt = int64(int8(y)) - b.Aux = c + 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.(s390x.CCMask).ReverseComparison()} y [int64(int8(x))] yes no) + // result: (CIJ {c.ReverseComparison()} y [ int8(x)] yes no) for b.Controls[0].Op == OpS390XMOVDconst { v_0 := b.Controls[0] - x := v_0.AuxInt + x := auxIntToInt64(v_0.AuxInt) y := b.Controls[1] - c := b.Aux + c := auxToS390xCCMask(b.Aux) if !(is8Bit(x)) { break } b.resetWithControl(BlockS390XCIJ, y) - b.AuxInt = int64(int8(x)) - b.Aux = c.(s390x.CCMask).ReverseComparison() + 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 [int64(int32(y))]) yes no) + // 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 := v_1.AuxInt - c := b.Aux + 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 = int64(int32(y)) + v0.AuxInt = int32ToAuxInt(int32(y)) v0.AddArg(x) b.resetWithControl(BlockS390XBRC, v0) - b.Aux = c + b.Aux = s390xCCMaskToAux(c) return true } // match: (CRJ {c} (MOVDconst [x]) y yes no) // cond: !is8Bit(x) && is32Bit(x) - // result: (BRC {c.(s390x.CCMask).ReverseComparison()} (CMPWconst y [int64(int32(x))]) yes no) + // result: (BRC {c.ReverseComparison()} (CMPWconst y [int32(x)]) yes no) for b.Controls[0].Op == OpS390XMOVDconst { v_0 := b.Controls[0] - x := v_0.AuxInt + x := auxIntToInt64(v_0.AuxInt) y := b.Controls[1] - c := b.Aux + c := auxToS390xCCMask(b.Aux) if !(!is8Bit(x) && is32Bit(x)) { break } v0 := b.NewValue0(v_0.Pos, OpS390XCMPWconst, types.TypeFlags) - v0.AuxInt = int64(int32(x)) + v0.AuxInt = int32ToAuxInt(int32(x)) v0.AddArg(y) b.resetWithControl(BlockS390XBRC, v0) - b.Aux = c.(s390x.CCMask).ReverseComparison() + b.Aux = s390xCCMaskToAux(c.ReverseComparison()) return true } // match: (CRJ {c} x y yes no) - // cond: x == y && c.(s390x.CCMask)&s390x.Equal != 0 + // cond: x == y && c&s390x.Equal != 0 // result: (First yes no) for { x := b.Controls[0] y := b.Controls[1] - c := b.Aux - if !(x == y && c.(s390x.CCMask)&s390x.Equal != 0) { + 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.CCMask)&s390x.Equal == 0 + // cond: x == y && c&s390x.Equal == 0 // result: (First no yes) for { x := b.Controls[0] y := b.Controls[1] - c := b.Aux - if !(x == y && c.(s390x.CCMask)&s390x.Equal == 0) { + c := auxToS390xCCMask(b.Aux) + if !(x == y && c&s390x.Equal == 0) { break } b.Reset(BlockFirst) |