Skip to content

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

Closed

Conversation

stephentyrone
Copy link
Contributor

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.

@stephentyrone
Copy link
Contributor Author

@swift-ci please test

@stephentyrone
Copy link
Contributor Author

@swift-ci please test source compatibility

@stephentyrone
Copy link
Contributor Author

@swift-ci please test

@stephentyrone
Copy link
Contributor Author

@swift-ci please test source compatibility

@swift-ci
Copy link
Contributor

swift-ci commented Jun 7, 2019

Build failed
Swift Test Linux Platform
Git Sha - 80ee75108304de229893918840e25732be99723c

@swift-ci
Copy link
Contributor

swift-ci commented Jun 7, 2019

Build failed
Swift Test OS X Platform
Git Sha - 80ee75108304de229893918840e25732be99723c

@stephentyrone
Copy link
Contributor Author

@swift-ci please test

@stephentyrone
Copy link
Contributor Author

@swift-ci please test source compatibility

@swift-ci
Copy link
Contributor

swift-ci commented Jun 8, 2019

Build failed
Swift Test Linux Platform
Git Sha - e0e1055e7873844dc679e8c793f192fb3b8dbb64

@swift-ci
Copy link
Contributor

swift-ci commented Jun 8, 2019

Build failed
Swift Test OS X Platform
Git Sha - e0e1055e7873844dc679e8c793f192fb3b8dbb64

stephentyrone and others added 5 commits June 12, 2019 10:41
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.
@stephentyrone
Copy link
Contributor Author

@swift-ci test

@stephentyrone
Copy link
Contributor Author

@swift-ci test source compatibility

@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - 3900c95d90d83a77bf8235d699d898ea75dd7d7a

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - 3900c95d90d83a77bf8235d699d898ea75dd7d7a

@stephentyrone
Copy link
Contributor Author

@swift-ci please smoke test

@stephentyrone
Copy link
Contributor Author

@swift-ci please test

@stephentyrone
Copy link
Contributor Author

@swift-ci please test source compatibility

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - 8cf461e

@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - 8cf461e

@airspeedswift
Copy link
Member

airspeedswift commented Jul 26, 2019

Closing this for now – we need to figure out the type checker consequences before these can be added.

@stephentyrone stephentyrone deleted the mathable-5.1 branch July 26, 2019 00:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants