【发布时间】:2016-08-05 22:58:49
【问题描述】:
我希望能够通过 Windows 上的 C++ 代码检查 CPU 是否具有可用的 AES-NI。 (MinGW GCC)
我找到了一个用 Visual Studio 用 C# 编写的解决方案。
Test for AES-NI instructions from C#
private static bool IsAESNIPresent()
{
byte[] sn = new byte[16]; // !!! Here were 8 bytes
if (!ExecuteCode(ref sn))
return false;
var ecx = BitConverter.ToUInt32(sn, 8);
return (ecx & (1 << 25)) != 0;
}
有没有一种简单的方法可以用 c++ 做同样的事情? (海合会)
【问题讨论】:
标签: c++ windows gcc mingw aes-ni