Add a "clobbers_flags" flag to encoding recipes.

On some ISAs like Intel's, all arithmetic instructions set all or some
of the CPU flags, so flag values can't be live across these
instructions. On ISAs like ARM's Aarch32, flags are clobbered by compact
16-bit encodings but not necessarily by 32-bit encodings of the same
instruction.

The "clobbers_flags" bit on the encoding recipe is used to indicate if
CPU flag values can be live across an instruction, or conversely whether
the encoding can be used where flag values are live.
This commit is contained in:
Jakob Stoklund Olesen
2017-10-16 14:06:04 -07:00
parent 5d065c4d8f
commit 620eb7effe
4 changed files with 75 additions and 16 deletions

View File

@@ -106,6 +106,11 @@ pub struct RecipeConstraints {
/// Are there any tied operands?
pub tied_ops: bool,
/// Does this instruction clobber the CPU flags?
///
/// When true, SSA values of type `iflags` or `fflags` can not be live across the instruction.
pub clobbers_flags: bool,
}
impl RecipeConstraints {