This utility analyzes x86_64 ELF binaries to determine which CPU instruction sets (such as SSE, AVX, AVX2, AVX-512, etc.) are used by the binary. It is useful for verifying binary compatibility with target CPUs, especially when deploying to environments with varying hardware capabilities.
- Detects and lists all CPU instruction sets used by a given binary.
- Accepts either a single binary file or a directory.
- If a directory is specified, recursively finds all executable files and reports the union of all instruction sets used.
- Supports Linux (uses Unix file permissions to detect executables).
Clone the repository:
git clone <repository-url>
cd instruction_set_validatorReplace <repository-url> with the actual URL of the repository if not already cloned.
Make sure you have Rust installed (edition 2021 or newer).
Build the project in release mode:
cargo build --releaseThe compiled binary will be located in target/release/instruction-set-validator.
cargo run --release -- <path-to-binary-or-folder>- If you provide a file, it will print the instruction sets used by that binary.
- If you provide a directory, it will recursively scan for executables and print the union of all instruction sets used.
Binary ./my_binary uses the following CPU features:
SSE2
AVX
AVX2
Or for a directory:
All binaries in ./bin/ use the following CPU features (union):
SSE2
AVX
AVX2
AVX512F
- Rust (edition 2021)
- Linux (for directory scanning and executable detection)
MIT