From 897b3da2e079b9b940b309747305a5379fffa6ec Mon Sep 17 00:00:00 2001 From: eric fang Date: Wed, 5 Jan 2022 09:20:06 +0000 Subject: cmd/internal/obj/arm64: adjust rule for VMOVQ instruction The VMOVQ instruction stores a 128-bit number into a V register, for example: VMOVQ $0x1122334455667788, $0x99aabbccddeeff00, V2 From a documentation (https://pkg.go.dev/cmd/internal/obj/arm64) point of view, the value in V2 should be 0x112233445566778899aabbccddeeff00, however the value is actually 0x99aabbccddeeff001122334455667788. The reason is that we misplaced the high 64-bit and the low 64-bit in the literal pool. To maintain backward compatibility, this CL adjusts the rule of VMOVQ instruction to make the documentation consistent with the code. Fixes #50528 Change-Id: Ib51f59e97c55252ab2a50bbc6ba4d430732a7a04 Reviewed-on: https://go-review.googlesource.com/c/go/+/377055 Reviewed-by: Cherry Mui Reviewed-by: Eric Fang Run-TryBot: Eric Fang Trust: Eric Fang TryBot-Result: Gopher Robot --- src/cmd/internal/obj/arm64/asm7.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/cmd/internal/obj/arm64/asm7.go') diff --git a/src/cmd/internal/obj/arm64/asm7.go b/src/cmd/internal/obj/arm64/asm7.go index 68f0921d4d..f4111f4f5c 100644 --- a/src/cmd/internal/obj/arm64/asm7.go +++ b/src/cmd/internal/obj/arm64/asm7.go @@ -1184,7 +1184,7 @@ func (c *ctxt7) addpool128(p *obj.Prog, al, ah *obj.Addr) { q := c.newprog() q.As = ADWORD q.To.Type = obj.TYPE_CONST - q.To.Offset = al.Offset + q.To.Offset = al.Offset // q.Pc is lower than t.Pc, so al.Offset is stored in q. t := c.newprog() t.As = ADWORD -- cgit v1.2.3-54-g00ecf