aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/asm/internal/asm/testdata/arm64error.s
diff options
context:
space:
mode:
authorfanzha02 <fannie.zhang@arm.com>2018-01-16 03:00:04 +0000
committerCherry Zhang <cherryyz@google.com>2018-01-23 15:59:15 +0000
commitcafb36bf11c0ec30a5650a6f1200b0f046fc67a7 (patch)
tree057ef0cb2f50d75bcd3e05f3eaca1095b66ea624 /src/cmd/asm/internal/asm/testdata/arm64error.s
parent4a2f28f51ecabfb4a839d7f483a32ae9b9206c83 (diff)
downloadgo-cafb36bf11c0ec30a5650a6f1200b0f046fc67a7.tar.gz
go-cafb36bf11c0ec30a5650a6f1200b0f046fc67a7.zip
cmd/internal/obj/arm64: fix assemble VLD1/VST1 bug
The current code misassembles VLD1/VST1 instruction with non-zero offset. The offset is dropped silently without any error message. The cause of the misassembling is the current code treats argument (Rn)(Rm) as ZOREG type. The fix changes the matching rules and considers (Rn)(Rm) as ROFF type. The fix will report error information when assembles VLD1/VST1 (R8)(R13), [V1.16B]. The fix enables the ARM64Errors test. Fixes #23448 Change-Id: I3dd518b91e9960131ffb8efcb685cb8df84b70eb Reviewed-on: https://go-review.googlesource.com/87956 Reviewed-by: Cherry Zhang <cherryyz@google.com> Run-TryBot: Cherry Zhang <cherryyz@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org>
Diffstat (limited to 'src/cmd/asm/internal/asm/testdata/arm64error.s')
-rw-r--r--src/cmd/asm/internal/asm/testdata/arm64error.s13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/cmd/asm/internal/asm/testdata/arm64error.s b/src/cmd/asm/internal/asm/testdata/arm64error.s
new file mode 100644
index 0000000000..97af09c4dd
--- /dev/null
+++ b/src/cmd/asm/internal/asm/testdata/arm64error.s
@@ -0,0 +1,13 @@
+// Copyright 2018 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+TEXT errors(SB),$0
+ MOVD.P 300(R2), R3 // ERROR "offset out of range [-255,254]"
+ MOVD.P R3, 344(R2) // ERROR "offset out of range [-255,254]"
+ VLD1 (R8)(R13), [V2.B16] // ERROR "illegal combination"
+ VLD1 8(R9), [V2.B16] // ERROR "illegal combination"
+ VST1 [V1.B16], (R8)(R13) // ERROR "illegal combination"
+ VST1 [V1.B16], 9(R2) // ERROR "illegal combination"
+ VLD1 8(R8)(R13), [V2.B16] // ERROR "illegal combination"
+ RET