Source file src/runtime/cpuflags.go

     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  	offsetX86HasERMS   = unsafe.Offsetof(cpu.X86.HasERMS)
    17  	offsetX86HasRDTSCP = unsafe.Offsetof(cpu.X86.HasRDTSCP)
    18  
    19  	offsetARMHasIDIVA = unsafe.Offsetof(cpu.ARM.HasIDIVA)
    20  
    21  	offsetMIPS64XHasMSA = unsafe.Offsetof(cpu.MIPS64X.HasMSA)
    22  
    23  	offsetLOONG64HasLSX = unsafe.Offsetof(cpu.Loong64.HasLSX)
    24  )
    25  
    26  var (
    27  	// Set in runtime.cpuinit.
    28  	// TODO: deprecate these; use internal/cpu directly.
    29  	x86HasPOPCNT bool
    30  	x86HasSSE41  bool
    31  	x86HasFMA    bool
    32  
    33  	armHasVFPv4 bool
    34  
    35  	arm64HasATOMICS bool
    36  
    37  	loong64HasLAMCAS bool
    38  	loong64HasLAM_BH bool
    39  	loong64HasLSX    bool
    40  )
    41  

View as plain text