Repository navigation
Commit 11de642
committed
tools: generate the per-CPU SIMD inventory from LLVM's TableGen source
tools/gen_llvm_inventory.py reads llvm-project's X86.td, AArch64Processors.td
and AArch64Features.td (plus the instruction/predicate .td files) at the
llvmorg-* tag matching `rustc -vV` (22.1.8 under the pinned 1.98.1), resolves
every processor's feature set, and writes:
tools/llvm-inventory/inventory.json full per-CPU feature sets
.claude/knowledge/llvm-cpu-inventory.md the human-readable table
Each row also names the backend the simd.rs cfg ladder selects, and which
instruction implements each crypto-relevant primitive (mul_lo32, variable
u32 shift/permute, IFMA, carry-less multiply, AES round) on that CPU. The
instruction defs and gating predicates are asserted to exist in the .td
files, so an LLVM rename fails the generator instead of leaving a stale row.
Like gen_ternlog_bodies.py, the output is committed and the script is its
provenance; the default mode exits 1 if the committed output is stale.
--verify-rustc compares every CPU (92 x86, 99 aarch64) with rustc's own
`--print cfg -C target-cpu=...` over all features stable rustc exposes,
using rustc's Rust<->LLVM name table parsed from rustc_codegen_llvm at the
pinned release. 191/191 agree. The comparator failed first and drove five
fixes: !listremove, the Architecture64 implied-list position, aarch64
architecture default extensions, the x86 ABI baseline, and tune records
that imply ISA features (TuneOryon -> FullFP16/FP16FML/SPE).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019HnekoM1EidTwQLS3oFVFm1 parent 07c7b4b commit 11de642
4 files changed
Lines changed: 13127 additions & 0 deletions
File tree
- .claude
- knowledge
- tools
- llvm-inventory
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
1 | 16 | | |
2 | 17 | | |
3 | 18 | | |
| |||
0 commit comments