| 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 |
package cpu |
| 6 |
|
| 7 |
func doinit() { |
| 8 |
// set HasASIMD and HasFP to true as per |
| 9 |
// https://learn.microsoft.com/en-us/cpp/build/arm64-windows-abi-conventions?view=msvc-170#base-requirements |
| 10 |
// |
| 11 |
// The ARM64 version of Windows always presupposes that it's running on an ARMv8 or later architecture. |
| 12 |
// Both floating-point and NEON support are presumed to be present in hardware. |
| 13 |
// |
| 14 |
ARM64.HasASIMD = true |
| 15 |
ARM64.HasFP = true |
| 16 |
|
| 17 |
if isProcessorFeaturePresent(_PF_ARM_V8_CRYPTO_INSTRUCTIONS_AVAILABLE) { |
| 18 |
ARM64.HasAES = true |
| 19 |
ARM64.HasPMULL = true |
| 20 |
ARM64.HasSHA1 = true |
| 21 |
ARM64.HasSHA2 = true |
| 22 |
} |
| 23 |
ARM64.HasSHA3 = isProcessorFeaturePresent(_PF_ARM_SHA3_INSTRUCTIONS_AVAILABLE) |
| 24 |
ARM64.HasCRC32 = isProcessorFeaturePresent(_PF_ARM_V8_CRC32_INSTRUCTIONS_AVAILABLE) |
| 25 |
ARM64.HasSHA512 = isProcessorFeaturePresent(_PF_ARM_SHA512_INSTRUCTIONS_AVAILABLE) |
| 26 |
ARM64.HasATOMICS = isProcessorFeaturePresent(_PF_ARM_V81_ATOMIC_INSTRUCTIONS_AVAILABLE) |
| 27 |
if isProcessorFeaturePresent(_PF_ARM_V82_DP_INSTRUCTIONS_AVAILABLE) { |
| 28 |
ARM64.HasASIMDDP = true |
| 29 |
ARM64.HasASIMDRDM = true |
| 30 |
} |
| 31 |
if isProcessorFeaturePresent(_PF_ARM_V83_LRCPC_INSTRUCTIONS_AVAILABLE) { |
| 32 |
ARM64.HasLRCPC = true |
| 33 |
ARM64.HasSM3 = true |
| 34 |
} |
| 35 |
ARM64.HasSVE = isProcessorFeaturePresent(_PF_ARM_SVE_INSTRUCTIONS_AVAILABLE) |
| 36 |
ARM64.HasSVE2 = isProcessorFeaturePresent(_PF_ARM_SVE2_INSTRUCTIONS_AVAILABLE) |
| 37 |
ARM64.HasJSCVT = isProcessorFeaturePresent(_PF_ARM_V83_JSCVT_INSTRUCTIONS_AVAILABLE) |
| 38 |
} |