cargo-asm
Inspects generated assembly for Rust functions using cargo-asm. Use when analyzing low-level codegen, verifying SIMD/vectorization, or debugging performance at the instruction level.
Installation
Follow the repository instructions for this skill and your agent. Review the files and dependencies before adding it to your workflow.
View source ↗GuidesSkill instructions
cargo-asm
Displays the generated assembly for specific Rust functions.
Usage
cargo asm [OPTIONS] <PATH>
Where <PATH> is a function path like crate::module::function or a partial match.
Common Workflows
View assembly for a function
cargo asm my_crate::hot_loop
List all available symbols
cargo asm --lib
Show with source interleaved
cargo asm --rust my_crate::function
Check specific target features
RUSTFLAGS="-C target-cpu=native" cargo asm my_crate::simd_fn
Key Options
-
--rust- Interleave Rust source with assembly -
--lib- Analyze library target (vs binary) -
--bin <NAME>- Analyze specific binary -
--release- Use release profile (default) -
--dev- Use dev profile -
--target <TRIPLE>- Cross-compile target
Tips
- Always use
--release(or it's on by default) to see optimized output - Use
--rustto understand which source lines map to which instructions - Look for
vmov,vpadd, etc. to verify SIMD vectorization - Missing function? Try
--libor check if it was inlined
Examples
Read the usage examples in the source repository.
View source ↗Source history
- Indexed on
- 2026-01-20
- Index updated
- 2026-03-03
- Branch
- main
Index and sync dates describe this directory. View the source repository for code history.
GitHub ↗chat Comments (0)
Sign in to join the discussion and leave a comment.
No comments yet. Be the first to share your thoughts!