aboutsummaryrefslogtreecommitdiff
path: root/test/codegen
diff options
context:
space:
mode:
authoreric fang <eric.fang@arm.com>2022-05-05 07:46:05 +0000
committerEric Fang <eric.fang@arm.com>2022-08-23 06:11:32 +0000
commit9f0f87c806b7a11b2cb3ebcd02eac57ee389c43a (patch)
tree863f4ed6c3f96c332dc96bff0ccb23314b9451fe /test/codegen
parent0a52d80666ddaa557cec17ad9166e2514b0bb6d4 (diff)
downloadgo-9f0f87c806b7a11b2cb3ebcd02eac57ee389c43a.tar.xz
cmd/internal/obj/arm64: remove the transition from $0 to ZR
Previously we convert $0 to the ZR register for some reasons, which causes two problems: 1. Confusion, the special case of the ZR register needs to be considered when dealing with constants. For encoding, some places we encode ZR, and some places we encode $0, although we have converted $0 to ZR. 2. Unexpected instruction format. All instructions that support ZR register operands can be replaced by $0. This patch removes this conversion. Note that this patch may cause previously unintendedly supported instruction formats to no longer be supported. Change-Id: I3d8d2c06711b7614a38191397da7776417f1861c Reviewed-on: https://go-review.googlesource.com/c/go/+/404316 Reviewed-by: David Chase <drchase@google.com> Run-TryBot: Eric Fang <eric.fang@arm.com> Reviewed-by: Cherry Mui <cherryyz@google.com> TryBot-Result: Gopher Robot <gobot@golang.org>
Diffstat (limited to 'test/codegen')
-rw-r--r--test/codegen/bitfield.go5
1 files changed, 3 insertions, 2 deletions
diff --git a/test/codegen/bitfield.go b/test/codegen/bitfield.go
index 11f31ecf25..3276af3de0 100644
--- a/test/codegen/bitfield.go
+++ b/test/codegen/bitfield.go
@@ -122,10 +122,10 @@ func sbfx1(x int64) int64 {
}
func sbfx2(x int64) int64 {
- return (x << 60) >> 60 // arm64:"SBFX\tZR, R[0-9]+, [$]4",-"LSL",-"ASR"
+ return (x << 60) >> 60 // arm64:"SBFX\t[$]0, R[0-9]+, [$]4",-"LSL",-"ASR"
}
-// merge shift and sign-extension into sbfx.
+// merge shift and sign-extension into sbfx.
func sbfx3(x int32) int64 {
return int64(x) >> 3 // arm64:"SBFX\t[$]3, R[0-9]+, [$]29",-"ASR"
}
@@ -328,6 +328,7 @@ func ubfx16(x uint64) uint64 {
}
// Check that we don't emit comparisons for constant shifts.
+//
//go:nosplit
func shift_no_cmp(x int) int {
// arm64:`LSL\t[$]17`,-`CMP`