-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
wasm: Make simd types passed via indirection again #85966
Conversation
(rust-highfive has picked a reviewer for you, use r? to override) |
It's worth pointing out that this may have actually always been a bug and when I first implemented this I just didn't realize the impact of what I was doing. In any case the test added here fails on wasm today with a linking error, but I dont believe that it should. It's possible perhaps to fix this in the codegen layer of LLVM by automatically enabling the |
This comment has been minimized.
This comment has been minimized.
102162b
to
9833fc0
Compare
This comment has been minimized.
This comment has been minimized.
This commit updates wasm target specs to use `simd_types_indirect: true` again. Long ago this was added since wasm simd types were always translated to `v128` under-the-hood in LLVM, meaning that it didn't matter whether that target feature was enabled or not. Now, however, `v128` is conditionally used in codegen depending on target features enabled, meaning that it's possible to get linker errors about different signatures in code that correctly uses simd types. The fix is the same as for all other platforms, which is to pass the type indirectly.
9833fc0
to
55769a5
Compare
I discussed this extensively with Alex yesterday off-sides to clarify my understanding of the situation, but today I realized that constituted a review of the code and really, of the situation as-is, which this PR essentially is a confirmation of. Some comments to summarize that (chat|review):
@bors r+ |
📌 Commit 55769a5 has been approved by |
Rollup of 10 pull requests Successful merges: - rust-lang#83653 (Remove unused code from `rustc_data_structures::sync`) - rust-lang#84466 (rustdoc: Remove `PrimitiveType::{to_url_str, as_str}`) - rust-lang#84880 (Make match in `register_res` easier to read) - rust-lang#84942 (rustdoc: link to stable/beta docs consistently in documentation) - rust-lang#85853 (Warn against boxed DST in `improper_ctypes_definitions` lint) - rust-lang#85939 (Fix suggestion for removing &mut from &mut macro!().) - rust-lang#85966 (wasm: Make simd types passed via indirection again) - rust-lang#85979 (don't suggest unsized indirection in where-clauses) - rust-lang#85983 (Update to semver 1.0.3) - rust-lang#85988 (Note that `ninja = false` goes under `[llvm]`) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
This commit updates wasm target specs to use
simd_types_indirect: true
again. Long ago this was added since wasm simd types were always
translated to
v128
under-the-hood in LLVM, meaning that it didn'tmatter whether that target feature was enabled or not. Now, however,
v128
is conditionally used in codegen depending on target featuresenabled, meaning that it's possible to get linker errors about different
signatures in code that correctly uses simd types. The fix is the same
as for all other platforms, which is to pass the type indirectly.