mirror of https://github.com/golang/go.git
cmd/compile: use the shorter version of XOR for breaking POPCNT register
dependency XORL accomplishes the same thing while being shorter to encode. Change-Id: I4397999ff617edb61a7fb7d1eca757a202ab8134 Reviewed-on: https://go-review.googlesource.com/c/go/+/354832 Reviewed-by: Keith Randall <khr@golang.org> Run-TryBot: Keith Randall <khr@golang.org> TryBot-Result: Go Bot <gobot@golang.org> Trust: Josh Bleecher Snyder <josharian@gmail.com>
This commit is contained in:
parent
ba2c9fef03
commit
b99abf3cce
|
|
@ -1125,7 +1125,7 @@ func ssaGenValue(s *ssagen.State, v *ssa.Value) {
|
|||
if v.Args[0].Reg() != v.Reg() {
|
||||
// POPCNT on Intel has a false dependency on the destination register.
|
||||
// Xor register with itself to break the dependency.
|
||||
p := s.Prog(x86.AXORQ)
|
||||
p := s.Prog(x86.AXORL)
|
||||
p.From.Type = obj.TYPE_REG
|
||||
p.From.Reg = v.Reg()
|
||||
p.To.Type = obj.TYPE_REG
|
||||
|
|
|
|||
Loading…
Reference in New Issue