diff options
author | Tobias Klauser <tklauser@distanz.ch> | 2018-04-12 10:27:42 +0200 |
---|---|---|
committer | Tobias Klauser <tobias.klauser@gmail.com> | 2018-04-15 20:33:59 +0000 |
commit | d0712096b32d032b0b83a5eb899a7359a830732b (patch) | |
tree | 4e9e64a61b04f580ff844d5884fb4876505aff9d /src/runtime/memclr_amd64.s | |
parent | 284ba47b4916e3cf4f206494ad5a3577e20db9bf (diff) | |
download | go-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/memclr_amd64.s')
-rw-r--r-- | src/runtime/memclr_amd64.s | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/runtime/memclr_amd64.s b/src/runtime/memclr_amd64.s index 244f5b4d8c..d0fd50d4f1 100644 --- a/src/runtime/memclr_amd64.s +++ b/src/runtime/memclr_amd64.s @@ -4,6 +4,7 @@ // +build !plan9 +#include "go_asm.h" #include "textflag.h" // NOTE: Windows externalthreadhandler expects memclr to preserve DX. @@ -36,7 +37,7 @@ tail: JBE _65through128 CMPQ BX, $256 JBE _129through256 - CMPB runtime·support_avx2(SB), $1 + CMPB internal∕cpu·X86+const_offsetX86HasAVX2(SB), $1 JE loop_preheader_avx2 // TODO: use branch table and BSR to make this just a single dispatch // TODO: for really big clears, use MOVNTDQ, even without AVX2. |