]> Cypherpunks repositories - gostls13.git/commit
[dev.ssa] cmd/compile: disable xor clearing when flags must be preserved
authorKeith Randall <khr@golang.org>
Fri, 22 Jan 2016 21:44:58 +0000 (13:44 -0800)
committerKeith Randall <khr@golang.org>
Tue, 26 Jan 2016 17:40:22 +0000 (17:40 +0000)
commit7b773946c09e075ed50c49e76e08f61c16616ee4
tree05792f94cb8138779bd8ceadf019a6518770aff0
parent733bf6ef67013b8410c51a72697c6fbff53ad30d
[dev.ssa] cmd/compile: disable xor clearing when flags must be preserved

The x86 backend automatically rewrites MOV $0, AX to
XOR AX, AX.  That rewrite isn't ok when the flags register
is live across the MOV.  Keep track of which moves care
about preserving flags, then disable this rewrite for them.

On x86, Prog.Mark was being used to hold the length of the
instruction.  We already store that in Prog.Isize, so no
need to store it in Prog.Mark also.  This frees up Prog.Mark
to hold a bitmask on x86 just like all the other architectures.

Update #12405

Change-Id: Ibad8a8f41fc6222bec1e4904221887d3cc3ca029
Reviewed-on: https://go-review.googlesource.com/18861
Reviewed-by: David Chase <drchase@google.com>
Reviewed-by: Russ Cox <rsc@golang.org>
src/cmd/compile/internal/gc/ssa.go
src/cmd/compile/internal/ssa/block.go
src/cmd/compile/internal/ssa/flagalloc.go
src/cmd/compile/internal/ssa/gen/AMD64Ops.go
src/cmd/compile/internal/ssa/opGen.go
src/cmd/compile/internal/ssa/regalloc.go
src/cmd/internal/obj/link.go
src/cmd/internal/obj/pass.go
src/cmd/internal/obj/x86/a.out.go
src/cmd/internal/obj/x86/asm6.go
src/cmd/internal/obj/x86/obj6.go