diff options
| author | Xiaolin Zhao <zhaoxiaolin@loongson.cn> | 2024-08-12 17:20:44 +0800 |
|---|---|---|
| committer | Gopher Robot <gobot@golang.org> | 2024-09-13 17:15:09 +0000 |
| commit | 2c5b707b3b30ea194877600151a7c299671cab3a (patch) | |
| tree | 285c45a05b1b2a35bfc07d205b83113350ae78ee /test/codegen/mathbits.go | |
| parent | b895dd56308304bedcea17852c01dc0cd794bfb8 (diff) | |
| download | go-2c5b707b3b30ea194877600151a7c299671cab3a.tar.xz | |
cmd/compile: optimize RotateLeft8/16 on loong64
goos: linux
goarch: loong64
pkg: math/bits
cpu: Loongson-3A6000 @ 2500.00MHz
│ bench.old │ bench.new │
│ sec/op │ sec/op vs base │
RotateLeft8 1.401n ± 0% 1.201n ± 0% -14.28% (p=0.000 n=20)
RotateLeft16 1.4010n ± 0% 0.8032n ± 0% -42.67% (p=0.000 n=20)
geomean 1.401n 0.9822n -29.90%
goos: linux
goarch: loong64
pkg: math/bits
cpu: Loongson-3A5000 @ 2500.00MHz
│ bench.old │ bench.new │
│ sec/op │ sec/op vs base │
RotateLeft8 1.576n ± 0% 1.310n ± 0% -16.88% (p=0.000 n=20)
RotateLeft16 1.576n ± 0% 1.166n ± 0% -26.02% (p=0.000 n=20)
geomean 1.576n 1.236n -21.58%
Change-Id: I39c18306be0b8fd31b57bd0911714abd1783b50e
Reviewed-on: https://go-review.googlesource.com/c/go/+/604738
Auto-Submit: abner chenc <chenguoqi@loongson.cn>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: abner chenc <chenguoqi@loongson.cn>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Tim King <taking@google.com>
Diffstat (limited to 'test/codegen/mathbits.go')
| -rw-r--r-- | test/codegen/mathbits.go | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/test/codegen/mathbits.go b/test/codegen/mathbits.go index af2c9e790c..4754f29525 100644 --- a/test/codegen/mathbits.go +++ b/test/codegen/mathbits.go @@ -230,6 +230,7 @@ func ReverseBytes16(n uint16) uint16 { func RotateLeft64(n uint64) uint64 { // amd64:"ROLQ" // arm64:"ROR" + // loong64:"ROTRV" // ppc64x:"ROTL" // riscv64:"RORI" // s390x:"RISBGZ\t[$]0, [$]63, [$]37, " @@ -241,6 +242,7 @@ func RotateLeft32(n uint32) uint32 { // amd64:"ROLL" 386:"ROLL" // arm:`MOVW\tR[0-9]+@>23` // arm64:"RORW" + // loong64:"ROTR\t" // ppc64x:"ROTLW" // riscv64:"RORIW" // s390x:"RLL" @@ -251,18 +253,21 @@ func RotateLeft32(n uint32) uint32 { func RotateLeft16(n uint16, s int) uint16 { // amd64:"ROLW" 386:"ROLW" // arm64:"RORW",-"CSEL" + // loong64:"ROTR\t","SLLV" return bits.RotateLeft16(n, s) } func RotateLeft8(n uint8, s int) uint8 { // amd64:"ROLB" 386:"ROLB" // arm64:"LSL","LSR",-"CSEL" + // loong64:"OR","SLLV","SRLV" return bits.RotateLeft8(n, s) } func RotateLeftVariable(n uint, m int) uint { // amd64:"ROLQ" // arm64:"ROR" + // loong64:"ROTRV" // ppc64x:"ROTL" // riscv64:"ROL" // s390x:"RLLG" @@ -273,6 +278,7 @@ func RotateLeftVariable(n uint, m int) uint { func RotateLeftVariable64(n uint64, m int) uint64 { // amd64:"ROLQ" // arm64:"ROR" + // loong64:"ROTRV" // ppc64x:"ROTL" // riscv64:"ROL" // s390x:"RLLG" @@ -284,6 +290,7 @@ func RotateLeftVariable32(n uint32, m int) uint32 { // arm:`MOVW\tR[0-9]+@>R[0-9]+` // amd64:"ROLL" // arm64:"RORW" + // loong64:"ROTR\t" // ppc64x:"ROTLW" // riscv64:"ROLW" // s390x:"RLL" |
