[PATCH] D24661: More processors support under AARch64 state for auto detection.
Tim Northover via llvm-commits
llvm-commits at lists.llvm.org
Mon Sep 19 01:39:59 PDT 2016
t.p.northover added inline comments.
================
Comment at: lib/Support/Host.cpp:1122-1128
@@ +1121,9 @@
+ if (Implementer == "0x41") // ARM Ltd.
+ // Look for the CPU part line.
+ for (unsigned I = 0, E = Lines.size(); I != E; ++I)
+ if (Lines[I].startswith("CPU part"))
+ // The CPU part is a 3 digit hexadecimal number with a 0x prefix. The
+ // values correspond to the "Part number" in the CP15/c0 register. The
+ // contents are specified in the various processor manuals.
+ return StringSwitch<const char *>(Lines[I].substr(8).ltrim("\t :"))
+ .Case("0xd03", "cortex-a53")
----------------
I don't like how this scales with the many vendors. We'll end up with this loop duplicated half a dozen times before we're done.
Perhaps convert the strings to numbers and use std::lower_bound on a static array?
https://reviews.llvm.org/D24661
More information about the llvm-commits
mailing list