]> Cypherpunks repositories - gostls13.git/commit
cmd/internal/obj/arm64: fix the bug of incorrect handling negative offset of LDP...
authorfanzha02 <fannie.zhang@arm.com>
Wed, 21 Mar 2018 10:49:24 +0000 (10:49 +0000)
committerCherry Zhang <cherryyz@google.com>
Fri, 13 Apr 2018 15:37:21 +0000 (15:37 +0000)
commit4d59b14400aff02ded4ccf62a7518266ea8fd767
tree8668699f7dd7fa81abc1a96e424b1e83a930d7f6
parent5a91c83ce82509551d353b1b5ea25cd72b44fec3
cmd/internal/obj/arm64: fix the bug of incorrect handling negative offset of LDP/STP/LDPW/STPW

The current assembler will report error when the negative offset is in
the range of [-256, 0) and is not the multiples of 4/8.

The fix introduces C_NSAUTO_8, C_NSAUTO_4 and C_NAUTO4K. C_NPAUTO
includes C_NSAUTO_8 instead of C_NSAUTO, C_NAUTO4K includes C_NSAUTO_8,
C_NSAUTO_4 and C_NSAUTO. So that assembler will encode the negative offset
that is greater than -4095 and is not the multiples of 4/8 as two instructions.

Add the test cases.

Fixed #24471

Change-Id: I42f34e3b8a9fc52c9e8b41504294271aafade639
Reviewed-on: https://go-review.googlesource.com/102635
Run-TryBot: Cherry Zhang <cherryyz@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
src/cmd/asm/internal/asm/testdata/arm64.s
src/cmd/internal/obj/arm64/a.out.go
src/cmd/internal/obj/arm64/anames7.go
src/cmd/internal/obj/arm64/asm7.go