From c925e1546ee72e40ca5351f3773379e99a6b8cdf Mon Sep 17 00:00:00 2001 From: eric fang Date: Fri, 7 May 2021 05:48:18 +0000 Subject: cmd/internal/obj/arm64: disable AL and NV for some condition operation instructions According to the armv8-a reference manual, conditions AL and NV are not allowed for instructions CINC, CINV, CNEG, CSET and CSETM. This CL adds this check and the corresponding test cases. Change-Id: Icb496b7b13a353f41491f2de4d939a5cd88abb04 Reviewed-on: https://go-review.googlesource.com/c/go/+/317912 Reviewed-by: eric fang Reviewed-by: Cherry Mui Trust: eric fang Run-TryBot: eric fang TryBot-Result: Go Bot --- src/cmd/asm/internal/asm/testdata/arm64error.s | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/cmd/asm/internal/asm/testdata/arm64error.s') diff --git a/src/cmd/asm/internal/asm/testdata/arm64error.s b/src/cmd/asm/internal/asm/testdata/arm64error.s index 66fc910759..cf57179e43 100644 --- a/src/cmd/asm/internal/asm/testdata/arm64error.s +++ b/src/cmd/asm/internal/asm/testdata/arm64error.s @@ -52,6 +52,16 @@ TEXT errors(SB),$0 NEGSW R7@>2, R5 // ERROR "unsupported shift operator" CINC CS, R2, R3, R4 // ERROR "illegal combination" CSEL LT, R1, R2 // ERROR "illegal combination" + CINC AL, R2, R3 // ERROR "invalid condition" + CINC NV, R2, R3 // ERROR "invalid condition" + CINVW AL, R2, R3 // ERROR "invalid condition" + CINV NV, R2, R3 // ERROR "invalid condition" + CNEG AL, R2, R3 // ERROR "invalid condition" + CNEGW NV, R2, R3 // ERROR "invalid condition" + CSET AL, R2 // ERROR "invalid condition" + CSET NV, R2 // ERROR "invalid condition" + CSETMW AL, R2 // ERROR "invalid condition" + CSETM NV, R2 // ERROR "invalid condition" LDP.P 8(R2), (R2, R3) // ERROR "constrained unpredictable behavior" LDP.W 8(R3), (R2, R3) // ERROR "constrained unpredictable behavior" LDP (R1), (R2, R2) // ERROR "constrained unpredictable behavior" -- cgit v1.2.3-54-g00ecf