Skip to content

Conversation

sayantn
Copy link
Contributor

@sayantn sayantn commented Oct 2, 2025

The x86 shift intrinsics do an overflowing shift (i.e. 0 in case of shift larger than type size), instead of wrapping shift (i.e. shift amount is taken modulo type size). So, we can't use simd_sh{l,r} here.

Also, simd_funnel_sh{l,r} doc says its UB for the shift amount to be greater than or equal to the type size. So, and them with T::BITS - 1 to ensure soundness (LLVM is clever enough to sees through it, there is no codegen impact)

@rustbot
Copy link
Collaborator

rustbot commented Oct 2, 2025

r? @Amanieu

rustbot has assigned @Amanieu.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@sayantn
Copy link
Contributor Author

sayantn commented Oct 2, 2025

wtf? random segfault??

edit: what has github been doing recently? Seeing so many spurious failures!

@madhav-madhusoodanan
Copy link
Contributor

x86-64_pc-windows-msvc has been giving segfaults randomly, been noticing it too frequently when building - #1894

@sayantn
Copy link
Contributor Author

sayantn commented Oct 3, 2025

Weird, but expected from msvc lol

Edit: this can possibly be something wrong on our side too, one test can be UBing and somehow only msvc is able to raise a segfault

@Amanieu Amanieu added this pull request to the merge queue Oct 3, 2025
Merged via the queue into rust-lang:master with commit 1d61f54 Oct 3, 2025
89 of 126 checks passed
@sayantn sayantn deleted the use-intrinsics branch October 8, 2025 10:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants