cmd/compile: fix clobberFlags for BSWAP

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>
This commit is contained in:
Jakub Ciolek 2022-03-10 15:35:17 +01:00 committed by Keith Randall
parent c5c66d78b2
commit 913ecf492d
3 changed files with 3 additions and 6 deletions

View 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

View 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.

View 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{