[llvm] r187350 - Some Intel Penryn CPUs come with SSE4 disabled. Detect them as core 2.

Benjamin Kramer benny.kra at googlemail.com
Mon Jul 29 04:02:08 PDT 2013


Author: d0k
Date: Mon Jul 29 06:02:08 2013
New Revision: 187350

URL: http://llvm.org/viewvc/llvm-project?rev=187350&view=rev
Log:
Some Intel Penryn CPUs come with SSE4 disabled. Detect them as core 2.

PR16721.

Modified:
    llvm/trunk/lib/Support/Host.cpp

Modified: llvm/trunk/lib/Support/Host.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/Host.cpp?rev=187350&r1=187349&r2=187350&view=diff
==============================================================================
--- llvm/trunk/lib/Support/Host.cpp (original)
+++ llvm/trunk/lib/Support/Host.cpp Mon Jul 29 06:02:08 2013
@@ -149,6 +149,7 @@ std::string sys::getHostCPUName() {
   DetectX86FamilyModel(EAX, Family, Model);
 
   bool HasSSE3 = (ECX & 0x1);
+  bool HasSSE41 = (ECX & 0x80000);
   // If CPUID indicates support for XSAVE, XRESTORE and AVX, and XGETBV 
   // indicates that the AVX registers will be saved and restored on context
   // switch, then we have full AVX support.
@@ -244,7 +245,8 @@ std::string sys::getHostCPUName() {
                // 17h. All processors are manufactured using the 45 nm process.
                //
                // 45nm: Penryn , Wolfdale, Yorkfield (XE)
-        return "penryn";
+        // Not all Penryn processors support SSE 4.1 (such as the Pentium brand)
+        return HasSSE41 ? "penryn" : "core2";
 
       case 26: // Intel Core i7 processor and Intel Xeon processor. All
                // processors are manufactured using the 45 nm process.





More information about the llvm-commits mailing list