-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Mathable for 5.1 branch #25302
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
Mathable for 5.1 branch #25302
Conversation
@swift-ci please test |
@swift-ci please test source compatibility |
@swift-ci please test |
@swift-ci please test source compatibility |
Build failed |
Build failed |
@swift-ci please test |
@swift-ci please test source compatibility |
Build failed |
Build failed |
This implements the protocols and static functions proposed in SE-0246, plus some initial test coverage. It also has some rough accompanying cleanup of tgmath. It does not include the globals (on scalars or SIMD types) nor does it deprecate much in tgmath.h.
…tlang#24187) * Add availability information to the new Math function protocols The protocols ElementaryFunctions, RealFunctions, and Real are new in Swift 5.1 and accordingly need to have availability attached to them for platforms that are ABI-stable. The actual implementation hooks (static functions) are unconditionally defined on scalar types and marked @_alwaysEmitIntoClient, so they are available even when targeting older library versions, but the protocols themselves, and anything defined in terms of them (the global functions and the SIMD extensions) is only available when targeting library versions that have the new protocols. * Additionally provide concrete implementations of signGamma for each stdlib-builtin floating-point type. * Remove Real[Functions] protocols pending re-review Temporarily pull these back so we can make minor tweaks to the design and get a re-review on SE.
These functions have never actually been supported in Swift, because Swift does not model the dynamic floating point environment. They may have worked occasionally in the past, but that was only accidental. Deprecate them with an explanatory message.
3900c95
to
063e841
Compare
@swift-ci test |
@swift-ci test source compatibility |
Build failed |
Build failed |
@swift-ci please smoke test |
@swift-ci please test |
@swift-ci please test source compatibility |
Build failed |
Build failed |
Closing this for now – we need to figure out the type checker consequences before these can be added. |
This PR contains the protocols and static functions for SE-0246. It is a cherry pick of #23824, #24187, and #24784 for 5.1 branch.