cmd/internal/obj: support arm64 FMOVQ from/to global address

Support arm64 FMOVQ from/to global address. Currently there are no
global addresses known to be aligned by 16 bytes, and with this CL
we will always use R_ADDRARM64 relocation with ADRP+ADD+FMOVQ instructions.

Change-Id: I283009eda151d1875cf4457734e79b68a941a6df
Reviewed-on: https://go-review.googlesource.com/c/go/+/718001
Auto-Submit: Keith Randall <khr@golang.org>
Reviewed-by: Keith Randall <khr@google.com>
Reviewed-by: Keith Randall <khr@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
This commit is contained in:
Alexander Musman
2025-11-05 17:03:31 +03:00
committed by Gopher Robot
parent 6435bf46c1
commit c373c59d68
2 changed files with 8 additions and 0 deletions

View File

@@ -698,6 +698,12 @@ TEXT foo(SB), DUPOK|NOSPLIT, $-8
FMOVD F4, (R2)(R6) // 446826fc
FMOVD F4, (R2)(R6<<3) // 447826fc
// global address
FMOVQ F5, x+8(SB)
FMOVQ F5, x(SB)
FMOVQ x+8(SB), F5
FMOVQ x(SB), F5
// vmov
VMOV V8.S[1], R1 // 013d0c0e
VMOV V0.D[0], R11 // 0b3c084e

View File

@@ -484,6 +484,8 @@ var optab = []Optab{
{AFMOVS, C_ADDR, C_NONE, C_NONE, C_FREG, C_NONE, 65, 12, 0, 0, 0},
{AFMOVD, C_FREG, C_NONE, C_NONE, C_ADDR, C_NONE, 64, 12, 0, 0, 0},
{AFMOVD, C_ADDR, C_NONE, C_NONE, C_FREG, C_NONE, 65, 12, 0, 0, 0},
{AFMOVQ, C_FREG, C_NONE, C_NONE, C_ADDR, C_NONE, 64, 12, 0, 0, 0},
{AFMOVQ, C_ADDR, C_NONE, C_NONE, C_FREG, C_NONE, 65, 12, 0, 0, 0},
{AFMOVS, C_FCON, C_NONE, C_NONE, C_FREG, C_NONE, 55, 4, 0, 0, 0},
{AFMOVS, C_FREG, C_NONE, C_NONE, C_FREG, C_NONE, 54, 4, 0, 0, 0},
{AFMOVD, C_FCON, C_NONE, C_NONE, C_FREG, C_NONE, 55, 4, 0, 0, 0},