Skip to content

Commit 505d4e8

Browse files
taiki-eAmanieu
authored andcommitted
std_detect: Support detecting lse/dotprod/jsconv/rcpc on aarch64 Windows
1 parent 6e5b949 commit 505d4e8

File tree

1 file changed

+20
-0
lines changed
  • library/stdarch/crates/std_detect/src/detect/os/windows

1 file changed

+20
-0
lines changed

library/stdarch/crates/std_detect/src/detect/os/windows/aarch64.rs

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@ pub(crate) fn detect_features() -> cache::Initializer {
1414
const PF_ARM_NEON_INSTRUCTIONS_AVAILABLE: u32 = 19;
1515
const PF_ARM_V8_CRYPTO_INSTRUCTIONS_AVAILABLE: u32 = 30;
1616
const PF_ARM_V8_CRC32_INSTRUCTIONS_AVAILABLE: u32 = 31;
17+
const PF_ARM_V81_ATOMIC_INSTRUCTIONS_AVAILABLE: u32 = 34;
18+
const PF_ARM_V82_DP_INSTRUCTIONS_AVAILABLE: u32 = 43;
19+
const PF_ARM_V83_JSCVT_INSTRUCTIONS_AVAILABLE: u32 = 44;
20+
const PF_ARM_V83_LRCPC_INSTRUCTIONS_AVAILABLE: u32 = 45;
1721

1822
extern "system" {
1923
pub fn IsProcessorFeaturePresent(ProcessorFeature: DWORD) -> BOOL;
@@ -39,6 +43,22 @@ pub(crate) fn detect_features() -> cache::Initializer {
3943
Feature::crc,
4044
IsProcessorFeaturePresent(PF_ARM_V8_CRC32_INSTRUCTIONS_AVAILABLE) != FALSE,
4145
);
46+
enable_feature(
47+
Feature::lse,
48+
IsProcessorFeaturePresent(PF_ARM_V81_ATOMIC_INSTRUCTIONS_AVAILABLE) != FALSE,
49+
);
50+
enable_feature(
51+
Feature::dotprod,
52+
IsProcessorFeaturePresent(PF_ARM_V82_DP_INSTRUCTIONS_AVAILABLE) != FALSE,
53+
);
54+
enable_feature(
55+
Feature::jsconv,
56+
IsProcessorFeaturePresent(PF_ARM_V83_JSCVT_INSTRUCTIONS_AVAILABLE) != FALSE,
57+
);
58+
enable_feature(
59+
Feature::rcpc,
60+
IsProcessorFeaturePresent(PF_ARM_V83_LRCPC_INSTRUCTIONS_AVAILABLE) != FALSE,
61+
);
4262
// PF_ARM_V8_CRYPTO_INSTRUCTIONS_AVAILABLE means aes, sha1, sha2 and
4363
// pmull support
4464
enable_feature(

0 commit comments

Comments
 (0)