]> Cypherpunks.ru repositories - gostls13.git/commit
cmd/internal/obj/arm64: fix VMOVQ instruction encoding error
authoreric fang <eric.fang@arm.com>
Thu, 14 Jan 2021 07:14:02 +0000 (07:14 +0000)
committereric fang <eric.fang@arm.com>
Sat, 23 Jan 2021 12:38:15 +0000 (12:38 +0000)
commitcd99385ff4a4b7534c71bb92420da6f462c5598e
tree53a464192d39ff41f148444908c309fc68f8348a
parent66ee8b158f0a9e9fdc6cc2118926cb4bea497128
cmd/internal/obj/arm64: fix VMOVQ instruction encoding error

The VMOVQ instruction moves a 128-bit constant into a V register, as 128-bit
constant can't be loaded into a register directly, we split it into two 64-bit
constants and load it from constant pool. Currently we add the 128-bit constant
to literal pool by calling the 'addpool' function twice, this is not the right
way because it doesn't guarantee the two DWORD instructions are consecutive,
and the second call of addpool will overwrite the p.Pool field,resulting in a
wrong PC-relative offset value of the Prog.

This CL renames the flag LFROM3 to LFROM128, and adds a new function addpool128
to add a 128-bit constant to the literal pool.

Change-Id: I616f043c99a9a18a663f8768842cc980de2e6f79
Reviewed-on: https://go-review.googlesource.com/c/go/+/282334
Reviewed-by: eric fang <eric.fang@arm.com>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
Run-TryBot: eric fang <eric.fang@arm.com>
Trust: eric fang <eric.fang@arm.com>
src/cmd/internal/obj/arm64/asm7.go
src/cmd/internal/obj/arm64/asm_arm64_test.go [moved from src/cmd/internal/obj/arm64/asm_test.go with 89% similarity]
src/cmd/internal/obj/arm64/asm_arm64_test.s [new file with mode: 0644]