From: Jake Ciolek Date: Sat, 9 Oct 2021 18:09:21 +0000 (+0200) Subject: cmd/compile: use the shorter version of XOR for breaking POPCNT register X-Git-Tag: go1.18beta1~960 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=b99abf3cce16721d79351c92031239a27fec3d22;p=gostls13.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 Run-TryBot: Keith Randall TryBot-Result: Go Bot Trust: Josh Bleecher Snyder --- diff --git a/src/cmd/compile/internal/amd64/ssa.go b/src/cmd/compile/internal/amd64/ssa.go index 33cd5985e0..78822098a7 100644 --- a/src/cmd/compile/internal/amd64/ssa.go +++ b/src/cmd/compile/internal/amd64/ssa.go @@ -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