Skip to content

Use SIMD intrinsics whereever possible - #1928

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

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

Conversation

@sayantn

@sayantn sayantn commented Oct 1, 2025 •

Copy link
Copy Markdown
Contributor

Also, remove uses of some deprecated LLVM intrinsics

FIXME: _mm256_test{z,c}_{ps,pd} doesn't optimize well in the testsuite for some reason, it works on godbolt 😕

@rustbot

rustbot commented Oct 1, 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 1, 2025

Copy link
Copy Markdown
Contributor Author

macos-15 runners are failing for some reason, is this a GH issue?

@Amanieu

Amanieu commented Oct 1, 2025

Copy link
Copy Markdown
Member

I restarted the runners and it seems to be working fine now. Do you want this merged now or try to find a solution for _mm256_test{z,c}_{ps,pd}?

@sayantn

sayantn commented Oct 1, 2025

Copy link
Copy Markdown
Contributor Author

let's merge this for now. That can be another PR later (the testnzc intrinsics will also need some attention)

@Amanieu
Amanieu added this pull request to the merge queue Oct 2, 2025
Merged via the queue into rust-lang:master with commit 6dfd5de Oct 2, 2025
240 of 252 checks passed
@sayantn

sayantn commented Oct 2, 2025 •

Copy link
Copy Markdown
Contributor Author

Just discovered that the s{l, r}l{,v} intrinsics are wrongly implemented here, they should zero on shift amount overflow (like unbounded_shl), but do wrap on overflow (like wrapping_shl). I will send a pr to revert those

Edit: weirdly, the rotate instructions do wrap on overflow

@RalfJung

RalfJung commented Nov 2, 2025

Copy link
Copy Markdown
Member

Nice, this means we can remove the implementation of vperm2 from Miri. :)
Are there any similar recent patches / more implementations we can remove now?

@sayantn

sayantn commented Nov 2, 2025

Copy link
Copy Markdown
Contributor Author

There should be quite a few, we have removed uses of many llvm intrinsics recently

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