Sign in to follow this  
flat2

Detecting hyperthreading and 64 bit cpu

Recommended Posts

Hi. Does anyone know how to do a check to discover if a users cpu supports hyperthreading, or if a users cpu is 64 bit? I'm using dxdiag for the other information I need, but this specific information is not available. Any ideas/pointers that don't involve cross-referencing the cpu name with a list greatly appreciated!

Share this post


Link to post
Share on other sites
I dont know if intel has 64 bit cpus, but i know how to detect a AMD 64Bit cpu - untested, but should work.


cpuid(0x80000000,eax,ebx,unused,edx);

// now in eax there is the max. supported extended CPUID level
// we check if theres an extended CPUID level support
if (eax >= 0x80000001)
{
// If we can access the extended CPUID level 0x80000001 we get the
// edx register
if (cpuid(0x80000001,eax,ebx,unused,edx))
{
// Now we can mask some specific cpu extensions

m_Info._AMD64Bit = ((edx & 1<<29) != 0);
}
}

Share this post


Link to post
Share on other sites
The cpuid assembly instruction can be used to get all of that information. The AMD cpuid documentation describes how to detect long mode which is the 64 bit mode that Athlon 64 and Opteron use.

Also, Intel Pentium cpus use the same bit in the extended flags for the same purpose.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this