]> Cypherpunks.ru repositories - gostls13.git/commitdiff
cmd/internal/obj/ppc64: do not assemble non-constant rotate RLWMI
authorPaul E. Murphy <murp@ibm.com>
Fri, 11 Nov 2022 14:38:50 +0000 (08:38 -0600)
committerPaul Murphy <murp@ibm.com>
Thu, 7 Sep 2023 19:20:03 +0000 (19:20 +0000)
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 <cherryyz@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Lynn Boger <laboger@linux.vnet.ibm.com>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
Run-TryBot: Paul Murphy <murp@ibm.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>

src/cmd/internal/obj/ppc64/asm9.go

index 4559eed36a87c542c86287800b01a939929979d7..660a27b5cfee5daf48e5f0b36557a108eb7043ff 100644 (file)
@@ -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: