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
......@@ -350,9 +350,9 @@ func init() {
// flags are set to "equal" if the input is zero, "not equal" otherwise.
// 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: "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: "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.
// if arg2 encodes a true result, return arg1, else arg0
......
......@@ -7395,6 +7395,7 @@ var opcodeTable = [...]opInfo{
{
name: "BSFL",
argLen: 1,
clobberFlags: true,
asm: x86.ABSFL,
reg: regInfo{
inputs: []inputInfo{
......@@ -7422,6 +7423,7 @@ var opcodeTable = [...]opInfo{
{
name: "BSRL",
argLen: 1,
clobberFlags: true,
asm: x86.ABSRL,
reg: regInfo{
inputs: []inputInfo{
......
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