Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Full asm!() support #1204

Open
16 of 21 tasks
bjorn3 opened this issue Nov 20, 2021 · 7 comments
Open
16 of 21 tasks

Full asm!() support #1204

bjorn3 opened this issue Nov 20, 2021 · 7 comments
Labels
C-enhancement Category: An issue proposing an enhancement or a PR with one.

Comments

@bjorn3
Copy link
Member

bjorn3 commented Nov 20, 2021

Tracking issue for stabilizing asm!(): rust-lang/rust#72016 Has been stabilized.

@bjorn3
Copy link
Member Author

bjorn3 commented Aug 12, 2022

Avoid the object file linking hack. It doesn't work on macOS and Windows but is currently necessary as incr comp expects each codegen unit to provide a single object file instead of allowing an extra object file for the compiled assembly.

I managed to do this on the parallel_comp_refactor branch.

@bjorn3
Copy link
Member Author

bjorn3 commented Aug 13, 2022

Merged in #1264.

@bjorn3
Copy link
Member Author

bjorn3 commented Feb 5, 2023

Mostly implemented const and sym operands for both inline and global asm.

@bjorn3
Copy link
Member Author

bjorn3 commented Oct 29, 2023

As of #1403 inline asm is now supported and stable on all targets supported by cg_clif.

@repi
Copy link

repi commented Oct 31, 2023

awesome!

did a quick test with building our codebase with this and did fail on wasmtime-runtime using inline asm:

error: asm! and global_asm! sym operands are not yet supported
   --> /home/repi/.cargo/registry/src/index.crates.io-6f17d22bba15001f/wasmtime-runtime-14.0.2/src/libcalls.rs:156:5
    |
156 |     wasmtime_environ::foreach_builtin_function!(libcall);
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = note: this error originates in the macro `std::arch::global_asm` which comes from the expansion of the macro `wasmtime_environ::foreach_builtin_function` (in Nightly builds, run with -Z macro-backtrace for more info)

related to this note?

For global asm (#1351, but doesn't work when the function is made private to the codegen unit)

or maybe this was not part of the new deployed rustup component?

@bjorn3
Copy link
Member Author

bjorn3 commented Oct 31, 2023

related to this note?

Correct. So far I had only checked wasmtime with unstable features enabled (as is the default for building it using ./y.sh in this repo), but not with unstable features disabled (as is the case for the rustc-codegen-cranelift-preview rustup component) With unstable features enabled the entire wasmtime test suite passes with the exception of a couple of tests that need panic=unwind.

@repi
Copy link

repi commented Oct 31, 2023

ah good to know, and fantastic that the full test suite passes!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-enhancement Category: An issue proposing an enhancement or a PR with one.
Projects
None yet
Development

No branches or pull requests

2 participants