1
0
mirror of https://github.com/golang/go synced 2024-11-25 19:07:57 -07:00

test/codegen: add Rotate test for riscv64

Change-Id: I7d996b8d46fbeef933943f806052a30f1f8d50c3
Reviewed-on: https://go-review.googlesource.com/c/go/+/588836
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Joel Sing <joel@sing.id.au>
Reviewed-by: Tim King <taking@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
This commit is contained in:
Meng Zhuo 2024-05-29 17:47:00 +08:00 committed by Meng Zhuo
parent 9b88f58099
commit 2982253c42

View File

@ -231,6 +231,7 @@ func RotateLeft64(n uint64) uint64 {
// amd64:"ROLQ" // amd64:"ROLQ"
// arm64:"ROR" // arm64:"ROR"
// ppc64x:"ROTL" // ppc64x:"ROTL"
// riscv64:"RORI"
// s390x:"RISBGZ\t[$]0, [$]63, [$]37, " // s390x:"RISBGZ\t[$]0, [$]63, [$]37, "
// wasm:"I64Rotl" // wasm:"I64Rotl"
return bits.RotateLeft64(n, 37) return bits.RotateLeft64(n, 37)
@ -241,6 +242,7 @@ func RotateLeft32(n uint32) uint32 {
// arm:`MOVW\tR[0-9]+@>23` // arm:`MOVW\tR[0-9]+@>23`
// arm64:"RORW" // arm64:"RORW"
// ppc64x:"ROTLW" // ppc64x:"ROTLW"
// riscv64:"RORIW"
// s390x:"RLL" // s390x:"RLL"
// wasm:"I32Rotl" // wasm:"I32Rotl"
return bits.RotateLeft32(n, 9) return bits.RotateLeft32(n, 9)
@ -262,6 +264,7 @@ func RotateLeftVariable(n uint, m int) uint {
// amd64:"ROLQ" // amd64:"ROLQ"
// arm64:"ROR" // arm64:"ROR"
// ppc64x:"ROTL" // ppc64x:"ROTL"
// riscv64:"ROL"
// s390x:"RLLG" // s390x:"RLLG"
// wasm:"I64Rotl" // wasm:"I64Rotl"
return bits.RotateLeft(n, m) return bits.RotateLeft(n, m)
@ -271,6 +274,7 @@ func RotateLeftVariable64(n uint64, m int) uint64 {
// amd64:"ROLQ" // amd64:"ROLQ"
// arm64:"ROR" // arm64:"ROR"
// ppc64x:"ROTL" // ppc64x:"ROTL"
// riscv64:"ROL"
// s390x:"RLLG" // s390x:"RLLG"
// wasm:"I64Rotl" // wasm:"I64Rotl"
return bits.RotateLeft64(n, m) return bits.RotateLeft64(n, m)
@ -281,6 +285,7 @@ func RotateLeftVariable32(n uint32, m int) uint32 {
// amd64:"ROLL" // amd64:"ROLL"
// arm64:"RORW" // arm64:"RORW"
// ppc64x:"ROTLW" // ppc64x:"ROTLW"
// riscv64:"ROLW"
// s390x:"RLL" // s390x:"RLL"
// wasm:"I32Rotl" // wasm:"I32Rotl"
return bits.RotateLeft32(n, m) return bits.RotateLeft32(n, m)