]> Cypherpunks repositories - gostls13.git/commitdiff
[dev.ssa] cmd/compile: implement genValue for MOVQstoreidx8
authorJosh Bleecher Snyder <josharian@gmail.com>
Mon, 27 Jul 2015 23:36:36 +0000 (16:36 -0700)
committerJosh Bleecher Snyder <josharian@gmail.com>
Tue, 28 Jul 2015 20:15:19 +0000 (20:15 +0000)
Change-Id: I6b13a26e01ef8739ed60e6fd5f5c1ea045bea581
Reviewed-on: https://go-review.googlesource.com/12793
Reviewed-by: Keith Randall <khr@golang.org>
src/cmd/compile/internal/gc/ssa.go
src/cmd/compile/internal/ssa/gen/AMD64Ops.go
src/cmd/compile/internal/ssa/opGen.go

index c33c1224f1e2b9a07ce0b7a4a907f68cb0cf4659..e435850b4737bf7799c4f6ca166de781ca31820a 100644 (file)
@@ -1749,6 +1749,15 @@ func genValue(v *ssa.Value) {
                p.To.Type = obj.TYPE_MEM
                p.To.Reg = regnum(v.Args[0])
                addAux(&p.To, v)
+       case ssa.OpAMD64MOVQstoreidx8:
+               p := Prog(x86.AMOVQ)
+               p.From.Type = obj.TYPE_REG
+               p.From.Reg = regnum(v.Args[2])
+               p.To.Type = obj.TYPE_MEM
+               p.To.Reg = regnum(v.Args[0])
+               p.To.Scale = 8
+               p.To.Index = regnum(v.Args[1])
+               addAux(&p.To, v)
        case ssa.OpAMD64MOVLQSX, ssa.OpAMD64MOVWQSX, ssa.OpAMD64MOVBQSX, ssa.OpAMD64MOVLQZX, ssa.OpAMD64MOVWQZX, ssa.OpAMD64MOVBQZX:
                p := Prog(v.Op.Asm())
                p.From.Type = obj.TYPE_REG
index 64095c565480293ca30223adcbde1c97c9348e53..9b5c302217c7f76602bb818eca57093ef5f24c43 100644 (file)
@@ -145,18 +145,18 @@ func init() {
                {name: "LEAQ4", reg: gp21sb},   // arg0 + 4*arg1 + auxint
                {name: "LEAQ8", reg: gp21sb},   // arg0 + 8*arg1 + auxint
 
-               {name: "MOVBload", reg: gpload, asm: "MOVB"},        // load byte from arg0+auxint. arg1=mem
-               {name: "MOVBQSXload", reg: gpload, asm: "MOVBQSX"},  // ditto, extend to int64
-               {name: "MOVBQZXload", reg: gpload, asm: "MOVBQZX"},  // ditto, extend to uint64
-               {name: "MOVWload", reg: gpload, asm: "MOVW"},        // load 2 bytes from arg0+auxint. arg1=mem
-               {name: "MOVLload", reg: gpload, asm: "MOVL"},        // load 4 bytes from arg0+auxint. arg1=mem
-               {name: "MOVQload", reg: gpload, asm: "MOVQ"},        // load 8 bytes from arg0+auxint. arg1=mem
-               {name: "MOVQloadidx8", reg: gploadidx, asm: "MOVQ"}, // load 8 bytes from arg0+8*arg1+auxint. arg2=mem
-               {name: "MOVBstore", reg: gpstore, asm: "MOVB"},      // store byte in arg1 to arg0+auxint. arg2=mem
-               {name: "MOVWstore", reg: gpstore, asm: "MOVW"},      // store 2 bytes in arg1 to arg0+auxint. arg2=mem
-               {name: "MOVLstore", reg: gpstore, asm: "MOVL"},      // store 4 bytes in arg1 to arg0+auxint. arg2=mem
-               {name: "MOVQstore", reg: gpstore, asm: "MOVQ"},      // store 8 bytes in arg1 to arg0+auxint. arg2=mem
-               {name: "MOVQstoreidx8", reg: gpstoreidx},            // store 8 bytes in arg2 to arg0+8*arg1+auxint. arg3=mem
+               {name: "MOVBload", reg: gpload, asm: "MOVB"},          // load byte from arg0+auxint. arg1=mem
+               {name: "MOVBQSXload", reg: gpload, asm: "MOVBQSX"},    // ditto, extend to int64
+               {name: "MOVBQZXload", reg: gpload, asm: "MOVBQZX"},    // ditto, extend to uint64
+               {name: "MOVWload", reg: gpload, asm: "MOVW"},          // load 2 bytes from arg0+auxint. arg1=mem
+               {name: "MOVLload", reg: gpload, asm: "MOVL"},          // load 4 bytes from arg0+auxint. arg1=mem
+               {name: "MOVQload", reg: gpload, asm: "MOVQ"},          // load 8 bytes from arg0+auxint. arg1=mem
+               {name: "MOVQloadidx8", reg: gploadidx, asm: "MOVQ"},   // load 8 bytes from arg0+8*arg1+auxint. arg2=mem
+               {name: "MOVBstore", reg: gpstore, asm: "MOVB"},        // store byte in arg1 to arg0+auxint. arg2=mem
+               {name: "MOVWstore", reg: gpstore, asm: "MOVW"},        // store 2 bytes in arg1 to arg0+auxint. arg2=mem
+               {name: "MOVLstore", reg: gpstore, asm: "MOVL"},        // store 4 bytes in arg1 to arg0+auxint. arg2=mem
+               {name: "MOVQstore", reg: gpstore, asm: "MOVQ"},        // store 8 bytes in arg1 to arg0+auxint. arg2=mem
+               {name: "MOVQstoreidx8", reg: gpstoreidx, asm: "MOVQ"}, // store 8 bytes in arg2 to arg0+8*arg1+auxint. arg3=mem
 
                {name: "MOVXzero", reg: gpstoreconst}, // store auxint 0 bytes into arg0 using a series of MOV instructions. arg1=mem.
                // TODO: implement this when register clobbering works
index 532c0558e0c004937edfee889360e6b4397fa95e..0d56e647af298f4223325d9d110948510c32ea2b 100644 (file)
@@ -890,6 +890,7 @@ var opcodeTable = [...]opInfo{
        },
        {
                name: "MOVQstoreidx8",
+               asm:  x86.AMOVQ,
                reg: regInfo{
                        inputs: []regMask{
                                4295032831, // .AX .CX .DX .BX .SP .BP .SI .DI .R8 .R9 .R10 .R11 .R12 .R13 .R14 .R15 .SB