Skip to content

Commit 7bb0bf7

Browse files
hmartinez82gopherbot
authored andcommitted

File tree

cpu/cpu.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@ var ARM64 struct {
106106
HasSVE2 bool // Scalable Vector Extensions 2
107107
HasASIMDFHM bool // Advanced SIMD multiplication FP16 to FP32
108108
HasDIT bool // Data Independent Timing support
109+
HasI8MM bool // Advanced SIMD Int8 matrix multiplication instructions
109110
_ CacheLinePad
110111
}
111112

cpu/cpu_arm64.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ func initOptions() {
3939
{Name: "asimddp", Feature: &ARM64.HasASIMDDP},
4040
{Name: "asimdfhm", Feature: &ARM64.HasASIMDFHM},
4141
{Name: "dit", Feature: &ARM64.HasDIT},
42+
{Name: "i8mm", Feature: &ARM64.HasI8MM},
4243
}
4344
}
4445

@@ -146,6 +147,11 @@ func parseARM64SystemRegisters(isar0, isar1, pfr0 uint64) {
146147
ARM64.HasLRCPC = true
147148
}
148149

150+
switch extractBits(isar1, 52, 55) {
151+
case 1:
152+
ARM64.HasI8MM = true
153+
}
154+
149155
// ID_AA64PFR0_EL1
150156
switch extractBits(pfr0, 16, 19) {
151157
case 0:

cpu/cpu_linux_arm64.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ const (
3838
hwcap_DIT = 1 << 24
3939

4040
hwcap2_SVE2 = 1 << 1
41+
hwcap2_I8MM = 1 << 13
4142
)
4243

4344
// linuxKernelCanEmulateCPUID reports whether we're running
@@ -112,6 +113,7 @@ func doinit() {
112113

113114
// HWCAP2 feature bits
114115
ARM64.HasSVE2 = isSet(hwCap2, hwcap2_SVE2)
116+
ARM64.HasI8MM = isSet(hwCap2, hwcap2_I8MM)
115117
}
116118

117119
func isSet(hwc uint, value uint) bool {

0 commit comments

Comments
 (0)