]> Cypherpunks repositories - gostls13.git/commit
runtime/internal/atomic: improve ARM atomics
authorCherry Zhang <cherryyz@google.com>
Thu, 3 May 2018 18:22:05 +0000 (14:22 -0400)
committerCherry Zhang <cherryyz@google.com>
Thu, 3 May 2018 21:37:31 +0000 (21:37 +0000)
commit14f929af91c6096e25b5cfe0549110ccc0e3db7b
tree283411153ffb07ecb86e12388a920d0843fd2b00
parent150b728675c64addd24d79ad3bb68fec4c137940
runtime/internal/atomic: improve ARM atomics

This is a follow-up of CL 93637. There, when we redirect sync/atomic
to runtime/internal/atomic, a few good implementations of ARM atomics
were lost. This CL brings most of them back, with some improvements.

- Change atomic Store to a plain store with memory barrier, as we
  already changed atomic Load to plain load with memory barrier.

- Use native 64-bit atomics on ARMv7, jump to Go implementations
  on older machines. But drop the kernel helper. In particular,
  for Load64, just do loads, not using Cas on the address being
  load from, so it works also for read-only memory (since we have
  already fixed 32-bit Load).

Change-Id: I725cd65cf945ae5200db81a35be3f251c9f7af14
Reviewed-on: https://go-review.googlesource.com/111315
Run-TryBot: Cherry Zhang <cherryyz@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Austin Clements <austin@google.com>
src/runtime/internal/atomic/asm_arm.s
src/runtime/internal/atomic/atomic_arm.go
src/runtime/internal/atomic/sys_linux_arm.s
src/runtime/internal/atomic/sys_nonlinux_arm.s