diff options
| author | Meng Zhuo <mzh@golangcn.org> | 2023-06-26 20:46:49 +0800 |
|---|---|---|
| committer | M Zhuo <mzh@golangcn.org> | 2023-08-22 08:38:08 +0000 |
| commit | 05f951158278da91a67a2f6380ffbf0c9172f565 (patch) | |
| tree | f78b9031764f51e6569b839729224edf399fcbe7 /test/codegen | |
| parent | e7e99a8e022a5fe185341090a9fbb0383f3fe6b1 (diff) | |
| download | go-05f951158278da91a67a2f6380ffbf0c9172f565.tar.xz | |
cmd/compile: improve FP FMA performance on riscv64
FMADD/FMSUB/FNSUB are an efficient FP FMA instructions, which can
be used by the compiler to improve FP performance.
Erf 188.0n ± 2% 139.5n ± 2% -25.82% (p=0.000 n=10)
Erfc 193.6n ± 1% 143.2n ± 1% -26.01% (p=0.000 n=10)
Erfinv 244.4n ± 2% 172.6n ± 0% -29.40% (p=0.000 n=10)
Erfcinv 244.7n ± 2% 173.0n ± 1% -29.31% (p=0.000 n=10)
geomean 216.0n 156.3n -27.65%
Ref: The RISC-V Instruction Set Manual Volume I: Unprivileged ISA
11.6 Single-Precision Floating-Point Computational Instructions
Change-Id: I89aa3a4df7576fdd47f4a6ee608ac16feafd093c
Reviewed-on: https://go-review.googlesource.com/c/go/+/506036
Reviewed-by: Joel Sing <joel@sing.id.au>
Run-TryBot: M Zhuo <mzh@golangcn.org>
Reviewed-by: David Chase <drchase@google.com>
Reviewed-by: Keith Randall <khr@golang.org>
Reviewed-by: Keith Randall <khr@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Diffstat (limited to 'test/codegen')
| -rw-r--r-- | test/codegen/floats.go | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/test/codegen/floats.go b/test/codegen/floats.go index 9cb62e031a..1c5fc8a31a 100644 --- a/test/codegen/floats.go +++ b/test/codegen/floats.go @@ -88,17 +88,20 @@ func FusedAdd64(x, y, z float64) float64 { // s390x:"FMADD\t" // ppc64x:"FMADD\t" // arm64:"FMADDD" + // riscv64:"FMADDD\t" return x*y + z } func FusedSub64_a(x, y, z float64) float64 { // s390x:"FMSUB\t" // ppc64x:"FMSUB\t" + // riscv64:"FMSUBD\t" return x*y - z } func FusedSub64_b(x, y, z float64) float64 { // arm64:"FMSUBD" + // riscv64:"FNMSUBD\t" return z - x*y } |
