]> Cypherpunks repositories - gostls13.git/commit
cmd/internal/obj, cmd/internal/obj/arm64: add support for GOARCH=arm64
authorAram Hăvărneanu <aram@mgk.ro>
Sun, 8 Mar 2015 12:58:16 +0000 (13:58 +0100)
committerAram Hăvărneanu <aram@mgk.ro>
Mon, 16 Mar 2015 18:44:57 +0000 (18:44 +0000)
commit26bbe7ac9b78db96023427e9dced8afeea3195af
treeac848853594db7c73ce61a41d30d76c697a2aa99
parent25e213752b22cf5d9298c03bc5c1d1ac8bf4b1b1
cmd/internal/obj, cmd/internal/obj/arm64: add support for GOARCH=arm64

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/7046
Reviewed-by: Russ Cox <rsc@golang.org>
src/cmd/internal/obj/arm64/7.out.go [new file with mode: 0644]
src/cmd/internal/obj/arm64/anames.go [new file with mode: 0644]
src/cmd/internal/obj/arm64/anames7.go [new file with mode: 0644]
src/cmd/internal/obj/arm64/asm7.go [new file with mode: 0644]
src/cmd/internal/obj/arm64/list7.go [new file with mode: 0644]
src/cmd/internal/obj/arm64/obj7.go [new file with mode: 0644]
src/cmd/internal/obj/arm64/util.go [new file with mode: 0644]
src/cmd/internal/obj/link.go
src/cmd/internal/obj/util.go