From 061d77cb7008cf9e4d8b3b6382828b483bff032f Mon Sep 17 00:00:00 2001 From: "Paul E. Murphy" Date: Fri, 15 Sep 2023 15:20:56 -0500 Subject: cmd/compile/internal/ssa: on PPC64, generate large constant paddi This is only supported power10/linux/PPC64. This generates smaller, faster code by merging a pli + add into paddi. Change-Id: I1f4d522fce53aea4c072713cc119a9e0d7065acc Reviewed-on: https://go-review.googlesource.com/c/go/+/531717 Run-TryBot: Paul Murphy LUCI-TryBot-Result: Go LUCI Reviewed-by: Than McIntosh Reviewed-by: Dmitri Shuralyov TryBot-Result: Gopher Robot Reviewed-by: Lynn Boger --- test/codegen/arithmetic.go | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'test/codegen/arithmetic.go') diff --git a/test/codegen/arithmetic.go b/test/codegen/arithmetic.go index b91a904be9..0d6d969000 100644 --- a/test/codegen/arithmetic.go +++ b/test/codegen/arithmetic.go @@ -10,6 +10,21 @@ package codegen // simplifications and optimizations on integer types. // For codegen tests on float types, see floats.go. +// ----------------- // +// Addition // +// ----------------- // + +func AddLargeConst(a uint64, out []uint64) { + // ppc64x/power10:"ADD\t[$]4294967296," + // ppc64x/power9:"MOVD\t[$]i64.0000000100000000[(]SB[)]", "ADD\tR[0-9]*" + // ppc64x/power8:"MOVD\t[$]i64.0000000100000000[(]SB[)]", "ADD\tR[0-9]*" + out[0] = a + 0x100000000 + // ppc64x/power10:"ADD\t[$]-8589934592," + // ppc64x/power9:"MOVD\t[$]i64.fffffffe00000000[(]SB[)]", "ADD\tR[0-9]*" + // ppc64x/power8:"MOVD\t[$]i64.fffffffe00000000[(]SB[)]", "ADD\tR[0-9]*" + out[1] = a + 0xFFFFFFFE00000000 +} + // ----------------- // // Subtraction // // ----------------- // -- cgit v1.3-6-g1900