github.com/x04/go/src@v0.0.0-20200202162449-3d481ceb3525/runtime/cpuflags.go (about)

     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  	"github.com/x04/go/src/internal/cpu"
     9  	"github.com/x04/go/src/unsafe"
    10  )
    11  
    12  // Offsets into internal/cpu records for use in assembly.
    13  const (
    14  	offsetX86HasAVX2	= unsafe.Offsetof(cpu.X86.HasAVX2)
    15  	offsetX86HasERMS	= unsafe.Offsetof(cpu.X86.HasERMS)
    16  	offsetX86HasSSE2	= unsafe.Offsetof(cpu.X86.HasSSE2)
    17  
    18  	offsetARMHasIDIVA	= unsafe.Offsetof(cpu.ARM.HasIDIVA)
    19  )
    20  
    21  var (
    22  	// Set in runtime.cpuinit.
    23  	// TODO: deprecate these; use internal/cpu directly.
    24  	x86HasPOPCNT	bool
    25  	x86HasSSE41	bool
    26  	x86HasFMA	bool
    27  
    28  	armHasVFPv4	bool
    29  
    30  	arm64HasATOMICS	bool
    31  )