Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add AArch32 and AArch64 CPU name and feature detection code
Also implement internal runtime API. The detection code avoid using `/proc/cpuinfo` whenever possible and should be much more reliable than the one in LLVM. It also contains a much larger CPUID table to decode CPU names. Compare to X86, the feature encoding/decoding is more complex due to the way LLVM takes attributes. Certain information (arch version) also needs to be moved between name and feature list.
- Loading branch information
Showing
5 changed files
with
1,504 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
// This file is a part of Julia. License is MIT: https://julialang.org/license | ||
|
||
// AArch32 features definition | ||
// hwcap | ||
JL_FEATURE_DEF(neon, 12, 0) | ||
JL_FEATURE_DEF(vfp3, 13, 0) | ||
// JL_FEATURE_DEF(vfpv3d16, 14, 0) // d16 | ||
JL_FEATURE_DEF(vfp4, 16, 0) | ||
JL_FEATURE_DEF_NAME(hwdiv_arm, 17, 0, "hwdiv-arm") | ||
JL_FEATURE_DEF(hwdiv, 18, 0) | ||
JL_FEATURE_DEF(d32, 19, 0) // -d16 | ||
|
||
// hwcap2 | ||
JL_FEATURE_DEF(crypto, 32 + 0, 0) | ||
JL_FEATURE_DEF(crc, 32 + 4, 0) | ||
// JL_FEATURE_DEF(ras, 32 + ???, 0) | ||
// JL_FEATURE_DEF(fullfp16, 32 + ???, 0) | ||
|
||
// custom bits to match llvm model | ||
JL_FEATURE_DEF(aclass, 32 * 2 + 0, 0) | ||
JL_FEATURE_DEF(rclass, 32 * 2 + 1, 0) | ||
JL_FEATURE_DEF(mclass, 32 * 2 + 2, 0) | ||
JL_FEATURE_DEF(v7, 32 * 2 + 3, 0) | ||
JL_FEATURE_DEF(v8, 32 * 2 + 4, 0) | ||
JL_FEATURE_DEF(v8_1a, 32 * 2 + 5, 0) | ||
JL_FEATURE_DEF(v8_2a, 32 * 2 + 6, 0) | ||
JL_FEATURE_DEF(v8_3a, 32 * 2 + 7, 60000) | ||
JL_FEATURE_DEF(v8_m_main, 32 * 2 + 8, 0) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
// This file is a part of Julia. License is MIT: https://julialang.org/license | ||
|
||
// AArch64 features definition | ||
// hwcap | ||
JL_FEATURE_DEF(crypto, 3, 0) | ||
JL_FEATURE_DEF(crc, 7, 0) | ||
JL_FEATURE_DEF(lse, 8, 40000) // ARMv8.1-Atomics | ||
JL_FEATURE_DEF(fullfp16, 9, 0) | ||
JL_FEATURE_DEF(rdm, 12, 50000) // ARMv8.1-SIMD | ||
JL_FEATURE_DEF(jscvt, 13, UINT32_MAX) // Linux Kernel HWCAP name | ||
JL_FEATURE_DEF(fcma, 14, UINT32_MAX) // Linux Kernel HWCAP name | ||
JL_FEATURE_DEF(rcpc, 15, 60000) | ||
JL_FEATURE_DEF(dcpop, 16, UINT32_MAX) // Linux Kernel HWCAP name | ||
// JL_FEATURE_DEF(dotprod, ???, 60000) // ARMv8.2-DotProd | ||
// JL_FEATURE_DEF(ras, ???, 0) | ||
// JL_FEATURE_DEF(sve, ???, UINT32_MAX) | ||
|
||
// hwcap2 | ||
// JL_FEATURE_DEF(?, 32 + ?, 0) | ||
|
||
// custom bits to match llvm model | ||
JL_FEATURE_DEF(v8_1a, 32 * 2 + 0, 0) | ||
JL_FEATURE_DEF(v8_2a, 32 * 2 + 1, 0) | ||
JL_FEATURE_DEF(v8_3a, 32 * 2 + 2, 60000) | ||
// JL_FEATURE_DEF(v8_4a, 32 * 2 + 3, ???) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.