Add meta definitions for floating point operations.

Rename the Select instruction format to Ternary since it is also used by the fma
instruction.
This commit is contained in:
Jakob Stoklund Olesen
2016-07-07 13:16:24 -07:00
parent 86688053a6
commit 2bfb4ca5b7
6 changed files with 183 additions and 64 deletions

View File

@@ -815,13 +815,15 @@ impl<'a> Parser<'a> {
args: [lhs, rhs],
}
}
InstructionFormat::Select => {
InstructionFormat::Ternary => {
// Names here refer to the `select` instruction.
// This format is also use by `fma`.
let ctrl_arg = try!(self.match_value("expected SSA value control operand"));
try!(self.match_token(Token::Comma, "expected ',' between operands"));
let true_arg = try!(self.match_value("expected SSA value true operand"));
try!(self.match_token(Token::Comma, "expected ',' between operands"));
let false_arg = try!(self.match_value("expected SSA value false operand"));
InstructionData::Select {
InstructionData::Ternary {
opcode: opcode,
ty: VOID,
args: [ctrl_arg, true_arg, false_arg],