]> Cypherpunks repositories - gostls13.git/commitdiff
runtime: remove unused xchgp/xchgp1
authorMichael Hudson-Doyle <michael.hudson@canonical.com>
Wed, 26 Aug 2015 22:59:43 +0000 (10:59 +1200)
committerIan Lance Taylor <iant@golang.org>
Thu, 27 Aug 2015 00:28:35 +0000 (00:28 +0000)
I noticed that they were unimplemented on arm64 but then that they were
in fact not used at all.

Change-Id: Iee579feda2a5e374fa571bcc8c89e4ef607d50f6
Reviewed-on: https://go-review.googlesource.com/13951
Run-TryBot: Minux Ma <minux@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
src/runtime/asm_386.s
src/runtime/asm_amd64.s
src/runtime/asm_amd64p32.s
src/runtime/asm_ppc64x.s
src/runtime/atomic_386.go
src/runtime/atomic_amd64x.go
src/runtime/atomic_arm.go
src/runtime/atomic_arm64.go
src/runtime/atomic_pointer.go
src/runtime/atomic_ppc64x.go

index eb9ca6350a325b9a8dc819e7dde9b39783d603e4..2bc5d8b658e9b6d33706398cfe10ec48e41219ce 100644 (file)
@@ -551,13 +551,6 @@ TEXT runtime·xchg(SB), NOSPLIT, $0-12
        MOVL    AX, ret+8(FP)
        RET
 
-TEXT runtime·xchgp1(SB), NOSPLIT, $0-12
-       MOVL    ptr+0(FP), BX
-       MOVL    new+4(FP), AX
-       XCHGL   AX, 0(BX)
-       MOVL    AX, ret+8(FP)
-       RET
-
 TEXT runtime·xchguintptr(SB), NOSPLIT, $0-12
        JMP     runtime·xchg(SB)
 
index ff2da3a858094e8e818799572f24bbf60fe8f852..d165e08333d7d8d63d498a7eda4273a056eab0ef 100644 (file)
@@ -563,13 +563,6 @@ TEXT runtime·xchg64(SB), NOSPLIT, $0-24
        MOVQ    AX, ret+16(FP)
        RET
 
-TEXT runtime·xchgp1(SB), NOSPLIT, $0-24
-       MOVQ    ptr+0(FP), BX
-       MOVQ    new+8(FP), AX
-       XCHGQ   AX, 0(BX)
-       MOVQ    AX, ret+16(FP)
-       RET
-
 TEXT runtime·xchguintptr(SB), NOSPLIT, $0-24
        JMP     runtime·xchg64(SB)
 
index a5d6e8155ad2217e32631da52ebf6577e5065543..e393431f2654829e67e8f1bccd054cbe4fd8dc4d 100644 (file)
@@ -517,13 +517,6 @@ TEXT runtime·xchg64(SB), NOSPLIT, $0-24
        MOVQ    AX, ret+16(FP)
        RET
 
-TEXT runtime·xchgp1(SB), NOSPLIT, $0-12
-       MOVL    ptr+0(FP), BX
-       MOVL    new+4(FP), AX
-       XCHGL   AX, 0(BX)
-       MOVL    AX, ret+8(FP)
-       RET
-
 TEXT runtime·xchguintptr(SB), NOSPLIT, $0-12
        JMP     runtime·xchg(SB)
 
index 04041245067c7496cf1dd0eb18a21d6e612c2637..60e6b8c4a4998547c8a57ff872c65d8790b8ba92 100644 (file)
@@ -584,9 +584,6 @@ TEXT runtime·xchg64(SB), NOSPLIT, $0-24
        MOVD    R3, ret+16(FP)
        RET
 
-TEXT runtime·xchgp1(SB), NOSPLIT, $0-24
-       BR      runtime·xchg64(SB)
-
 TEXT runtime·xchguintptr(SB), NOSPLIT, $0-24
        BR      runtime·xchg64(SB)
 
index f8d589e33ba686190b3a1d5b45205e896dbdffae..204a0eb0bc12a9ee8426a6adb2f6dfd3632a8b0b 100644 (file)
@@ -52,9 +52,6 @@ func xadd(ptr *uint32, delta int32) uint32
 //go:noescape
 func xchg(ptr *uint32, new uint32) uint32
 
-// NO go:noescape annotation; see atomic_pointer.go.
-func xchgp1(ptr unsafe.Pointer, new unsafe.Pointer) unsafe.Pointer
-
 //go:noescape
 func xchguintptr(ptr *uintptr, new uintptr) uintptr
 
index edcc6d665efe0fb7e14f891c64ea8ba9075d8cbc..256b30bb5f7102d1d63f8f63943d53d46ec79e22 100644 (file)
@@ -45,9 +45,6 @@ func xchg(ptr *uint32, new uint32) uint32
 //go:noescape
 func xchg64(ptr *uint64, new uint64) uint64
 
-// NO go:noescape annotation; see atomic_pointer.go.
-func xchgp1(ptr unsafe.Pointer, new unsafe.Pointer) unsafe.Pointer
-
 //go:noescape
 func xchguintptr(ptr *uintptr, new uintptr) uintptr
 
index 02a1f35ffafe8460e8f43ffcfeb3ab6020502d28..0c53b102c126e4fc10ecd7dc7f4533ab08f3ad22 100644 (file)
@@ -41,16 +41,6 @@ func xchg(addr *uint32, v uint32) uint32 {
        }
 }
 
-//go:nosplit
-func xchgp1(addr unsafe.Pointer, v unsafe.Pointer) unsafe.Pointer {
-       for {
-               old := *(*unsafe.Pointer)(addr)
-               if casp1((*unsafe.Pointer)(addr), old, v) {
-                       return old
-               }
-       }
-}
-
 //go:nosplit
 func xchguintptr(addr *uintptr, v uintptr) uintptr {
        return uintptr(xchg((*uint32)(unsafe.Pointer(addr)), uint32(v)))
index a377e3e4b3d0a589ddbcd0a171b23fa39519b828..b3af4002c4b3816232a44849cc1f7738eed5c52c 100644 (file)
@@ -22,9 +22,6 @@ func xchg(ptr *uint32, new uint32) uint32
 //go:noescape
 func xchg64(ptr *uint64, new uint64) uint64
 
-// NO go:noescape annotation; see atomic_pointer.go.
-func xchgp1(ptr unsafe.Pointer, new unsafe.Pointer) unsafe.Pointer
-
 //go:noescape
 func xchguintptr(ptr *uintptr, new uintptr) uintptr
 
index f84afe0362af13777f048d31765cd9acaf76a006..ec2ea8a3384234ccb8f0a2ef58eeedc0d7a0e1e1 100644 (file)
@@ -10,7 +10,7 @@ import "unsafe"
 // because while ptr does not escape, new does.
 // If new is marked as not escaping, the compiler will make incorrect
 // escape analysis decisions about the pointer value being stored.
-// Instead, these are wrappers around the actual atomics (xchgp1 and so on)
+// Instead, these are wrappers around the actual atomics (casp1 and so on)
 // that use noescape to convey which arguments do not escape.
 //
 // Additionally, these functions must update the shadow heap for
@@ -22,13 +22,6 @@ func atomicstorep(ptr unsafe.Pointer, new unsafe.Pointer) {
        writebarrierptr_nostore((*uintptr)(ptr), uintptr(new))
 }
 
-//go:nosplit
-func xchgp(ptr unsafe.Pointer, new unsafe.Pointer) unsafe.Pointer {
-       old := xchgp1(noescape(ptr), new)
-       writebarrierptr_nostore((*uintptr)(ptr), uintptr(new))
-       return old
-}
-
 //go:nosplit
 func casp(ptr *unsafe.Pointer, old, new unsafe.Pointer) bool {
        if !casp1((*unsafe.Pointer)(noescape(unsafe.Pointer(ptr))), noescape(old), new) {
index b58ee5ae33bd84aa73830d088fdf44aeec18552e..9273ddf03ec813bc0c7bf8fa33c0eae58359a3c9 100644 (file)
@@ -24,9 +24,6 @@ func xchg(ptr *uint32, new uint32) uint32
 //go:noescape
 func xchg64(ptr *uint64, new uint64) uint64
 
-// NO go:noescape annotation; see atomic_pointer.go.
-func xchgp1(ptr unsafe.Pointer, new unsafe.Pointer) unsafe.Pointer
-
 //go:noescape
 func xchguintptr(ptr *uintptr, new uintptr) uintptr