• Keith Randall's avatar
    cmd/compile: inline atomics from runtime/internal/atomic on amd64 · 320ddcf8
    Keith Randall authored
    Inline atomic reads and writes on amd64.  There's no reason
    to pay the overhead of a call for these.
    
    To keep atomic loads from being reordered, we make them
    return a <value,memory> tuple.
    
    Change the meaning of resultInArg0 for tuple-generating ops
    to mean the first part of the result tuple, not the second.
    This means we can always put the store part of the tuple last,
    matching how arguments are laid out.  This requires reordering
    the outputs of add32carry and sub32carry and their descendents
    in various architectures.
    
    benchmark                    old ns/op     new ns/op     delta
    BenchmarkAtomicLoad64-8      2.09          0.26          -87.56%
    BenchmarkAtomicStore64-8     7.54          5.72          -24.14%
    
    TBD (in a different CL): Cas, Or8, ...
    
    Change-Id: I713ea88e7da3026c44ea5bdb56ed094b20bc5207
    Reviewed-on: https://go-review.googlesource.com/27641Reviewed-by: 's avatarCherry Zhang <cherryyz@google.com>
    320ddcf8
Name
Last commit
Last update
..
asm_386.s Loading commit data...
asm_amd64.s Loading commit data...
asm_amd64p32.s Loading commit data...
asm_arm.s Loading commit data...
asm_arm64.s Loading commit data...
asm_mips64x.s Loading commit data...
asm_ppc64x.s Loading commit data...
asm_s390x.s Loading commit data...
atomic_386.go Loading commit data...
atomic_amd64x.go Loading commit data...
atomic_arm.go Loading commit data...
atomic_arm64.go Loading commit data...
atomic_arm64.s Loading commit data...
atomic_mips64x.go Loading commit data...
atomic_mips64x.s Loading commit data...
atomic_ppc64x.go Loading commit data...
atomic_ppc64x.s Loading commit data...
atomic_s390x.go Loading commit data...
atomic_test.go Loading commit data...
bench_test.go Loading commit data...
stubs.go Loading commit data...
sys_darwin_arm.s Loading commit data...
sys_freebsd_arm.s Loading commit data...
sys_linux_arm.s Loading commit data...
sys_nacl_arm.s Loading commit data...
sys_netbsd_arm.s Loading commit data...
sys_openbsd_arm.s Loading commit data...
sys_plan9_arm.s Loading commit data...