Skip to content

Commit 7bb0bf7

Browse files
hmartinez82gopherbot
authored andcommitted
cpu: add Int8 matrix multiplication instructions CPU feature flag for ARM64
References: https://github.com/torvalds/linux/blob/5bbd9b249880dba032bffa002dd9cd12cd5af09c/arch/arm64/include/uapi/asm/hwcap.h#L75C9-L75C31 https://developer.arm.com/documentation/ddi0601/2024-03/AArch64-Registers/ID-AA64ISAR1-EL1--AArch64-Instruction-Set-Attribute-Register-1 Change-Id: Ic4e1cf2c23097c7e8695453b6d0b335756d474bc Reviewed-on: https://go-review.googlesource.com/c/sys/+/595678 Reviewed-by: Ian Lance Taylor <[email protected]> LUCI-TryBot-Result: Go LUCI <[email protected]> Auto-Submit: Ian Lance Taylor <[email protected]> Reviewed-by: Cherry Mui <[email protected]>
1 parent bce4cf7 commit 7bb0bf7

File tree

3 files changed

+9
-0
lines changed

3 files changed

+9
-0
lines changed

Diff for: cpu/cpu.go

+1
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

Diff for: cpu/cpu_arm64.go

+6
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:

Diff for: cpu/cpu_linux_arm64.go

+2
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)