-
-
Notifications
You must be signed in to change notification settings - Fork 14.8k
Tracking Issue for Integer Funnel Shifts #145686
Copy link
Copy link
Open
Labels
C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCCategory: An issue tracking the progress of sth. like the implementation of an RFCT-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.Relevant to the library API team, which will review and decide on the PR/issue.
Metadata
Metadata
Assignees
Labels
C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCCategory: An issue tracking the progress of sth. like the implementation of an RFCT-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.Relevant to the library API team, which will review and decide on the PR/issue.
Type
Fields
Give feedbackNo fields configured for issues without a type.
Feature gate:
#![feature(funnel_shifts)]This is a tracking issue for implementation of funnel shifts on integers.
Funnel shifts are essentially a generalization of bitwise rotations.
a.funnel_shl(b, n)means concatenateaandb(withain the most significant half), creating an integer twice as wide, shifting this to the left byn(taken modulo the bit size ofaandb), shifting in zeros, and finally extract the most significant half of the wide integer as the result.The functions will panic if
n >= T::BITS, and thewrappingversions considernmoduloT::BITS. Theuncheckedvariant doesn't do any checks (as the name suggests), and so is unsafe.a.wrapping_funnel_shl(a, n)is meant to be exactly equivalent toa.rotate_left(n).Public API
Steps / History
A SIMD version of these intrinsics were added in #142078
unchecked_funnel_{shl,shr}#154153Unresolved Questions
rotates)?Footnotes
https://std-dev-guide.rust-lang.org/feature-lifecycle/stabilization.html ↩