diff --git a/cpu/cpu.go b/cpu/cpu.go index 11a0abc1d..ec07aab05 100644 --- a/cpu/cpu.go +++ b/cpu/cpu.go @@ -106,6 +106,7 @@ var ARM64 struct { HasSVE2 bool // Scalable Vector Extensions 2 HasASIMDFHM bool // Advanced SIMD multiplication FP16 to FP32 HasDIT bool // Data Independent Timing support + HasI8MM bool // Advanced SIMD Int8 matrix multiplication instructions _ CacheLinePad } diff --git a/cpu/cpu_arm64.go b/cpu/cpu_arm64.go index 8bde6f1b9..af2aa99f9 100644 --- a/cpu/cpu_arm64.go +++ b/cpu/cpu_arm64.go @@ -39,6 +39,7 @@ func initOptions() { {Name: "asimddp", Feature: &ARM64.HasASIMDDP}, {Name: "asimdfhm", Feature: &ARM64.HasASIMDFHM}, {Name: "dit", Feature: &ARM64.HasDIT}, + {Name: "i8mm", Feature: &ARM64.HasI8MM}, } } @@ -146,6 +147,11 @@ func parseARM64SystemRegisters(isar0, isar1, pfr0 uint64) { ARM64.HasLRCPC = true } + switch extractBits(isar1, 52, 55) { + case 1: + ARM64.HasI8MM = true + } + // ID_AA64PFR0_EL1 switch extractBits(pfr0, 16, 19) { case 0: diff --git a/cpu/cpu_linux_arm64.go b/cpu/cpu_linux_arm64.go index bc61b1909..08f35ea17 100644 --- a/cpu/cpu_linux_arm64.go +++ b/cpu/cpu_linux_arm64.go @@ -38,6 +38,7 @@ const ( hwcap_DIT = 1 << 24 hwcap2_SVE2 = 1 << 1 + hwcap2_I8MM = 1 << 13 ) // linuxKernelCanEmulateCPUID reports whether we're running @@ -112,6 +113,7 @@ func doinit() { // HWCAP2 feature bits ARM64.HasSVE2 = isSet(hwCap2, hwcap2_SVE2) + ARM64.HasI8MM = isSet(hwCap2, hwcap2_I8MM) } func isSet(hwc uint, value uint) bool {