-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Fix simd_bswap for i8/u8 #114266
Fix simd_bswap for i8/u8 #114266
Conversation
(rustbot has picked a reviewer for you, use r? to override) |
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.
Do we expect people to be calling this intrinsic on i8xN
? This seems like a misuse of the intrinsic, or at least for LLVM, since llvm.bswap.*
says the element needs an even number of bytes.
indeed, what are we actually trying to achieve here? |
This mirrors the scalar bswap intrinsic: rust/compiler/rustc_codegen_llvm/src/intrinsic.rs Lines 251 to 260 in a8be6e0
It would be a bit of a pain to special-case i8/u8 vectors in std::simd. |
or more precisely, what is the current behavior we're trying to avoid? |
I thought LLVM would handle a no-op, but instead the compiler crashes:
|
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 guess r=me if @workingjubilee thinks that this is worthwhile -- the fact that we're special-casing i8 in both the simd and non-simd bswap intrinsics is a tiny bit odd, but I could believe it makes sense with like... macro-generated code or something. Still kinda sus, though.
lmao llvm |
Both scalar integers and std::simd integer vectors are macro-generated 🙃 No users should be seeing these intrinsics. |
To be fair to LLVM, it says very clearly that the intrinsic is only defined when |
yeaaaaah, I guess.
that describes all of std's integer impls, baby! @bors r=compiler-errors |
…er-errors Fix simd_bswap for i8/u8 rust-lang#114156 missed this test case☹️ cc `@workingjubilee`
The failed test is tests/ui/lint/must_not_suspend/handled.rs, I don't see any way this PR could affect that. Maybe spurious? |
...hm yeah you're right, I misread the logs at-a-glance. Probably is spurious then. @bors r=compiler-errors |
☀️ Test successful - checks-actions |
Finished benchmarking commit (3be07c1): comparison URL. Overall result: ❌ regressions - ACTION NEEDEDNext Steps: If you can justify the regressions found in this perf run, please indicate this with @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.
CyclesResultsThis 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.
Binary sizeThis benchmark run did not return any relevant results for this metric. Bootstrap: 652.418s -> 653.862s (0.22%) |
One possible, marginal regression, nothing to worry about. @rustbot label: +perf-regression-triaged |
#114156 missed this test case☹️
cc @workingjubilee