Source File
cpuflags_amd64.go
Belonging Package
runtime
// Copyright 2015 The Go Authors. All rights reserved.// Use of this source code is governed by a BSD-style// license that can be found in the LICENSE file.package runtimeimport ()var memmoveBits uint8const (// avxSupported indicates that the CPU supports AVX instructions.avxSupported = 1 << 0// repmovsPreferred indicates that REP MOVSx instruction is more// efficient on the CPU.repmovsPreferred = 1 << 1)func init() {// Here we assume that on modern CPUs with both FSRM and ERMS features,// copying data blocks of 2KB or larger using the REP MOVSB instruction// will be more efficient to avoid having to keep up with CPU generations.// Therefore, we may retain a BlockList mechanism to ensure that microarchitectures// that do not fit this case may appear in the future.// We enable it on Intel CPUs first, and we may support more platforms// in the future.:= isIntel:= && cpu.X86.HasERMS && cpu.X86.HasFSRMif cpu.X86.HasAVX {memmoveBits |= avxSupported}if {memmoveBits |= repmovsPreferred}}
![]() |
The pages are generated with Golds v0.7.9-preview. (GOOS=linux GOARCH=amd64) Golds is a Go 101 project developed by Tapir Liu. PR and bug reports are welcome and can be submitted to the issue list. Please follow @zigo_101 (reachable from the left QR code) to get the latest news of Golds. |