• Advertisement
Sign in to follow this  

Detecting hyperthreading and 64 bit cpu

This topic is 4921 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

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
Advertisement
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
Sign in to follow this  

  • Advertisement