[LLVMdev] [PATCH] Detect Haswell subarchitecture (i.e. using -march=native)

Tim Northover t.p.northover at gmail.com
Fri Nov 22 07:34:42 PST 2013


> I don’t remember really, but presuming the conclusions of the discussion, seems it is fixed now. It was something 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.




More information about the llvm-dev mailing list