Commit 29e5a81e authored by Keith Randall's avatar Keith Randall Committed by Keith Randall

cmd/compile: mark BS{F,R}L as clobbering flags

Turns out it doesn't currently matter, as these ops are always issued
together with a BTSL which does clobber flags. So I can't write a test
that currently fails. But better to be future-proof.

BS{F,R}Q generates flags, so it doesn't need to be marked as clobbering.

Change-Id: I70daea154023fd435fac696bf3a384803c647cd3
Reviewed-on: https://go-review.googlesource.com/117375
Run-TryBot: Keith Randall <khr@golang.org>
Reviewed-by: default avatarJosh Bleecher Snyder <josharian@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
parent 1425412f
...@@ -349,10 +349,10 @@ func init() { ...@@ -349,10 +349,10 @@ func init() {
// result is undefined if the input is zero. // result is undefined if the input is zero.
// flags are set to "equal" if the input is zero, "not equal" otherwise. // flags are set to "equal" if the input is zero, "not equal" otherwise.
// BS{F,R}L returns only the result. // BS{F,R}L returns only the result.
{name: "BSFQ", argLength: 1, reg: gp11flags, asm: "BSFQ", typ: "(UInt64,Flags)"}, // # of low-order zeroes in 64-bit arg {name: "BSFQ", argLength: 1, reg: gp11flags, asm: "BSFQ", typ: "(UInt64,Flags)"}, // # of low-order zeroes in 64-bit arg
{name: "BSFL", argLength: 1, reg: gp11, asm: "BSFL", typ: "UInt32"}, // # of low-order zeroes in 32-bit arg {name: "BSFL", argLength: 1, reg: gp11, asm: "BSFL", typ: "UInt32", clobberFlags: true}, // # of low-order zeroes in 32-bit arg
{name: "BSRQ", argLength: 1, reg: gp11flags, asm: "BSRQ", typ: "(UInt64,Flags)"}, // # of high-order zeroes in 64-bit arg {name: "BSRQ", argLength: 1, reg: gp11flags, asm: "BSRQ", typ: "(UInt64,Flags)"}, // # of high-order zeroes in 64-bit arg
{name: "BSRL", argLength: 1, reg: gp11, asm: "BSRL", typ: "UInt32"}, // # of high-order zeroes in 32-bit arg {name: "BSRL", argLength: 1, reg: gp11, asm: "BSRL", typ: "UInt32", clobberFlags: true}, // # of high-order zeroes in 32-bit arg
// CMOV instructions: 64, 32 and 16-bit sizes. // CMOV instructions: 64, 32 and 16-bit sizes.
// if arg2 encodes a true result, return arg1, else arg0 // if arg2 encodes a true result, return arg1, else arg0
......
...@@ -7393,9 +7393,10 @@ var opcodeTable = [...]opInfo{ ...@@ -7393,9 +7393,10 @@ var opcodeTable = [...]opInfo{
}, },
}, },
{ {
name: "BSFL", name: "BSFL",
argLen: 1, argLen: 1,
asm: x86.ABSFL, clobberFlags: true,
asm: x86.ABSFL,
reg: regInfo{ reg: regInfo{
inputs: []inputInfo{ inputs: []inputInfo{
{0, 65519}, // AX CX DX BX BP SI DI R8 R9 R10 R11 R12 R13 R14 R15 {0, 65519}, // AX CX DX BX BP SI DI R8 R9 R10 R11 R12 R13 R14 R15
...@@ -7420,9 +7421,10 @@ var opcodeTable = [...]opInfo{ ...@@ -7420,9 +7421,10 @@ var opcodeTable = [...]opInfo{
}, },
}, },
{ {
name: "BSRL", name: "BSRL",
argLen: 1, argLen: 1,
asm: x86.ABSRL, clobberFlags: true,
asm: x86.ABSRL,
reg: regInfo{ reg: regInfo{
inputs: []inputInfo{ inputs: []inputInfo{
{0, 65519}, // AX CX DX BX BP SI DI R8 R9 R10 R11 R12 R13 R14 R15 {0, 65519}, // AX CX DX BX BP SI DI R8 R9 R10 R11 R12 R13 R14 R15
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment