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-10606] Slow type checking of bit-twiddling function #53006

Open
swift-ci opened this issue May 2, 2019 · 1 comment
Open

[SR-10606] Slow type checking of bit-twiddling function #53006

swift-ci opened this issue May 2, 2019 · 1 comment
Labels
compiler The Swift compiler in itself improvement performance type checker Area → compiler: Semantic analysis

Comments

@swift-ci
Copy link
Collaborator

swift-ci commented May 2, 2019

Previous ID SR-10606
Radar None
Original Reporter smartgo (JIRA User)
Type Improvement

Attachment: Download

Additional Detail from JIRA
Votes 0
Component/s Compiler
Labels Improvement, Performance, TypeChecker
Assignee None
Priority Medium

md5: 4478fece73f38e6a73319d8f60b2f0f6

Issue Description:

Slow type checking for the following function:

func extractBits(from word: UInt64, offset: Int, numBits: Int) -> UInt {
    return UInt((word >> offset) & ((1 << numBits) - 1))
}

Xcode 10.2.1, Swift 5.

@belkadan
Copy link
Contributor

belkadan commented May 3, 2019

I'll note that you probably want UInt(bitPattern:), but the report's still important.

@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
compiler The Swift compiler in itself improvement performance type checker Area → compiler: Semantic analysis
Projects
None yet
Development

No branches or pull requests

2 participants