Skip to content

Commit

Permalink
runtime: remove VZEROUPPER in asyncPreempt on darwin/amd64
Browse files Browse the repository at this point in the history
Updates golang#37174
Updates golang#49233
Fixes golang#41152

Change-Id: I35b148c8bc132f02dd6a5a6bb48b711fb5c5df9e
Reviewed-on: https://go-review.googlesource.com/c/go/+/560955
Reviewed-by: Keith Randall <[email protected]>
Auto-Submit: Dmitri Shuralyov <[email protected]>
LUCI-TryBot-Result: Go LUCI <[email protected]>
Reviewed-by: Cherry Mui <[email protected]>
  • Loading branch information
cuonglm authored and gopherbot committed Jul 23, 2024
1 parent 78c0ea5 commit fe87b58
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 20 deletions.
13 changes: 0 additions & 13 deletions src/runtime/mkpreempt.go
Original file line number Diff line number Diff line change
Expand Up @@ -264,19 +264,6 @@ func genAMD64() {

l.save()

// Apparently, the signal handling code path in darwin kernel leaves
// the upper bits of Y registers in a dirty state, which causes
// many SSE operations (128-bit and narrower) become much slower.
// Clear the upper bits to get to a clean state. See issue #37174.
// It is safe here as Go code don't use the upper bits of Y registers.
p("#ifdef GOOS_darwin")
p("#ifndef hasAVX")
p("CMPB internal∕cpu·X86+const_offsetX86HasAVX(SB), $0")
p("JE 2(PC)")
p("#endif")
p("VZEROUPPER")
p("#endif")

lSSE.save()
p("CALL ·asyncPreempt2(SB)")
lSSE.restore()
Expand Down
7 changes: 0 additions & 7 deletions src/runtime/preempt_amd64.s
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,6 @@ TEXT ·asyncPreempt(SB),NOSPLIT|NOFRAME,$0-0
MOVQ R13, 88(SP)
MOVQ R14, 96(SP)
MOVQ R15, 104(SP)
#ifdef GOOS_darwin
#ifndef hasAVX
CMPB internal∕cpu·X86+const_offsetX86HasAVX(SB), $0
JE 2(PC)
#endif
VZEROUPPER
#endif
MOVUPS X0, 112(SP)
MOVUPS X1, 128(SP)
MOVUPS X2, 144(SP)
Expand Down

0 comments on commit fe87b58

Please sign in to comment.