]> Cypherpunks repositories - gostls13.git/commit
cmd/compile,cmd/asm: on PPC64, generate compares against constant 0
authorPaul E. Murphy <murp@ibm.com>
Mon, 13 May 2024 16:56:42 +0000 (11:56 -0500)
committerPaul Murphy <murp@ibm.com>
Wed, 15 May 2024 13:55:28 +0000 (13:55 +0000)
commit408739fc96f00a50642673544e803a3c3f3e27df
treedfdefff56180661408202a77de0456af3324b47c
parent6ccd8e4cf69efbc8983a9873a41158f554ea5363
cmd/compile,cmd/asm: on PPC64, generate compares against constant 0

Merge the handling of CMPx r,r,cr and CMPx r,i,cr when assembling.

This prevents generating machine code like cmpd rx,r0 when cmpdi rx,0
is preferred. The preferred form can be fused on Power10 for faster
execution of some instruction sequences.

Likewise, update a common case to use $0 instead of R0 to take
advantage of this.

Change-Id: If2549ca25a5f7d23001885ad444c70d829b3b066
Cq-Include-Trybots: luci.golang.try:gotip-linux-ppc64_power10,gotip-linux-ppc64_power8,gotip-linux-ppc64le_power10,gotip-linux-ppc64le_power8,gotip-linux-ppc64le_power9
Reviewed-on: https://go-review.googlesource.com/c/go/+/585137
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Lynn Boger <laboger@linux.vnet.ibm.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
src/cmd/asm/internal/asm/testdata/ppc64.s
src/cmd/compile/internal/ppc64/ssa.go
src/cmd/internal/obj/ppc64/asm9.go