Skip to content

Fix mistake in #1928 - #1931

Merged
Amanieu merged 2 commits into
rust-lang:masterfrom
sayantn:use-intrinsics
Oct 3, 2025
Merged

Amanieu merged 2 commits into
rust-lang:masterfrom
sayantn:use-intrinsics

Conversation

@sayantn

@sayantn sayantn commented Oct 2, 2025

Copy link
Copy Markdown
Contributor

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

rustbot commented Oct 2, 2025

Copy link
Copy Markdown
Collaborator

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

sayantn commented Oct 2, 2025 •

Copy link
Copy Markdown
Contributor Author

wtf? random segfault??

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

@madhav-madhusoodanan

Copy link
Copy Markdown
Contributor

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

@sayantn

sayantn commented Oct 3, 2025 •

Copy link
Copy Markdown
Contributor Author

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