Commit Graph

7 Commits

Author SHA1 Message Date
Saleem Abdulrasool
74496f3bad Runtime: correct the location of windows header inclusion
We would previously include a header inside the `swift::impl` namespace,
which would prevent the proper declaration of the functions and
enumerators.  This corrects the location of the header inclusion to fix
this issue.
2021-09-01 14:12:43 -07:00
John McCall
f0977ac2fc Fixes to swift::atomic: load is const, provide a store. 2021-07-14 15:51:02 -04:00
John McCall
c346d94655 Fix the build and implementation of the 16-byte atomics for MSVC.
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.
2020-12-04 01:51:29 -05:00
John McCall
a53d83f4db Disable the swift::atomic<..., 16> specialization until we can
figure out how to convince clang-cl to accept it.

We need to make progress.
2020-12-02 18:47:13 -05:00
John McCall
ca16548470 Add a swift::atomic<T> which uses a better ABI than MSVC's 128-bit std::atomic. 2020-12-02 18:47:02 -05:00
Saleem Abdulrasool
2d04b8491b stdlib: check for ARM/ARM64 more thoroughly (NFC)
Update the instances of checks for architectures to be more broad for different
spellings of the architecture macro.  Certain targets use `_M_ARM` and others
use `__arm__`.  Similarly, arm64/aarch64 has `_M_ARM64`, `__arm64__` and
`__aarch64__` as spellings.  This just mechanically goes through and encodes the
various spellings.

Take the opportunity to replace some raw checks with `defined` checks which
avoids a pedantic warning due to the undefined macro when performing the check
as the preprocessor may warn about an undefined condition evaluating to `0`.
2018-09-21 11:24:03 -07:00
Mike Ash
da4fa67d7e [Runtime] Move ConcurrentReadableArray's allocate/deallocate functions into Storage. Mark ConcurrentReadableArray as un-copyable, un-assignable, and un-movable. Use SWIFT_MEMORY_ORDER_CONSUME instead of std::memory_order_consume. Make read() pass a const pointer.
rdar://problem/37173156
2018-05-15 15:27:33 -04:00