The inline assembly RFC has a list of future possibilities for features to add to inline assembly.
I personally feel that these two are the most promising:
I'm particularly interested in bringing
global_asm! up to speed with the new features of
asm!. As a bonus, this would allow us to deprecate the existing naked function support and replace it with a proc macro.
The clobber support feels important since it fills in a usability hole with
asm!: you can't reliably mark all registers as clobbered if the ISA can add new registers in the future.
So, a "clobber all registers that a function call is considered to clobber on the native ABI" clobber?
That seems like a great idea to me.
I personally am excited about having a structured,
match-like construct that can effectively replace
I'm less excited about asm goto since it is likely to be very difficult to implement and it doesn't really enable any new use cases like the two features I mentioned above: you can always emulate asm goto by returning an int and matching on that.
It does enable a specific new use case: static branches that use unconditional jumps and are binary-patchable.
The Linux kernel uses many of those, for performance-sensitive code.
The goal is to completely eliminate the conditional.
When global_asm gets worked on, I hope that we can give it the
link_section attribute (I don't know if that's already possible). This would allow me to pull my project's equivalent for the "crt0.s" entirely inside of rust and then I'd only need to do a little linker script magic, wouldn't need to directly call the assembler (from
build.rs) at all.
There won't be any attributes on
global_asm! itself but you can use assembler directives inside it.
Essentially you would do
In fact, you can already do that today.
The only changes I want to make to
I'm assuming it'll support the
Looking over the entire
asm! RFC again, I don't see anything else that would need changing in