std_detect Darwin AArch64: add new-style detection for FEAT_CRC32
Now that this feature has a standard identifier, Darwin has started exposing it accordingly, in addition to the existing less-standard way. Check both, and enable the `crc` feature if either identifier for it is present to ensure backwards and forwards compatibility.
This commit is contained in:
@@ -37,12 +37,13 @@ pub(crate) fn detect_features() -> cache::Initializer {
|
||||
// Armv8.0 features not using the standard identifiers
|
||||
let fp = _sysctlbyname(c"hw.optional.floatingpoint");
|
||||
let asimd = _sysctlbyname(c"hw.optional.AdvSIMD");
|
||||
let crc = _sysctlbyname(c"hw.optional.armv8_crc32");
|
||||
let crc_old = _sysctlbyname(c"hw.optional.armv8_crc32");
|
||||
|
||||
// Armv8 and Armv9 features using the standard identifiers
|
||||
let aes = _sysctlbyname(c"hw.optional.arm.FEAT_AES");
|
||||
let bf16 = _sysctlbyname(c"hw.optional.arm.FEAT_BF16");
|
||||
let bti = _sysctlbyname(c"hw.optional.arm.FEAT_BTI");
|
||||
let crc = _sysctlbyname(c"hw.optional.arm.FEAT_CRC32");
|
||||
let cssc = _sysctlbyname(c"hw.optional.arm.FEAT_CSSC");
|
||||
let dit = _sysctlbyname(c"hw.optional.arm.FEAT_DIT");
|
||||
let dpb = _sysctlbyname(c"hw.optional.arm.FEAT_DPB");
|
||||
@@ -111,7 +112,7 @@ pub(crate) fn detect_features() -> cache::Initializer {
|
||||
enable_feature(Feature::asimd, asimd);
|
||||
enable_feature(Feature::bf16, bf16);
|
||||
enable_feature(Feature::bti, bti);
|
||||
enable_feature(Feature::crc, crc);
|
||||
enable_feature(Feature::crc, crc_old || crc);
|
||||
enable_feature(Feature::cssc, cssc);
|
||||
enable_feature(Feature::dit, dit);
|
||||
enable_feature(Feature::dotprod, dotprod);
|
||||
|
||||
Reference in New Issue
Block a user