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

Joerg Sonnenberger via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 9 08:20:56 PDT 2016


joerg 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)) {
----------------
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.


http://reviews.llvm.org/D21033





More information about the llvm-commits mailing list