-
-
Notifications
You must be signed in to change notification settings - Fork 16.3k
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-libsRelevant to the library team, which will review and decide on the PR/issue.Relevant to the library team, which will review and decide on the PR/issue.
Description
Activity
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-libsRelevant to the library team, which will review and decide on the PR/issue.Relevant to the library team, which will review and decide on the PR/issue.
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}#154153funnel_shifts(includingconst) #161015Unresolved Questions
rotates)?Footnotes
https://std-dev-guide.rust-lang.org/feature-lifecycle/stabilization.html ↩