Lokasi ngalangkungan proxy:   [ UP ]  
[Ngawartoskeun bug]   [Panyetelan cookie]                
Skip to content

Add ShiftRightAndReorderDemote2To / ShiftRightAndOrderedDemote2To - #3087

Merged
copybara-service[bot] merged 1 commit into
google:masterfrom
eyupcanakman:feat/shift-right-and-reorder-demote-2to
Jun 9, 2026
Merged

copybara-service[bot] merged 1 commit into
google:masterfrom
eyupcanakman:feat/shift-right-and-reorder-demote-2to

Conversation

@eyupcanakman

Copy link
Copy Markdown
Contributor

Implements ShiftRightAndReorderDemote2To and ShiftRightAndOrderedDemote2To, with their rounding variants, for #2628. These are the Demote2To follow-up to #3056. NEON fuses the shift and the saturating narrow into one instruction (vqshrn/vqshrun/vqrshrn/vqrshrun, using the _high form for the second vector); other targets fall back to ReorderDemote2To(d, [Rounding]ShiftRight<k>(a), ...) and the Ordered equivalent.

SVE2/RVV/LSX/LASX overrides are left as a TODO per the issue thread.

jan-wassenberg
jan-wassenberg previously approved these changes Jun 8, 2026

@jan-wassenberg jan-wassenberg left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM, just a naming change.

Comment thread g3doc/quick_reference.md Outdated

* `V`,`D`: any `(V, D)` accepted by `ReorderDemote2To`, with `V` and
`TFromD<D>` integer \
<code>Vec&lt;D&gt; **ShiftRightAndReorderDemote2To**&lt;int kShiftAmt&gt;(D, V

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

For consistency with other names, how about we make Reorder and Ordered a prefix, such that this op would be called ReorderShiftRightAndDemote2To?

@eyupcanakman
eyupcanakman force-pushed the feat/shift-right-and-reorder-demote-2to branch from 55fc4ce to 10a41de Compare June 9, 2026 14:35
@eyupcanakman

Copy link
Copy Markdown
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 jan-wassenberg left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM, thanks for making the change.

@copybara-service
copybara-service Bot merged commit f754233 into google:master Jun 9, 2026
15 of 44 checks passed
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants