]> Cypherpunks repositories - gostls13.git/commit
math: optimize the floating-point pipeline on loong64
authorXiaolin Zhao <zhaoxiaolin@loongson.cn>
Wed, 6 Aug 2025 03:34:12 +0000 (11:34 +0800)
committerabner chenc <chenguoqi@loongson.cn>
Thu, 29 Jan 2026 01:01:37 +0000 (17:01 -0800)
commit7f0f67195194cb07122315d5ab563eb617dbe21a
treef8726a984eff7a4de1b88d6d309923f2c08972fc
parent985b0b3fe26661c10a3201470e80685765656363
math: optimize the floating-point pipeline on loong64

Using the FSEL instruction on loong64 to eliminate branches and reduce
pipeline interruptions.

On the Loongson CPU 3A6000, there is a 0.09% performance improvement, as follows:
goos: linux
goarch: loong64
pkg: math/big
cpu: Loongson-3A6000-HV @ 2500.00MHz
        │  old.bench  │             new.bench              │
        │   sec/op    │   sec/op     vs base               │
Exp       7.748m ± 0%   7.740m ± 0%  -0.10% (p=0.001 n=10)
Exp2      7.747m ± 0%   7.741m ± 0%  -0.09% (p=0.002 n=10)
geomean   7.747m        7.740m       -0.09%

Change-Id: If62f2e81bf345c83a1fa9350ace131240cfa3b9b
Reviewed-on: https://go-review.googlesource.com/c/go/+/693458
Reviewed-by: Dmitri Shuralyov <dmitshur@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>
Reviewed-by: Meidan Li <limeidan@loongson.cn>
src/math/exp_loong64.s