mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
cmd/compile/internal/ssa: optimise more branches with SGTconst/SGTUconst on loong64
Add branches to convert EQZ/NEZ into more optimal branch conditions. This reduces 720 instructions from the go toolchain binary on loong64. file before after Δ % asm 555306 555082 -224 -0.0403% cgo 481814 481742 -72 -0.0149% compile 2475686 2475710 +24 +0.0010% cover 516854 516770 -84 -0.0163% link 702566 702530 -36 -0.0051% preprofile 238612 238548 -64 -0.0268% vet 793140 793060 -80 -0.0101% go 1573466 1573346 -120 -0.0076% gofmt 320560 320496 -64 -0.0200% total 7658004 7657284 -720 -0.0094% Additionally, rename EQ/NE to EQZ/NEZ to enhance readability. Change-Id: Ibc876bc8b8d4e81d5c3aaf0b74b60419f3c771b1 Reviewed-on: https://go-review.googlesource.com/c/go/+/693455 Reviewed-by: abner chenc <chenguoqi@loongson.cn> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com> Reviewed-by: Keith Randall <khr@google.com>
This commit is contained in:
parent
fbac94a799
commit
a62f72f7a7
5 changed files with 156 additions and 107 deletions
|
|
@ -1075,8 +1075,8 @@ func ssaGenValue(s *ssagen.State, v *ssa.Value) {
|
||||||
var blockJump = map[ssa.BlockKind]struct {
|
var blockJump = map[ssa.BlockKind]struct {
|
||||||
asm, invasm obj.As
|
asm, invasm obj.As
|
||||||
}{
|
}{
|
||||||
ssa.BlockLOONG64EQ: {loong64.ABEQ, loong64.ABNE},
|
ssa.BlockLOONG64EQZ: {loong64.ABEQ, loong64.ABNE},
|
||||||
ssa.BlockLOONG64NE: {loong64.ABNE, loong64.ABEQ},
|
ssa.BlockLOONG64NEZ: {loong64.ABNE, loong64.ABEQ},
|
||||||
ssa.BlockLOONG64LTZ: {loong64.ABLTZ, loong64.ABGEZ},
|
ssa.BlockLOONG64LTZ: {loong64.ABLTZ, loong64.ABGEZ},
|
||||||
ssa.BlockLOONG64GEZ: {loong64.ABGEZ, loong64.ABLTZ},
|
ssa.BlockLOONG64GEZ: {loong64.ABGEZ, loong64.ABLTZ},
|
||||||
ssa.BlockLOONG64LEZ: {loong64.ABLEZ, loong64.ABGTZ},
|
ssa.BlockLOONG64LEZ: {loong64.ABLEZ, loong64.ABGTZ},
|
||||||
|
|
@ -1102,7 +1102,7 @@ func ssaGenBlock(s *ssagen.State, b, next *ssa.Block) {
|
||||||
case ssa.BlockExit, ssa.BlockRetJmp:
|
case ssa.BlockExit, ssa.BlockRetJmp:
|
||||||
case ssa.BlockRet:
|
case ssa.BlockRet:
|
||||||
s.Prog(obj.ARET)
|
s.Prog(obj.ARET)
|
||||||
case ssa.BlockLOONG64EQ, ssa.BlockLOONG64NE,
|
case ssa.BlockLOONG64EQZ, ssa.BlockLOONG64NEZ,
|
||||||
ssa.BlockLOONG64LTZ, ssa.BlockLOONG64GEZ,
|
ssa.BlockLOONG64LTZ, ssa.BlockLOONG64GEZ,
|
||||||
ssa.BlockLOONG64LEZ, ssa.BlockLOONG64GTZ,
|
ssa.BlockLOONG64LEZ, ssa.BlockLOONG64GTZ,
|
||||||
ssa.BlockLOONG64BEQ, ssa.BlockLOONG64BNE,
|
ssa.BlockLOONG64BEQ, ssa.BlockLOONG64BNE,
|
||||||
|
|
@ -1132,7 +1132,7 @@ func ssaGenBlock(s *ssagen.State, b, next *ssa.Block) {
|
||||||
p.From.Type = obj.TYPE_REG
|
p.From.Type = obj.TYPE_REG
|
||||||
p.From.Reg = b.Controls[0].Reg()
|
p.From.Reg = b.Controls[0].Reg()
|
||||||
p.Reg = b.Controls[1].Reg()
|
p.Reg = b.Controls[1].Reg()
|
||||||
case ssa.BlockLOONG64EQ, ssa.BlockLOONG64NE,
|
case ssa.BlockLOONG64EQZ, ssa.BlockLOONG64NEZ,
|
||||||
ssa.BlockLOONG64LTZ, ssa.BlockLOONG64GEZ,
|
ssa.BlockLOONG64LTZ, ssa.BlockLOONG64GEZ,
|
||||||
ssa.BlockLOONG64LEZ, ssa.BlockLOONG64GTZ,
|
ssa.BlockLOONG64LEZ, ssa.BlockLOONG64GTZ,
|
||||||
ssa.BlockLOONG64FPT, ssa.BlockLOONG64FPF:
|
ssa.BlockLOONG64FPT, ssa.BlockLOONG64FPF:
|
||||||
|
|
|
||||||
|
|
@ -517,7 +517,7 @@
|
||||||
(GetCallerSP ...) => (LoweredGetCallerSP ...)
|
(GetCallerSP ...) => (LoweredGetCallerSP ...)
|
||||||
(GetCallerPC ...) => (LoweredGetCallerPC ...)
|
(GetCallerPC ...) => (LoweredGetCallerPC ...)
|
||||||
|
|
||||||
(If cond yes no) => (NE (MOVBUreg <typ.UInt64> cond) yes no)
|
(If cond yes no) => (NEZ (MOVBUreg <typ.UInt64> cond) yes no)
|
||||||
(MOVBUreg x:((SGT|SGTU) _ _)) => x
|
(MOVBUreg x:((SGT|SGTU) _ _)) => x
|
||||||
(MOVBUreg x:(XOR (MOVVconst [1]) ((SGT|SGTU) _ _))) => x
|
(MOVBUreg x:(XOR (MOVVconst [1]) ((SGT|SGTU) _ _))) => x
|
||||||
|
|
||||||
|
|
@ -902,41 +902,46 @@
|
||||||
// Optimizations
|
// Optimizations
|
||||||
|
|
||||||
// Absorb boolean tests into block
|
// Absorb boolean tests into block
|
||||||
(NE (FPFlagTrue cmp) yes no) => (FPT cmp yes no)
|
(NEZ (FPFlagTrue cmp) yes no) => (FPT cmp yes no)
|
||||||
(NE (FPFlagFalse cmp) yes no) => (FPF cmp yes no)
|
(NEZ (FPFlagFalse cmp) yes no) => (FPF cmp yes no)
|
||||||
(EQ (FPFlagTrue cmp) yes no) => (FPF cmp yes no)
|
(EQZ (FPFlagTrue cmp) yes no) => (FPF cmp yes no)
|
||||||
(EQ (FPFlagFalse cmp) yes no) => (FPT cmp yes no)
|
(EQZ (FPFlagFalse cmp) yes no) => (FPT cmp yes no)
|
||||||
(NE (XORconst [1] cmp:(SGT _ _)) yes no) => (EQ cmp yes no)
|
(NEZ (XORconst [1] cmp:(SGT _ _)) yes no) => (EQZ cmp yes no)
|
||||||
(NE (XORconst [1] cmp:(SGTU _ _)) yes no) => (EQ cmp yes no)
|
(NEZ (XORconst [1] cmp:(SGTU _ _)) yes no) => (EQZ cmp yes no)
|
||||||
(NE (XORconst [1] cmp:(SGTconst _)) yes no) => (EQ cmp yes no)
|
(NEZ (XORconst [1] cmp:(SGTconst _)) yes no) => (EQZ cmp yes no)
|
||||||
(NE (XORconst [1] cmp:(SGTUconst _)) yes no) => (EQ cmp yes no)
|
(NEZ (XORconst [1] cmp:(SGTUconst _)) yes no) => (EQZ cmp yes no)
|
||||||
(EQ (XORconst [1] cmp:(SGT _ _)) yes no) => (NE cmp yes no)
|
(EQZ (XORconst [1] cmp:(SGT _ _)) yes no) => (NEZ cmp yes no)
|
||||||
(EQ (XORconst [1] cmp:(SGTU _ _)) yes no) => (NE cmp yes no)
|
(EQZ (XORconst [1] cmp:(SGTU _ _)) yes no) => (NEZ cmp yes no)
|
||||||
(EQ (XORconst [1] cmp:(SGTconst _)) yes no) => (NE cmp yes no)
|
(EQZ (XORconst [1] cmp:(SGTconst _)) yes no) => (NEZ cmp yes no)
|
||||||
(EQ (XORconst [1] cmp:(SGTUconst _)) yes no) => (NE cmp yes no)
|
(EQZ (XORconst [1] cmp:(SGTUconst _)) yes no) => (NEZ cmp yes no)
|
||||||
(NE (SGTUconst [1] x) yes no) => (EQ x yes no)
|
(NEZ (SGTUconst [1] x) yes no) => (EQZ x yes no)
|
||||||
(EQ (SGTUconst [1] x) yes no) => (NE x yes no)
|
(EQZ (SGTUconst [1] x) yes no) => (NEZ x yes no)
|
||||||
(NE (SGTU x (MOVVconst [0])) yes no) => (NE x yes no)
|
(NEZ (SGTU x (MOVVconst [0])) yes no) => (NEZ x yes no)
|
||||||
(EQ (SGTU x (MOVVconst [0])) yes no) => (EQ x yes no)
|
(EQZ (SGTU x (MOVVconst [0])) yes no) => (EQZ x yes no)
|
||||||
(NE (SGTconst [0] x) yes no) => (LTZ x yes no)
|
(NEZ (SGTconst [0] x) yes no) => (LTZ x yes no)
|
||||||
(EQ (SGTconst [0] x) yes no) => (GEZ x yes no)
|
(EQZ (SGTconst [0] x) yes no) => (GEZ x yes no)
|
||||||
(NE (SGT x (MOVVconst [0])) yes no) => (GTZ x yes no)
|
(NEZ (SGT x (MOVVconst [0])) yes no) => (GTZ x yes no)
|
||||||
(EQ (SGT x (MOVVconst [0])) yes no) => (LEZ x yes no)
|
(EQZ (SGT x (MOVVconst [0])) yes no) => (LEZ x yes no)
|
||||||
|
|
||||||
(EQ (SGTU (MOVVconst [c]) y) yes no) && c >= -2048 && c <= 2047 => (EQ (SGTUconst [c] y) yes no)
|
// Convert EQZ/NEZ into more optimal branch conditions.
|
||||||
(NE (SGTU (MOVVconst [c]) y) yes no) && c >= -2048 && c <= 2047 => (NE (SGTUconst [c] y) yes no)
|
(EQZ (SGTU (MOVVconst [c]) y) yes no) && c >= -2048 && c <= 2047 => (EQZ (SGTUconst [c] y) yes no)
|
||||||
(EQ (SUBV x y) yes no) => (BEQ x y yes no)
|
(NEZ (SGTU (MOVVconst [c]) y) yes no) && c >= -2048 && c <= 2047 => (NEZ (SGTUconst [c] y) yes no)
|
||||||
(NE (SUBV x y) yes no) => (BNE x y yes no)
|
(EQZ (SUBV x y) yes no) => (BEQ x y yes no)
|
||||||
(EQ (SGT x y) yes no) => (BGE y x yes no)
|
(NEZ (SUBV x y) yes no) => (BNE x y yes no)
|
||||||
(NE (SGT x y) yes no) => (BLT y x yes no)
|
(EQZ (SGT x y) yes no) => (BGE y x yes no)
|
||||||
(EQ (SGTU x y) yes no) => (BGEU y x yes no)
|
(NEZ (SGT x y) yes no) => (BLT y x yes no)
|
||||||
(NE (SGTU x y) yes no) => (BLTU y x yes no)
|
(EQZ (SGTU x y) yes no) => (BGEU y x yes no)
|
||||||
|
(NEZ (SGTU x y) yes no) => (BLTU y x yes no)
|
||||||
|
(EQZ (SGTconst [c] y) yes no) => (BGE y (MOVVconst [c]) yes no)
|
||||||
|
(NEZ (SGTconst [c] y) yes no) => (BLT y (MOVVconst [c]) yes no)
|
||||||
|
(EQZ (SGTUconst [c] y) yes no) => (BGEU y (MOVVconst [c]) yes no)
|
||||||
|
(NEZ (SGTUconst [c] y) yes no) => (BLTU y (MOVVconst [c]) yes no)
|
||||||
|
|
||||||
// absorb constants into branches
|
// absorb constants into branches
|
||||||
(EQ (MOVVconst [0]) yes no) => (First yes no)
|
(EQZ (MOVVconst [0]) yes no) => (First yes no)
|
||||||
(EQ (MOVVconst [c]) yes no) && c != 0 => (First no yes)
|
(EQZ (MOVVconst [c]) yes no) && c != 0 => (First no yes)
|
||||||
(NE (MOVVconst [0]) yes no) => (First no yes)
|
(NEZ (MOVVconst [0]) yes no) => (First no yes)
|
||||||
(NE (MOVVconst [c]) yes no) && c != 0 => (First yes no)
|
(NEZ (MOVVconst [c]) yes no) && c != 0 => (First yes no)
|
||||||
(LTZ (MOVVconst [c]) yes no) && c < 0 => (First yes no)
|
(LTZ (MOVVconst [c]) yes no) && c < 0 => (First yes no)
|
||||||
(LTZ (MOVVconst [c]) yes no) && c >= 0 => (First no yes)
|
(LTZ (MOVVconst [c]) yes no) && c >= 0 => (First no yes)
|
||||||
(LEZ (MOVVconst [c]) yes no) && c <= 0 => (First yes no)
|
(LEZ (MOVVconst [c]) yes no) && c <= 0 => (First yes no)
|
||||||
|
|
|
||||||
|
|
@ -580,8 +580,8 @@ func init() {
|
||||||
}
|
}
|
||||||
|
|
||||||
blocks := []blockData{
|
blocks := []blockData{
|
||||||
{name: "EQ", controls: 1},
|
{name: "EQZ", controls: 1}, // = 0
|
||||||
{name: "NE", controls: 1},
|
{name: "NEZ", controls: 1}, // != 0
|
||||||
{name: "LTZ", controls: 1}, // < 0
|
{name: "LTZ", controls: 1}, // < 0
|
||||||
{name: "LEZ", controls: 1}, // <= 0
|
{name: "LEZ", controls: 1}, // <= 0
|
||||||
{name: "GTZ", controls: 1}, // > 0
|
{name: "GTZ", controls: 1}, // > 0
|
||||||
|
|
|
||||||
|
|
@ -94,8 +94,8 @@ const (
|
||||||
BlockARM64GEnoov
|
BlockARM64GEnoov
|
||||||
BlockARM64JUMPTABLE
|
BlockARM64JUMPTABLE
|
||||||
|
|
||||||
BlockLOONG64EQ
|
BlockLOONG64EQZ
|
||||||
BlockLOONG64NE
|
BlockLOONG64NEZ
|
||||||
BlockLOONG64LTZ
|
BlockLOONG64LTZ
|
||||||
BlockLOONG64LEZ
|
BlockLOONG64LEZ
|
||||||
BlockLOONG64GTZ
|
BlockLOONG64GTZ
|
||||||
|
|
@ -250,8 +250,8 @@ var blockString = [...]string{
|
||||||
BlockARM64GEnoov: "GEnoov",
|
BlockARM64GEnoov: "GEnoov",
|
||||||
BlockARM64JUMPTABLE: "JUMPTABLE",
|
BlockARM64JUMPTABLE: "JUMPTABLE",
|
||||||
|
|
||||||
BlockLOONG64EQ: "EQ",
|
BlockLOONG64EQZ: "EQZ",
|
||||||
BlockLOONG64NE: "NE",
|
BlockLOONG64NEZ: "NEZ",
|
||||||
BlockLOONG64LTZ: "LTZ",
|
BlockLOONG64LTZ: "LTZ",
|
||||||
BlockLOONG64LEZ: "LEZ",
|
BlockLOONG64LEZ: "LEZ",
|
||||||
BlockLOONG64GTZ: "GTZ",
|
BlockLOONG64GTZ: "GTZ",
|
||||||
|
|
|
||||||
|
|
@ -11479,8 +11479,8 @@ func rewriteValueLOONG64_OpZero(v *Value) bool {
|
||||||
func rewriteBlockLOONG64(b *Block) bool {
|
func rewriteBlockLOONG64(b *Block) bool {
|
||||||
typ := &b.Func.Config.Types
|
typ := &b.Func.Config.Types
|
||||||
switch b.Kind {
|
switch b.Kind {
|
||||||
case BlockLOONG64EQ:
|
case BlockLOONG64EQZ:
|
||||||
// match: (EQ (FPFlagTrue cmp) yes no)
|
// match: (EQZ (FPFlagTrue cmp) yes no)
|
||||||
// result: (FPF cmp yes no)
|
// result: (FPF cmp yes no)
|
||||||
for b.Controls[0].Op == OpLOONG64FPFlagTrue {
|
for b.Controls[0].Op == OpLOONG64FPFlagTrue {
|
||||||
v_0 := b.Controls[0]
|
v_0 := b.Controls[0]
|
||||||
|
|
@ -11488,7 +11488,7 @@ func rewriteBlockLOONG64(b *Block) bool {
|
||||||
b.resetWithControl(BlockLOONG64FPF, cmp)
|
b.resetWithControl(BlockLOONG64FPF, cmp)
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
// match: (EQ (FPFlagFalse cmp) yes no)
|
// match: (EQZ (FPFlagFalse cmp) yes no)
|
||||||
// result: (FPT cmp yes no)
|
// result: (FPT cmp yes no)
|
||||||
for b.Controls[0].Op == OpLOONG64FPFlagFalse {
|
for b.Controls[0].Op == OpLOONG64FPFlagFalse {
|
||||||
v_0 := b.Controls[0]
|
v_0 := b.Controls[0]
|
||||||
|
|
@ -11496,8 +11496,8 @@ func rewriteBlockLOONG64(b *Block) bool {
|
||||||
b.resetWithControl(BlockLOONG64FPT, cmp)
|
b.resetWithControl(BlockLOONG64FPT, cmp)
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
// match: (EQ (XORconst [1] cmp:(SGT _ _)) yes no)
|
// match: (EQZ (XORconst [1] cmp:(SGT _ _)) yes no)
|
||||||
// result: (NE cmp yes no)
|
// result: (NEZ cmp yes no)
|
||||||
for b.Controls[0].Op == OpLOONG64XORconst {
|
for b.Controls[0].Op == OpLOONG64XORconst {
|
||||||
v_0 := b.Controls[0]
|
v_0 := b.Controls[0]
|
||||||
if auxIntToInt64(v_0.AuxInt) != 1 {
|
if auxIntToInt64(v_0.AuxInt) != 1 {
|
||||||
|
|
@ -11507,11 +11507,11 @@ func rewriteBlockLOONG64(b *Block) bool {
|
||||||
if cmp.Op != OpLOONG64SGT {
|
if cmp.Op != OpLOONG64SGT {
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
b.resetWithControl(BlockLOONG64NE, cmp)
|
b.resetWithControl(BlockLOONG64NEZ, cmp)
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
// match: (EQ (XORconst [1] cmp:(SGTU _ _)) yes no)
|
// match: (EQZ (XORconst [1] cmp:(SGTU _ _)) yes no)
|
||||||
// result: (NE cmp yes no)
|
// result: (NEZ cmp yes no)
|
||||||
for b.Controls[0].Op == OpLOONG64XORconst {
|
for b.Controls[0].Op == OpLOONG64XORconst {
|
||||||
v_0 := b.Controls[0]
|
v_0 := b.Controls[0]
|
||||||
if auxIntToInt64(v_0.AuxInt) != 1 {
|
if auxIntToInt64(v_0.AuxInt) != 1 {
|
||||||
|
|
@ -11521,11 +11521,11 @@ func rewriteBlockLOONG64(b *Block) bool {
|
||||||
if cmp.Op != OpLOONG64SGTU {
|
if cmp.Op != OpLOONG64SGTU {
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
b.resetWithControl(BlockLOONG64NE, cmp)
|
b.resetWithControl(BlockLOONG64NEZ, cmp)
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
// match: (EQ (XORconst [1] cmp:(SGTconst _)) yes no)
|
// match: (EQZ (XORconst [1] cmp:(SGTconst _)) yes no)
|
||||||
// result: (NE cmp yes no)
|
// result: (NEZ cmp yes no)
|
||||||
for b.Controls[0].Op == OpLOONG64XORconst {
|
for b.Controls[0].Op == OpLOONG64XORconst {
|
||||||
v_0 := b.Controls[0]
|
v_0 := b.Controls[0]
|
||||||
if auxIntToInt64(v_0.AuxInt) != 1 {
|
if auxIntToInt64(v_0.AuxInt) != 1 {
|
||||||
|
|
@ -11535,11 +11535,11 @@ func rewriteBlockLOONG64(b *Block) bool {
|
||||||
if cmp.Op != OpLOONG64SGTconst {
|
if cmp.Op != OpLOONG64SGTconst {
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
b.resetWithControl(BlockLOONG64NE, cmp)
|
b.resetWithControl(BlockLOONG64NEZ, cmp)
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
// match: (EQ (XORconst [1] cmp:(SGTUconst _)) yes no)
|
// match: (EQZ (XORconst [1] cmp:(SGTUconst _)) yes no)
|
||||||
// result: (NE cmp yes no)
|
// result: (NEZ cmp yes no)
|
||||||
for b.Controls[0].Op == OpLOONG64XORconst {
|
for b.Controls[0].Op == OpLOONG64XORconst {
|
||||||
v_0 := b.Controls[0]
|
v_0 := b.Controls[0]
|
||||||
if auxIntToInt64(v_0.AuxInt) != 1 {
|
if auxIntToInt64(v_0.AuxInt) != 1 {
|
||||||
|
|
@ -11549,22 +11549,22 @@ func rewriteBlockLOONG64(b *Block) bool {
|
||||||
if cmp.Op != OpLOONG64SGTUconst {
|
if cmp.Op != OpLOONG64SGTUconst {
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
b.resetWithControl(BlockLOONG64NE, cmp)
|
b.resetWithControl(BlockLOONG64NEZ, cmp)
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
// match: (EQ (SGTUconst [1] x) yes no)
|
// match: (EQZ (SGTUconst [1] x) yes no)
|
||||||
// result: (NE x yes no)
|
// result: (NEZ x yes no)
|
||||||
for b.Controls[0].Op == OpLOONG64SGTUconst {
|
for b.Controls[0].Op == OpLOONG64SGTUconst {
|
||||||
v_0 := b.Controls[0]
|
v_0 := b.Controls[0]
|
||||||
if auxIntToInt64(v_0.AuxInt) != 1 {
|
if auxIntToInt64(v_0.AuxInt) != 1 {
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
x := v_0.Args[0]
|
x := v_0.Args[0]
|
||||||
b.resetWithControl(BlockLOONG64NE, x)
|
b.resetWithControl(BlockLOONG64NEZ, x)
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
// match: (EQ (SGTU x (MOVVconst [0])) yes no)
|
// match: (EQZ (SGTU x (MOVVconst [0])) yes no)
|
||||||
// result: (EQ x yes no)
|
// result: (EQZ x yes no)
|
||||||
for b.Controls[0].Op == OpLOONG64SGTU {
|
for b.Controls[0].Op == OpLOONG64SGTU {
|
||||||
v_0 := b.Controls[0]
|
v_0 := b.Controls[0]
|
||||||
_ = v_0.Args[1]
|
_ = v_0.Args[1]
|
||||||
|
|
@ -11573,10 +11573,10 @@ func rewriteBlockLOONG64(b *Block) bool {
|
||||||
if v_0_1.Op != OpLOONG64MOVVconst || auxIntToInt64(v_0_1.AuxInt) != 0 {
|
if v_0_1.Op != OpLOONG64MOVVconst || auxIntToInt64(v_0_1.AuxInt) != 0 {
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
b.resetWithControl(BlockLOONG64EQ, x)
|
b.resetWithControl(BlockLOONG64EQZ, x)
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
// match: (EQ (SGTconst [0] x) yes no)
|
// match: (EQZ (SGTconst [0] x) yes no)
|
||||||
// result: (GEZ x yes no)
|
// result: (GEZ x yes no)
|
||||||
for b.Controls[0].Op == OpLOONG64SGTconst {
|
for b.Controls[0].Op == OpLOONG64SGTconst {
|
||||||
v_0 := b.Controls[0]
|
v_0 := b.Controls[0]
|
||||||
|
|
@ -11587,7 +11587,7 @@ func rewriteBlockLOONG64(b *Block) bool {
|
||||||
b.resetWithControl(BlockLOONG64GEZ, x)
|
b.resetWithControl(BlockLOONG64GEZ, x)
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
// match: (EQ (SGT x (MOVVconst [0])) yes no)
|
// match: (EQZ (SGT x (MOVVconst [0])) yes no)
|
||||||
// result: (LEZ x yes no)
|
// result: (LEZ x yes no)
|
||||||
for b.Controls[0].Op == OpLOONG64SGT {
|
for b.Controls[0].Op == OpLOONG64SGT {
|
||||||
v_0 := b.Controls[0]
|
v_0 := b.Controls[0]
|
||||||
|
|
@ -11600,9 +11600,9 @@ func rewriteBlockLOONG64(b *Block) bool {
|
||||||
b.resetWithControl(BlockLOONG64LEZ, x)
|
b.resetWithControl(BlockLOONG64LEZ, x)
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
// match: (EQ (SGTU (MOVVconst [c]) y) yes no)
|
// match: (EQZ (SGTU (MOVVconst [c]) y) yes no)
|
||||||
// cond: c >= -2048 && c <= 2047
|
// cond: c >= -2048 && c <= 2047
|
||||||
// result: (EQ (SGTUconst [c] y) yes no)
|
// result: (EQZ (SGTUconst [c] y) yes no)
|
||||||
for b.Controls[0].Op == OpLOONG64SGTU {
|
for b.Controls[0].Op == OpLOONG64SGTU {
|
||||||
v_0 := b.Controls[0]
|
v_0 := b.Controls[0]
|
||||||
y := v_0.Args[1]
|
y := v_0.Args[1]
|
||||||
|
|
@ -11617,10 +11617,10 @@ func rewriteBlockLOONG64(b *Block) bool {
|
||||||
v0 := b.NewValue0(v_0.Pos, OpLOONG64SGTUconst, typ.Bool)
|
v0 := b.NewValue0(v_0.Pos, OpLOONG64SGTUconst, typ.Bool)
|
||||||
v0.AuxInt = int64ToAuxInt(c)
|
v0.AuxInt = int64ToAuxInt(c)
|
||||||
v0.AddArg(y)
|
v0.AddArg(y)
|
||||||
b.resetWithControl(BlockLOONG64EQ, v0)
|
b.resetWithControl(BlockLOONG64EQZ, v0)
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
// match: (EQ (SUBV x y) yes no)
|
// match: (EQZ (SUBV x y) yes no)
|
||||||
// result: (BEQ x y yes no)
|
// result: (BEQ x y yes no)
|
||||||
for b.Controls[0].Op == OpLOONG64SUBV {
|
for b.Controls[0].Op == OpLOONG64SUBV {
|
||||||
v_0 := b.Controls[0]
|
v_0 := b.Controls[0]
|
||||||
|
|
@ -11629,7 +11629,7 @@ func rewriteBlockLOONG64(b *Block) bool {
|
||||||
b.resetWithControl2(BlockLOONG64BEQ, x, y)
|
b.resetWithControl2(BlockLOONG64BEQ, x, y)
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
// match: (EQ (SGT x y) yes no)
|
// match: (EQZ (SGT x y) yes no)
|
||||||
// result: (BGE y x yes no)
|
// result: (BGE y x yes no)
|
||||||
for b.Controls[0].Op == OpLOONG64SGT {
|
for b.Controls[0].Op == OpLOONG64SGT {
|
||||||
v_0 := b.Controls[0]
|
v_0 := b.Controls[0]
|
||||||
|
|
@ -11638,7 +11638,7 @@ func rewriteBlockLOONG64(b *Block) bool {
|
||||||
b.resetWithControl2(BlockLOONG64BGE, y, x)
|
b.resetWithControl2(BlockLOONG64BGE, y, x)
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
// match: (EQ (SGTU x y) yes no)
|
// match: (EQZ (SGTU x y) yes no)
|
||||||
// result: (BGEU y x yes no)
|
// result: (BGEU y x yes no)
|
||||||
for b.Controls[0].Op == OpLOONG64SGTU {
|
for b.Controls[0].Op == OpLOONG64SGTU {
|
||||||
v_0 := b.Controls[0]
|
v_0 := b.Controls[0]
|
||||||
|
|
@ -11647,7 +11647,29 @@ func rewriteBlockLOONG64(b *Block) bool {
|
||||||
b.resetWithControl2(BlockLOONG64BGEU, y, x)
|
b.resetWithControl2(BlockLOONG64BGEU, y, x)
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
// match: (EQ (MOVVconst [0]) yes no)
|
// match: (EQZ (SGTconst [c] y) yes no)
|
||||||
|
// result: (BGE y (MOVVconst [c]) yes no)
|
||||||
|
for b.Controls[0].Op == OpLOONG64SGTconst {
|
||||||
|
v_0 := b.Controls[0]
|
||||||
|
c := auxIntToInt64(v_0.AuxInt)
|
||||||
|
y := v_0.Args[0]
|
||||||
|
v0 := b.NewValue0(b.Pos, OpLOONG64MOVVconst, typ.UInt64)
|
||||||
|
v0.AuxInt = int64ToAuxInt(c)
|
||||||
|
b.resetWithControl2(BlockLOONG64BGE, y, v0)
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
// match: (EQZ (SGTUconst [c] y) yes no)
|
||||||
|
// result: (BGEU y (MOVVconst [c]) yes no)
|
||||||
|
for b.Controls[0].Op == OpLOONG64SGTUconst {
|
||||||
|
v_0 := b.Controls[0]
|
||||||
|
c := auxIntToInt64(v_0.AuxInt)
|
||||||
|
y := v_0.Args[0]
|
||||||
|
v0 := b.NewValue0(b.Pos, OpLOONG64MOVVconst, typ.UInt64)
|
||||||
|
v0.AuxInt = int64ToAuxInt(c)
|
||||||
|
b.resetWithControl2(BlockLOONG64BGEU, y, v0)
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
// match: (EQZ (MOVVconst [0]) yes no)
|
||||||
// result: (First yes no)
|
// result: (First yes no)
|
||||||
for b.Controls[0].Op == OpLOONG64MOVVconst {
|
for b.Controls[0].Op == OpLOONG64MOVVconst {
|
||||||
v_0 := b.Controls[0]
|
v_0 := b.Controls[0]
|
||||||
|
|
@ -11657,7 +11679,7 @@ func rewriteBlockLOONG64(b *Block) bool {
|
||||||
b.Reset(BlockFirst)
|
b.Reset(BlockFirst)
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
// match: (EQ (MOVVconst [c]) yes no)
|
// match: (EQZ (MOVVconst [c]) yes no)
|
||||||
// cond: c != 0
|
// cond: c != 0
|
||||||
// result: (First no yes)
|
// result: (First no yes)
|
||||||
for b.Controls[0].Op == OpLOONG64MOVVconst {
|
for b.Controls[0].Op == OpLOONG64MOVVconst {
|
||||||
|
|
@ -11724,12 +11746,12 @@ func rewriteBlockLOONG64(b *Block) bool {
|
||||||
}
|
}
|
||||||
case BlockIf:
|
case BlockIf:
|
||||||
// match: (If cond yes no)
|
// match: (If cond yes no)
|
||||||
// result: (NE (MOVBUreg <typ.UInt64> cond) yes no)
|
// result: (NEZ (MOVBUreg <typ.UInt64> cond) yes no)
|
||||||
for {
|
for {
|
||||||
cond := b.Controls[0]
|
cond := b.Controls[0]
|
||||||
v0 := b.NewValue0(cond.Pos, OpLOONG64MOVBUreg, typ.UInt64)
|
v0 := b.NewValue0(cond.Pos, OpLOONG64MOVBUreg, typ.UInt64)
|
||||||
v0.AddArg(cond)
|
v0.AddArg(cond)
|
||||||
b.resetWithControl(BlockLOONG64NE, v0)
|
b.resetWithControl(BlockLOONG64NEZ, v0)
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
case BlockLOONG64LEZ:
|
case BlockLOONG64LEZ:
|
||||||
|
|
@ -11784,8 +11806,8 @@ func rewriteBlockLOONG64(b *Block) bool {
|
||||||
b.swapSuccessors()
|
b.swapSuccessors()
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
case BlockLOONG64NE:
|
case BlockLOONG64NEZ:
|
||||||
// match: (NE (FPFlagTrue cmp) yes no)
|
// match: (NEZ (FPFlagTrue cmp) yes no)
|
||||||
// result: (FPT cmp yes no)
|
// result: (FPT cmp yes no)
|
||||||
for b.Controls[0].Op == OpLOONG64FPFlagTrue {
|
for b.Controls[0].Op == OpLOONG64FPFlagTrue {
|
||||||
v_0 := b.Controls[0]
|
v_0 := b.Controls[0]
|
||||||
|
|
@ -11793,7 +11815,7 @@ func rewriteBlockLOONG64(b *Block) bool {
|
||||||
b.resetWithControl(BlockLOONG64FPT, cmp)
|
b.resetWithControl(BlockLOONG64FPT, cmp)
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
// match: (NE (FPFlagFalse cmp) yes no)
|
// match: (NEZ (FPFlagFalse cmp) yes no)
|
||||||
// result: (FPF cmp yes no)
|
// result: (FPF cmp yes no)
|
||||||
for b.Controls[0].Op == OpLOONG64FPFlagFalse {
|
for b.Controls[0].Op == OpLOONG64FPFlagFalse {
|
||||||
v_0 := b.Controls[0]
|
v_0 := b.Controls[0]
|
||||||
|
|
@ -11801,8 +11823,8 @@ func rewriteBlockLOONG64(b *Block) bool {
|
||||||
b.resetWithControl(BlockLOONG64FPF, cmp)
|
b.resetWithControl(BlockLOONG64FPF, cmp)
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
// match: (NE (XORconst [1] cmp:(SGT _ _)) yes no)
|
// match: (NEZ (XORconst [1] cmp:(SGT _ _)) yes no)
|
||||||
// result: (EQ cmp yes no)
|
// result: (EQZ cmp yes no)
|
||||||
for b.Controls[0].Op == OpLOONG64XORconst {
|
for b.Controls[0].Op == OpLOONG64XORconst {
|
||||||
v_0 := b.Controls[0]
|
v_0 := b.Controls[0]
|
||||||
if auxIntToInt64(v_0.AuxInt) != 1 {
|
if auxIntToInt64(v_0.AuxInt) != 1 {
|
||||||
|
|
@ -11812,11 +11834,11 @@ func rewriteBlockLOONG64(b *Block) bool {
|
||||||
if cmp.Op != OpLOONG64SGT {
|
if cmp.Op != OpLOONG64SGT {
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
b.resetWithControl(BlockLOONG64EQ, cmp)
|
b.resetWithControl(BlockLOONG64EQZ, cmp)
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
// match: (NE (XORconst [1] cmp:(SGTU _ _)) yes no)
|
// match: (NEZ (XORconst [1] cmp:(SGTU _ _)) yes no)
|
||||||
// result: (EQ cmp yes no)
|
// result: (EQZ cmp yes no)
|
||||||
for b.Controls[0].Op == OpLOONG64XORconst {
|
for b.Controls[0].Op == OpLOONG64XORconst {
|
||||||
v_0 := b.Controls[0]
|
v_0 := b.Controls[0]
|
||||||
if auxIntToInt64(v_0.AuxInt) != 1 {
|
if auxIntToInt64(v_0.AuxInt) != 1 {
|
||||||
|
|
@ -11826,11 +11848,11 @@ func rewriteBlockLOONG64(b *Block) bool {
|
||||||
if cmp.Op != OpLOONG64SGTU {
|
if cmp.Op != OpLOONG64SGTU {
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
b.resetWithControl(BlockLOONG64EQ, cmp)
|
b.resetWithControl(BlockLOONG64EQZ, cmp)
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
// match: (NE (XORconst [1] cmp:(SGTconst _)) yes no)
|
// match: (NEZ (XORconst [1] cmp:(SGTconst _)) yes no)
|
||||||
// result: (EQ cmp yes no)
|
// result: (EQZ cmp yes no)
|
||||||
for b.Controls[0].Op == OpLOONG64XORconst {
|
for b.Controls[0].Op == OpLOONG64XORconst {
|
||||||
v_0 := b.Controls[0]
|
v_0 := b.Controls[0]
|
||||||
if auxIntToInt64(v_0.AuxInt) != 1 {
|
if auxIntToInt64(v_0.AuxInt) != 1 {
|
||||||
|
|
@ -11840,11 +11862,11 @@ func rewriteBlockLOONG64(b *Block) bool {
|
||||||
if cmp.Op != OpLOONG64SGTconst {
|
if cmp.Op != OpLOONG64SGTconst {
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
b.resetWithControl(BlockLOONG64EQ, cmp)
|
b.resetWithControl(BlockLOONG64EQZ, cmp)
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
// match: (NE (XORconst [1] cmp:(SGTUconst _)) yes no)
|
// match: (NEZ (XORconst [1] cmp:(SGTUconst _)) yes no)
|
||||||
// result: (EQ cmp yes no)
|
// result: (EQZ cmp yes no)
|
||||||
for b.Controls[0].Op == OpLOONG64XORconst {
|
for b.Controls[0].Op == OpLOONG64XORconst {
|
||||||
v_0 := b.Controls[0]
|
v_0 := b.Controls[0]
|
||||||
if auxIntToInt64(v_0.AuxInt) != 1 {
|
if auxIntToInt64(v_0.AuxInt) != 1 {
|
||||||
|
|
@ -11854,22 +11876,22 @@ func rewriteBlockLOONG64(b *Block) bool {
|
||||||
if cmp.Op != OpLOONG64SGTUconst {
|
if cmp.Op != OpLOONG64SGTUconst {
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
b.resetWithControl(BlockLOONG64EQ, cmp)
|
b.resetWithControl(BlockLOONG64EQZ, cmp)
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
// match: (NE (SGTUconst [1] x) yes no)
|
// match: (NEZ (SGTUconst [1] x) yes no)
|
||||||
// result: (EQ x yes no)
|
// result: (EQZ x yes no)
|
||||||
for b.Controls[0].Op == OpLOONG64SGTUconst {
|
for b.Controls[0].Op == OpLOONG64SGTUconst {
|
||||||
v_0 := b.Controls[0]
|
v_0 := b.Controls[0]
|
||||||
if auxIntToInt64(v_0.AuxInt) != 1 {
|
if auxIntToInt64(v_0.AuxInt) != 1 {
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
x := v_0.Args[0]
|
x := v_0.Args[0]
|
||||||
b.resetWithControl(BlockLOONG64EQ, x)
|
b.resetWithControl(BlockLOONG64EQZ, x)
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
// match: (NE (SGTU x (MOVVconst [0])) yes no)
|
// match: (NEZ (SGTU x (MOVVconst [0])) yes no)
|
||||||
// result: (NE x yes no)
|
// result: (NEZ x yes no)
|
||||||
for b.Controls[0].Op == OpLOONG64SGTU {
|
for b.Controls[0].Op == OpLOONG64SGTU {
|
||||||
v_0 := b.Controls[0]
|
v_0 := b.Controls[0]
|
||||||
_ = v_0.Args[1]
|
_ = v_0.Args[1]
|
||||||
|
|
@ -11878,10 +11900,10 @@ func rewriteBlockLOONG64(b *Block) bool {
|
||||||
if v_0_1.Op != OpLOONG64MOVVconst || auxIntToInt64(v_0_1.AuxInt) != 0 {
|
if v_0_1.Op != OpLOONG64MOVVconst || auxIntToInt64(v_0_1.AuxInt) != 0 {
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
b.resetWithControl(BlockLOONG64NE, x)
|
b.resetWithControl(BlockLOONG64NEZ, x)
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
// match: (NE (SGTconst [0] x) yes no)
|
// match: (NEZ (SGTconst [0] x) yes no)
|
||||||
// result: (LTZ x yes no)
|
// result: (LTZ x yes no)
|
||||||
for b.Controls[0].Op == OpLOONG64SGTconst {
|
for b.Controls[0].Op == OpLOONG64SGTconst {
|
||||||
v_0 := b.Controls[0]
|
v_0 := b.Controls[0]
|
||||||
|
|
@ -11892,7 +11914,7 @@ func rewriteBlockLOONG64(b *Block) bool {
|
||||||
b.resetWithControl(BlockLOONG64LTZ, x)
|
b.resetWithControl(BlockLOONG64LTZ, x)
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
// match: (NE (SGT x (MOVVconst [0])) yes no)
|
// match: (NEZ (SGT x (MOVVconst [0])) yes no)
|
||||||
// result: (GTZ x yes no)
|
// result: (GTZ x yes no)
|
||||||
for b.Controls[0].Op == OpLOONG64SGT {
|
for b.Controls[0].Op == OpLOONG64SGT {
|
||||||
v_0 := b.Controls[0]
|
v_0 := b.Controls[0]
|
||||||
|
|
@ -11905,9 +11927,9 @@ func rewriteBlockLOONG64(b *Block) bool {
|
||||||
b.resetWithControl(BlockLOONG64GTZ, x)
|
b.resetWithControl(BlockLOONG64GTZ, x)
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
// match: (NE (SGTU (MOVVconst [c]) y) yes no)
|
// match: (NEZ (SGTU (MOVVconst [c]) y) yes no)
|
||||||
// cond: c >= -2048 && c <= 2047
|
// cond: c >= -2048 && c <= 2047
|
||||||
// result: (NE (SGTUconst [c] y) yes no)
|
// result: (NEZ (SGTUconst [c] y) yes no)
|
||||||
for b.Controls[0].Op == OpLOONG64SGTU {
|
for b.Controls[0].Op == OpLOONG64SGTU {
|
||||||
v_0 := b.Controls[0]
|
v_0 := b.Controls[0]
|
||||||
y := v_0.Args[1]
|
y := v_0.Args[1]
|
||||||
|
|
@ -11922,10 +11944,10 @@ func rewriteBlockLOONG64(b *Block) bool {
|
||||||
v0 := b.NewValue0(v_0.Pos, OpLOONG64SGTUconst, typ.Bool)
|
v0 := b.NewValue0(v_0.Pos, OpLOONG64SGTUconst, typ.Bool)
|
||||||
v0.AuxInt = int64ToAuxInt(c)
|
v0.AuxInt = int64ToAuxInt(c)
|
||||||
v0.AddArg(y)
|
v0.AddArg(y)
|
||||||
b.resetWithControl(BlockLOONG64NE, v0)
|
b.resetWithControl(BlockLOONG64NEZ, v0)
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
// match: (NE (SUBV x y) yes no)
|
// match: (NEZ (SUBV x y) yes no)
|
||||||
// result: (BNE x y yes no)
|
// result: (BNE x y yes no)
|
||||||
for b.Controls[0].Op == OpLOONG64SUBV {
|
for b.Controls[0].Op == OpLOONG64SUBV {
|
||||||
v_0 := b.Controls[0]
|
v_0 := b.Controls[0]
|
||||||
|
|
@ -11934,7 +11956,7 @@ func rewriteBlockLOONG64(b *Block) bool {
|
||||||
b.resetWithControl2(BlockLOONG64BNE, x, y)
|
b.resetWithControl2(BlockLOONG64BNE, x, y)
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
// match: (NE (SGT x y) yes no)
|
// match: (NEZ (SGT x y) yes no)
|
||||||
// result: (BLT y x yes no)
|
// result: (BLT y x yes no)
|
||||||
for b.Controls[0].Op == OpLOONG64SGT {
|
for b.Controls[0].Op == OpLOONG64SGT {
|
||||||
v_0 := b.Controls[0]
|
v_0 := b.Controls[0]
|
||||||
|
|
@ -11943,7 +11965,7 @@ func rewriteBlockLOONG64(b *Block) bool {
|
||||||
b.resetWithControl2(BlockLOONG64BLT, y, x)
|
b.resetWithControl2(BlockLOONG64BLT, y, x)
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
// match: (NE (SGTU x y) yes no)
|
// match: (NEZ (SGTU x y) yes no)
|
||||||
// result: (BLTU y x yes no)
|
// result: (BLTU y x yes no)
|
||||||
for b.Controls[0].Op == OpLOONG64SGTU {
|
for b.Controls[0].Op == OpLOONG64SGTU {
|
||||||
v_0 := b.Controls[0]
|
v_0 := b.Controls[0]
|
||||||
|
|
@ -11952,7 +11974,29 @@ func rewriteBlockLOONG64(b *Block) bool {
|
||||||
b.resetWithControl2(BlockLOONG64BLTU, y, x)
|
b.resetWithControl2(BlockLOONG64BLTU, y, x)
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
// match: (NE (MOVVconst [0]) yes no)
|
// match: (NEZ (SGTconst [c] y) yes no)
|
||||||
|
// result: (BLT y (MOVVconst [c]) yes no)
|
||||||
|
for b.Controls[0].Op == OpLOONG64SGTconst {
|
||||||
|
v_0 := b.Controls[0]
|
||||||
|
c := auxIntToInt64(v_0.AuxInt)
|
||||||
|
y := v_0.Args[0]
|
||||||
|
v0 := b.NewValue0(b.Pos, OpLOONG64MOVVconst, typ.UInt64)
|
||||||
|
v0.AuxInt = int64ToAuxInt(c)
|
||||||
|
b.resetWithControl2(BlockLOONG64BLT, y, v0)
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
// match: (NEZ (SGTUconst [c] y) yes no)
|
||||||
|
// result: (BLTU y (MOVVconst [c]) yes no)
|
||||||
|
for b.Controls[0].Op == OpLOONG64SGTUconst {
|
||||||
|
v_0 := b.Controls[0]
|
||||||
|
c := auxIntToInt64(v_0.AuxInt)
|
||||||
|
y := v_0.Args[0]
|
||||||
|
v0 := b.NewValue0(b.Pos, OpLOONG64MOVVconst, typ.UInt64)
|
||||||
|
v0.AuxInt = int64ToAuxInt(c)
|
||||||
|
b.resetWithControl2(BlockLOONG64BLTU, y, v0)
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
// match: (NEZ (MOVVconst [0]) yes no)
|
||||||
// result: (First no yes)
|
// result: (First no yes)
|
||||||
for b.Controls[0].Op == OpLOONG64MOVVconst {
|
for b.Controls[0].Op == OpLOONG64MOVVconst {
|
||||||
v_0 := b.Controls[0]
|
v_0 := b.Controls[0]
|
||||||
|
|
@ -11963,7 +12007,7 @@ func rewriteBlockLOONG64(b *Block) bool {
|
||||||
b.swapSuccessors()
|
b.swapSuccessors()
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
// match: (NE (MOVVconst [c]) yes no)
|
// match: (NEZ (MOVVconst [c]) yes no)
|
||||||
// cond: c != 0
|
// cond: c != 0
|
||||||
// result: (First yes no)
|
// result: (First yes no)
|
||||||
for b.Controls[0].Op == OpLOONG64MOVVconst {
|
for b.Controls[0].Op == OpLOONG64MOVVconst {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue