aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/internal/obj/util.go
diff options
context:
space:
mode:
authorJunyang Shao <shaojunyang@google.com>2026-04-10 17:14:35 +0000
committerJunyang Shao <shaojunyang@google.com>2026-04-13 13:36:48 -0700
commit356b87fa7bbba02debea59d2d03e1eca1750ccb6 (patch)
treecf151c602d80cc2c5faf4547de8ec00800275431 /src/cmd/internal/obj/util.go
parent65203e06e61429f0dfc79a406212fa9b99599546 (diff)
downloadgo-356b87fa7bbba02debea59d2d03e1eca1750ccb6.tar.xz
cmd/asm, cmd/internal/obj/arm64: support memory with MUL VL imm offset
This CL is generated by CL 765440. This CL supports this addressing pattern: (VL*imm)(Reg) (-VL*imm)(Reg) Change-Id: I4d1bab2ef6c4141699a47b28aa14b28cdee6cb3f Reviewed-on: https://go-review.googlesource.com/c/go/+/765420 LUCI-TryBot-Result: golang-scoped@luci-project-accounts.iam.gserviceaccount.com <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: David Chase <drchase@google.com> Commit-Queue: Junyang Shao <shaojunyang@google.com>
Diffstat (limited to 'src/cmd/internal/obj/util.go')
-rw-r--r--src/cmd/internal/obj/util.go42
1 files changed, 25 insertions, 17 deletions
diff --git a/src/cmd/internal/obj/util.go b/src/cmd/internal/obj/util.go
index fffafeba05..2b7c1f99a8 100644
--- a/src/cmd/internal/obj/util.go
+++ b/src/cmd/internal/obj/util.go
@@ -304,24 +304,32 @@ func writeDconv(w io.Writer, p *Prog, a *Addr, abiDetail bool) {
case TYPE_MEM:
if buildcfg.GOARCH == "arm64" && (a.Scale < 0 || (a.Index != REG_NONE && (isZReg(int(a.Reg)) || isZReg(int(a.Index))))) {
// SVE extended addressing pattern
- amount := 0
- mod := 0
- if a.Scale < 0 {
- amount = int((a.Scale >> 12) & 0x7)
- mod = int((a.Scale >> 9) & 0x7)
- }
- modStr := ""
- switch mod {
- case 1:
- modStr = ".UXTW"
- case 2:
- modStr = ".SXTW"
- }
- amountStr := ""
- if amount != 0 {
- amountStr = fmt.Sprintf("<<%d", amount)
+ if a.Index == REG_NONE {
+ if a.Offset < 0 {
+ fmt.Fprintf(w, "(-VL*%d)(%v)", -a.Offset, Rconv(int(a.Reg)))
+ } else {
+ fmt.Fprintf(w, "(VL*%d)(%v)", a.Offset, Rconv(int(a.Reg)))
+ }
+ } else {
+ amount := 0
+ mod := 0
+ if a.Scale < 0 {
+ amount = int((a.Scale >> 12) & 0x7)
+ mod = int((a.Scale >> 9) & 0x7)
+ }
+ modStr := ""
+ switch mod {
+ case 1:
+ modStr = ".UXTW"
+ case 2:
+ modStr = ".SXTW"
+ }
+ amountStr := ""
+ if amount != 0 {
+ amountStr = fmt.Sprintf("<<%d", amount)
+ }
+ fmt.Fprintf(w, "(%v%s%s)(%v)", Rconv(int(a.Reg)), modStr, amountStr, Rconv(int(a.Index)))
}
- fmt.Fprintf(w, "(%v%s%s)(%v)", Rconv(int(a.Reg)), modStr, amountStr, Rconv(int(a.Index)))
} else {
a.WriteNameTo(w)
if a.Index != REG_NONE {