about summary refs log tree commit diff
path: root/library/stdarch/crates/std_detect/src
diff options
context:
space:
mode:
authorTaiki Endo <te316e89@gmail.com>2023-01-24 03:17:26 +0900
committerAmanieu d'Antras <amanieu@gmail.com>2023-01-23 22:26:08 +0000
commit505d4e8d48397fca4491ab52afccf33b0b037fa2 (patch)
tree8bf10bca1ccaa8e9bdfe9d9d424b7dd3842b0c84 /library/stdarch/crates/std_detect/src
parent6e5b949ee7a158835ed9d3d93c45badee61a6e8d (diff)
downloadrust-505d4e8d48397fca4491ab52afccf33b0b037fa2.tar.gz
rust-505d4e8d48397fca4491ab52afccf33b0b037fa2.zip
std_detect: Support detecting lse/dotprod/jsconv/rcpc on aarch64 Windows
Diffstat (limited to 'library/stdarch/crates/std_detect/src')
-rw-r--r--library/stdarch/crates/std_detect/src/detect/os/windows/aarch64.rs20
1 files changed, 20 insertions, 0 deletions
diff --git a/library/stdarch/crates/std_detect/src/detect/os/windows/aarch64.rs b/library/stdarch/crates/std_detect/src/detect/os/windows/aarch64.rs
index 051ad6d1bfc..119c905e03b 100644
--- a/library/stdarch/crates/std_detect/src/detect/os/windows/aarch64.rs
+++ b/library/stdarch/crates/std_detect/src/detect/os/windows/aarch64.rs
@@ -14,6 +14,10 @@ pub(crate) fn detect_features() -> cache::Initializer {
     const PF_ARM_NEON_INSTRUCTIONS_AVAILABLE: u32 = 19;
     const PF_ARM_V8_CRYPTO_INSTRUCTIONS_AVAILABLE: u32 = 30;
     const PF_ARM_V8_CRC32_INSTRUCTIONS_AVAILABLE: u32 = 31;
+    const PF_ARM_V81_ATOMIC_INSTRUCTIONS_AVAILABLE: u32 = 34;
+    const PF_ARM_V82_DP_INSTRUCTIONS_AVAILABLE: u32 = 43;
+    const PF_ARM_V83_JSCVT_INSTRUCTIONS_AVAILABLE: u32 = 44;
+    const PF_ARM_V83_LRCPC_INSTRUCTIONS_AVAILABLE: u32 = 45;
 
     extern "system" {
         pub fn IsProcessorFeaturePresent(ProcessorFeature: DWORD) -> BOOL;
@@ -39,6 +43,22 @@ pub(crate) fn detect_features() -> cache::Initializer {
                 Feature::crc,
                 IsProcessorFeaturePresent(PF_ARM_V8_CRC32_INSTRUCTIONS_AVAILABLE) != FALSE,
             );
+            enable_feature(
+                Feature::lse,
+                IsProcessorFeaturePresent(PF_ARM_V81_ATOMIC_INSTRUCTIONS_AVAILABLE) != FALSE,
+            );
+            enable_feature(
+                Feature::dotprod,
+                IsProcessorFeaturePresent(PF_ARM_V82_DP_INSTRUCTIONS_AVAILABLE) != FALSE,
+            );
+            enable_feature(
+                Feature::jsconv,
+                IsProcessorFeaturePresent(PF_ARM_V83_JSCVT_INSTRUCTIONS_AVAILABLE) != FALSE,
+            );
+            enable_feature(
+                Feature::rcpc,
+                IsProcessorFeaturePresent(PF_ARM_V83_LRCPC_INSTRUCTIONS_AVAILABLE) != FALSE,
+            );
             // PF_ARM_V8_CRYPTO_INSTRUCTIONS_AVAILABLE means aes, sha1, sha2 and
             // pmull support
             enable_feature(