diff options
author | Cherry Zhang <cherryyz@google.com> | 2020-02-25 20:30:37 -0500 |
---|---|---|
committer | Cherry Zhang <cherryyz@google.com> | 2020-02-26 01:52:42 +0000 |
commit | c46ffdd2eca339918ed30b6ba9d4715ba769d35d (patch) | |
tree | 02888c9df18e9afafd0a59ad94b63761a2a01ba8 /src/runtime/cpuflags.go | |
parent | 089e482b3dd2026178c8ee5b90d9aadb6bf81239 (diff) | |
download | go-c46ffdd2eca339918ed30b6ba9d4715ba769d35d.tar.gz go-c46ffdd2eca339918ed30b6ba9d4715ba769d35d.zip |
runtime: guard VZEROUPPER on CPU feature
In CL 219131 we inserted a VZEROUPPER instruction on darwin/amd64.
The instruction is not available on pre-AVX machines. Guard it
with CPU feature.
Fixes #37459.
Change-Id: I9a064df277d091be4ee594eda5c7fd8ee323102b
Reviewed-on: https://go-review.googlesource.com/c/go/+/221057
Run-TryBot: Cherry Zhang <cherryyz@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
Diffstat (limited to 'src/runtime/cpuflags.go')
-rw-r--r-- | src/runtime/cpuflags.go | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/runtime/cpuflags.go b/src/runtime/cpuflags.go index 94f9331d15..4bd894d984 100644 --- a/src/runtime/cpuflags.go +++ b/src/runtime/cpuflags.go @@ -11,6 +11,7 @@ import ( // Offsets into internal/cpu records for use in assembly. const ( + offsetX86HasAVX = unsafe.Offsetof(cpu.X86.HasAVX) offsetX86HasAVX2 = unsafe.Offsetof(cpu.X86.HasAVX2) offsetX86HasERMS = unsafe.Offsetof(cpu.X86.HasERMS) offsetX86HasSSE2 = unsafe.Offsetof(cpu.X86.HasSSE2) |