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:
@@ -159,7 +159,7 @@ pub enum InstructionData {
|
||||
second_result: Value,
|
||||
args: [Value; 2],
|
||||
},
|
||||
Select {
|
||||
Ternary {
|
||||
opcode: Opcode,
|
||||
ty: Type,
|
||||
args: [Value; 3],
|
||||
|
||||
@@ -194,7 +194,7 @@ pub fn write_instruction(w: &mut Write, func: &Function, inst: Inst) -> Result {
|
||||
BinaryImm { arg, imm, .. } => writeln!(w, " {}, {}", arg, imm),
|
||||
BinaryImmRev { imm, arg, .. } => writeln!(w, " {}, {}", imm, arg),
|
||||
BinaryOverflow { args, .. } => writeln!(w, " {}, {}", args[0], args[1]),
|
||||
Select { args, .. } => writeln!(w, " {}, {}, {}", args[0], args[1], args[2]),
|
||||
Ternary { args, .. } => writeln!(w, " {}, {}, {}", args[0], args[1], args[2]),
|
||||
InsertLane { lane, args, .. } => writeln!(w, " {}, {}, {}", args[0], lane, args[1]),
|
||||
ExtractLane { lane, arg, .. } => writeln!(w, " {}, {}", arg, lane),
|
||||
IntCompare { cond, args, .. } => writeln!(w, " {}, {}, {}", cond, args[0], args[1]),
|
||||
|
||||
@@ -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],
|
||||
|
||||
Reference in New Issue
Block a user