(GetCallerSP ...) => (LoweredGetCallerSP ...)
(GetCallerPC ...) => (LoweredGetCallerPC ...)
-(If cond yes no) => (NE cond yes no)
+(If cond yes no) => (NE (MOVBUreg <typ.UInt64> cond) yes no)
// Write barrier.
(WB ...) => (LoweredWB ...)
(EQ (SGTconst [0] x) yes no) => (GEZ x yes no)
(NE (SGT x (MOVVconst [0])) yes no) => (GTZ x yes no)
(EQ (SGT x (MOVVconst [0])) yes no) => (LEZ x yes no)
+(MOVBUreg x:((SGT|SGTU) _ _)) => x
// fold offset into address
(ADDVconst [off1] (MOVVaddr [off2] {sym} ptr)) && is32Bit(off1+int64(off2)) => (MOVVaddr [int32(off1)+int32(off2)] {sym} ptr)
}
func rewriteValueLOONG64_OpLOONG64MOVBUreg(v *Value) bool {
v_0 := v.Args[0]
+ // match: (MOVBUreg x:(SGT _ _))
+ // result: x
+ for {
+ x := v_0
+ if x.Op != OpLOONG64SGT {
+ break
+ }
+ v.copyOf(x)
+ return true
+ }
+ // match: (MOVBUreg x:(SGTU _ _))
+ // result: x
+ for {
+ x := v_0
+ if x.Op != OpLOONG64SGTU {
+ break
+ }
+ v.copyOf(x)
+ return true
+ }
// match: (MOVBUreg x:(MOVBUload _ _))
// result: (MOVVreg x)
for {
return false
}
func rewriteBlockLOONG64(b *Block) bool {
+ typ := &b.Func.Config.Types
switch b.Kind {
case BlockLOONG64EQ:
// match: (EQ (FPFlagTrue cmp) yes no)
}
case BlockIf:
// match: (If cond yes no)
- // result: (NE cond yes no)
+ // result: (NE (MOVBUreg <typ.UInt64> cond) yes no)
for {
cond := b.Controls[0]
- b.resetWithControl(BlockLOONG64NE, cond)
+ v0 := b.NewValue0(cond.Pos, OpLOONG64MOVBUreg, typ.UInt64)
+ v0.AddArg(cond)
+ b.resetWithControl(BlockLOONG64NE, v0)
return true
}
case BlockLOONG64LEZ: