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

Eric Christopher via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 9 14:39:30 PDT 2016


echristo 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)) {
----------------
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 :)


http://reviews.llvm.org/D21033





More information about the llvm-commits mailing list