Skip to content

Rotate by scalar shift counts in in_out_mapper_simd - #4

Merged
RagnarGrootKoerkamp merged 1 commit into
rust-seq:masterfrom
bede:simd128-rotate
Oct 23, 2026
Merged

RagnarGrootKoerkamp merged 1 commit into
rust-seq:masterfrom
bede:simd128-rotate

Conversation

@bede

@bede bede commented Oct 23, 2026

Copy link
Copy Markdown
Contributor

Wasm32 has no per lane shift count instruction so wide makes this scalar on wasm, apparently. Using a constant shift improves perf on wasm a lot but also significantly on arm64, with much reduced instruction count. Identical codegen for me on x86-64-v3. Is a constant shift safe here? Looks like it?

Large perf gain under wasm32, smaller on arm64, identical codegen
on amd64.
@RagnarGrootKoerkamp

Copy link
Copy Markdown
Contributor

Identical codegen for me on x86-64-v3

Ah; IIRC I hoisted it as a constant to (slightly, probably) improve codegen/performance on x86-64 for for, but if shifting by a constant is better everywhere else, let's revert that.

@RagnarGrootKoerkamp
RagnarGrootKoerkamp merged commit 7144873 into rust-seq:master Oct 23, 2026
@bede

bede commented Oct 23, 2026

Copy link
Copy Markdown
Contributor Author

Okok, do check it doesn't regress x86 on your machine. On Zen 3 it doesn't

@RagnarGrootKoerkamp

Copy link
Copy Markdown
Contributor

Seems to be perf-neutral, at least in an isolated seq-hash only benchmark 👍

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.

2 participants