]> Cypherpunks.ru repositories - gostls13.git/commit
cmd/compile/internal/amd64: follow-on regabi fix for amd64 zerorange
authorThan McIntosh <thanm@google.com>
Tue, 6 Apr 2021 20:18:50 +0000 (16:18 -0400)
committerThan McIntosh <thanm@google.com>
Mon, 12 Apr 2021 10:30:24 +0000 (10:30 +0000)
commitc26f954a540a99eafac6ee3bb3b996c750aad8a4
tree7d1f54018243071e6d165a1d961299b6d67a6cca
parent16cd770e0668a410a511680b2ac1412e554bd27b
cmd/compile/internal/amd64: follow-on regabi fix for amd64 zerorange

This patch provides a better long-term fix for the compiler's
zerorange() helper function to make it generate code friendly to the
register ABI.

CL 305829 did part of the work, but didn't properly handle the case
where the compiler emits a REP.STOSQ sequence; this patch changes the
REP code to make sure it doesn't clobber any incoming register
parameter values.

Also included is a test that is specifically written to trigger
the REP emit code in the compiler (prior to this, this code was
not being hit on linux/amd64 all.bash).

Updates #45372.
Updates #40724.

Change-Id: Iaf1c4e709e98eda45cd6f3aeebda0fe9160f1f42
Reviewed-on: https://go-review.googlesource.com/c/go/+/307829
Trust: Than McIntosh <thanm@google.com>
Run-TryBot: Than McIntosh <thanm@google.com>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
src/cmd/compile/internal/amd64/ggen.go
src/cmd/compile/internal/test/zerorange_test.go