From: Todd Neal Date: Tue, 1 Sep 2015 22:56:37 +0000 (-0500) Subject: [dev.ssa] cmd/compile: make REPSTOSQ clobber flags X-Git-Tag: go1.7beta1~1623^2^2~218 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=4219aba5dbbc94d82a4b80c1f6ecc97d7eb3a62d;p=gostls13.git [dev.ssa] cmd/compile: make REPSTOSQ clobber flags It does a XOR internally and clobbers flags. Change-Id: Id6ef9219c4e6c3a2b5fc79c8d52bcfa30c148617 Reviewed-on: https://go-review.googlesource.com/14165 Reviewed-by: Keith Randall --- diff --git a/src/cmd/compile/internal/ssa/gen/AMD64Ops.go b/src/cmd/compile/internal/ssa/gen/AMD64Ops.go index da5c506064..d8d7703594 100644 --- a/src/cmd/compile/internal/ssa/gen/AMD64Ops.go +++ b/src/cmd/compile/internal/ssa/gen/AMD64Ops.go @@ -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 diff --git a/src/cmd/compile/internal/ssa/opGen.go b/src/cmd/compile/internal/ssa/opGen.go index 82ba4a5449..d663535940 100644 --- a/src/cmd/compile/internal/ssa/opGen.go +++ b/src/cmd/compile/internal/ssa/opGen.go @@ -3024,7 +3024,7 @@ var opcodeTable = [...]opInfo{ {0, 128}, // .DI {1, 2}, // .CX }, - clobbers: 131, // .AX .CX .DI + clobbers: 8589934723, // .AX .CX .DI .FLAGS }, }, {