mirror of
https://github.com/golang/go
synced 2024-11-18 17:04:41 -07:00
cmd/compile: simplify Neg lowering on s390x
No need to sign extend input to Neg8 and Neg16. Change-Id: I7896c83c9cdf84a34098582351a4aabf61cd6fdd Reviewed-on: https://go-review.googlesource.com/102675 Run-TryBot: Michael Munday <mike.munday@ibm.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
This commit is contained in:
parent
7b177b1a03
commit
331c187b17
@ -58,10 +58,8 @@
|
|||||||
(Xor64 x y) -> (XOR x y)
|
(Xor64 x y) -> (XOR x y)
|
||||||
(Xor(32|16|8) x y) -> (XORW x y)
|
(Xor(32|16|8) x y) -> (XORW x y)
|
||||||
|
|
||||||
(Neg64 x) -> (NEG x)
|
(Neg64 x) -> (NEG x)
|
||||||
(Neg32 x) -> (NEGW x)
|
(Neg(32|16|8) x) -> (NEGW x)
|
||||||
(Neg16 x) -> (NEGW (MOVHreg x))
|
|
||||||
(Neg8 x) -> (NEGW (MOVBreg x))
|
|
||||||
(Neg32F x) -> (FNEGS x)
|
(Neg32F x) -> (FNEGS x)
|
||||||
(Neg64F x) -> (FNEG x)
|
(Neg64F x) -> (FNEG x)
|
||||||
|
|
||||||
|
@ -4564,19 +4564,13 @@ func rewriteValueS390X_OpMul8_0(v *Value) bool {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
func rewriteValueS390X_OpNeg16_0(v *Value) bool {
|
func rewriteValueS390X_OpNeg16_0(v *Value) bool {
|
||||||
b := v.Block
|
|
||||||
_ = b
|
|
||||||
typ := &b.Func.Config.Types
|
|
||||||
_ = typ
|
|
||||||
// match: (Neg16 x)
|
// match: (Neg16 x)
|
||||||
// cond:
|
// cond:
|
||||||
// result: (NEGW (MOVHreg x))
|
// result: (NEGW x)
|
||||||
for {
|
for {
|
||||||
x := v.Args[0]
|
x := v.Args[0]
|
||||||
v.reset(OpS390XNEGW)
|
v.reset(OpS390XNEGW)
|
||||||
v0 := b.NewValue0(v.Pos, OpS390XMOVHreg, typ.Int64)
|
v.AddArg(x)
|
||||||
v0.AddArg(x)
|
|
||||||
v.AddArg(v0)
|
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -4625,19 +4619,13 @@ func rewriteValueS390X_OpNeg64F_0(v *Value) bool {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
func rewriteValueS390X_OpNeg8_0(v *Value) bool {
|
func rewriteValueS390X_OpNeg8_0(v *Value) bool {
|
||||||
b := v.Block
|
|
||||||
_ = b
|
|
||||||
typ := &b.Func.Config.Types
|
|
||||||
_ = typ
|
|
||||||
// match: (Neg8 x)
|
// match: (Neg8 x)
|
||||||
// cond:
|
// cond:
|
||||||
// result: (NEGW (MOVBreg x))
|
// result: (NEGW x)
|
||||||
for {
|
for {
|
||||||
x := v.Args[0]
|
x := v.Args[0]
|
||||||
v.reset(OpS390XNEGW)
|
v.reset(OpS390XNEGW)
|
||||||
v0 := b.NewValue0(v.Pos, OpS390XMOVBreg, typ.Int64)
|
v.AddArg(x)
|
||||||
v0.AddArg(x)
|
|
||||||
v.AddArg(v0)
|
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user