[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 03:23:04 PST 2022
danilaml added a comment.
In D119435#3313720 <https://reviews.llvm.org/D119435#3313720>, @peter.smith wrote:
> I think we need to be careful here. The extensions in that StringSwitch are for Armv8-a and hence applicable to all AArch64 CPUs. Things like `sve` are only available on later processors. We'll need to check to see what the intent was here before adding things. We'll also need to work out how to add tests for these, a good idea would be to see how the existing ones are tested.
>
> Got a bit too much on at the moment to look into this in detail. May have some time next week.
Hm, I'm not sure what you mean by "be careful here". This code just matches the `/proc/cpuinfo/ output to LLVM features. The only "hard" part here is figuring which LLVM feature corresponds to cpuinfo one (that's why I've added only a small subset), but for something like sve/sve2 it's obvious. It also wouldn't be reported on a CPU that doesn't support it.
I've looked at the feature descriptions here: https://github.com/google/cpu_features/blob/main/include/cpuinfo_aarch64.h
I don' think this is tested anywhere (all recent updates to this code were done without adding tests) and if it's possible to test it without some complicated setup (launching llvm in qemu?).
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