Skip to content

Improve shift documentation - #359

Merged
Shnatsel merged 4 commits into
linebender:mainfrom
Shnatsel:improve-shift-docs
Aug 29, 2026
Merged

Improve shift documentation#359
Shnatsel merged 4 commits into
linebender:mainfrom
Shnatsel:improve-shift-docs

Conversation

@Shnatsel

@Shnatsel Shnatsel commented Aug 29, 2026

Copy link
Copy Markdown
Contributor

See also: #163

Doesn't document #280 since that's hopefully temporary

Comment thread fearless_simd_gen/src/mk_simd_trait.rs Outdated
Comment thread fearless_simd_gen/src/ops.rs Outdated

@LaurenzV LaurenzV left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Though it's still an open question whether we should keep the overload (which is what the issue was mainly about I think), any opinion that? I guess people might not discover the doc comment if they just use << directly.

@Shnatsel

Copy link
Copy Markdown
Contributor Author

I genuinely don't know.

std::simd uses << but it's not exactly a model of performance.

SSE4.2 is 15% of x86 in active use, only 8-bit AVX2 will be slow forever, so I guess it's not that bad?

I can't come up with a good name for it either. shift is close to shift_elements and is easy to confuse. The safe_arch crate uses shl_each_* but safe_arch isn't exactly widely used, and even wide built on top doesn't expose those ops at all.

@Shnatsel
Shnatsel added this pull request to the merge queue Aug 29, 2026
Merged via the queue into linebender:main with commit 390b3c2 Aug 29, 2026
22 checks passed
@Shnatsel
Shnatsel deleted the improve-shift-docs branch August 29, 2026 13:16
@Shnatsel

Copy link
Copy Markdown
Contributor Author

We might be able to do better for u8 than outright scalarizing with some clever emulation.

Sadly this optimization work is blocked by multiple compiler bugs:

rust-lang/rust#159831 rust-lang/rust#159464

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