inline comparison instructions.

This commit is contained in:
Mark Thom
2017-12-04 21:01:23 -07:00
parent 8e5aaf02a4
commit cf6a47272a
8 changed files with 110 additions and 123 deletions

View File

@@ -16,9 +16,21 @@ macro_rules! deallocate {
)
}
macro_rules! move_at {
($at:expr, $r:expr) => (
Line::Query(vec![QueryInstruction::MoveArithmeticTerm($at, $r)])
macro_rules! compare_number {
($cmp: expr, $terms: expr) => (
QueryTerm::Inlined(InlinedQueryTerm::CompareNumber($cmp, $terms))
)
}
macro_rules! compare_number_instr {
($cmp: expr, $at_1: expr, $at_2: expr) => (
Line::BuiltIn(BuiltInInstruction::CompareNumber($cmp, $at_1, $at_2))
)
}
macro_rules! interm {
($n: expr) => (
ArithmeticTerm::Interm($n)
)
}
@@ -50,12 +62,6 @@ macro_rules! fact {
)
}
macro_rules! compare_number_call {
($cmp: expr) => (
Line::Control(ControlInstruction::CompareNumberCall($cmp))
)
}
macro_rules! temp_v {
($x:expr) => (
RegType::Temp($x)
@@ -216,8 +222,8 @@ macro_rules! unify {
}
macro_rules! is_call {
($r:expr) => (
Line::Control(ControlInstruction::IsCall($r))
($r:expr, $at:expr) => (
Line::Control(ControlInstruction::IsCall($r, $at))
)
}