[PATCH] D119435: [Support][AArch64] Detect a few more host CPU features on AArch64

Danila Malyutin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 11 06:53:22 PST 2022


danilaml added a comment.

In D119435#3313897 <https://reviews.llvm.org/D119435#3313897>, @peter.smith wrote:

> You'll have to forgive me, I'm coming at this without a lot of context other than what is supported on what Arm architecture, and I didn't have time to reverse engineer it from the code. Thanks for the link, that makes it look like this is related to something like parsing `proc/cpuinfo` and nowhere else.
>
> If that is the case, would it be possible to update the description with a bit more context, including the link you posted to the available values. Many of the reviewers here won't have the linux context so it can help reviewers if they know what they need to check for.
>
> If this is indeed linux related, may I suggest adding nickdesaulniers as a reviewer. He has been involved in clang built linux project and may know more people that can help from the linux kernel side. If we are going to add more features it would be good to think about what we need to support in total and how to get there across one or more patches.
>
> For testing, given that this is something from the environment I think it would require a unit-test if done on the LLVM side. Making one of those would be good, but quite a bit of work, would be good to put a comment in the description for the benefit of other reviewers.

Yes, Arm implementation of this function on linux appears to just parse /proc/cpuinfo (see Line 1681 and below), compared to x86 one that inspects CPUID bits (I assume because something similar is not possible in userspace on Arm? Might be wrong here, but Win implementation goes with the similar route).

The link is just something I've used as a neat human-readable description of what each capability actually means collected in one place as linux kernel doc only refers to the bit it checks (requiring another lookup in Arm reference): https://www.kernel.org/doc/html/latest/arm64/elf_hwcaps.html


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D119435



More information about the llvm-commits mailing list