How to find out the default CPU / Features String for a given triple?

For CPU generic AArch64 target parser will choose armv8-a:
https://github.com/llvm/llvm-project/blob/master/llvm/lib/Support/AArch64TargetParser.cpp#L51

Which will expand to features crypto, floating point and simd.
https://github.com/llvm/llvm-project/blob/master/llvm/include/llvm/Support/AArch64TargetParser.def#L20

So I’d expect a much smaller list of features, and v8.5-a doesn’t sound correct either way for generic. Though your generated file’s entry for “generic” looks okay at first glance:
https://github.com/ziglang/zig/blob/c86589a738e5053a26b2be7d156bcfee1565f00b/lib/std/target/aarch64.zig#L1340

For the triple “aarch64v8.1a-unknown-linux-unknown” you mentioned, clang does use the generic CPU name:
$ ./clang -target aarch64v8.1a-unknown-linux-unknown /tmp/test.c -o /dev/null -###

<…>"-target-cpu" “generic” “-target-feature” “+neon” <…>

There is no similar option to llvm-mc to tell you what features it actually expands to. You could look at the test file for some hints:
https://github.com/llvm/llvm-project/blob/master/llvm/unittests/Support/TargetParserTest.cpp

Though I don’t think it’s exhaustive. If you don’t mind the hassle, adding some logging to llvm-mc might be the way to go if you can find the place with the final list of features.

Thanks,
David Spickett.