|
před 1 rokem | |
---|---|---|
.. | ||
README.md | před 1 rokem | |
build_featuregen.sh | před 1 rokem | |
featuregen.cpp | před 1 rokem | |
featuregen.py | před 1 rokem |
This directory contains a python and CPP script that generates the needed information for features regarding microarchitecture and target features of the compiler.
It is not pretty! But LLVM has no way to query this information with their C API.
It generates these globals (intended for src/build_settings_microarch.cpp
:
target_microarch_list
: an array of strings indexed by the architecture, each string is a comma-seperated list of microarchitectures available on that architecturetarget_features_list
: an array of strings indexed by the architecture, each string is a comma-seperated list of target features available on that architecturetarget_microarch_counts
: an array of ints indexed by the architecture, each int represents the amount of microarchitectures available on that target, intended for easier iteration of the next globalmicroarch_features_list
: an array of a tuple like struct where the first string is a microarchitecture and the second is a comma-seperated list of all features that are enabled by default for itIn order to get the default features for a microarchitecture there is a small CPP program that takes a target triple and microarchitecture and spits out the default features, this is then parsed by the python script.
This should be ran each time we update LLVM to stay in sync.
If there are minor differences (like the Odin user using LLVM 14 and this table being generated on LLVM 17) it does not impact much at all, the only thing it will do is make LLVM print a message that the feature is ignored (if it was added between 14 and 17 in this case).
./build_featuregen.sh
python3 featuregen.py
src/build_settings.cpp