]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/compile: fix clobberFlags for BSWAP
authorJakub Ciolek <jakub@ciolek.dev>
Thu, 10 Mar 2022 14:35:17 +0000 (15:35 +0100)
committerKeith Randall <khr@golang.org>
Thu, 31 Mar 2022 19:18:14 +0000 (19:18 +0000)
BSWAP does not affect EFLAGS on neither 386 nor x64. Set the clobberFlags value accordingly.

Change-Id: Ib9e88400607fea44bb51fe95dc4d77e7cb54bfec
Reviewed-on: https://go-review.googlesource.com/c/go/+/391494
Reviewed-by: Keith Randall <khr@golang.org>
Run-TryBot: Keith Randall <khr@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Trust: Ian Lance Taylor <iant@golang.org>

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

index f4c89b0bb3152926b03599f1e48bf87b78d8f6ba..8ec9c68d7ff70913021c6d9c2e9037c5828343e9 100644 (file)
@@ -306,7 +306,7 @@ func init() {
                {name: "BSRL", argLength: 1, reg: gp11, asm: "BSRL", clobberFlags: true}, // arg0 # of high-order zeroes ; undef if zero
                {name: "BSRW", argLength: 1, reg: gp11, asm: "BSRW", clobberFlags: true}, // arg0 # of high-order zeroes ; undef if zero
 
-               {name: "BSWAPL", argLength: 1, reg: gp11, asm: "BSWAPL", resultInArg0: true, clobberFlags: true}, // arg0 swap bytes
+               {name: "BSWAPL", argLength: 1, reg: gp11, asm: "BSWAPL", resultInArg0: true}, // arg0 swap bytes
 
                {name: "SQRTSD", argLength: 1, reg: fp11, asm: "SQRTSD"}, // sqrt(arg0)
                {name: "SQRTSS", argLength: 1, reg: fp11, asm: "SQRTSS"}, // sqrt(arg0), float32
index a6906bec7c74eae3768d6577524ba3661beb2382..50e23871ddf66792fdb2e2a848ac50c875fea796 100644 (file)
@@ -577,8 +577,8 @@ func init() {
                {name: "CMOVWGTF", argLength: 3, reg: gp21, asm: "CMOVWHI", resultInArg0: true},
                {name: "CMOVWGEF", argLength: 3, reg: gp21, asm: "CMOVWCC", resultInArg0: true},
 
-               {name: "BSWAPQ", argLength: 1, reg: gp11, asm: "BSWAPQ", resultInArg0: true, clobberFlags: true}, // arg0 swap bytes
-               {name: "BSWAPL", argLength: 1, reg: gp11, asm: "BSWAPL", resultInArg0: true, clobberFlags: true}, // arg0 swap bytes
+               {name: "BSWAPQ", argLength: 1, reg: gp11, asm: "BSWAPQ", resultInArg0: true}, // arg0 swap bytes
+               {name: "BSWAPL", argLength: 1, reg: gp11, asm: "BSWAPL", resultInArg0: true}, // arg0 swap bytes
 
                // POPCNT instructions aren't guaranteed to be on the target platform (they are SSE4).
                // Any use must be preceded by a successful check of runtime.x86HasPOPCNT.
index ca285a2dfcbe44bcda58b0c2fa245279775e3b95..0830cf5f7cc6e7c7d91fd32adc39d7118e54cd92 100644 (file)
@@ -4815,7 +4815,6 @@ var opcodeTable = [...]opInfo{
                name:         "BSWAPL",
                argLen:       1,
                resultInArg0: true,
-               clobberFlags: true,
                asm:          x86.ABSWAPL,
                reg: regInfo{
                        inputs: []inputInfo{
@@ -11506,7 +11505,6 @@ var opcodeTable = [...]opInfo{
                name:         "BSWAPQ",
                argLen:       1,
                resultInArg0: true,
-               clobberFlags: true,
                asm:          x86.ABSWAPQ,
                reg: regInfo{
                        inputs: []inputInfo{
@@ -11521,7 +11519,6 @@ var opcodeTable = [...]opInfo{
                name:         "BSWAPL",
                argLen:       1,
                resultInArg0: true,
-               clobberFlags: true,
                asm:          x86.ABSWAPL,
                reg: regInfo{
                        inputs: []inputInfo{