Skip to content

Implement rotate_elements_{left,right} on masks - #360

Merged
Shnatsel merged 2 commits into
linebender:mainfrom
Shnatsel:mask-movement-methods
Sep 3, 2026
Merged

Implement rotate_elements_{left,right} on masks#360
Shnatsel merged 2 commits into
linebender:mainfrom
Shnatsel:mask-movement-methods

Conversation

@Shnatsel

Copy link
Copy Markdown
Contributor

Pretty straightforward: forward either to the vector rotate_elements_* for vector-backed masks, or to rotate_* on std scalars for AVX-512.

Since lowerings into slide() caused issues with compile time before, I measured how this impacts the build, and it's within measurement noise. I've experimented with implementing it as a default trait without re-emitting basically the same body into individual implementation methods, but that created more IR for LLVM dead code elimination to chew through, and slowed down compilation of code that actually uses and instantiates this without meaningfully changing the frontend costs. So I believe this is the best way to implement this.

@Shnatsel Shnatsel mentioned this pull request Aug 29, 2026
22 tasks
@Shnatsel
Shnatsel force-pushed the mask-movement-methods branch from bec1909 to 1d89c39 Compare August 30, 2026 09:56

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.

Optional but I wonder if there should be 1 test for each with a mask with more than 1 bit set at a time?

@Shnatsel
Shnatsel enabled auto-merge September 3, 2026 18:30
@Shnatsel
Shnatsel added this pull request to the merge queue Sep 3, 2026
Merged via the queue into linebender:main with commit d802338 Sep 3, 2026
22 checks passed
@Shnatsel
Shnatsel deleted the mask-movement-methods branch September 3, 2026 18:39
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