]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/compile: mark NOT as an op that doesn't clobber flags on i386/AMD64
authorJake Ciolek <jakub@ciolek.dev>
Sat, 9 Oct 2021 15:57:06 +0000 (17:57 +0200)
committerJosh Bleecher Snyder <josharian@gmail.com>
Sat, 9 Oct 2021 17:34:04 +0000 (17:34 +0000)
NOT does not affect any FLAGS register values on i386/AMD64 so we do not
need to mark it as an Op that clobbers them.

Change-Id: I6d99cad49cfa2568b01e58190256582b18fb3b7b
Reviewed-on: https://go-review.googlesource.com/c/go/+/354831
Reviewed-by: Keith Randall <khr@golang.org>
Run-TryBot: Keith Randall <khr@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Trust: Josh Bleecher Snyder <josharian@gmail.com>

src/cmd/compile/internal/ssa/gen/386Ops.go
src/cmd/compile/internal/ssa/gen/AMD64Ops.go
src/cmd/compile/internal/ssa/opGen.go

index 3512d60865f6dc9a28fcb0cd50eaa77e54380414..a6da7a5fce2961a07e667934eadb670aebe4a8a8 100644 (file)
@@ -298,7 +298,7 @@ func init() {
                // unary ops
                {name: "NEGL", argLength: 1, reg: gp11, asm: "NEGL", resultInArg0: true, clobberFlags: true}, // -arg0
 
-               {name: "NOTL", argLength: 1, reg: gp11, asm: "NOTL", resultInArg0: true, clobberFlags: true}, // ^arg0
+               {name: "NOTL", argLength: 1, reg: gp11, asm: "NOTL", resultInArg0: true}, // ^arg0
 
                {name: "BSFL", argLength: 1, reg: gp11, asm: "BSFL", clobberFlags: true}, // arg0 # of low-order zeroes ; undef if zero
                {name: "BSFW", argLength: 1, reg: gp11, asm: "BSFW", clobberFlags: true}, // arg0 # of low-order zeroes ; undef if zero
index 188777273624a8b17d4bab207214a743f3ec94f2..731454c761fe3ca5ca7bbd18d37f2d898f77ffda 100644 (file)
@@ -513,8 +513,8 @@ func init() {
                {name: "NEGQ", argLength: 1, reg: gp11, asm: "NEGQ", resultInArg0: true, clobberFlags: true}, // -arg0
                {name: "NEGL", argLength: 1, reg: gp11, asm: "NEGL", resultInArg0: true, clobberFlags: true}, // -arg0
 
-               {name: "NOTQ", argLength: 1, reg: gp11, asm: "NOTQ", resultInArg0: true, clobberFlags: true}, // ^arg0
-               {name: "NOTL", argLength: 1, reg: gp11, asm: "NOTL", resultInArg0: true, clobberFlags: true}, // ^arg0
+               {name: "NOTQ", argLength: 1, reg: gp11, asm: "NOTQ", resultInArg0: true}, // ^arg0
+               {name: "NOTL", argLength: 1, reg: gp11, asm: "NOTL", resultInArg0: true}, // ^arg0
 
                // BS{F,R}Q returns a tuple [result, flags]
                // result is undefined if the input is zero.
index 09006c8c853549d321841cd508c631a2f9dc22a8..640e517fe767923f31ca4762de7e740606f0ac2e 100644 (file)
@@ -4733,7 +4733,6 @@ var opcodeTable = [...]opInfo{
                name:         "NOTL",
                argLen:       1,
                resultInArg0: true,
-               clobberFlags: true,
                asm:          x86.ANOTL,
                reg: regInfo{
                        inputs: []inputInfo{
@@ -10777,7 +10776,6 @@ var opcodeTable = [...]opInfo{
                name:         "NOTQ",
                argLen:       1,
                resultInArg0: true,
-               clobberFlags: true,
                asm:          x86.ANOTQ,
                reg: regInfo{
                        inputs: []inputInfo{
@@ -10792,7 +10790,6 @@ var opcodeTable = [...]opInfo{
                name:         "NOTL",
                argLen:       1,
                resultInArg0: true,
-               clobberFlags: true,
                asm:          x86.ANOTL,
                reg: regInfo{
                        inputs: []inputInfo{