| 1 |
// Copyright 2018 The Go Authors. All rights reserved. |
| 2 |
// Use of this source code is governed by a BSD-style |
| 3 |
// license that can be found in the LICENSE file. |
| 4 |
|
| 5 |
package runtime |
| 6 |
|
| 7 |
import ( |
| 8 |
"internal/cpu" |
| 9 |
"unsafe" |
| 10 |
) |
| 11 |
|
| 12 |
// Offsets into internal/cpu records for use in assembly. |
| 13 |
const ( |
| 14 |
offsetX86HasAVX = unsafe.Offsetof(cpu.X86.HasAVX) |
| 15 |
offsetX86HasAVX2 = unsafe.Offsetof(cpu.X86.HasAVX2) |
| 16 |
offsetX86HasAVX512 = unsafe.Offsetof(cpu.X86.HasAVX512) // F+CD+BW+DQ+VL |
| 17 |
offsetX86HasERMS = unsafe.Offsetof(cpu.X86.HasERMS) |
| 18 |
offsetX86HasRDTSCP = unsafe.Offsetof(cpu.X86.HasRDTSCP) |
| 19 |
|
| 20 |
offsetARMHasIDIVA = unsafe.Offsetof(cpu.ARM.HasIDIVA) |
| 21 |
|
| 22 |
offsetMIPS64XHasMSA = unsafe.Offsetof(cpu.MIPS64X.HasMSA) |
| 23 |
|
| 24 |
offsetLOONG64HasLSX = unsafe.Offsetof(cpu.Loong64.HasLSX) |
| 25 |
offsetLOONG64HasLASX = unsafe.Offsetof(cpu.Loong64.HasLASX) |
| 26 |
) |
| 27 |
|
| 28 |
var ( |
| 29 |
// Set in runtime.cpuinit. |
| 30 |
// TODO: deprecate these; use internal/cpu directly. |
| 31 |
x86HasAVX bool |
| 32 |
x86HasFMA bool |
| 33 |
x86HasPOPCNT bool |
| 34 |
x86HasSSE41 bool |
| 35 |
|
| 36 |
armHasVFPv4 bool |
| 37 |
|
| 38 |
arm64HasATOMICS bool |
| 39 |
|
| 40 |
loong64HasLAMCAS bool |
| 41 |
loong64HasLAM_BH bool |
| 42 |
loong64HasLSX bool |
| 43 |
|
| 44 |
riscv64HasZbb bool |
| 45 |
) |