diff options
author | fanzha02 <fannie.zhang@arm.com> | 2021-01-20 17:58:21 +0800 |
---|---|---|
committer | fannie zhang <Fannie.Zhang@arm.com> | 2021-03-12 01:47:01 +0000 |
commit | a607408403df7515f831fef64991222673a50a68 (patch) | |
tree | a59b734fd705d12bf9e1d12c580783788eb62537 /src/cmd/asm/internal/asm/testdata/arm64error.s | |
parent | 71a6c13164f2151c14ebaeccdfcb3633fc8b618e (diff) | |
download | go-a607408403df7515f831fef64991222673a50a68.tar.gz go-a607408403df7515f831fef64991222673a50a68.zip |
cmd/internal/obj/arm64: add support for op(extended register) with RSP arguments
Refer to ARM reference manual, like add(extended register) instructions,
the extension is encoded in the "option" field. If "Rd" or "Rn" is
RSP and "option" is "010" then LSL is preferred. Therefore, the instrution
"add Rm<<imm, RSP, RSP" or "add Rm<<imm RSP" is valid and can be encoded
as add(extended register) instruction.
But the current assembler can not handle like "op R1<<1, RSP, RSP"
instructions, this patch adds the support.
Because MVN(extended register) does not exist, remove it.
Add test cases.
Change-Id: I968749d75c6b93a4f297b39c73cc292e6b1035ad
Reviewed-on: https://go-review.googlesource.com/c/go/+/284900
Trust: fannie zhang <Fannie.Zhang@arm.com>
Run-TryBot: fannie zhang <Fannie.Zhang@arm.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
Diffstat (limited to 'src/cmd/asm/internal/asm/testdata/arm64error.s')
-rw-r--r-- | src/cmd/asm/internal/asm/testdata/arm64error.s | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/cmd/asm/internal/asm/testdata/arm64error.s b/src/cmd/asm/internal/asm/testdata/arm64error.s index 1c8eaa1752..64bade2051 100644 --- a/src/cmd/asm/internal/asm/testdata/arm64error.s +++ b/src/cmd/asm/internal/asm/testdata/arm64error.s @@ -368,4 +368,7 @@ TEXT errors(SB),$0 CASPD (R2, R3), (R2), (R9, R10) // ERROR "destination register pair must start from even register" CASPD (R2, R4), (R2), (R8, R9) // ERROR "source register pair must be contiguous" CASPD (R2, R3), (R2), (R8, R10) // ERROR "destination register pair must be contiguous" + ADD R1>>2, RSP, R3 // ERROR "illegal combination" + ADDS R2<<3, R3, RSP // ERROR "unexpected SP reference" + CMP R1<<5, RSP // ERROR "the left shift amount out of range 0 to 4" RET |