Source file src/simd/midway_amd64.go

     1  // Copyright 2026 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  //go:build goexperiment.simd && amd64
     6  
     7  package simd
     8  
     9  import (
    10  	"internal/cpu"
    11  	"simd/archsimd"
    12  )
    13  
    14  const archHasHwClmul = true
    15  
    16  func archMaxVectorSize() (size, allFeatureSize int) {
    17  	if archsimd.X86.AVX() {
    18  		size = 128
    19  		allFeatureSize = 128
    20  	}
    21  	if archsimd.X86.AVX2() {
    22  		size = 256
    23  		if cpu.X86.HasVPCLMULQDQ {
    24  			allFeatureSize = 256
    25  		}
    26  	}
    27  	if archsimd.X86.AVX512() {
    28  		size = 512
    29  		if cpu.X86.HasAVX512VPCLMULQDQ {
    30  			allFeatureSize = 512
    31  		}
    32  	}
    33  	return
    34  }
    35  

View as plain text