Repository navigation
Add ShiftRightAndReorderDemote2To / ShiftRightAndOrderedDemote2To - #3087
Merged
copybara-service[bot] merged 1 commit intoJun 9, 2026
Conversation
jan-wassenberg
previously approved these changes
Jun 8, 2026
jan-wassenberg
left a comment
Member
There was a problem hiding this comment.
LGTM, just a naming change.
|
|
||
| * `V`,`D`: any `(V, D)` accepted by `ReorderDemote2To`, with `V` and | ||
| `TFromD<D>` integer \ | ||
| <code>Vec<D> **ShiftRightAndReorderDemote2To**<int kShiftAmt>(D, V |
Member
There was a problem hiding this comment.
For consistency with other names, how about we make Reorder and Ordered a prefix, such that this op would be called ReorderShiftRightAndDemote2To?
eyupcanakman
force-pushed
the
feat/shift-right-and-reorder-demote-2to
branch
from
June 9, 2026 14:35
55fc4ce to
10a41de
Compare
Contributor
Author
|
Done. Put Reorder and Ordered first and kept RoundingShiftRight intact, so the rounding pair is ReorderRoundingShiftRightAndDemote2To and OrderedRoundingShiftRightAndDemote2To. Can reorder those two if you'd prefer. |
jan-wassenberg
approved these changes
Jun 9, 2026
jan-wassenberg
left a comment
Member
There was a problem hiding this comment.
LGTM, thanks for making the change.
copybara-service Bot
pushed a commit
that referenced
this pull request
Jun 30, 2026
Reorder and OrderedShiftRightAndDemote2To (and the Rounding variants) reuse the fused vnclip/vnclipu single-vector op, combining the two inputs then one fused narrow, or narrowing each half then combining at the max LMUL. Cross-sign and multi-step cases fall back to ReorderDemote2To(dn, [Rounding]ShiftRight<k>(a), ...). Follow-up to #3087 for #2628; builds on the single-vector RVV override in #3140.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implements
ShiftRightAndReorderDemote2ToandShiftRightAndOrderedDemote2To, with their rounding variants, for #2628. These are theDemote2Tofollow-up to #3056. NEON fuses the shift and the saturating narrow into one instruction (vqshrn/vqshrun/vqrshrn/vqrshrun, using the_highform for the second vector); other targets fall back toReorderDemote2To(d, [Rounding]ShiftRight<k>(a), ...)and the Ordered equivalent.SVE2/RVV/LSX/LASX overrides are left as a TODO per the issue thread.