]> Cypherpunks repositories - gostls13.git/commitdiff
[dev.ssa] cmd/compile/internal/ssa: make SETEQF and SETNEF clobber flags
authorKeith Randall <khr@golang.org>
Tue, 1 Sep 2015 22:18:01 +0000 (15:18 -0700)
committerKeith Randall <khr@golang.org>
Tue, 1 Sep 2015 22:21:45 +0000 (22:21 +0000)
They do an AND or an OR internally, so they clobber flags.

Fixes #12441

Change-Id: I6c843bd268496bc13fc7e3c561d76619e961e8ad
Reviewed-on: https://go-review.googlesource.com/14180
Reviewed-by: Todd Neal <todd@tneal.org>
src/cmd/compile/internal/ssa/gen/AMD64Ops.go
src/cmd/compile/internal/ssa/opGen.go

index 09ffd4526f0cbe868454447ceda89f14ebf46127..da5c5060645695f8dc611c145ebc94fce8875dda 100644 (file)
@@ -112,7 +112,7 @@ func init() {
                gp1flags  = regInfo{inputs: []regMask{gpsp}, outputs: flagsonly}
                flagsgp   = regInfo{inputs: flagsonly, outputs: gponly}
                readflags = regInfo{inputs: flagsonly, outputs: gponly}
-               flagsgpax = regInfo{inputs: flagsonly, clobbers: ax, outputs: []regMask{gp &^ ax}}
+               flagsgpax = regInfo{inputs: flagsonly, clobbers: ax | flags, outputs: []regMask{gp &^ ax}}
 
                gpload    = regInfo{inputs: []regMask{gpspsb, 0}, outputs: gponly}
                gploadidx = regInfo{inputs: []regMask{gpspsb, gpsp, 0}, outputs: gponly}
index 8263268019cc45aae920a728b57ef88ee7490166..82ba4a5449435d8b3e2df16674a70612d36612f7 100644 (file)
@@ -2502,7 +2502,7 @@ var opcodeTable = [...]opInfo{
                        inputs: []inputInfo{
                                {0, 8589934592}, // .FLAGS
                        },
-                       clobbers: 1, // .AX
+                       clobbers: 8589934593, // .AX .FLAGS
                        outputs: []regMask{
                                65518, // .CX .DX .BX .BP .SI .DI .R8 .R9 .R10 .R11 .R12 .R13 .R14 .R15
                        },
@@ -2515,7 +2515,7 @@ var opcodeTable = [...]opInfo{
                        inputs: []inputInfo{
                                {0, 8589934592}, // .FLAGS
                        },
-                       clobbers: 1, // .AX
+                       clobbers: 8589934593, // .AX .FLAGS
                        outputs: []regMask{
                                65518, // .CX .DX .BX .BP .SI .DI .R8 .R9 .R10 .R11 .R12 .R13 .R14 .R15
                        },