cargo-show-asm 0.1.20 - new and improved all over the place :)

110 points manpacket

Ever wondered what kind of asm code rustc generates behind your back? There is godbolt but copying all the dependencies from a typical project is too much work. There is cargo rustc -- --emit asm but good luck finding exact piece of code you want to look at. And there's cargo-show-asm :)

Start with

cargo install cargo-show-asm

Pick a function from your project (you might need to specify a package for workspace projects or a binary/example/library)

cargo asm --lib

Pick something you want to see the asm code for from the list, you can type part of the name to ask it to filter things a bit:

cargo asm --lib "mini_std::math::lerp"

And get the results right in your terminal.

mini_std::math::lerp:
.Lfunc_begin25:
        .cfi_startproc
        movsd xmm3, qword ptr [rip + .LCPI25_0]
.Ltmp646:
        subsd xmm3, xmm2
        mulsd xmm3, xmm0
        mulsd xmm1, xmm2
.Ltmp647:
        addsd xmm3, xmm1
        movapd xmm0, xmm3
.Ltmp648:
        ret
.Ltmp649:
.Lfunc_end25:
        .size   mini_std::math::lerp, .Lfunc_end25-mini_std::math::lerp
        .cfi_endproc

Should support Intel and AT&T asm syntax, annotate asm with Rust code, dumping LLVM and MIR code, support all sorts of crosscompilation, should work on Linux, Windows and MacOS at least.

Get yours today :) https://crates.io/crates/cargo-show-asm https://github.com/pacak/cargo-show-asm