Skip to content

Commit a631b65

Browse files
committed
Add detection of ARMv8.5-MemTag based on reserved kernel bit
1 parent a8bc98a commit a631b65

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

src/features_aarch64.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ JL_FEATURE_DEF(bf16, 32 + 14, 110000) // HWCAP2_BF16, ARMv8.2-BF16. Required in
6060
// JL_FEATURE_DEF(dgh, 32 + 15, UINT32_MAX) // HWCAP2_DGH, ARMv8.0-DGH. Not implement in LLVM yet
6161
JL_FEATURE_DEF(rand, 32 + 16, 0) // HWCAP2_RNG, ARMv8.5-RNG
6262
JL_FEATURE_DEF(bti, 32 + 17, 0) // HWCAP2_BTI
63+
JL_FEATURE_DEF(mte, 32 + 18, 0) // HWCAP2_MTE, ARMv8.5-MemTag (reserved as of kernel 5.9-rc1)
6364

6465
// custom bits to match llvm model
6566
JL_FEATURE_DEF(v8_1a, 32 * 2 + 0, 0)
@@ -74,7 +75,6 @@ JL_FEATURE_DEF(v8_6a, 32 * 2 + 5, 110000)
7475
// am: ID_AA64PFR0_EL1.AMU (0b1, 0b10)
7576
// specrestrict: ID_AA64PFR0_EL1.CSV2 (0b10)
7677
// predres: ID_AA64PFR0_EL1.CSV3 (0b1)
77-
// mte: ID_AA64PFR1_EL1.MTE (0b1, 0b10)
7878
// ecv: ID_AA64MMFR0_EL1.ECV (0b1, 0b10) (LLVM 11)
7979
// lor: ID_AA64MMFR1_EL1.LO (0b1)
8080
// perfmon: ID_AA64DFR0_EL1.PMUVer (0b1, 0b100, 0b101, 0b110)

src/processor_arm.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,9 @@ constexpr auto armv8_6a = armv8_5a | get_feature_masks(v8_6a, i8mm, bf16);
277277
// .DIT: dit
278278
// .BT: bti
279279

280-
// ID_AA64PFR1_EL1.SSBS: ssbs
280+
// ID_AA64PFR1_EL1
281+
// .SSBS: ssbs
282+
// .MTE: mte
281283

282284
// ID_AA64MMFR2_EL1.AT: uscat
283285

@@ -1762,7 +1764,7 @@ const std::pair<std::string,std::string> &jl_get_llvm_disasm_target(void)
17621764
# if JL_LLVM_VERSION > 100000
17631765
"+tme,"
17641766
# endif
1765-
"+am,+specrestrict,+predres,+mte,+lor,+perfmon,+spe,+tracev8.4",
1767+
"+am,+specrestrict,+predres,+lor,+perfmon,+spe,+tracev8.4",
17661768
#else
17671769
"+dotprod",
17681770
#endif

0 commit comments

Comments
 (0)