aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/asm_386.s
diff options
context:
space:
mode:
authorTobias Klauser <tklauser@distanz.ch>2018-04-12 10:27:42 +0200
committerTobias Klauser <tobias.klauser@gmail.com>2018-04-15 20:33:59 +0000
commitd0712096b32d032b0b83a5eb899a7359a830732b (patch)
tree4e9e64a61b04f580ff844d5884fb4876505aff9d /src/runtime/asm_386.s
parent284ba47b4916e3cf4f206494ad5a3577e20db9bf (diff)
downloadgo-d0712096b32d032b0b83a5eb899a7359a830732b.tar.gz
go-d0712096b32d032b0b83a5eb899a7359a830732b.zip
runtime: use internal/cpu.X86.HasAVX2 instead of support_avx2
After CL 104636 cpu.X86.HasAVX is set early enough that it can be used in runtime·memclrNoHeapPointers. Add an offset to use in assembly and replace the only occurence of support_avx2. Change-Id: Icada62efeb3e24d71251d55623a8a8602364c9a8 Reviewed-on: https://go-review.googlesource.com/106595 Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Reviewed-by: Ilya Tocar <ilya.tocar@intel.com>
Diffstat (limited to 'src/runtime/asm_386.s')
-rw-r--r--src/runtime/asm_386.s10
1 files changed, 1 insertions, 9 deletions
diff --git a/src/runtime/asm_386.s b/src/runtime/asm_386.s
index e68f727076..28d045e416 100644
--- a/src/runtime/asm_386.s
+++ b/src/runtime/asm_386.s
@@ -184,11 +184,6 @@ eax7:
MOVL $0, CX
CPUID
- // If OS support for XMM and YMM is not present
- // support_avx2 will be set back to false later.
- TESTL $(1<<5), BX
- SETNE runtime·support_avx2(SB)
-
TESTL $(1<<9), BX // ERMS
SETNE runtime·support_erms(SB)
@@ -197,16 +192,13 @@ osavx:
// for XMM and YMM OS support.
#ifndef GOOS_nacl
CMPB runtime·support_osxsave(SB), $1
- JNE noavx
+ JNE nocpuinfo
MOVL $0, CX
// For XGETBV, OSXSAVE bit is required and sufficient
XGETBV
ANDL $6, AX
CMPL AX, $6 // Check for OS support of XMM and YMM registers.
- JE nocpuinfo
#endif
-noavx:
- MOVB $0, runtime·support_avx2(SB)
nocpuinfo:
// if there is an _cgo_init, call it to let it