From e74b6f0a4bb86d5186ccc47ffd096f2ebfb29bc1 Mon Sep 17 00:00:00 2001 From: Jakub Konka Date: Fri, 25 Nov 2022 20:09:21 +0100 Subject: [PATCH] windows: detect couple more aarch64 CPU features --- lib/std/os/windows.zig | 4 ++++ lib/std/zig/system/windows.zig | 9 +++++++++ 2 files changed, 13 insertions(+) diff --git a/lib/std/os/windows.zig b/lib/std/os/windows.zig index 5308a6fae27cd8591c9e6396963b6be1b145ab87..b6d61e324e7b2f42d5412608d95d91e3e5c05619 100644 --- a/lib/std/os/windows.zig +++ b/lib/std/os/windows.zig @@ -3838,7 +3838,11 @@ pub const PF = enum(DWORD) { AVX512F_INSTRUCTIONS_AVAILABLE = 41, ERMS_AVAILABLE = 42, + + /// This ARM processor implements the ARM v8.2 Dot Product (DP) instructions. ARM_V82_DP_INSTRUCTIONS_AVAILABLE = 43, + + /// This ARM processor implements the ARM v8.3 JavaScript conversion (JSCVT) instructions. ARM_V83_JSCVT_INSTRUCTIONS_AVAILABLE = 44, }; diff --git a/lib/std/zig/system/windows.zig b/lib/std/zig/system/windows.zig index eb6206812092332172b18e187be340e92f0ed171..569daf0a3084eb31a55e5600f3df5afdfe6e698d 100644 --- a/lib/std/zig/system/windows.zig +++ b/lib/std/zig/system/windows.zig @@ -61,6 +61,15 @@ fn detectNativeCpuAndFeaturesArm64() Target.Cpu { if (IsProcessorFeaturePresent(PF.ARM_V8_CRYPTO_INSTRUCTIONS_AVAILABLE)) { cpu.features.addFeature(@enumToInt(Feature.crypto)); } + if (IsProcessorFeaturePresent(PF.ARM_V81_ATOMIC_INSTRUCTIONS_AVAILABLE)) { + cpu.features.addFeature(@enumToInt(Feature.lse)); + } + if (IsProcessorFeaturePresent(PF.ARM_V82_DP_INSTRUCTIONS_AVAILABLE)) { + cpu.features.addFeature(@enumToInt(Feature.dotprod)); + } + if (IsProcessorFeaturePresent(PF.ARM_V83_JSCVT_INSTRUCTIONS_AVAILABLE)) { + cpu.features.addFeature(@enumToInt(Feature.jsconv)); + } return cpu; } -- 2.54.0