Skip to content

Importer support for float80 #14971

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

@stephentyrone stephentyrone commented Mar 5, 2018

Teach the importer to map between C's long double type and Float80 on non-Windows x86_64 and i386 platforms, and take advantage of this mapping to clean up a few details in the stdlib.

This also makes available the full set of platform math functions for Float80.

Resolves SR-2046.

@stephentyrone
Copy link
Contributor Author

@swift-ci Please test.

@stephentyrone
Copy link
Contributor Author

@moiseev The stdlib changes here are pretty minimal, but can you take a quick look?

@jrose-apple
Copy link
Contributor

Importer side looks good, and none of the rest looks like anything alarming.

@stephentyrone stephentyrone merged commit f8a9e56 into swiftlang:master Mar 7, 2018
@stephentyrone stephentyrone deleted the importer-support-for-Float80 branch March 7, 2018 21:49
@vivkong
Copy link
Contributor

vivkong commented Mar 8, 2018

Got build failures on Linux on Z (s390x) related to this commit:

/home/swiftbuild/workspace/Swift/CONFIG/FIVE/GIT_BRANCH/master/label/csz25097/swift/stdlib/public/Platform/tgmath.swift.gyb:207:34: error: 'Float80' is unavailable: Float80 is only available on non-Windows x86 targets.
09:08:10 public func cos(_ x: Float80) -> Float80 {
09:08:10                                  ^~~~~~~
09:08:10 Swift.Float80:2:15: note: 'Float80' has been explicitly marked unavailable here
09:08:10 public struct Float80 {
09:08:10               ^
09:08:10 /home/swiftbuild/workspace/Swift/CONFIG/FIVE/GIT_BRANCH/master/label/csz25097/swift/stdlib/public/Platform/tgmath.swift.gyb:207:22: error: 'Float80' is unavailable: Float80 is only available on non-Windows x86 targets.
09:08:10 public func cos(_ x: Float80) -> Float80 {
09:08:10                      ^~~~~~~
09:08:10 Swift.Float80:2:15: note: 'Float80' has been explicitly marked unavailable here
09:08:10 public struct Float80 {
09:08:10               ^

(and others)

Any ideas on how to fix this? Thanks

@jrose-apple
Copy link
Contributor

Looks like Steve forgot one of the #if blocks, the one for OverlayFloatTypes. Feel free to put up a PR for that if you don't want to wait for him.

@vivkong
Copy link
Contributor

vivkong commented Mar 8, 2018

ah OK. I have a patch ready. Will create a PR. Thanks @jrose-apple!

@stephentyrone
Copy link
Contributor Author

Great, thanks @vivkong! I'm happy to review.

Copy link

@ricksentam ricksentam left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

4 participants