-
Notifications
You must be signed in to change notification settings - Fork 10.6k
Reimplement floating-point description implementation in Swift. #82750
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
Reimplement floating-point description implementation in Swift. #82750
Conversation
|
CC: @stephentyrone for visibility. (I'll eventually need advice about how to deal with the availability mess here.) |
295114c to
28ca1f0
Compare
28ca1f0 to
5bfe1c1
Compare
compnerd
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems to be missing the addition of the new file to swiftCore in the new runtimes build.
How do I fix that? I'm not familiar with "the new runtimes build." |
Add swift/Runtimes/Core/core/CMakeLists.txt Line 82 in e690f1d
|
5b20b0b to
cac5983
Compare
|
@swift-ci Please test |
1 similar comment
|
@swift-ci Please test |
|
@etcwilde Now we're failing in CI for AVR. Clearly, a 16-bit platform does not want this file. How do I exclude it from those? |
|
@swift-ci Please test |
|
I tweaked one place where 32-bit int was assumed but not specified. This may let it build on AVR. |
For example, this avoids the need to do any explicit byte-by-byte writes when expanding "123" out to "123000000.0". This also required reworking the "back out extra digits" process for Float64 to ensure the unused digits get written as '0' characters instead of null bytes.
77b26ca to
7a4bd46
Compare
|
@swift-ci Please test macOS Platform |
|
Huh... CI checked everything out, then just ... stopped. After an hour, the script timed out with an error. |
|
@swift-ci Please test macOS platform |
|
@swift-ci Please test macOS platform |
|
@swift-ci Please test macOS platform |
|
@swift-ci Please test macOS Platform |
|
@swift-ci Please test macOS Platform |
|
@swift-ci Please test Linux platform |
|
@swift-ci Please test Windows Platform |
…ption Revert "Merge pull request #82750 from tbkka/tbkka-swift-floatingpointtostring"
…mplementation in Swift. This reverts PR swiftlang#84576, which was a revert of PR swiftlang#82750 It reverts commit 4ac18aa, reversing changes made to b46eddb.
…mplementation in Swift. This reverts PR swiftlang#84576, which was a revert of PR swiftlang#82750 It reverts commit 4ac18aa, reversing changes made to b46eddb.
This replaces the previous SwiftDtoa.cpp with the same algorithm reimplemented in Swift. It supports Float16, Float32, Float64, and Float80 (on Intel).
Performance is reasonable: In my testing (M1 and x86_64): Float16 and Float32 are a bit faster than the C version, Float64 is almost exactly the same, Float80 is a bit slower.
I think I've finally worked out the availability, though I'd appreciate someone who knows better taking a critical look.