]> Cypherpunks repositories - gostls13.git/commitdiff
[dev.ssa] cmd/compile: make REPSTOSQ clobber flags
authorTodd Neal <todd@tneal.org>
Tue, 1 Sep 2015 22:56:37 +0000 (17:56 -0500)
committerTodd Neal <todd@tneal.org>
Wed, 2 Sep 2015 00:35:25 +0000 (00:35 +0000)
It does a XOR internally and clobbers flags.

Change-Id: Id6ef9219c4e6c3a2b5fc79c8d52bcfa30c148617
Reviewed-on: https://go-review.googlesource.com/14165
Reviewed-by: Keith Randall <khr@golang.org>
src/cmd/compile/internal/ssa/gen/AMD64Ops.go
src/cmd/compile/internal/ssa/opGen.go

index da5c5060645695f8dc611c145ebc94fce8875dda..d8d77035941dc285a0503306a675acfc9a78781d 100644 (file)
@@ -380,8 +380,8 @@ func init() {
                {name: "MOVQstoreidx8", reg: gpstoreidx, asm: "MOVQ"}, // store 8 bytes in arg2 to arg0+8*arg1+auxint+aux. 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
-               {name: "REPSTOSQ", reg: regInfo{[]regMask{buildReg("DI"), buildReg("CX")}, buildReg("DI AX CX"), nil}}, // store arg1 8-byte words containing zero into arg0 using STOSQ. arg2=mem.
+
+               {name: "REPSTOSQ", reg: regInfo{[]regMask{buildReg("DI"), buildReg("CX")}, buildReg("DI AX CX FLAGS"), nil}}, // store arg1 8-byte words containing zero into arg0 using STOSQ. arg2=mem.
 
                //TODO: set register clobber to everything?
                {name: "CALLstatic", reg: regInfo{clobbers: callerSave}},                                 // call static function aux.(*gc.Sym).  arg0=mem, auxint=argsize, returns mem
index 82ba4a5449435d8b3e2df16674a70612d36612f7..d6635359408bf1fa4cbd03643a44c4ec5d44c727 100644 (file)
@@ -3024,7 +3024,7 @@ var opcodeTable = [...]opInfo{
                                {0, 128}, // .DI
                                {1, 2},   // .CX
                        },
-                       clobbers: 131, // .AX .CX .DI
+                       clobbers: 8589934723, // .AX .CX .DI .FLAGS
                },
        },
        {