]> Cypherpunks repositories - gostls13.git/commit
cmd/internal/obj/arm64: fix the wrong sp dst register of ADDS/SUBS instructions
authoreric fang <eric.fang@arm.com>
Tue, 13 Apr 2021 02:48:32 +0000 (02:48 +0000)
committereric fang <eric.fang@arm.com>
Thu, 15 Apr 2021 01:54:41 +0000 (01:54 +0000)
commit48b7432e3f5318a026842fc4f39fb690e13f79f8
treef88afa9b60c7568f7ed83b6af0ed79fe193a7d84
parent566a87c16b055872cb469d46cbccc2404dba9bb7
cmd/internal/obj/arm64: fix the wrong sp dst register of ADDS/SUBS instructions

According the armv8-a specification, the destination register of the ADDS/ADDSW/
SUBS/SUBSW instructions can not be RSP, the current implementation does not
check this and encodes this wrong instruction format as a CMN instruction. This
CL adds a check and test cases for this situation.

Change-Id: I92cc2f8e17dbda70f0dce8fddf1ca6d5d7730589
Reviewed-on: https://go-review.googlesource.com/c/go/+/309989
Reviewed-by: eric fang <eric.fang@arm.com>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
Trust: eric fang <eric.fang@arm.com>
Run-TryBot: eric fang <eric.fang@arm.com>
TryBot-Result: Go Bot <gobot@golang.org>
src/cmd/asm/internal/asm/testdata/arm64error.s
src/cmd/internal/obj/arm64/asm7.go