]> Cypherpunks repositories - gostls13.git/commit
cmd/compile: lowered MulUintptr on riscv64
authorMeng Zhuo <mzh@golangcn.org>
Sat, 31 Jul 2021 10:20:10 +0000 (10:20 +0000)
committerMeng Zhuo <mzh@golangcn.org>
Tue, 17 Aug 2021 01:29:37 +0000 (01:29 +0000)
commit1951afc9193f8e197cb7dfaf6afed70ea02404cb
treeaeb457e9d3096d8bbd03bd3d04d183cd05fdbf62
parent2a193337164c8af8cba3d5c4ec0f36413c528bd8
cmd/compile: lowered MulUintptr on riscv64

According to RISCV instruction set manual v2.2 Sec 6.1
MULHU followed by MUL will be fused into one multiply by microarchitecture

name              old time/op  new time/op  delta
MulUintptr/small  11.2ns ±24%   9.2ns ± 0%  -17.54%  (p=0.000 n=10+9)
MulUintptr/large  15.9ns ± 0%  10.9ns ± 0%  -31.55%  (p=0.000 n=8+8)

Change-Id: I3d152218f83948cbc5c576bda29dc86e9b4206ee
Reviewed-on: https://go-review.googlesource.com/c/go/+/338753
Trust: Meng Zhuo <mzh@golangcn.org>
Reviewed-by: Joel Sing <joel@sing.id.au>
src/cmd/compile/internal/riscv64/ssa.go
src/cmd/compile/internal/ssa/gen/RISCV64.rules
src/cmd/compile/internal/ssa/gen/RISCV64Ops.go
src/cmd/compile/internal/ssa/opGen.go
src/cmd/compile/internal/ssa/rewriteRISCV64.go
src/cmd/compile/internal/ssagen/ssa.go