aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/compile/internal/ssa/_gen/LOONG64.rules
diff options
context:
space:
mode:
authorXiaolin Zhao <zhaoxiaolin@loongson.cn>2026-01-12 16:21:54 +0800
committerabner chenc <chenguoqi@loongson.cn>2026-01-28 06:19:53 -0800
commitf65fe3216ef67b4318f8da475ec59418dfc4fb5d (patch)
treeda15b08b45cfbc4998e9959cd228fae6e0b221c0 /src/cmd/compile/internal/ssa/_gen/LOONG64.rules
parent514790c2b983a91ca48742aea9bc519d7caea6c4 (diff)
downloadgo-f65fe3216ef67b4318f8da475ec59418dfc4fb5d.tar.xz
cmd/compile: (loong64) optimize float32(abs|sqrt64(float64(x)))
Ref: #733621 Updates #75463 Change-Id: Idd8821d1713754097a2fe83a050c25d9ec5b17eb Reviewed-on: https://go-review.googlesource.com/c/go/+/735540 Reviewed-by: abner chenc <chenguoqi@loongson.cn> Reviewed-by: Carlos Amedee <carlos@golang.org> Reviewed-by: David Chase <drchase@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Diffstat (limited to 'src/cmd/compile/internal/ssa/_gen/LOONG64.rules')
-rw-r--r--src/cmd/compile/internal/ssa/_gen/LOONG64.rules3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/cmd/compile/internal/ssa/_gen/LOONG64.rules b/src/cmd/compile/internal/ssa/_gen/LOONG64.rules
index a40603e93d..9793e6cf34 100644
--- a/src/cmd/compile/internal/ssa/_gen/LOONG64.rules
+++ b/src/cmd/compile/internal/ssa/_gen/LOONG64.rules
@@ -773,6 +773,9 @@
(SUBF (NEGF (MULF x y)) z) && z.Block.Func.useFMA(v) => (FNMADDF x y z)
(SUBD (NEGD (MULD x y)) z) && z.Block.Func.useFMA(v) => (FNMADDD x y z)
+// Absorb conversion between 32 bit and 64 bit if both src and dst are 32 bit.
+(MOVDF ((ABS|SQRT)D (MOVFD x))) => ((ABS|SQRT)F x)
+
// generic simplifications
(ADDV x (NEGV y)) => (SUBV x y)
(SUBV x (NEGV y)) => (ADDV x y)