AMD or Intel
-
Is there any reliable location in windows registry that tell if the architecture of the machine is AMD or Intel ? If there is, where is this location ? I know this location:
HKEY_LOCAL_MACHINE\HARDWARE\DESCRIPTION\System\CentralProcessor\0
and
Identifier
key, but my machine is Intel ... and I don't know what would be this value on AMD case ... is this a reliable location ? P.S. Also, I know that I could find here:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment
PROCESSOR_ARCHITECTURE
has AMD64 value, even if I have Intel machine ...1. As someone already mentioned, the CPUID instruction gives you this information. It may be called using compiler intrinsics (#include <intrin.h>) on the Microsoft compiler. See [here](https://en.wikipedia.org/wiki/CPUID) for fuller documentation. Pay attention to the EAX=0 function (Get Manufacturer ID). 2. It appears that the same information may be found in the Registry at HKEY_LOCAL_MACHINE\HARDWARE\DESCRIPTION\System\CentralProcessor\0\VendorIdentifier
Freedom is the freedom to say that two plus two make four. If that is granted, all else follows. -- 6079 Smith W.
-
1. As someone already mentioned, the CPUID instruction gives you this information. It may be called using compiler intrinsics (#include <intrin.h>) on the Microsoft compiler. See [here](https://en.wikipedia.org/wiki/CPUID) for fuller documentation. Pay attention to the EAX=0 function (Get Manufacturer ID). 2. It appears that the same information may be found in the Registry at HKEY_LOCAL_MACHINE\HARDWARE\DESCRIPTION\System\CentralProcessor\0\VendorIdentifier
Freedom is the freedom to say that two plus two make four. If that is granted, all else follows. -- 6079 Smith W.
-
Richard, I am sorry if I was evasive ... Thank you for your patience. I am working on some code which execute some depending of what kind of processor:
BOOL bIsIntel = FALSE;
SYSTEM_INFO si;
GetSystemInfo(&si);
bIsIntel = (si.wProcessorArchitecture == xxx);
if(bIsIntel)
{
// execute some code (I cannot write here what kind of code)
}
else
{
// execute else code
}Furthermore, the code is critical as speed of execution. So, I noticed that
GetSystemInfo
is taking a time, specially on older machines. So, I intend to retrieve from registry if the machine is AMD or Intel. That is all. I am not hiding anything. If I omitting anything, please tell me, and I will write here. P.S. I don't have any AMD machine, or my colleagues ... if I would, I had tested myself.One way would be to run a registry-watching program (e.g., Process Explorer) while this piece of code executes. Then you can see what key(s) are being read.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles
-
One way would be to run a registry-watching program (e.g., Process Explorer) while this piece of code executes. Then you can see what key(s) are being read.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles