-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Move most of the simd operators into an optional module #20914
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
Move most of the simd operators into an optional module #20914
Conversation
Adding simd to the stdlib caused some typechecker regressions. We can resolve them in the near-term by making the types universally available, but moving the arithmetic operators into a separate module that must be explicitly imported.
@swift-ci please test |
Build failed |
Build failed |
@swift-ci please test |
Build failed |
Build failed |
stdlib/public/core/SIMDVector.swift
Outdated
infix operator .&= : AssignmentPrecedence | ||
infix operator .^= : AssignmentPrecedence | ||
infix operator .|= : AssignmentPrecedence | ||
prefix operator .! |
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.
These should probably still be declared in the stdlib even if there are no functions that implement them.
@stephentyrone - why not make this an overlay? It could overlap the SIMD module in the SDK and re-export it with the additional overloads. |
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.
LGTM! (Concur with Jordan's note)
It's concerning to me that besides performance newly added operators re-introduced crashers, something has to be really fragile in the type-checker, going to take a closer look shortly.
@compnerd the simd SDK module depends on having the operators available. I'm not sure why you want to reverse that dependency? |
@xedin Yeah, something is fishy about those two crashers. Clearly they weren't so much "fixed" as "happened to stop crashing" =) |
@swift-ci please test |
Build failed |
Build failed |
@swift-ci please test source compatibility |
@stephentyrone One more thing I noticed might be good to do before merging - can you uncomment this expression https://github.com/apple/swift/blob/master/test/Sema/complex_expressions.swift#L7 and see if that works again? |
@xedin I'll put that in a separate PR, so we can get this moving (but yes, it does work again). |
) * Move most of the simd operators into an optional module Adding simd to the stdlib caused some typechecker regressions. We can resolve them in the near-term by making the types universally available, but moving the arithmetic operators into a separate module that must be explicitly imported. * Move two fuzzing tests back to fixed. * Add SIMDOperators as a dependency for MediaPlayer. * Move the .-prefixed operator declarations back into the stdlib. (cherry picked from commit 28962b5)
Okay, sounds good! |
* SIMD into stdlib Implements SE-0229. Also updates simd module types in the Apple SDKs to use the new types, and updates a couple tests to work with the new types and protocols. (cherry picked from commit fb8b9e1) * Move most of the simd operators into an optional module (#20914) * Move most of the simd operators into an optional module Adding simd to the stdlib caused some typechecker regressions. We can resolve them in the near-term by making the types universally available, but moving the arithmetic operators into a separate module that must be explicitly imported. * Move two fuzzing tests back to fixed. * Add SIMDOperators as a dependency for MediaPlayer. * Move the .-prefixed operator declarations back into the stdlib. (cherry picked from commit 28962b5)
Adding simd to the stdlib caused some typechecker regressions. We can resolve them in the near-term by making the types universally available, but moving the arithmetic operators into a separate module that must be explicitly imported.
The working name for this module is
SIMDOperators
. We can tweak that going forward if we want to, but it seems generally plausible. I deliberately avoidedSIMD
to avoid collision with the existing SDK module namedsimd
.rdar://problem/46364455