Skip to content

Fix the build and implementation of the 16-byte atomics for MSVC #34958

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
merged 1 commit into from
Dec 4, 2020

Conversation

rjmccall
Copy link
Contributor

@rjmccall rjmccall commented Dec 4, 2020

Credit for the cmake fix here goes to Saleem Abdulrasool.

The substantive fix is embarrassing; I didn't pay close attention to the intrinsic's argument order and just assumed that the first argument for the replacement value was the low half (the part you'd find at index 0 if it were an array), but in fact it's the high half (the part you'd find at index 1).

I also change the code to be much more reinterpret_casty, which isolates the type-punning mostly "within" the intrinsic, and which seems to match how other code I was able to find uses it.

Credit for the cmake fix here goes to Saleem Abdulrasool.

The substantive fix is embarrassing; I didn't pay close attention
to the intrinsic's argument order and just assumed that the first
argument for the replacement value was the low half (the part
you'd find at index 0 if it were an array), but in fact it's the
high half (the part you'd find at index 1).

I also change the code to be much more reinterpret_casty, which
isolates the type-punning mostly "within" the intrinsic, and
which seems to match how other code uses it.
@rjmccall rjmccall requested a review from compnerd December 4, 2020 06:52
@rjmccall
Copy link
Contributor Author

rjmccall commented Dec 4, 2020

@swift-ci Please test Windows

@rjmccall
Copy link
Contributor Author

rjmccall commented Dec 4, 2020

@swift-ci Please smoke test

@rjmccall
Copy link
Contributor Author

rjmccall commented Dec 4, 2020

Test failures on Windows are due to running out of space, but the concurrency-specific tests seem to have passed.

@rjmccall rjmccall merged commit a6b302c into swiftlang:main Dec 4, 2020
@rjmccall rjmccall deleted the msvc-atomic-128 branch December 4, 2020 18:04
@compnerd
Copy link
Member

compnerd commented Dec 4, 2020

Thanks @rjmccall! LGTM

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