[PATCH] D117111: [AArch64] Add native CPU detection for Ampere1

Dave Green via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue May 3 08:10:22 PDT 2022


This revision was automatically updated to reflect the committed changes.
Closed by commit rG7e02bc523775: [AArch64] Add native CPU detection for Ampere1 (authored by philipp.tomsich, committed by dmgreen).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D117111/new/

https://reviews.llvm.org/D117111

Files:
  llvm/lib/Support/Host.cpp
  llvm/unittests/Support/Host.cpp


Index: llvm/unittests/Support/Host.cpp
===================================================================
--- llvm/unittests/Support/Host.cpp
+++ llvm/unittests/Support/Host.cpp
@@ -133,6 +133,10 @@
                                               "CPU part        : 0xc01"),
             "saphira");
 
+  EXPECT_EQ(sys::detail::getHostCPUNameForARM("CPU implementer : 0xc0\n"
+                                              "CPU part        : 0xac3"),
+            "ampere1");
+
   // MSM8992/4 weirdness
   StringRef MSM8992ProcCpuInfo = R"(
 Processor       : AArch64 Processor rev 3 (aarch64)
Index: llvm/lib/Support/Host.cpp
===================================================================
--- llvm/lib/Support/Host.cpp
+++ llvm/lib/Support/Host.cpp
@@ -296,6 +296,12 @@
     }
   }
 
+  if (Implementer == "0xc0") { // Ampere Computing
+    return StringSwitch<const char *>(Part)
+        .Case("0xac3", "ampere1")
+        .Default("generic");
+  }
+
   return "generic";
 }
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D117111.426714.patch
Type: text/x-patch
Size: 986 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220503/a6c5d6e2/attachment.bin>


More information about the llvm-commits mailing list