diff options
| author | Paul E. Murphy <murp@ibm.com> | 2023-09-15 15:20:56 -0500 |
|---|---|---|
| committer | Paul Murphy <murp@ibm.com> | 2023-10-18 18:04:48 +0000 |
| commit | 061d77cb7008cf9e4d8b3b6382828b483bff032f (patch) | |
| tree | ac1747533e6536f1a0fe04f1e5ac0f5dd4783990 /test/codegen/arithmetic.go | |
| parent | 3550a84840c3922477dc78abc4677d485600f705 (diff) | |
| download | go-061d77cb7008cf9e4d8b3b6382828b483bff032f.tar.xz | |
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 <murp@ibm.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Than McIntosh <thanm@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Lynn Boger <laboger@linux.vnet.ibm.com>
Diffstat (limited to 'test/codegen/arithmetic.go')
| -rw-r--r-- | test/codegen/arithmetic.go | 15 |
1 files changed, 15 insertions, 0 deletions
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 @@ -11,6 +11,21 @@ package codegen // 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 // // ----------------- // |
