Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SR-11505] Add rotate operations to the FixedWidthIntegers #53906

Open
Lukasa opened this issue Sep 22, 2019 · 0 comments
Open

[SR-11505] Add rotate operations to the FixedWidthIntegers #53906

Lukasa opened this issue Sep 22, 2019 · 0 comments
Labels
improvement standard library Area: Standard library umbrella

Comments

@Lukasa
Copy link
Contributor

Lukasa commented Sep 22, 2019

Previous ID SR-11505
Radar None
Original Reporter @Lukasa
Type Improvement
Additional Detail from JIRA
Votes 0
Component/s Standard Library
Labels Improvement
Assignee None
Priority Medium

md5: 3b5020922338e97047de7ca9dc03baab

Issue Description:

In some low-level mathematical operations (e.g. cryptographic applications) it is useful to have a bitwise “rotate” operation. It would be nice if Swift would expose this operation directly, especially as it would be straightforward for Swift to use [the LLVM intrinsics| https://reviews.llvm.org/D50924] that enable optimised codegen on platforms that have appropriate instructions for this task.

As a hypothetical enhancement to this project the rotate operation could even be available as a protocol hook on FixedWidthInteger, with a default implementation available in terms of left shift, right shift, and bitwise or. This would likely be unnecessary, and rarely useful, but not entirely useless.

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
improvement standard library Area: Standard library umbrella
Projects
None yet
Development

No branches or pull requests

1 participant