Integer add with carry instructions.

Integer addition with carry in/out/both.
This commit is contained in:
Jakob Stoklund Olesen
2016-09-23 13:32:26 -07:00
parent 7ec54a5a01
commit 9cb3451432
7 changed files with 103 additions and 6 deletions

View File

@@ -149,6 +149,11 @@ pub enum InstructionData {
ty: Type,
args: [Value; 3],
},
TernaryOverflow {
opcode: Opcode,
ty: Type,
data: Box<TernaryOverflowData>,
},
InsertLane {
opcode: Opcode,
ty: Type,
@@ -254,6 +259,19 @@ impl Default for VariableArgs {
}
}
/// Payload data for ternary instructions with multiple results, such as `iadd_carry`.
#[derive(Clone, Debug)]
pub struct TernaryOverflowData {
pub second_result: Value,
pub args: [Value; 3],
}
impl Display for TernaryOverflowData {
fn fmt(&self, f: &mut Formatter) -> fmt::Result {
write!(f, "{}, {}, {}", self.args[0], self.args[1], self.args[2])
}
}
/// Payload data for jump instructions. These need to carry lists of EBB arguments that won't fit
/// in the allowed InstructionData size.
#[derive(Clone, Debug)]