...
Run Format

Source file src/runtime/cpuflags_amd64.go

Documentation: runtime

     1  // Copyright 2015 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  	offsetX86HasAVX2 = unsafe.Offsetof(cpu.X86.HasAVX2)
    15  )
    16  
    17  var useAVXmemmove bool
    18  
    19  func init() {
    20  	// Let's remove stepping and reserved fields
    21  	processor := processorVersionInfo & 0x0FFF3FF0
    22  
    23  	isIntelBridgeFamily := isIntel &&
    24  		processor == 0x206A0 ||
    25  		processor == 0x206D0 ||
    26  		processor == 0x306A0 ||
    27  		processor == 0x306E0
    28  
    29  	useAVXmemmove = cpu.X86.HasAVX && !isIntelBridgeFamily
    30  }
    31  

View as plain text