aboutsummaryrefslogtreecommitdiff
path: root/test/codegen/mathbits.go
diff options
context:
space:
mode:
authorMichael Munday <mike.munday@ibm.com>2018-09-03 10:47:58 -0400
committerMichael Munday <mike.munday@ibm.com>2018-09-05 08:29:02 +0000
commitf94de9c9fbed2a8d52a84b565c54da6efb015c4d (patch)
tree6037323e075061d9d1ac1d395757201833ca5c31 /test/codegen/mathbits.go
parent0e9f1de0b7c934d9061f05f4781994fbd3ebd301 (diff)
downloadgo-f94de9c9fbed2a8d52a84b565c54da6efb015c4d.tar.xz
cmd/compile: make math/bits.RotateLeft{32,64} intrinsics on s390x
Extends CL 132435 to s390x. s390x has 32- and 64-bit variable rotate left instructions. Change-Id: Ic4f1ebb0e0543207ed2fc8c119e0163b428138a5 Reviewed-on: https://go-review.googlesource.com/133035 Run-TryBot: Michael Munday <mike.munday@ibm.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Cherry Zhang <cherryyz@google.com>
Diffstat (limited to 'test/codegen/mathbits.go')
-rw-r--r--test/codegen/mathbits.go23
1 files changed, 23 insertions, 0 deletions
diff --git a/test/codegen/mathbits.go b/test/codegen/mathbits.go
index ad2c5abb02..b8844c518f 100644
--- a/test/codegen/mathbits.go
+++ b/test/codegen/mathbits.go
@@ -171,6 +171,7 @@ func RotateLeft64(n uint64) uint64 {
// amd64:"ROLQ"
// arm64:"ROR"
// ppc64:"ROTL"
+ // s390x:"RLLG"
return bits.RotateLeft64(n, 37)
}
@@ -178,6 +179,7 @@ func RotateLeft32(n uint32) uint32 {
// amd64:"ROLL" 386:"ROLL"
// arm64:"RORW"
// ppc64:"ROTLW"
+ // s390x:"RLL"
return bits.RotateLeft32(n, 9)
}
@@ -191,6 +193,27 @@ func RotateLeft8(n uint8) uint8 {
return bits.RotateLeft8(n, 5)
}
+func RotateLeftVariable(n uint, m int) uint {
+ // amd64:"ROLQ"
+ // ppc64:"ROTL"
+ // s390x:"RLLG"
+ return bits.RotateLeft(n, m)
+}
+
+func RotateLeftVariable64(n uint64, m int) uint64 {
+ // amd64:"ROLQ"
+ // ppc64:"ROTL"
+ // s390x:"RLLG"
+ return bits.RotateLeft64(n, m)
+}
+
+func RotateLeftVariable32(n uint32, m int) uint32 {
+ // amd64:"ROLL"
+ // ppc64:"ROTLW"
+ // s390x:"RLL"
+ return bits.RotateLeft32(n, m)
+}
+
// ------------------------ //
// bits.TrailingZeros //
// ------------------------ //