]> Cypherpunks repositories - gostls13.git/commitdiff
runtime: VZEROUPPER at the end of FilterNilAVX512
authorCherry Mui <cherryyz@google.com>
Tue, 9 Dec 2025 16:48:41 +0000 (11:48 -0500)
committerCherry Mui <cherryyz@google.com>
Wed, 10 Dec 2025 18:57:48 +0000 (10:57 -0800)
VZEROUPPER at the end of FilterNilAVX512 as we're leaving AVX
context. Also explicitly zero Z15, as the high bits are not
guaranteed zero as of CL 728240.

Change-Id: I000a199206d0b8fd4905c8a699e934551bbd3c60
Reviewed-on: https://go-review.googlesource.com/c/go/+/728740
Reviewed-by: Michael Knyszek <mknyszek@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>

src/internal/runtime/gc/scan/filter_amd64.s

index 47330b62eeaa02bb1c0dd8fbed85935d6defdee8..2897d3c026f79325df16a59787e1f7709d158553 100644 (file)
@@ -16,6 +16,7 @@ TEXT ·FilterNilAVX512(SB), NOSPLIT, $0-20
        SUBL R10, R12   // R12 = n - scanned
        CMPL R12, $8    // Compare (n - scanned) with 8
        JLT scalar_loop // If (n - scanned) < 8, jump to the scalar cleanup
+       VPXOR X15, X15, X15     // Zero the high bits of Z15
 
 vector_loop:
        LEAQ (R8)(R10*8), R13   // R13 = buf[scanned:] address
@@ -61,4 +62,5 @@ scalar_increment_i:
 
 end:
        MOVL R11, ret+16(FP)
+       VZEROUPPER
        RET