[PATCH] D21033: Add runtime support for __cpu_model (__builtin_cpu_supports)

Alina Sbirlea via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 15 13:36:28 PDT 2016

asbirlea added inline comments.

Comment at: lib/builtins/cpu_model.c:729
@@ +728,3 @@
+  /* Assume cpuid insn present. Run in level 0 to get vendor id. */
+  if (getX86CpuIDAndInfo(0, &MaxLeaf, &Vendor, &ECX, &EDX)) {
echristo wrote:
> joerg wrote:
> > This assumption will bit us, BTW. We've bug reports for OpenSSL crashing not too long ago on CPUs without CPUID support. At least for i386, presence definitely must be checked first via the corresponding eflags bit.
> Yeesh. You should probably update the code in Host.cpp then :)
I'm not familiar with what flags need to be checked. Could you elaborate or update Host.cpp to resolve this? 


More information about the llvm-commits mailing list