Skip to content

Add availability information to the new Math function protocols #24187

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

Merged

Conversation

stephentyrone
Copy link
Contributor

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.

This change also restores the statics on SIMD types, when targeting supported standard library versions.

rdar://problem/50060408

@stephentyrone
Copy link
Contributor Author

@swift-ci please test

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - b19313ea39c9d91fc0e63c211f324db59ca7c0a6

@stephentyrone
Copy link
Contributor Author

@swift-ci please test

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - b19313ea39c9d91fc0e63c211f324db59ca7c0a6

@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - b19313ea39c9d91fc0e63c211f324db59ca7c0a6

@stephentyrone
Copy link
Contributor Author

@swift-ci please smoke test macOS

@stephentyrone
Copy link
Contributor Author

@swift-ci please test source compatibility

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.
Temporarily pull these back so we can make minor tweaks to the design and get a re-review on SE.
@stephentyrone stephentyrone force-pushed the math-protocols-availability branch from 0304247 to 8708c7b Compare April 26, 2019 20:18
@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 - 0304247bb050a3fd9e2bf7cbda0d2e5fbf924407

@stephentyrone
Copy link
Contributor Author

@swift-ci please test os x

@stephentyrone stephentyrone merged commit d2f6959 into swiftlang:master Apr 29, 2019
@stephentyrone stephentyrone deleted the math-protocols-availability branch April 29, 2019 21:39
stephentyrone added a commit to stephentyrone/swift that referenced this pull request Jun 12, 2019
…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.
stephentyrone added a commit to stephentyrone/swift that referenced this pull request Aug 23, 2019
stephentyrone added a commit that referenced this pull request Aug 23, 2019
* Revert "Add availability information to the new Math function protocols (#24187)"

This reverts commit d2f6959.

* Revert "SE-0246: Protocols and static functions (#23824)"

This reverts commit 57a4553.

* Expected abi changes.
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.

2 participants