From 9e7cf69ac36960d362b358fc8bcb12d29c1d2c69 Mon Sep 17 00:00:00 2001 From: XMRig Date: Fri, 13 Jun 2025 21:02:10 +0700 Subject: [PATCH] Detect CPU name and AES instructions on Windows ARM64. --- src/backend/cpu/platform/BasicCpuInfo_arm_win.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/backend/cpu/platform/BasicCpuInfo_arm_win.cpp b/src/backend/cpu/platform/BasicCpuInfo_arm_win.cpp index 623248a1..a11aa94d 100644 --- a/src/backend/cpu/platform/BasicCpuInfo_arm_win.cpp +++ b/src/backend/cpu/platform/BasicCpuInfo_arm_win.cpp @@ -18,10 +18,15 @@ #include "backend/cpu/platform/BasicCpuInfo.h" +#include + void xmrig::BasicCpuInfo::init_arm() { -# if __ARM_FEATURE_CRYPTO - m_flags.set(FLAG_AES, true); // FIXME -# endif + DWORD size = sizeof(m_brand) - 1; + const char *subkey = "HARDWARE\\DESCRIPTION\\System\\CentralProcessor\\0"; + + RegGetValueA(HKEY_LOCAL_MACHINE, subkey, "ProcessorNameString", RRF_RT_REG_SZ, nullptr, m_brand, &size); + + m_flags.set(FLAG_AES, IsProcessorFeaturePresent(PF_ARM_V8_CRYPTO_INSTRUCTIONS_AVAILABLE)); }