• Aram Hăvărneanu's avatar
    cmd/internal/obj, cmd/internal/obj/arm64: add support for GOARCH=arm64 · 26bbe7ac
    Aram Hăvărneanu authored
    ARM64 (ARMv8) has 32 general purpose, 64-bit integer registers
    (R0-R31), 32 64-bit scalar floating point registers (F0-F31), and
    32 128-bit vector registers (unused, V0-V31).
    
    R31 is either the stack pointer (RSP), or the zero register (ZR),
    depending on the instruction. Note the distinction between the
    hardware stack pointer, RSP, and the virtual stack pointer SP.
    
    The (hardware) stack pointer must be 16-byte aligned at all times;
    the RSP register itself must be aligned, offset(RSP) only has to
    have natural alignment.
    
    Instructions are fixed-width, and are 32-bit wide. ARM64 supports
    ARMv7 too (32-bit ARM), but not in the same process. In general,
    there is not much in common between 32-bit ARM and ARM64, it's a
    new architecture.
    
    All implementations have floating point instructions.
    
    This change adds a Prog.To3 field analogous to Prog.To. It is used
    by exclusive load/store instructions such as STLXR which read from
    one register, and write to both a register and a memory address.
    
    	STLXRW	R1, (R0), R3
    
    This will store the word contained in R1 to the memory address
    pointed by R0. R3 will be updated with the status result of the
    store. It is used to implement atomic operations.
    
    No other changes are made to the portable Prog and Addr structures.
    
    Change-Id: Ie839029aa5265bbad35769d9689eca11e1c48c47
    Reviewed-on: https://go-review.googlesource.com/7046Reviewed-by: 's avatarRuss Cox <rsc@golang.org>
    26bbe7ac
list7.go 3.08 KB