aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorKeith Randall <khr@golang.org>2021-09-19 09:09:55 -0700
committerKeith Randall <khr@golang.org>2021-09-19 23:50:23 +0000
commit83b36ffb108cc6e6cc3282b94c090f70100b5ef0 (patch)
treede573d1db3c26cd5600fec69276e55cbcadbc5d7 /test
parent771b8ea4f4c56b3e27351807ade7ef72c3a15750 (diff)
downloadgo-83b36ffb108cc6e6cc3282b94c090f70100b5ef0.tar.gz
go-83b36ffb108cc6e6cc3282b94c090f70100b5ef0.zip
cmd/compile: implement constant rotates on arm64
Explicit constant rotates work, but constant arguments to bits.RotateLeft* needed the additional rule. Fixes #48465 Change-Id: Ia7544f21d0e7587b6b6506f72421459cd769aea6 Reviewed-on: https://go-review.googlesource.com/c/go/+/350909 Trust: Keith Randall <khr@golang.org> Trust: Josh Bleecher Snyder <josharian@gmail.com> Run-TryBot: Keith Randall <khr@golang.org> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
Diffstat (limited to 'test')
-rw-r--r--test/codegen/rotate.go19
1 files changed, 17 insertions, 2 deletions
diff --git a/test/codegen/rotate.go b/test/codegen/rotate.go
index 519cc83263..70489a2adc 100644
--- a/test/codegen/rotate.go
+++ b/test/codegen/rotate.go
@@ -34,8 +34,15 @@ func rot64(x uint64) uint64 {
// ppc64le:"ROTL\t[$]9"
a += x<<9 ^ x>>55
- // s390x:"RISBGZ\t[$]0, [$]63, [$]7, "
+ // amd64:"ROLQ\t[$]10"
+ // arm64:"ROR\t[$]54"
+ // s390x:"RISBGZ\t[$]0, [$]63, [$]10, "
+ // ppc64:"ROTL\t[$]10"
+ // ppc64le:"ROTL\t[$]10"
// arm64:"ROR\t[$]57" // TODO this is not great line numbering, but then again, the instruction did appear
+ // s390x:"RISBGZ\t[$]0, [$]63, [$]7, " // TODO ditto
+ a += bits.RotateLeft64(x, 10)
+
return a
}
@@ -64,8 +71,16 @@ func rot32(x uint32) uint32 {
// ppc64le:"ROTLW\t[$]9"
a += x<<9 ^ x>>23
- // s390x:"RLL\t[$]7"
+ // amd64:"ROLL\t[$]10"
+ // arm:"MOVW\tR\\d+@>22"
+ // arm64:"RORW\t[$]22"
+ // s390x:"RLL\t[$]10"
+ // ppc64:"ROTLW\t[$]10"
+ // ppc64le:"ROTLW\t[$]10"
// arm64:"RORW\t[$]25" // TODO this is not great line numbering, but then again, the instruction did appear
+ // s390x:"RLL\t[$]7" // TODO ditto
+ a += bits.RotateLeft32(x, 10)
+
return a
}