4 ms·
One example is authoring USDT probes. This is done by writing inline assembly comments [1] that the kernel can then trace when instructed to. Also people doing
by yoshuaw 6y ago
One example is authoring USDT probes. This is done by writing inline assembly comments [1] that the kernel can then trace when instructed to.
Also people doing cryptography things occasionally need access to specific ASM instructions for their work. I believe AES has specialized instructions, but there are more cases.
You're not wrong that writing inline ASM is a fairly specialized need, but for those who require it this will come in incredibly useful.
[1]: I still need to try using this, so I might be wrong. I was waiting on inline assembly to be available before trying tho, so quite excited it's now available.
- mkchoi212 6y agoYeah true. But doesn’t Rust provide an equivalent to C’s intrinsic functions like popcount?
- MaulingMonkey 6y agoYes: https://doc.rust-lang.org/core/intrinsics/fn.ctpop.html https://doc.rust-lang.org/core/intrinsics/fn.ctpop.html https://doc.rust-lang.org/std/?search=count_ones https://doc.rust-lang.org/std/?search=count_ones There are still use cases for raw assembly untouched by the optimizer - e.g. constant time cryptography functions designed to thwart timing attacks might desire control over the exact instruction stream. Although, most of that can be tackled with out-of-line assembly - as one must do with x64 MSVC for example.