@@ -103,80 +103,7 @@ func _stdlib_atomicInitializeARCRef(
103
103
}
104
104
105
105
% for bits in [ 32 , 64 ] :
106
-
107
- @_transparent
108
- public // @testable
109
- func _stdlib_atomicCompareExchangeStrongUInt${ bits} (
110
- object target: UnsafeMutablePointer < UInt ${ bits} > ,
111
- expected: UnsafeMutablePointer < UInt ${ bits} > ,
112
- desired: UInt ${ bits} ) - > Bool {
113
-
114
- let ( oldValue, won) = Builtin . cmpxchg_seqcst_seqcst_Int ${ bits} (
115
- target. _rawValue, expected. pointee. _value, desired. _value)
116
- expected. pointee. _value = oldValue
117
- return Bool ( won)
118
- }
119
-
120
- @_transparent
121
- public // @testable
122
- func _stdlib_atomicCompareExchangeStrongInt${ bits} (
123
- object target: UnsafeMutablePointer < Int ${ bits} > ,
124
- expected: UnsafeMutablePointer < Int ${ bits} > ,
125
- desired: Int ${ bits} ) -> Bool {
126
-
127
- let ( oldValue, won) = Builtin . cmpxchg_seqcst_seqcst_Int ${ bits} (
128
- target. _rawValue, expected. pointee. _value, desired. _value)
129
- expected. pointee. _value = oldValue
130
- return Bool ( won)
131
- }
132
-
133
- @_transparent
134
- public // @testable
135
- func _swift_stdlib_atomicStoreUInt${ bits} (
136
- object target: UnsafeMutablePointer < UInt ${ bits} > ,
137
- desired: UInt ${ bits} ) {
138
-
139
- Builtin . atomicstore_seqcst_Int ${ bits} ( target. _rawValue, desired. _value)
140
- }
141
-
142
- @inlinable // FIXME(sil-serialize-all)
143
- internal func _swift_stdlib_atomicStoreInt${ bits} (
144
- object target: UnsafeMutablePointer < Int ${ bits} > ,
145
- desired: Int ${ bits} ) {
146
-
147
- Builtin . atomicstore_seqcst_Int ${ bits} ( target. _rawValue, desired. _value)
148
- }
149
-
150
- @inlinable // FIXME(sil-serialize-all)
151
- public // @testable
152
- func _swift_stdlib_atomicLoadUInt${ bits} (
153
- object target: UnsafeMutablePointer < UInt ${ bits} > ) -> UInt ${ bits} {
154
-
155
- let value = Builtin . atomicload_seqcst_Int ${ bits} ( target. _rawValue)
156
- return UInt${ bits} ( value)
157
- }
158
-
159
- @inlinable // FIXME(sil-serialize-all)
160
- internal func _swift_stdlib_atomicLoadInt${ bits} (
161
- object target: UnsafeMutablePointer < Int ${ bits} > ) -> Int ${ bits} {
162
-
163
- let value = Builtin . atomicload_seqcst_Int ${ bits} ( target. _rawValue)
164
- return Int${ bits} ( value)
165
- }
166
-
167
106
% for operation in [ 'Add', 'And', 'Or', 'Xor'] :
168
- // Warning: no overflow checking.
169
- @_transparent
170
- public // @testable
171
- func _swift_stdlib_atomicFetch${ operation} UInt${ bits} (
172
- object target: UnsafeMutablePointer < UInt ${ bits} > ,
173
- operand: UInt ${ bits} ) - > UInt${ bits} {
174
-
175
- let value = Builtin . atomicrmw_ ${ operation. lower ( ) } _seqcst_Int${ bits} (
176
- target. _rawValue, operand. _value)
177
-
178
- return UInt ${ bits} ( value)
179
- }
180
107
181
108
// Warning: no overflow checking.
182
109
@inlinable // FIXME(sil-serialize-all)
@@ -189,8 +116,8 @@ internal func _swift_stdlib_atomicFetch${operation}Int${bits}(
189
116
190
117
return Int ${ bits} ( value)
191
118
}
192
- % end
193
119
120
+ % end
194
121
% end
195
122
196
123
@inlinable // FIXME(sil-serialize-all)
0 commit comments