Detect CPU name and AES instructions on Windows ARM64.

This commit is contained in:
XMRig 2025-06-13 21:02:10 +07:00
parent 57a4998ae2
commit 9e7cf69ac3
No known key found for this signature in database
GPG key ID: 446A53638BE94409

View file

@ -18,10 +18,15 @@
#include "backend/cpu/platform/BasicCpuInfo.h"
#include <Windows.h>
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));
}