Skip to content

Tracking Issue for Integer Funnel Shifts #145686

@sayantn

Description

@sayantn

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 concatenate a and b (with a in the most significant half), creating an integer twice as wide, shifting this to the left by n (taken modulo the bit size of a and b), shifting in zeros, and finally extract the most significant half of the wide integer as the result.

a.funnel_shl(a, n) is meant to be exactly equivalent to a.rotate_left(n).

Public API

  • funnel_shl and funnel_shr on the primitive integer types u8, u16, u32, u64 and u128

Steps / History

A SIMD version of these intrinsics were added in #142078

  • Implementation
  • Final comment period (FCP)1
  • Stabilization PR

Unresolved Questions

  • Should we also provide these functions on signed integer types (akin to rotates`?

Footnotes

  1. https://std-dev-guide.rust-lang.org/feature-lifecycle/stabilization.html

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCS-tracking-unimplementedStatus: The feature has not been implemented.T-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions