aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/asm
diff options
context:
space:
mode:
authoreric fang <eric.fang@arm.com>2021-04-15 03:27:55 +0000
committereric fang <eric.fang@arm.com>2021-04-22 01:40:02 +0000
commit5daefc5363080acd631ae97a84faf651a70d9888 (patch)
tree19764b652befa9b2d74dc66fbfb7a7cde8d48ab6 /src/cmd/asm
parent0636d88f6d79827e0acdc8e53b8f249652061d2d (diff)
downloadgo-5daefc5363080acd631ae97a84faf651a70d9888.tar.gz
go-5daefc5363080acd631ae97a84faf651a70d9888.zip
cmd/internal/obj/arm64: fix the wrong ROR operator of some instructions
Instructions such as ADD, SUB, CMP do not support ROR shift operations, but we have not checked this at present. This CL adds this check. Change-Id: Icac461f61ad6ddb60886a59ba34dddd29df1cc0f Reviewed-on: https://go-review.googlesource.com/c/go/+/310035 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>
Diffstat (limited to 'src/cmd/asm')
-rw-r--r--src/cmd/asm/internal/asm/testdata/arm64error.s18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/cmd/asm/internal/asm/testdata/arm64error.s b/src/cmd/asm/internal/asm/testdata/arm64error.s
index 474ed556d0..1744c09b98 100644
--- a/src/cmd/asm/internal/asm/testdata/arm64error.s
+++ b/src/cmd/asm/internal/asm/testdata/arm64error.s
@@ -32,6 +32,24 @@ TEXT errors(SB),$0
ANDS $0x22220000, R2, RSP // ERROR "illegal combination"
ADD R1, R2, R3, R4 // ERROR "illegal combination"
BICW R7@>33, R5, R16 // ERROR "shift amount out of range 0 to 31"
+ NEGW R7<<33, R5 // ERROR "shift amount out of range 0 to 31"
+ NEGSW R7<<33, R5 // ERROR "shift amount out of range 0 to 31"
+ ADD R7@>2, R5, R16 // ERROR "unsupported shift operator"
+ ADDW R7@>2, R5, R16 // ERROR "unsupported shift operator"
+ ADDS R7@>2, R5, R16 // ERROR "unsupported shift operator"
+ ADDSW R7@>2, R5, R16 // ERROR "unsupported shift operator"
+ SUB R7@>2, R5, R16 // ERROR "unsupported shift operator"
+ SUBW R7@>2, R5, R16 // ERROR "unsupported shift operator"
+ SUBS R7@>2, R5, R16 // ERROR "unsupported shift operator"
+ SUBSW R7@>2, R5, R16 // ERROR "unsupported shift operator"
+ CMP R7@>2, R5 // ERROR "unsupported shift operator"
+ CMPW R7@>2, R5 // ERROR "unsupported shift operator"
+ CMN R7@>2, R5 // ERROR "unsupported shift operator"
+ CMNW R7@>2, R5 // ERROR "unsupported shift operator"
+ NEG R7@>2, R5 // ERROR "unsupported shift operator"
+ NEGW R7@>2, R5 // ERROR "unsupported shift operator"
+ NEGS R7@>2, R5 // ERROR "unsupported shift operator"
+ NEGSW R7@>2, R5 // ERROR "unsupported shift operator"
CINC CS, R2, R3, R4 // ERROR "illegal combination"
CSEL LT, R1, R2 // ERROR "illegal combination"
LDP.P 8(R2), (R2, R3) // ERROR "constrained unpredictable behavior"