Skip to content

Commit 4bfed5c

Browse files
mauri870cherrymui
authored andcommitted
runtime/internal/atomic: deduplicate And/Or code on arm
Turns out after adding the generic implementation for And/Or we ended up with duplicated ops that are exactly the same for arm. Apologies for the oversight, this CL removes the redundant arm code and adds arm to the generic build flags. For #61395 Change-Id: Id5e5a5cf113774948f8e772592e898d0810ad1f6 GitHub-Last-Rev: 4d8c857 GitHub-Pull-Request: #64299 Reviewed-on: https://go-review.googlesource.com/c/go/+/544017 LUCI-TryBot-Result: Go LUCI <[email protected]> Reviewed-by: Cherry Mui <[email protected]> TryBot-Result: Gopher Robot <[email protected]> Reviewed-by: Michael Knyszek <[email protected]> Run-TryBot: Cherry Mui <[email protected]>
1 parent d7fcb5c commit 4bfed5c

File tree

2 files changed

+1
-61
lines changed

2 files changed

+1
-61
lines changed

src/runtime/internal/atomic/atomic_andor_generic.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// Use of this source code is governed by a BSD-style
33
// license that can be found in the LICENSE file.
44

5-
//go:build s390x || loong64 || mips || mipsle || mips64 || mips64le
5+
//go:build arm || s390x || loong64 || mips || mipsle || mips64 || mips64le
66

77
package atomic
88

src/runtime/internal/atomic/atomic_arm.go

Lines changed: 0 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -208,66 +208,6 @@ func And(addr *uint32, v uint32) {
208208
}
209209
}
210210

211-
//go:nosplit
212-
func Or32(addr *uint32, v uint32) uint32 {
213-
for {
214-
old := *addr
215-
if Cas(addr, old, old|v) {
216-
return old
217-
}
218-
}
219-
}
220-
221-
//go:nosplit
222-
func And32(addr *uint32, v uint32) uint32 {
223-
for {
224-
old := *addr
225-
if Cas(addr, old, old&v) {
226-
return old
227-
}
228-
}
229-
}
230-
231-
//go:nosplit
232-
func Or64(addr *uint64, v uint64) uint64 {
233-
for {
234-
old := *addr
235-
if Cas64(addr, old, old|v) {
236-
return old
237-
}
238-
}
239-
}
240-
241-
//go:nosplit
242-
func And64(addr *uint64, v uint64) uint64 {
243-
for {
244-
old := *addr
245-
if Cas64(addr, old, old&v) {
246-
return old
247-
}
248-
}
249-
}
250-
251-
//go:nosplit
252-
func Oruintptr(addr *uintptr, v uintptr) uintptr {
253-
for {
254-
old := *addr
255-
if Casuintptr(addr, old, old|v) {
256-
return old
257-
}
258-
}
259-
}
260-
261-
//go:nosplit
262-
func Anduintptr(addr *uintptr, v uintptr) uintptr {
263-
for {
264-
old := *addr
265-
if Casuintptr(addr, old, old&v) {
266-
return old
267-
}
268-
}
269-
}
270-
271211
//go:nosplit
272212
func armcas(ptr *uint32, old, new uint32) bool
273213

0 commit comments

Comments
 (0)