From b99abf3cce16721d79351c92031239a27fec3d22 Mon Sep 17 00:00:00 2001 From: Jake Ciolek Date: Sat, 9 Oct 2021 20:09:21 +0200 Subject: [PATCH] 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 --- src/cmd/compile/internal/amd64/ssa.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 -- 2.50.0