mirror of
https://github.com/golang/go
synced 2024-11-17 13:04:54 -07:00
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: 4d8c857d15
GitHub-Pull-Request: golang/go#64299
Reviewed-on: https://go-review.googlesource.com/c/go/+/544017
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
Run-TryBot: Cherry Mui <cherryyz@google.com>
This commit is contained in:
parent
d7fcb5cf80
commit
4bfed5ce74
@ -2,7 +2,7 @@
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
//go:build s390x || loong64 || mips || mipsle || mips64 || mips64le
|
||||
//go:build arm || s390x || loong64 || mips || mipsle || mips64 || mips64le
|
||||
|
||||
package atomic
|
||||
|
||||
|
@ -208,66 +208,6 @@ func And(addr *uint32, v uint32) {
|
||||
}
|
||||
}
|
||||
|
||||
//go:nosplit
|
||||
func Or32(addr *uint32, v uint32) uint32 {
|
||||
for {
|
||||
old := *addr
|
||||
if Cas(addr, old, old|v) {
|
||||
return old
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//go:nosplit
|
||||
func And32(addr *uint32, v uint32) uint32 {
|
||||
for {
|
||||
old := *addr
|
||||
if Cas(addr, old, old&v) {
|
||||
return old
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//go:nosplit
|
||||
func Or64(addr *uint64, v uint64) uint64 {
|
||||
for {
|
||||
old := *addr
|
||||
if Cas64(addr, old, old|v) {
|
||||
return old
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//go:nosplit
|
||||
func And64(addr *uint64, v uint64) uint64 {
|
||||
for {
|
||||
old := *addr
|
||||
if Cas64(addr, old, old&v) {
|
||||
return old
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//go:nosplit
|
||||
func Oruintptr(addr *uintptr, v uintptr) uintptr {
|
||||
for {
|
||||
old := *addr
|
||||
if Casuintptr(addr, old, old|v) {
|
||||
return old
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//go:nosplit
|
||||
func Anduintptr(addr *uintptr, v uintptr) uintptr {
|
||||
for {
|
||||
old := *addr
|
||||
if Casuintptr(addr, old, old&v) {
|
||||
return old
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//go:nosplit
|
||||
func armcas(ptr *uint32, old, new uint32) bool
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user