Skip to content

Commit baf9100

Browse files
Carl PetoCarl Peto
Carl Peto
authored and
Carl Peto
committed
revert work on the Syncrhonization library for a separate PR
1 parent 57e8b03 commit baf9100

File tree

3 files changed

+5
-30
lines changed

3 files changed

+5
-30
lines changed

stdlib/public/Synchronization/Atomics/AtomicIntegers.swift.gyb

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,6 @@ extension ${intType}: AtomicRepresentable {
3939
#elseif _pointerBitWidth(_32)
4040
@available(SwiftStdlib 6.0, *)
4141
public typealias AtomicRepresentation = _Atomic32BitStorage
42-
#elseif _pointerBitWidth(_16)
43-
@available(SwiftStdlib 6.0, *)
44-
public typealias AtomicRepresentation = _Atomic16BitStorage
4542
#else
4643
#error("Unsupported platform")
4744
#endif
@@ -131,11 +128,6 @@ extension Atomic where Value == ${intType} {
131128
_rawAddress,
132129
operand._value
133130
)
134-
#elseif _pointerBitWidth(_16)
135-
Builtin.atomicrmw_${atomicOperationName(intType, builtinName)}_${llvmOrder}_Int16(
136-
_rawAddress,
137-
operand._value
138-
)
139131
#else
140132
#error("Unsupported platform")
141133
#endif

stdlib/public/Synchronization/Atomics/AtomicPointers.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -771,7 +771,7 @@ extension ObjectIdentifier: AtomicOptionalRepresentable {
771771
// UnsafeBufferPointer AtomicRepresentable conformance
772772
//===----------------------------------------------------------------------===//
773773

774-
#if ((_pointerBitWidth(_32) || _pointerBitWidth(_16)) && _hasAtomicBitWidth(_64)) || (_pointerBitWidth(_64) && _hasAtomicBitWidth(_128))
774+
#if (_pointerBitWidth(_32) && _hasAtomicBitWidth(_64)) || (_pointerBitWidth(_64) && _hasAtomicBitWidth(_128))
775775

776776
@available(SwiftStdlib 6.0, *)
777777
extension UnsafeBufferPointer: AtomicRepresentable where Element: ~Copyable {
@@ -837,7 +837,7 @@ extension UnsafeBufferPointer: AtomicRepresentable where Element: ~Copyable {
837837
// UnsafeMutableBufferPointer AtomicRepresentable conformance
838838
//===----------------------------------------------------------------------===//
839839

840-
#if ((_pointerBitWidth(_32) || _pointerBitWidth(_16)) && _hasAtomicBitWidth(_64)) || (_pointerBitWidth(_64) && _hasAtomicBitWidth(_128))
840+
#if (_pointerBitWidth(_32) && _hasAtomicBitWidth(_64)) || (_pointerBitWidth(_64) && _hasAtomicBitWidth(_128))
841841

842842
@available(SwiftStdlib 6.0, *)
843843
extension UnsafeMutableBufferPointer: AtomicRepresentable
@@ -905,7 +905,7 @@ where Element: ~Copyable
905905
// UnsafeRawBufferPointer AtomicRepresentable conformance
906906
//===----------------------------------------------------------------------===//
907907

908-
#if ((_pointerBitWidth(_32) || _pointerBitWidth(_16)) && _hasAtomicBitWidth(_64)) || (_pointerBitWidth(_64) && _hasAtomicBitWidth(_128))
908+
#if (_pointerBitWidth(_32) && _hasAtomicBitWidth(_64)) || (_pointerBitWidth(_64) && _hasAtomicBitWidth(_128))
909909

910910
@available(SwiftStdlib 6.0, *)
911911
extension UnsafeRawBufferPointer: AtomicRepresentable {
@@ -971,7 +971,7 @@ extension UnsafeRawBufferPointer: AtomicRepresentable {
971971
// UnsafeMutableRawBufferPointer AtomicRepresentable conformance
972972
//===----------------------------------------------------------------------===//
973973

974-
#if ((_pointerBitWidth(_32) || _pointerBitWidth(_16)) && _hasAtomicBitWidth(_64)) || (_pointerBitWidth(_64) && _hasAtomicBitWidth(_128))
974+
#if (_pointerBitWidth(_32) && _hasAtomicBitWidth(_64)) || (_pointerBitWidth(_64) && _hasAtomicBitWidth(_128))
975975

976976
@available(SwiftStdlib 6.0, *)
977977
extension UnsafeMutableRawBufferPointer: AtomicRepresentable {

stdlib/public/Synchronization/Atomics/WordPair.swift

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ public struct WordPair {
6262
}
6363
}
6464

65-
#if ((_pointerBitWidth(_32) || _pointerBitWidth(_16)) && _hasAtomicBitWidth(_64)) || (_pointerBitWidth(_64) && _hasAtomicBitWidth(_128))
65+
#if (_pointerBitWidth(_32) && _hasAtomicBitWidth(_64)) || (_pointerBitWidth(_64) && _hasAtomicBitWidth(_128))
6666

6767
@available(SwiftStdlib 6.0, *)
6868
extension WordPair: AtomicRepresentable {
@@ -74,10 +74,6 @@ extension WordPair: AtomicRepresentable {
7474
/// The storage representation type that `Self` encodes to and decodes from
7575
/// which is a suitable type when used in atomic operations.
7676
public typealias AtomicRepresentation = _Atomic64BitStorage
77-
#elseif _pointerBitWidth(_16)
78-
/// The storage representation type that `Self` encodes to and decodes from
79-
/// which is a suitable type when used in atomic operations.
80-
public typealias AtomicRepresentation = _Atomic32BitStorage
8177
#else
8278
#error("Unsupported platform")
8379
#endif
@@ -114,14 +110,6 @@ extension WordPair: AtomicRepresentable {
114110
i64 = Builtin.or_Int64(i64, high64)
115111

116112
return AtomicRepresentation(i64)
117-
#elseif _pointerBitWidth(_16)
118-
var i32 = Builtin.zext_Int16_Int32(value.first._value)
119-
var high32 = Builtin.zext_Int16_Int32(value.second._value)
120-
let highShift = Builtin.zext_Int16_Int32(UInt(16)._value)
121-
high32 = Builtin.shl_Int32(high32, highShift)
122-
i32 = Builtin.or_Int32(i32, high32)
123-
124-
return AtomicRepresentation(i32)
125113
#else
126114
#error("Unsupported platform")
127115
#endif
@@ -153,11 +141,6 @@ extension WordPair: AtomicRepresentable {
153141
let high64 = Builtin.lshr_Int64(representation._storage, highShift)
154142
let high = Builtin.trunc_Int64_Int32(high64)
155143
let low = Builtin.trunc_Int64_Int32(representation._storage)
156-
#elseif _pointerBitWidth(_16)
157-
let highShift = Builtin.zext_Int16_Int32(UInt(16)._value)
158-
let high32 = Builtin.lshr_Int32(representation._storage, highShift)
159-
let high = Builtin.trunc_Int32_Int16(high32)
160-
let low = Builtin.trunc_Int32_Int16(representation._storage)
161144
#else
162145
#error("Unsupported platform")
163146
#endif

0 commit comments

Comments
 (0)