-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Implement init?<T:BinaryInteger>(exactly:T) for the stdlib FP types #32632
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
Conversation
…h stdlib FP type. Previously these always went through the FloatingPoint-provided default implementation, which is not particularly efficient. Also try removing inlinable from the generic _convert hooks, since we probably never want to actually inline them.
Not able to test this locally at present, so we have to cross our fingers. |
@swift-ci please test |
@swift-ci please benchmark |
Performance: -O
Code size: -OPerformance: -Osize
Code size: -OsizePerformance: -Onone
Code size: -swiftlibs
How to read the dataThe tables contain differences in performance which are larger than 8% and differences in code size which are larger than 1%.If you see any unexpected regressions, you should consider fixing the Noise: Sometimes the performance results (not code size!) contain false Hardware Overview
|
…h stdlib FP type. (swiftlang#32632) Previously these always went through the FloatingPoint-provided default implementation, which is not particularly efficient. Also try removing inlinable from the generic _convert hooks, since we probably never want to actually inline them.
* Provide an implementation of init?<T:BinaryInteger>(exactly:T) on each stdlib FP type. (#32632) Previously these always went through the FloatingPoint-provided default implementation, which is not particularly efficient. Also try removing inlinable from the generic _convert hooks, since we probably never want to actually inline them. * Add explicit init from BinaryInteger to CGFloat The override was previously missing, which meant that we fell back on the generic implementation; we should simply forward this to the NativeType implementation instead.
Previously these always went through the FloatingPoint-provided default implementation, which is not particularly efficient. Also try removing inlinable from the generic _convert hooks, since we probably never want to actually inline them (rdar://problem/64544503).
Follow-up on #32617