Add a trapif instruction.

This is a conditional trap controlled by integer CPU flags.
Compare to brif.
This commit is contained in:
Jakob Stoklund Olesen
2018-02-08 14:39:06 -08:00
parent 3eeef1c752
commit 11c721934c
8 changed files with 49 additions and 0 deletions

View File

@@ -2348,6 +2348,21 @@ impl<'a> Parser<'a> {
let code = self.match_enum("expected trap code")?;
InstructionData::CondTrap { opcode, arg, code }
}
InstructionFormat::IntCondTrap => {
let cond = self.match_enum("expected intcc condition code")?;
let arg = self.match_value("expected SSA value operand")?;
self.match_token(
Token::Comma,
"expected ',' between operands",
)?;
let code = self.match_enum("expected trap code")?;
InstructionData::IntCondTrap {
opcode,
cond,
arg,
code,
}
}
};
Ok(idata)
}