-
Notifications
You must be signed in to change notification settings - Fork 59
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
Use signext
and zeroext
argument attributes.
#88
Comments
alexcrichton
referenced
this issue
in alexcrichton/rust
Mar 12, 2018
It actually was already using the `cabi_asmjs` module but that was by accident, so route the new `wasm32-unknown-unknown` target to a new `cabi_wasm32` module. The first entries in this module are to use `signext` and `zeroext` for types that are under 32 bytes in size Closes rust-lang-nursery/rust-wasm#88
Oh nice catch! I've submitted rust-lang/rust#48959 to cover this |
kennytm
referenced
this issue
in kennytm/rust
Mar 15, 2018
rustc: Start a custom cabi module for wasm32 It actually was already using the `cabi_asmjs` module but that was by accident, so route the new `wasm32-unknown-unknown` target to a new `cabi_wasm32` module. The first entries in this module are to use `signext` and `zeroext` for types that are under 32 bytes in size Closes rust-lang-nursery/rust-wasm#88
Fixed in rust-lang/rust#48959 |
This was referenced Jun 21, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Rust should use LLVM's
signext
andzeroext
argument attributes for bool/i8/i16/u8/u16 types when targetting WebAssembly, for consistency with LLVM IR generated by clang, and to allow these values to be automatically interpreted by JS.For example, on this Rust code:
Running
rustc test.rs --emit llvm-ir --crate-type=cdylib --target=wasm32-unknown-unknown
produces:It should have attributes like this:
The text was updated successfully, but these errors were encountered: