x86: use intrinsics::simd for masked truncated saturating stores#2013
Merged
folkertdev merged 1 commit intorust-lang:mainfrom Feb 8, 2026
Merged
Conversation
6f6d55e to
7e375c1
Compare
Contributor
Author
|
We can merge this now, and get back to the avx512 one if it does get backported, or else in 6 months. r? sayantn |
sayantn
reviewed
Feb 5, 2026
crates/core_arch/src/x86/avx512bw.rs
Outdated
| let min = simd_splat(i16::from(i8::MIN)); | ||
|
|
||
| let v = a.as_i16x16(); | ||
| let v = simd_select(simd_lt::<_, i16x16>(v, max), v, max); |
Contributor
Author
There was a problem hiding this comment.
Done and rebased.
8126665 to
058350a
Compare
sayantn
reviewed
Feb 8, 2026
crates/core_arch/src/x86/avx512bw.rs
Outdated
| let max = simd_splat(u16::from(u8::MAX)); | ||
|
|
||
| let v = a.as_u16x8(); | ||
| let v = simd_select(simd_lt::<_, u16x8>(v, max), v, max); |
Contributor
There was a problem hiding this comment.
I think you forgot this one, lgtm otherwise
058350a to
3c618ba
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Unfortunately the
_mm512variant does not optimize due to a logic error (it would when thevlfeature is also enabled). I'll make an LLVM fix but that probably won't be backported.