From cc673d2ec5df9e0894ea2cc3e16a9c309c219bd8 Mon Sep 17 00:00:00 2001 From: "Paul E. Murphy" Date: Tue, 14 May 2024 10:05:00 -0500 Subject: all: convert PPC64 CMPx ...,R0,... to CMPx Rx,$0 Cleanup all remaining trivial compares against $0 in ppc64x assembly. In math, SRD ...,Rx; CMP Rx, $0 is further simplified to SRDCC. Change-Id: Ia2bc204953e32f08ee142bfd06a91965f30f99b6 Reviewed-on: https://go-review.googlesource.com/c/go/+/587016 Reviewed-by: Dmitri Shuralyov Reviewed-by: Lynn Boger Run-TryBot: Paul Murphy Reviewed-by: Cherry Mui TryBot-Result: Gopher Robot LUCI-TryBot-Result: Go LUCI --- src/cmd/internal/obj/ppc64/obj9.go | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'src/cmd/internal/obj') diff --git a/src/cmd/internal/obj/ppc64/obj9.go b/src/cmd/internal/obj/ppc64/obj9.go index 23196875a5..bf52e72009 100644 --- a/src/cmd/internal/obj/ppc64/obj9.go +++ b/src/cmd/internal/obj/ppc64/obj9.go @@ -969,15 +969,15 @@ func preprocess(ctxt *obj.Link, cursym *obj.LSym, newprog obj.ProgAlloc) { if c.cursym.Func().Text.From.Sym.Wrapper() { // if(g->panic != nil && g->panic->argp == FP) g->panic->argp = bottom-of-frame // - // MOVD g_panic(g), R3 - // CMP R0, R3 + // MOVD g_panic(g), R22 + // CMP R22, $0 // BEQ end - // MOVD panic_argp(R3), R4 - // ADD $(autosize+8), R1, R5 - // CMP R4, R5 + // MOVD panic_argp(R22), R23 + // ADD $(autosize+8), R1, R24 + // CMP R23, R24 // BNE end - // ADD $8, R1, R6 - // MOVD R6, panic_argp(R3) + // ADD $8, R1, R25 + // MOVD R25, panic_argp(R22) // end: // NOP // @@ -996,9 +996,9 @@ func preprocess(ctxt *obj.Link, cursym *obj.LSym, newprog obj.ProgAlloc) { q = obj.Appendp(q, c.newprog) q.As = ACMP q.From.Type = obj.TYPE_REG - q.From.Reg = REG_R0 - q.To.Type = obj.TYPE_REG - q.To.Reg = REG_R22 + q.From.Reg = REG_R22 + q.To.Type = obj.TYPE_CONST + q.To.Offset = 0 q = obj.Appendp(q, c.newprog) q.As = ABEQ -- cgit v1.3