From dcd018b5c54cd23b36ef732473f0d99fbb57f6fc Mon Sep 17 00:00:00 2001 From: "Paul E. Murphy" Date: Tue, 19 Sep 2023 17:01:28 -0500 Subject: cmd/internal/obj/ppc64: generate MOVD mask constants in register Add a new form of RLDC which maps directly to the ISA definition of rldc: RLDC Rs, $sh, $mb, Ra. This is used to generate mask constants described below. Using MOVD $-1, Rx; RLDC Rx, $sh, $mb, Rx, any mask constant can be generated. A mask is a contiguous series of 1 bits, which may wrap. Change-Id: Ifcaae1114080ad58b5fdaa3e5fc9019e2051f282 Reviewed-on: https://go-review.googlesource.com/c/go/+/531120 Reviewed-by: Matthew Dempsky LUCI-TryBot-Result: Go LUCI Reviewed-by: Michael Pratt Reviewed-by: Lynn Boger Run-TryBot: Paul Murphy TryBot-Result: Gopher Robot --- src/cmd/asm/internal/asm/testdata/ppc64.s | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/cmd/asm') diff --git a/src/cmd/asm/internal/asm/testdata/ppc64.s b/src/cmd/asm/internal/asm/testdata/ppc64.s index a8b9e33db3..6f5182e1f9 100644 --- a/src/cmd/asm/internal/asm/testdata/ppc64.s +++ b/src/cmd/asm/internal/asm/testdata/ppc64.s @@ -42,6 +42,10 @@ TEXT asmtest(SB),DUPOK|NOSPLIT,$0 MOVD $2199090364416, R5 // 60058001 // Hex constant 0xFFFFFE0004000000 MOVD $-2198956146688, R5 // 38a08001 + // TODO: On GOPPC64={power8,power9}, this is preprocessed into MOVD $-1, R5; RLDC R5, $33, $63, R5. + // This only captures the MOVD. Should the RLDC be appended to the encoding by the test? + // Hex constant 0xFFFFFFFE00000001 + MOVD $-8589934591, R5 // 38a0ffff or 0602000038a00001 MOVD 8(R3), R4 // e8830008 MOVD (R3)(R4), R5 // 7ca4182a @@ -426,6 +430,10 @@ TEXT asmtest(SB),DUPOK|NOSPLIT,$0 RLDIMI $0, R4, $7, R6 // 788601cc RLDIMICC $0, R4, $7, R6 // 788601cd RLDC $0, R4, $15, R6 // 78860728 + RLDC R3, $32, $12, R4 // 7864030a + RLDC R3, $8, $32, R4 // 78644028 + RLDCCC R3, $32, $12, R4 // 7864030b + RLDCCC R3, $8, $32, R4 // 78644029 RLDCCC $0, R4, $15, R6 // 78860729 RLDCL $0, R4, $7, R6 // 78860770 RLDCLCC $0, R4, $15, R6 // 78860721 -- cgit v1.3-5-g9baa