From 105ac94486f243fc478c3a146d836302a95cdbbc Mon Sep 17 00:00:00 2001 From: "Paul E. Murphy" Date: Tue, 14 May 2024 08:21:14 -0500 Subject: [PATCH] cmd/asm: on PPC64, fix assembling of FCMPO opcode The assembler should pack 3 argument usage of FCMPO similar to other CMP-like opcodes. Fixes #67359 Change-Id: Icfb42a67d741431a70dd880806857b4c38f42d62 Reviewed-on: https://go-review.googlesource.com/c/go/+/585640 Reviewed-by: Cherry Mui LUCI-TryBot-Result: Go LUCI Reviewed-by: Lynn Boger Reviewed-by: Dmitri Shuralyov --- src/cmd/asm/internal/arch/ppc64.go | 2 +- src/cmd/asm/internal/asm/testdata/ppc64.s | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/cmd/asm/internal/arch/ppc64.go b/src/cmd/asm/internal/arch/ppc64.go index 98a2bfedfd..c13652e960 100644 --- a/src/cmd/asm/internal/arch/ppc64.go +++ b/src/cmd/asm/internal/arch/ppc64.go @@ -25,7 +25,7 @@ func jumpPPC64(word string) bool { // one of the CMP instructions that require special handling. func IsPPC64CMP(op obj.As) bool { switch op { - case ppc64.ACMP, ppc64.ACMPU, ppc64.ACMPW, ppc64.ACMPWU, ppc64.AFCMPU: + case ppc64.ACMP, ppc64.ACMPU, ppc64.ACMPW, ppc64.ACMPWU, ppc64.AFCMPO, ppc64.AFCMPU: return true } return false diff --git a/src/cmd/asm/internal/asm/testdata/ppc64.s b/src/cmd/asm/internal/asm/testdata/ppc64.s index 7e8c6f9cf2..918c2e1681 100644 --- a/src/cmd/asm/internal/asm/testdata/ppc64.s +++ b/src/cmd/asm/internal/asm/testdata/ppc64.s @@ -763,7 +763,9 @@ TEXT asmtest(SB),DUPOK|NOSPLIT,$0 FCPSGN F1, F2 // fc420810 FCPSGNCC F1, F2 // fc420811 FCMPO F1, F2 // fc011040 + FCMPO F1, F2, CR0 // FCMPO F1,CR0,F2 // fc011040 FCMPU F1, F2 // fc011000 + FCMPU F1, F2, CR0 // FCMPU F1,CR0,F2 // fc011000 LVX (R3)(R4), V1 // 7c2418ce LVX (R3)(R0), V1 // 7c2018ce LVX (R3), V1 // 7c2018ce @@ -1153,6 +1155,7 @@ TEXT asmtest(SB),DUPOK|NOSPLIT,$0 MOVD XER, 4(R1) // 7fe102a6fbe10004 MOVD 4(R1), SPR(3) // ebe100047fe303a6 MOVD 4(R1), XER // ebe100047fe103a6 + OR $0, R0, R0 // 60000000 PNOP // 0700000000000000 SETB CR1,R3 // 7c640100 -- 2.50.0