mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
As a follow up to an earlier change[1] to add ARMv8+LSE instructions in
the compiler generated atomic intrinsics, make the same change in the
runtime library. Since not all ARMv8 systems support LSE instructions,
they are protected by a feature-flag branch.
[1]: golang.org/cl/234217 commit: ecc3f5112e
Change-Id: I0e2fb22e78d5eddb6547863667a8865946679a00
Reviewed-on: https://go-review.googlesource.com/c/go/+/310591
Reviewed-by: Cherry Mui <cherryyz@google.com>
Run-TryBot: Cherry Mui <cherryyz@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Trust: Heschi Kreinick <heschi@google.com>
95 lines
1.8 KiB
Go
95 lines
1.8 KiB
Go
// Copyright 2015 The Go Authors. All rights reserved.
|
|
// Use of this source code is governed by a BSD-style
|
|
// license that can be found in the LICENSE file.
|
|
|
|
//go:build arm64
|
|
// +build arm64
|
|
|
|
package atomic
|
|
|
|
import (
|
|
"unsafe"
|
|
"internal/cpu"
|
|
)
|
|
|
|
const (
|
|
offsetARM64HasATOMICS = unsafe.Offsetof(cpu.ARM64.HasATOMICS)
|
|
)
|
|
|
|
//go:noescape
|
|
func Xadd(ptr *uint32, delta int32) uint32
|
|
|
|
//go:noescape
|
|
func Xadd64(ptr *uint64, delta int64) uint64
|
|
|
|
//go:noescape
|
|
func Xadduintptr(ptr *uintptr, delta uintptr) uintptr
|
|
|
|
//go:noescape
|
|
func Xchg(ptr *uint32, new uint32) uint32
|
|
|
|
//go:noescape
|
|
func Xchg64(ptr *uint64, new uint64) uint64
|
|
|
|
//go:noescape
|
|
func Xchguintptr(ptr *uintptr, new uintptr) uintptr
|
|
|
|
//go:noescape
|
|
func Load(ptr *uint32) uint32
|
|
|
|
//go:noescape
|
|
func Load8(ptr *uint8) uint8
|
|
|
|
//go:noescape
|
|
func Load64(ptr *uint64) uint64
|
|
|
|
// NO go:noescape annotation; *ptr escapes if result escapes (#31525)
|
|
func Loadp(ptr unsafe.Pointer) unsafe.Pointer
|
|
|
|
//go:noescape
|
|
func LoadAcq(addr *uint32) uint32
|
|
|
|
//go:noescape
|
|
func LoadAcq64(ptr *uint64) uint64
|
|
|
|
//go:noescape
|
|
func LoadAcquintptr(ptr *uintptr) uintptr
|
|
|
|
//go:noescape
|
|
func Or8(ptr *uint8, val uint8)
|
|
|
|
//go:noescape
|
|
func And8(ptr *uint8, val uint8)
|
|
|
|
//go:noescape
|
|
func And(ptr *uint32, val uint32)
|
|
|
|
//go:noescape
|
|
func Or(ptr *uint32, val uint32)
|
|
|
|
//go:noescape
|
|
func Cas64(ptr *uint64, old, new uint64) bool
|
|
|
|
//go:noescape
|
|
func CasRel(ptr *uint32, old, new uint32) bool
|
|
|
|
//go:noescape
|
|
func Store(ptr *uint32, val uint32)
|
|
|
|
//go:noescape
|
|
func Store8(ptr *uint8, val uint8)
|
|
|
|
//go:noescape
|
|
func Store64(ptr *uint64, val uint64)
|
|
|
|
// NO go:noescape annotation; see atomic_pointer.go.
|
|
func StorepNoWB(ptr unsafe.Pointer, val unsafe.Pointer)
|
|
|
|
//go:noescape
|
|
func StoreRel(ptr *uint32, val uint32)
|
|
|
|
//go:noescape
|
|
func StoreRel64(ptr *uint64, val uint64)
|
|
|
|
//go:noescape
|
|
func StoreReluintptr(ptr *uintptr, val uintptr)
|