rust-lang / rust

Empowering everyone to build reliable and efficient software.
https://www.rust-lang.org
Other
97.79k stars 12.66k forks source link

Tracking Issue for asm_experimental_arch #93335

Open Amanieu opened 2 years ago

Amanieu commented 2 years ago

The feature gate for the issue is #![feature(asm_experimental_arch)].

Summary

This feature tracks asm! and global_asm! support for the following architectures:

Status

Each architecture needs to be reviewed before stabilization:

solomatov commented 2 months ago

Is there any chance that wasm32 assembly support will be stabilized any time soon? Are there any tasks where contributions might speed this up?

AtomicGamer9523 commented 3 weeks ago

Is there any news about AVR ? If not, where and how can I contribute to this?

tgross35 commented 3 weeks ago

The top post mentions the following:

Each architecture needs to be reviewed before stabilization:

  • It must have clobber_abi.
  • It must be possible to clobber every register that is normally clobbered by a function call.
  • Generally review that the exposed register classes make sense.

Anyone can post a stabilization (or status) report answering the above, probably with examples/tests, and that would be a good place for any platform to start. It would also be good to make sure there aren't any open LLVM issues, and mention it there.

The bar for enabling AVR should be pretty low since it is tier 3. I am not a decision maker here but I think any of the tier 3 targets could probably be stabilized with just the report and some real-world usage backing it up.

I'm not sure what exactly would be needed for the tier 2 and above targets, e.g. WASM as requested by @solomatov. Having a better picture of LLVM support is more important. @alexcrichton maybe you have an idea about the WASM picture here, or know who would?

tgross35 commented 3 weeks ago

Cc @ecnelises with the above in case you are interested in moving ppc assembly forward, based on linked issues it seems like there may be some ecosystem use cases.

alexcrichton commented 2 weeks ago

Ah I don't know very much about inline assembly for the wasm target. I believe it works enough to do "some things" but that's the extent of my knowledge, and I wouldn't be prepared to assist with or myself propose stabilization. I also don't know who might know more about the wasm side of things other than "generally LLVM folks doing wasm things may know more", which I realize is unfortunately not very specific or actionable...

tgross35 commented 1 week ago

@AtomicGamer9523 https://github.com/rust-lang/rust/pull/131258 is an example of stabilizing assembly for a target that is behind this feature. You could probably put up a similar PR for AVR.

taiki-e commented 1 week ago

In my understanding, here is the status on each architecture other than s390x (which already has stabilization PR): (Disclaimer: I'm not an expert of any of these. In particular, I know almost nothing about asm for WASM, GPU and BPF.)


FYI: