Neat, `cfg_asm` made it to stable.
I implemented this somewhere last year. It's a niche feature, but useful when writing assembly with some subtle target-specific variations. The cortex-m crate ran into this and currently uses a hack with a custom macro that duplicates the full assembly call on each condition.
![exerpt from the rust 1.93.0 release blog post:
cfg attributes on asm! lines
Previously, if individual parts of a section of inline assembly needed to be cfg'd, the full asm! block would need to be repeated with and without that section. In 1.93, cfg can now be applied to individual statements within the asm! block.
```rust
asm!( // or global_asm! or naked_asm!
"nop",
#[cfg(target_feature = "sse2")]
"nop",
// ...
#[cfg(target_feature = "sse2")]
a = const 123, // only used on sse2
);
```](https://media.hachyderm.io/media_attachments/files/115/939/626/759/733/147/original/c0ce66a8a1acbf30.png)