-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
remove platform-intrinsics ABI; make SIMD intrinsics be regular intrinsics #121516
Conversation
rustbot has assigned @Mark-Simulacrum. Use r? to explicitly pick a reviewer |
Some changes occurred to MIR optimizations cc @rust-lang/wg-mir-opt This PR changes Stable MIR cc @oli-obk, @celinval, @spastorino, @ouz-a Some changes occurred to the platform-builtins intrinsics. Make sure the cc @antoyo, @GuillaumeGomez, @bjorn3, @calebzulawski, @programmerjake Some changes occurred in compiler/rustc_codegen_cranelift cc @bjorn3 These commits modify compiler targets. |
// that's how we connect up to LLVM and it's unstable | ||
// anyway, we control all calls to it in libstd. | ||
Abi::Vector { .. } | ||
if abi != SpecAbi::PlatformIntrinsic | ||
&& cx.tcx.sess.target.simd_types_indirect => | ||
if abi != SpecAbi::RustIntrinsic && cx.tcx.sess.target.simd_types_indirect => |
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.
This means we're no longer applying the make-simd-indirect ABI adjustment to our non-SIMD intrinsics. But those aren't actual function calls anyway so I think that's fine?
This comment has been minimized.
This comment has been minimized.
The Miri subtree was changed cc @rust-lang/miri |
This comment has been minimized.
This comment has been minimized.
794721e
to
774c8f9
Compare
This comment has been minimized.
This comment has been minimized.
well, these seem like non-starters. |
🤦 |
774c8f9
to
30f7d92
Compare
This PR changes MIR cc @oli-obk, @RalfJung, @JakobDegen, @davidtwco, @celinval, @vakaras |
30f7d92
to
188c583
Compare
This comment has been minimized.
This comment has been minimized.
This seems fine to me. There was indeed once a plan to stabilize these as a surface interface, but it was during a point in time when it was thought that e.g. add-with-carry would require these. The overwhelming tendency has been against that over time, and making things at least surface as more "normal" library abstractions. SIMD intrinsics do have a distinctive "expected UX" (and by "UX", I mean "they should codegen a certain way"), but so do most rust-intrinsics, which generally serve some codegen purpose and each require at least some special handling. In each case we may address these needs by handling these symbols individually, or by adding an attribute which covers their need. |
LGTM. It's clear the design for SIMD has moved away from these intrinsics towards std::{arch,simd} instead. |
extern "platform-intrinsic" { | ||
fn simd_fmin<T>(x: T, y: T) -> T; | ||
fn simd_fmax<T>(x: T, y: T) -> T; | ||
} | ||
use std::intrinsics::simd::*; |
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.
I'm assuming the reason only some of these got converted to imports in tests is that it's annoying to do with a search and replace?
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, I changed this one since @bjorn3 mentioned it but most of the diff in tests/ui is search-and-replace. it'd be tedious to convert them all and it's orthogonal to what this PR is trying to achieve.
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.
Oh yea, that's fine, just wanted to make sure I wasn't missing anything
7415e4c
to
65d0dbe
Compare
This comment has been minimized.
This comment has been minimized.
65d0dbe
to
f0b4f4c
Compare
@bors r- I guess we're waiting for the submodule sync PR first r=me with that done |
☔ The latest upstream changes (presumably #121549) made this pull request unmergeable. Please resolve the merge conflicts. |
22904b8
to
c1d0e48
Compare
@bors r=oli-obk |
☀️ Test successful - checks-actions |
Finished benchmarking commit (5c786a7): comparison URL. Overall result: ✅ improvements - no action needed@rustbot label: -perf-regression Instruction countThis is a highly reliable metric that was used to determine the overall result at the top of this comment.
Max RSS (memory usage)ResultsThis is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
CyclesThis benchmark run did not return any relevant results for this metric. Binary sizeResultsThis is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
Bootstrap: 651.881s -> 650.825s (-0.16%) |
Upgrades the Rust toolchain to `nightly-2024-03-01`. The Rust compiler PRs that triggered changes in this upgrades are: * rust-lang/rust#121516 * rust-lang/rust#121598 * rust-lang/rust#121489 * rust-lang/rust#121783
… r=oli-obk remove platform-intrinsics ABI; make SIMD intrinsics be regular intrinsics `@Amanieu` `@workingjubilee` I don't think there is any reason these need to be "special"? The [original RFC](https://rust-lang.github.io/rfcs/1199-simd-infrastructure.html) indicated eventually making them stable, but I think that is no longer the plan, so seems to me like we can clean this up a bit. Blocked on rust-lang/stdarch#1538, rust-lang#121542.
@Amanieu @workingjubilee I don't think there is any reason these need to be "special"? The original RFC indicated eventually making them stable, but I think that is no longer the plan, so seems to me like we can clean this up a bit.
Blocked on rust-lang/stdarch#1538, #121542.