Skip to content

Commit 7673e30

Browse files
zorrorffmcherrymui
authored andcommitted
cmd/asm: fix bug about VMOV instruction (move register to vector element) on ARM64
This change fixes index error when encoding VMOV instruction which pattern is VMOV Rn, V.<T>[index]. For example VMOV R1, V1.S[1] is assembled as VMOV R1, V1.S[0] Fixes #24400 Change-Id: I82b5edc8af4e06862bc4692b119697c6bb7dc3fb Reviewed-on: https://go-review.googlesource.com/101297 Reviewed-by: Cherry Zhang <[email protected]>
1 parent c12b185 commit 7673e30

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

src/cmd/asm/internal/asm/testdata/arm64.s

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,7 @@ TEXT foo(SB), DUPOK|NOSPLIT, $-8
230230
VMOV V0.D[0], R11 // 0b3c084e
231231
VMOV V0.D[1], R11 // 0b3c184e
232232
VMOV R20, V1.S[0] // 811e044e
233+
VMOV R20, V1.S[1] // 811e0c4e
233234
VMOV R1, V9.H4 // 290c020e
234235
VMOV R22, V11.D2 // cb0e084e
235236
VMOV V2.B16, V4.B16 // 441ca24e

src/cmd/internal/obj/arm64/asm7.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3563,7 +3563,7 @@ func (c *ctxt7) asmout(p *obj.Prog, o *Optab, out []uint32) {
35633563
rt := int(p.To.Reg)
35643564
imm5 := 0
35653565
o1 = 1<<30 | 7<<25 | 7<<10
3566-
index := int(p.From.Index)
3566+
index := int(p.To.Index)
35673567
switch (p.To.Reg >> 5) & 15 {
35683568
case ARNG_B:
35693569
c.checkindex(p, index, 15)

0 commit comments

Comments
 (0)