Skip to content

[5.0] Make SIMD types Codable. #22110

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 Jan 25, 2019

Explanation: This is a very tiny ABI change, in that user-defined SIMD types compiled with an earlier version of 5.0 will be missing the necessary conformance to Codable. Discussed with Ben, and we're OK with this because we don't think there are such types yet, and it can be fixed with a recompile. However, because of this consideration we either need to do this in 5.0 or not at all (for now).

Scope: Limited. Adds a common conformance to SIMD types that should be baseline for any new stdlib type. Some adopters may need to remove existing retroactive conformances.

Issue: rdar://problem/47549986

Risk: Low.

Testing: Passed CI testing on master, including new tests for this conformance.

Reviewed by: @airspeedswift (#22092)

* Make SIMD types codable. We're considering this a bugfix.

This is a very tiny ABI change, in that user-defined SIMD types compiled with an earlier version of 5.0 will be missing the necessary conformance to Codable. Discussed with Ben, and we're OK with this because we don't think there are such types yet, and it can be fixed with a recompile.

* Add basic tests
@stephentyrone stephentyrone requested a review from a team as a code owner January 25, 2019 04:38
@stephentyrone
Copy link
Contributor Author

@swift-ci please test

@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - aa04a01

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - aa04a01

It looks like JSONEncoder can't round-trip floating-point values on i386 only. Likely an x87 excess-precision bug, but I don't have time to investigate right now. Tracked by https://bugs.swift.org/browse/SR-9759
@stephentyrone
Copy link
Contributor Author

@swift-ci please test

@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - aa04a01

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - aa04a01

@stephentyrone
Copy link
Contributor Author

Linux failure unrelated.

@stephentyrone
Copy link
Contributor Author

@swift-ci please test Linux

@stephentyrone
Copy link
Contributor Author

@swift-ci Please test

@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - 5c42761

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - 5c42761

These are still breaking on 10.11, so we'll turn them off for now.
@stephentyrone
Copy link
Contributor Author

@swift-ci please test

@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - 6e86d20

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - 6e86d20

@stephentyrone
Copy link
Contributor Author

@swift-ci test

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - 59a40cc

@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - 59a40cc

@airspeedswift airspeedswift merged commit dfdb6b4 into swiftlang:swift-5.0-branch Jan 25, 2019
@stephentyrone stephentyrone deleted the simd-codable-5.0 branch February 8, 2023 00:36
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