Skip to content

Commit

Permalink
Update AArch64 features to Linux 6.6. (#347)
Browse files Browse the repository at this point in the history
  • Loading branch information
tamaszarm authored Nov 27, 2023
1 parent 8cfb520 commit 104602c
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 1 deletion.
4 changes: 4 additions & 0 deletions include/cpuinfo_aarch64.h
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,8 @@ typedef struct {
int smebi32i32 : 1; // 1-bit binary to 32-bit integer outer product.
int smeb16b16 : 1; // SME2.1 BFloat16 instructions.
int smef16f16 : 1; // FP16 to FP16 outer product.
int mops : 1; // Standardized memory operations.
int hbc : 1; // Hinted conditional branches.

// Make sure to update Aarch64FeaturesEnum below if you add a field here.
} Aarch64Features;
Expand Down Expand Up @@ -284,6 +286,8 @@ typedef enum {
AARCH64_SME_BI32I32,
AARCH64_SME_B16B16,
AARCH64_SME_F16F16,
AARCH64_MOPS,
AARCH64_HBC,
AARCH64_LAST_,
} Aarch64FeaturesEnum;

Expand Down
2 changes: 2 additions & 0 deletions include/internal/hwcaps.h
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,8 @@ CPU_FEATURES_START_CPP_NAMESPACE
#define AARCH64_HWCAP2_SME_BI32I32 (1UL << 40)
#define AARCH64_HWCAP2_SME_B16B16 (1UL << 41)
#define AARCH64_HWCAP2_SME_F16F16 (1UL << 42)
#define AARCH64_HWCAP2_MOPS (1UL << 43)
#define AARCH64_HWCAP2_HBC (1UL << 44)

// http://elixir.free-electrons.com/linux/latest/source/arch/arm/include/uapi/asm/hwcap.h
#define ARM_HWCAP_SWP (1UL << 0)
Expand Down
5 changes: 4 additions & 1 deletion src/impl_aarch64__base_implementation.inl
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,10 @@
AARCH64_HWCAP2_SME_BI32I32) \
LINE(AARCH64_SME_B16B16, smeb16b16, "smeb16b16", 0, \
AARCH64_HWCAP2_SME_B16B16) \
LINE(AARCH64_SME_F16F16, smef16f16, "smef16f16", 0, AARCH64_HWCAP2_SME_F16F16)
LINE(AARCH64_SME_F16F16, smef16f16, "smef16f16", 0, \
AARCH64_HWCAP2_SME_F16F16) \
LINE(AARCH64_MOPS, mops, "mops", 0, AARCH64_HWCAP2_MOPS) \
LINE(AARCH64_HBC, hbc, "hbc", 0, AARCH64_HWCAP2_HBC)
#define INTROSPECTION_PREFIX Aarch64
#define INTROSPECTION_ENUM_PREFIX AARCH64
#include "define_introspection_and_hwcaps.inl"
2 changes: 2 additions & 0 deletions test/cpuinfo_aarch64_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,8 @@ CPU revision : 3)");
EXPECT_FALSE(info.features.smebi32i32);
EXPECT_FALSE(info.features.smeb16b16);
EXPECT_FALSE(info.features.smef16f16);
EXPECT_FALSE(info.features.mops);
EXPECT_FALSE(info.features.hbc);
}
#elif defined(CPU_FEATURES_OS_MACOS)
TEST_F(CpuidAarch64Test, FromDarwinSysctlFromName) {
Expand Down

0 comments on commit 104602c

Please sign in to comment.