-
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
simd_shuffle: require index argument to be a vector #130268
Conversation
rustbot has assigned @petrochenkov. Use |
Some changes occurred in compiler/rustc_codegen_cranelift cc @bjorn3 Portable SIMD is developed in its own repository. If possible, consider making this change to rust-lang/portable-simd instead. cc @calebzulawski, @programmerjake The Miri subtree was changed cc @rust-lang/miri Some changes occurred to the intrinsics. Make sure the CTFE / Miri interpreter cc @rust-lang/miri Some changes occurred in compiler/rustc_codegen_gcc Some changes occurred to the platform-builtins intrinsics. Make sure the cc @antoyo, @GuillaumeGomez, @bjorn3, @calebzulawski, @programmerjake |
This comment has been minimized.
This comment has been minimized.
8a3d96d
to
eba25b4
Compare
This comment has been minimized.
This comment has been minimized.
eba25b4
to
40b0292
Compare
40b0292
to
45872e8
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
very cool work
mask_elements | ||
}; | ||
let mask_num_units = mask_elements.len(); | ||
let vector_type = mask.get_type().dyncast_vector().unwrap(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
expect here?
// third argument must be constant. This is | ||
// checked by the type-checker. | ||
if i == 2 && intrinsic.name == sym::simd_shuffle { | ||
// FIXME: the simd_shuffle argument is actually an array, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❤️ glad to see this hack go away lol
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah me too :D
i left a nit but whatever, probably not worth fixing @bors r+ |
45872e8
to
5287fa3
Compare
Too late, nit is fixed now. ;) @bors r=compiler-errors |
5287fa3
to
7a1b5e5
Compare
And another conflict. @bors r=compiler-errors |
…r=compiler-errors simd_shuffle: require index argument to be a vector Remove some codegen hacks by forcing the SIMD shuffle `index` argument to be a vector, which means (thanks to rust-lang#128537) that it will automatically be passed as an immediate in LLVM. The only special-casing we still have is for the extra sanity-checks we add that ensure that the indices are all in-bounds. (And the GCC backend needs to do a bunch of work since the Rust intrinsic is modeled after what LLVM expects, which seems to be quite different from what GCC expects.) Fixes rust-lang#128738, see that issue for more context.
Rollup of 3 pull requests Successful merges: - rust-lang#130053 (fix doc comments for Peekable::next_if(_eq)) - rust-lang#130268 (simd_shuffle: require index argument to be a vector) - rust-lang#130334 (Fix `SDKROOT` ignore on macOS) r? `@ghost` `@rustbot` modify labels: rollup
…compiler-errors simd_shuffle: require index argument to be a vector Remove some codegen hacks by forcing the SIMD shuffle `index` argument to be a vector, which means (thanks to rust-lang#128537) that it will automatically be passed as an immediate in LLVM. The only special-casing we still have is for the extra sanity-checks we add that ensure that the indices are all in-bounds. (And the GCC backend needs to do a bunch of work since the Rust intrinsic is modeled after what LLVM expects, which seems to be quite different from what GCC expects.) Fixes rust-lang#128738, see that issue for more context.
This comment has been minimized.
This comment has been minimized.
💔 Test failed - checks-actions |
7a1b5e5
to
f7bb2dd
Compare
Seems like I have to make sure to not emit an intrinsic when the index is OOB. Makes sense. The last patch should fix that. @compiler-errors does that seem right to you? |
f7bb2dd
to
60ee1b7
Compare
Yeah, makes sense. @bors r+ |
Rollup of 6 pull requests Successful merges: - rust-lang#130017 (coverage: Extract `executor::block_on` from several async coverage tests) - rust-lang#130268 (simd_shuffle: require index argument to be a vector) - rust-lang#130290 (Stabilize entry_insert) - rust-lang#130294 (Lifetime cleanups) - rust-lang#130343 (docs: Enable required feature for 'closure_returning_async_block' lint) - rust-lang#130349 (Fix `Parser::break_up_float`'s right span) r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of rust-lang#130268 - RalfJung:simd-shuffle-idx-vector, r=compiler-errors simd_shuffle: require index argument to be a vector Remove some codegen hacks by forcing the SIMD shuffle `index` argument to be a vector, which means (thanks to rust-lang#128537) that it will automatically be passed as an immediate in LLVM. The only special-casing we still have is for the extra sanity-checks we add that ensure that the indices are all in-bounds. (And the GCC backend needs to do a bunch of work since the Rust intrinsic is modeled after what LLVM expects, which seems to be quite different from what GCC expects.) Fixes rust-lang#128738, see that issue for more context.
Remove some codegen hacks by forcing the SIMD shuffle
index
argument to be a vector, which means (thanks to #128537) that it will automatically be passed as an immediate in LLVM. The only special-casing we still have is for the extra sanity-checks we add that ensure that the indices are all in-bounds. (And the GCC backend needs to do a bunch of work since the Rust intrinsic is modeled after what LLVM expects, which seems to be quite different from what GCC expects.)Fixes #128738, see that issue for more context.