From: Paul E. Murphy Date: Fri, 11 Nov 2022 14:38:50 +0000 (-0600) Subject: cmd/internal/obj/ppc64: do not assemble non-constant rotate RLWMI X-Git-Tag: go1.22rc1~955 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=d80f3966b8b5b2a6e606b416fe80dffeb810ab68;p=gostls13.git cmd/internal/obj/ppc64: do not assemble non-constant rotate RLWMI Unlike RLWNM, the ISA only supports an immediate rotate operand. Update optab and opirrr to avoid quietly assembling this insn. Change-Id: I1472a431cb8a870d55d5fff79ab905c4c459f630 Reviewed-on: https://go-review.googlesource.com/c/go/+/449835 Reviewed-by: Cherry Mui TryBot-Result: Gopher Robot Reviewed-by: Lynn Boger Reviewed-by: Matthew Dempsky Run-TryBot: Paul Murphy LUCI-TryBot-Result: Go LUCI --- diff --git a/src/cmd/internal/obj/ppc64/asm9.go b/src/cmd/internal/obj/ppc64/asm9.go index 4559eed36a..660a27b5cf 100644 --- a/src/cmd/internal/obj/ppc64/asm9.go +++ b/src/cmd/internal/obj/ppc64/asm9.go @@ -185,8 +185,10 @@ var optab = []Optab{ {as: ASRAD, a1: C_SCON, a6: C_REG, type_: 56, size: 4}, {as: ARLWMI, a1: C_SCON, a2: C_REG, a3: C_LCON, a6: C_REG, type_: 62, size: 4}, {as: ARLWMI, a1: C_SCON, a2: C_REG, a3: C_SCON, a4: C_SCON, a6: C_REG, type_: 102, size: 4}, - {as: ARLWMI, a1: C_REG, a2: C_REG, a3: C_LCON, a6: C_REG, type_: 63, size: 4}, - {as: ARLWMI, a1: C_REG, a2: C_REG, a3: C_SCON, a4: C_SCON, a6: C_REG, type_: 103, size: 4}, + {as: ARLWNM, a1: C_SCON, a2: C_REG, a3: C_LCON, a6: C_REG, type_: 62, size: 4}, + {as: ARLWNM, a1: C_SCON, a2: C_REG, a3: C_SCON, a4: C_SCON, a6: C_REG, type_: 102, size: 4}, + {as: ARLWNM, a1: C_REG, a2: C_REG, a3: C_LCON, a6: C_REG, type_: 63, size: 4}, + {as: ARLWNM, a1: C_REG, a2: C_REG, a3: C_SCON, a4: C_SCON, a6: C_REG, type_: 103, size: 4}, {as: ACLRLSLWI, a1: C_SCON, a2: C_REG, a3: C_LCON, a6: C_REG, type_: 62, size: 4}, {as: ARLDMI, a1: C_SCON, a2: C_REG, a3: C_LCON, a6: C_REG, type_: 30, size: 4}, {as: ARLDC, a1: C_SCON, a2: C_REG, a3: C_LCON, a6: C_REG, type_: 29, size: 4}, @@ -1995,7 +1997,8 @@ func buildop(ctxt *obj.Link) { case ARLWMI: opset(ARLWMICC, r0) - opset(ARLWNM, r0) + + case ARLWNM: opset(ARLWNMCC, r0) case ARLDMI: @@ -3927,7 +3930,7 @@ func asmout(c *ctxt9, p *obj.Prog, o *Optab, out *[5]uint32) { sh := uint32(c.regoff(&p.From)) o1 = OP_RLW(c.opirr(p.As), uint32(p.To.Reg), uint32(p.Reg), sh, mb, me) - case 103: /* RLWMI rb,rs,$mb,$me,rt (M-form opcode)*/ + case 103: /* RLWNM rb,rs,$mb,$me,rt (M-form opcode)*/ mb := uint32(c.regoff(&p.RestArgs[0].Addr)) me := uint32(c.regoff(&p.RestArgs[1].Addr)) o1 = OP_RLW(c.oprrr(p.As), uint32(p.To.Reg), uint32(p.Reg), uint32(p.From.Reg), mb, me) @@ -4446,10 +4449,6 @@ func (c *ctxt9) oprrr(a obj.As) uint32 { case AHRFID: return OPVCC(19, 274, 0, 0) - case ARLWMI: - return OPVCC(20, 0, 0, 0) - case ARLWMICC: - return OPVCC(20, 0, 0, 1) case ARLWNM: return OPVCC(23, 0, 0, 0) case ARLWNMCC: