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/runtime/asm_ppc64x.s | 8 ++++---- src/runtime/rt0_linux_ppc64le.s | 4 ++-- src/runtime/sys_linux_ppc64x.s | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) (limited to 'src/runtime') diff --git a/src/runtime/asm_ppc64x.s b/src/runtime/asm_ppc64x.s index 98002bccf6..2b8c4d42a3 100644 --- a/src/runtime/asm_ppc64x.s +++ b/src/runtime/asm_ppc64x.s @@ -40,7 +40,7 @@ TEXT runtime·rt0_go(SB),NOSPLIT|TOPFRAME,$0 // If there is a _cgo_init, call it using the gcc ABI. MOVD _cgo_init(SB), R12 - CMP R0, R12 + CMP R12, $0 BEQ nocgo #ifdef GO_PPC64X_HAS_FUNCDESC @@ -466,7 +466,7 @@ callfn: \ #ifdef GOOS_aix \ /* AIX won't trigger a SIGSEGV if R11 = nil */ \ /* So it manually triggers it */ \ - CMP R0, R11 \ + CMP R11, $0 \ BNE 2(PC) \ MOVD R0, 0(R0) \ #endif \ @@ -564,7 +564,7 @@ TEXT gosave_systemstack_switch<>(SB),NOSPLIT|NOFRAME,$0 MOVD R0, (g_sched+gobuf_ret)(g) // Assert ctxt is zero. See func save. MOVD (g_sched+gobuf_ctxt)(g), R31 - CMP R0, R31 + CMP R31, $0 BEQ 2(PC) BL runtime·abort(SB) RET @@ -1235,7 +1235,7 @@ TEXT runtime·debugCallV2(SB), NOSPLIT|NOFRAME, $0-0 CALL runtime·debugCallCheck(SB) MOVD 40(R1), R22 XOR R0, R0 - CMP R22, R0 + CMP R22, $0 BEQ good MOVD 48(R1), R22 MOVD $8, R20 diff --git a/src/runtime/rt0_linux_ppc64le.s b/src/runtime/rt0_linux_ppc64le.s index 417ada21bf..4b7d8e1b94 100644 --- a/src/runtime/rt0_linux_ppc64le.s +++ b/src/runtime/rt0_linux_ppc64le.s @@ -78,7 +78,7 @@ TEXT _main<>(SB),NOSPLIT,$-8 // passes argc/argv similar to the linux kernel, R13 (TLS) is // initialized, and R3/R4 are undefined. MOVD (R1), R12 - CMP R0, R12 + CMP R12, $0 BEQ tls_and_argcv_in_reg // Arguments are passed via the stack (musl loader or a static binary) @@ -86,7 +86,7 @@ TEXT _main<>(SB),NOSPLIT,$-8 ADD $8, R1, R4 // argv // Did the TLS pointer get set? If so, don't change it (e.g musl). - CMP R0, R13 + CMP R13, $0 BNE tls_and_argcv_in_reg MOVD $runtime·m0+m_tls(SB), R13 // TLS diff --git a/src/runtime/sys_linux_ppc64x.s b/src/runtime/sys_linux_ppc64x.s index d105585b7e..ba4988b723 100644 --- a/src/runtime/sys_linux_ppc64x.s +++ b/src/runtime/sys_linux_ppc64x.s @@ -211,7 +211,7 @@ TEXT runtime·walltime(SB),NOSPLIT,$16-12 MOVD $0, R3 // CLOCK_REALTIME MOVD runtime·vdsoClockgettimeSym(SB), R12 // Check for VDSO availability - CMP R12, R0 + CMP R12, $0 BEQ fallback // Set vdsoPC and vdsoSP for SIGPROF traceback. @@ -305,7 +305,7 @@ TEXT runtime·nanotime1(SB),NOSPLIT,$16-8 MOVD g_m(g), R21 // R21 = m MOVD runtime·vdsoClockgettimeSym(SB), R12 // Check for VDSO availability - CMP R12, R0 + CMP R12, $0 BEQ fallback // Set vdsoPC and vdsoSP for SIGPROF traceback. -- cgit v1.3