Add a trapif instruction.
This is a conditional trap controlled by integer CPU flags. Compare to brif.
This commit is contained in:
@@ -264,6 +264,12 @@ pub enum InstructionData {
|
||||
arg: Value,
|
||||
code: ir::TrapCode,
|
||||
},
|
||||
IntCondTrap {
|
||||
opcode: Opcode,
|
||||
cond: IntCC,
|
||||
arg: Value,
|
||||
code: ir::TrapCode,
|
||||
},
|
||||
}
|
||||
|
||||
/// A variable list of `Value` operands used for function call arguments and passing arguments to
|
||||
|
||||
@@ -365,6 +365,7 @@ impl<'a> Verifier<'a> {
|
||||
CopySpecial { .. } |
|
||||
Trap { .. } |
|
||||
CondTrap { .. } |
|
||||
IntCondTrap { .. } |
|
||||
NullAry { .. } => {}
|
||||
}
|
||||
|
||||
|
||||
@@ -428,6 +428,7 @@ pub fn write_operands(
|
||||
}
|
||||
Trap { code, .. } => write!(w, " {}", code),
|
||||
CondTrap { arg, code, .. } => write!(w, " {}, {}", arg, code),
|
||||
IntCondTrap { cond, arg, code, .. } => write!(w, " {} {}, {}", cond, arg, code),
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user