Skip to content

Add SVE-accelerated Vec::retain_mut for aarch64 - #161034

Open
ywxt wants to merge 1 commit into
rust-lang:mainfrom
ywxt:retian-sve
Open

Add SVE-accelerated Vec::retain_mut for aarch64#161034
ywxt wants to merge 1 commit into
rust-lang:mainfrom
ywxt:retian-sve

Conversation

@ywxt

@ywxt ywxt commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

The PR adds SVE support for specified width types(8, 16, 32 and 64 bits) in Vec::retain_mut. Due to pointer provenance being stripped by intrinsics) here it has to use inline asm instead of sve intrinsics.

1. retain half (ns/iter)

Elements u32 SVE u32 scalar Change u64 SVE u64 scalar Change
4 10.32 12.36 / 10.25 11.83 /
8 12.93 15.08 / 13.40 14.74 /
16 18.66 19.46 / 19.08 18.89 /
32 31.84 31.12 / 31.78 31.26 /
64 32.99 59.17 -44.2% 59.86 59.44 /
1,000 471.51 811.71 -41.9% 820.98 827.16 /
10,000 4,660 7,990 -41.7% 5,836 8,242 -29.2%
100,000 46,414 79,608 -41.7% 57,561 82,861 -30.5%

2. retain whole

Elements u32 SVE u32 scalar Change u64 SVE u64 scalar Change
4 3.46 3.11 / 3.45 3.45 /
8 4.90 4.49 / 4.83 6.22 /
16 8.44 8.14 / 8.44 11.74 /
32 15.83 15.51 / 15.83 22.79 /
64 21.57 30.66 -29.6% 30.72 44.89 /
1,000 358.53 483.33 -25.8% 469.18 696.43 /
10,000 3,127 4,745 -34.1% 5,082 6,912 -26.5%
100,000 32,509 49,501 -34.3% 49,484 79,749 -38.0%

r? @Amanieu

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Aug 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-libs Relevant to the library team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants