(MOVDstore [off] {sym} ptr (MOVDconst [0]) mem) => (MOVDstorezero [off] {sym} ptr mem)
// Avoid sign/zero extension for consts.
-(MOVBreg (MOVDconst [c])) => (MOVDconst [int64(c)])
-(MOVHreg (MOVDconst [c])) => (MOVDconst [int64(c)])
-(MOVWreg (MOVDconst [c])) => (MOVDconst [int64(c)])
+(MOVBreg (MOVDconst [c])) => (MOVDconst [int64(int8(c))])
+(MOVHreg (MOVDconst [c])) => (MOVDconst [int64(int16(c))])
+(MOVWreg (MOVDconst [c])) => (MOVDconst [int64(int32(c))])
(MOVBUreg (MOVDconst [c])) => (MOVDconst [int64(uint8(c))])
(MOVHUreg (MOVDconst [c])) => (MOVDconst [int64(uint16(c))])
(MOVWUreg (MOVDconst [c])) => (MOVDconst [int64(uint32(c))])
v_0 := v.Args[0]
b := v.Block
// match: (MOVBreg (MOVDconst [c]))
- // result: (MOVDconst [int64(c)])
+ // result: (MOVDconst [int64(int8(c))])
for {
if v_0.Op != OpRISCV64MOVDconst {
break
}
c := auxIntToInt64(v_0.AuxInt)
v.reset(OpRISCV64MOVDconst)
- v.AuxInt = int64ToAuxInt(int64(c))
+ v.AuxInt = int64ToAuxInt(int64(int8(c)))
return true
}
// match: (MOVBreg x:(MOVBload _ _))
v_0 := v.Args[0]
b := v.Block
// match: (MOVHreg (MOVDconst [c]))
- // result: (MOVDconst [int64(c)])
+ // result: (MOVDconst [int64(int16(c))])
for {
if v_0.Op != OpRISCV64MOVDconst {
break
}
c := auxIntToInt64(v_0.AuxInt)
v.reset(OpRISCV64MOVDconst)
- v.AuxInt = int64ToAuxInt(int64(c))
+ v.AuxInt = int64ToAuxInt(int64(int16(c)))
return true
}
// match: (MOVHreg x:(MOVBload _ _))
v_0 := v.Args[0]
b := v.Block
// match: (MOVWreg (MOVDconst [c]))
- // result: (MOVDconst [int64(c)])
+ // result: (MOVDconst [int64(int32(c))])
for {
if v_0.Op != OpRISCV64MOVDconst {
break
}
c := auxIntToInt64(v_0.AuxInt)
v.reset(OpRISCV64MOVDconst)
- v.AuxInt = int64ToAuxInt(int64(c))
+ v.AuxInt = int64ToAuxInt(int64(int32(c)))
return true
}
// match: (MOVWreg x:(MOVBload _ _))