From c12cd31a3326e6b2119525cd07cebc6d6e1b52ee Mon Sep 17 00:00:00 2001 From: Carlos Eduardo Seo Date: Thu, 16 Feb 2017 14:58:47 -0200 Subject: [PATCH] cmd/internal/obj/ppc64: Fix RLDIMI Fix the encoding of the SH field for rldimi. The SH field of rldimi is 6-bit wide and it is not contiguous in the instruction. Bits 0-4 are placed in bit fields 16-20 in the instruction, while bit 5 is placed in bit field 30. The current implementation does not consider this and, therefore, any SH field between 32 and 63 are encoded wrongly in the instruciton. Change-Id: I4d25a0a70f4219569be0e18160dea5505bd7fff0 Reviewed-on: https://go-review.googlesource.com/37350 TryBot-Result: Gobot Gobot Reviewed-by: Lynn Boger --- src/cmd/internal/obj/ppc64/asm9.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/cmd/internal/obj/ppc64/asm9.go b/src/cmd/internal/obj/ppc64/asm9.go index e88cd12126..771f8e5605 100644 --- a/src/cmd/internal/obj/ppc64/asm9.go +++ b/src/cmd/internal/obj/ppc64/asm9.go @@ -2721,6 +2721,9 @@ func asmout(ctxt *obj.Link, p *obj.Prog, o *Optab, out []uint32) { case ARLDIMI, ARLDIMICC: o1 = AOP_RRR(opirr(ctxt, p.As), uint32(p.Reg), uint32(p.To.Reg), (uint32(v) & 0x1F)) o1 |= (uint32(d) & 31) << 6 + if d&0x20 != 0 { + o1 |= 1 << 5 + } if v&0x20 != 0 { o1 |= 1 << 1 }