Skip to content

Commit 9c31224

Browse files
zorrorffmcherrymui
authored andcommitted
cmd/asm: fix bug about VMOV instruction (move a vector element to another) on ARM64
This change fixes index error when encoding VMOV instruction which pattern is vmov Vn.<T>[index], Vd.<T>[index] Change-Id: I949166e6dfd63fb0a9365f183b6c50d452614f9d Reviewed-on: https://go-review.googlesource.com/101335 Reviewed-by: Cherry Zhang <[email protected]>
1 parent 7673e30 commit 9c31224

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
@@ -239,6 +239,7 @@ TEXT foo(SB), DUPOK|NOSPLIT, $-8
239239
VMOV V10.S[0], V12.S[1] // 4c050c6e
240240
VMOV V9.H[0], V12.H[1] // 2c05066e
241241
VMOV V8.B[0], V12.B[1] // 0c05036e
242+
VMOV V8.B[7], V4.B[8] // 043d116e
242243
VREV32 V5.B16, V5.B16 // a508206e
243244
VDUP V19.S[0], V17.S4 // 7106044e
244245
//

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3910,7 +3910,7 @@ func (c *ctxt7) asmout(p *obj.Prog, o *Optab, out []uint32) {
39103910
default:
39113911
c.ctxt.Diag("invalid arrangement: %v", p)
39123912
}
3913-
o1 |= (uint32(imm5&0x1f) << 16) | (uint32(imm4&0xf) << 16) | (uint32(rf&31) << 5) | uint32(rt&31)
3913+
o1 |= (uint32(imm5&0x1f) << 16) | (uint32(imm4&0xf) << 11) | (uint32(rf&31) << 5) | uint32(rt&31)
39143914

39153915
break
39163916

0 commit comments

Comments
 (0)