github.com/primecitizens/pcz/std@v0.2.1/core/mem/features_amd64.go (about)

     1  // SPDX-License-Identifier: Apache-2.0
     2  // Copyright 2023 The Prime Citizens
     3  
     4  //go:build pcz && amd64
     5  
     6  package mem
     7  
     8  import "github.com/primecitizens/pcz/std/core/cpu"
     9  
    10  var (
    11  	hasERMS       bool // required by memclr & memmove
    12  	useAVXmemmove bool // required by memmove
    13  	hasAVX2       bool // required by memequal
    14  )
    15  
    16  func init() {
    17  	hasERMS = cpu.X86.HasAll(cpu.X86Feature_erms)
    18  	hasAVX2 = cpu.X86.HasAll(cpu.X86Feature_avx2)
    19  
    20  	// TODO: need to check cpu family: see golang std src/runtime/cpuflags_amd64.go
    21  	useAVXmemmove = cpu.X86.HasAll(cpu.X86Feature_avx)
    22  }