Any way to get the correct amount of physical cores?
I had tried using the following code, but for my i5 3570K it returns too many for logical cores 16 and physical cores 8. Im not sure if this is some issue with hyperthreading or some other issue i havent identified. Im assuming if it is hyperthreading, then logical should be 8 and physical should be 4.
mov eax, 1
xor ebx, ebx
xor ecx, ecx
xor edx, edx
cpuid
and ebx, 000FF0000h
shr ebx, 16
mov LogicalCores, ebx
mov eax, 4
xor ebx, ebx
xor ecx, ecx
xor edx, edx
cpuid
and eax, 0FC000000h; 11111100000000000000000000000000b ; bits 26-31
shr eax, 26
inc eax
mov PhysicalCores, eax