Displaying 3 results from an estimated 3 matches for "getcpuidandinfoex".
2013 Nov 22
2
[LLVMdev] [PATCH] Detect Haswell subarchitecture (i.e. using -march=native)
>> + bool HasAVX2 = HasAVX && !GetX86CpuIDAndInfo(0x7, &EAX, &EBX, &ECX, &EDX) &&
>> + (EBX & 0x20);
>
> I don't think this guarantees %ecx is 0, does it? Wasn't that the
> entire reason the original code went wrong?
I don’t remember really, but presuming the conclusions of the discussion, seems it is fixed now. It
2013 Nov 22
0
[LLVMdev] [PATCH] Detect Haswell subarchitecture (i.e. using -march=native)
...mething about registers when using inline assembly. Anyway this works just fine on all my Haswell machines.
I think that's more coincidence than anything else (something
perturbed in your host compiler's backend). If you look at
lib/Target/X86/MCTargetDesc/X86MCTargetDesc.cpp there's a
GetCpuIDAndInfoEx function which specifically sets %ecx to a valid
value before executing "cpuid".
The code in Host.cpp needs to do something similar.
Cheers.
Tim.
2013 Nov 23
2
[LLVMdev] [PATCH] Detect Haswell subarchitecture (i.e. using -march=native)
I agree with Tim, you need to implement a GetCpuIDAndInfoEx function in
Host.cpp and pass the correct value to ecx. Also you need to verify that 7
is a valid leaf because an invalid leaf is defined to return the highest
supported leaf on that processor. So if a processor supports say leaf 6 and
not leaf 7, then an access leaf 7 will return the data from lea...