]> Cypherpunks repositories - gostls13.git/commit
math: implement arch{Floor, Ceil, Trunc} in hardware on loong64
authorXiaolin Zhao <zhaoxiaolin@loongson.cn>
Thu, 12 Sep 2024 03:37:45 +0000 (11:37 +0800)
committerabner chenc <chenguoqi@loongson.cn>
Sat, 12 Oct 2024 03:24:22 +0000 (03:24 +0000)
commitb521ebb55a9b26c8824b219376c7f91f7cda6ec2
tree243c1e8d42c1b76b2a9680e3b22f26cbdebaacf2
parent7e0159c50bd0a819ed00938f10792415393f951f
math: implement arch{Floor, Ceil, Trunc} in hardware on loong64

benchmark:

goos: linux
goarch: loong64
pkg: math
cpu: Loongson-3A6000 @ 2500.00MHz
        │  bench.old   │              bench.new              │
        │    sec/op    │   sec/op     vs base                │
Ceil      10.810n ± 0%   2.578n ± 0%  -76.15% (p=0.000 n=20)
Floor     10.810n ± 0%   2.531n ± 0%  -76.59% (p=0.000 n=20)
Trunc      9.606n ± 0%   2.530n ± 0%  -73.67% (p=0.000 n=20)
geomean    10.39n        2.546n       -75.50%

goos: linux
goarch: loong64
pkg: math
cpu: Loongson-3A5000 @ 2500.00MHz
        │  bench.old   │              bench.new              │
        │    sec/op    │   sec/op     vs base                │
Ceil      13.220n ± 0%   7.703n ± 8%  -41.73% (p=0.000 n=20)
Floor     12.410n ± 0%   7.248n ± 2%  -41.59% (p=0.000 n=20)
Trunc     11.210n ± 0%   7.757n ± 4%  -30.80% (p=0.000 n=20)
geomean    12.25n        7.566n       -38.25%

Change-Id: I3af51e9852e9cf5f965fed895d68945a2e8675f4
Reviewed-on: https://go-review.googlesource.com/c/go/+/612615
Reviewed-by: Michael Knyszek <mknyszek@google.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Reviewed-by: abner chenc <chenguoqi@loongson.cn>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
src/math/floor_asm.go
src/math/floor_loong64.s [new file with mode: 0644]
src/math/floor_noasm.go