]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/asm: fix bug about VMOV instruction (move a vector element to another) on ARM64
authorFangming.Fang <fangming.fang@arm.com>
Mon, 19 Mar 2018 07:36:43 +0000 (07:36 +0000)
committerCherry Zhang <cherryyz@google.com>
Tue, 20 Mar 2018 03:45:04 +0000 (03:45 +0000)
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 <cherryyz@google.com>
src/cmd/asm/internal/asm/testdata/arm64.s
src/cmd/internal/obj/arm64/asm7.go

index 4b364c458bbee8069a3761745b35230c01d2d29b..570efd83d2f3e8774993142c4c8fa0ad9a78f714 100644 (file)
@@ -239,6 +239,7 @@ TEXT        foo(SB), DUPOK|NOSPLIT, $-8
        VMOV    V10.S[0], V12.S[1]    // 4c050c6e
        VMOV    V9.H[0], V12.H[1]     // 2c05066e
        VMOV    V8.B[0], V12.B[1]     // 0c05036e
+       VMOV    V8.B[7], V4.B[8]      // 043d116e
        VREV32  V5.B16, V5.B16        // a508206e
        VDUP    V19.S[0], V17.S4      // 7106044e
 //
index a948d1243de34a782fd3cfdb6d1cc19c985fbd66..22fd4d61bda213511f960e4190a73da621a5144c 100644 (file)
@@ -3910,7 +3910,7 @@ func (c *ctxt7) asmout(p *obj.Prog, o *Optab, out []uint32) {
                default:
                        c.ctxt.Diag("invalid arrangement: %v", p)
                }
-               o1 |= (uint32(imm5&0x1f) << 16) | (uint32(imm4&0xf) << 16) | (uint32(rf&31) << 5) | uint32(rt&31)
+               o1 |= (uint32(imm5&0x1f) << 16) | (uint32(imm4&0xf) << 11) | (uint32(rf&31) << 5) | uint32(rt&31)
 
                break