diff --git a/nautilus/include/nautilus/val.hpp b/nautilus/include/nautilus/val.hpp index 6fee93c3..b19cbf28 100644 --- a/nautilus/include/nautilus/val.hpp +++ b/nautilus/include/nautilus/val.hpp @@ -307,8 +307,7 @@ class val { }; template -concept is_fundamental_value = - requires(val value) { std::is_fundamental_v::basic_type>; }; +concept is_fundamental_value = requires(val value) { std::is_fundamental_v::basic_type>; }; template concept is_arithmetic_value = std::is_arithmetic_v::basic_type>; @@ -357,44 +356,46 @@ auto&& cast_value(LeftType&& value) { namespace details { #ifdef ENABLE_TRACING -#define TRAC_BINARY_OP(OP) \ - if (tracing::inTracer()) { \ - auto tc = tracing::traceBinaryOp(lValue.state, rValue.state); \ - return val(tc); \ +#define TRAC_BINARY_OP(OP) \ + if (tracing::inTracer()) { \ + auto tc = tracing::traceBinaryOp(lValue.state, rValue.state); \ + return val(tc); \ } -#define TRAC_BINARY_OP_DIRECT(OP) \ - if (tracing::inTracer()) { \ - auto tc = tracing::traceBinaryOp(left.state, right.state); \ - return val(tc); \ +#define TRAC_BINARY_OP_DIRECT(OP) \ + if (tracing::inTracer()) { \ + auto tc = tracing::traceBinaryOp(left.state, right.state); \ + return val(tc); \ } #else #define TRAC_OP(OP) #endif #ifdef ENABLE_TRACING -#define TRAC_LOGICAL_BINARY_OP(OP) \ - if (tracing::inTracer()) { \ - auto tc = tracing::traceBinaryOp(lValue.state, rValue.state); \ - return val(tc); \ +#define TRAC_LOGICAL_BINARY_OP(OP) \ + if (tracing::inTracer()) { \ + auto tc = tracing::traceBinaryOp(lValue.state, rValue.state); \ + return val(tc); \ } #else #define TRAC_LOGICAL_BINARY_OP(OP) #endif -#define DEFINE_BINARY_OPERATOR_HELPER(OP, OP_NAME, OP_TRACE, RES_TYPE) \ - template \ - auto inline OP_NAME(LHS&& left, RHS&& right) { \ - typedef typename std::common_type::type commonType; \ - auto&& lValue = cast_value(std::forward(left)); \ - auto&& rValue = cast_value(std::forward(right)); \ - if SHOULD_TRACE () { \ - auto tc = tracing::traceBinaryOp(details::getState(lValue), details::getState(rValue)); \ - return RES_TYPE(tc); \ - } \ - return RES_TYPE(getRawValue(lValue) OP getRawValue(rValue)); \ +#define DEFINE_BINARY_OPERATOR_HELPER(OP, OP_NAME, OP_TRACE, RES_TYPE) \ + template \ + auto inline OP_NAME(LHS&& left, RHS&& right) { \ + typedef typename std::common_type::type commonType; \ + auto&& lValue = cast_value(std::forward(left)); \ + auto&& rValue = cast_value(std::forward(right)); \ + using resultType = decltype(getRawValue(lValue) OP getRawValue(rValue)); \ + if SHOULD_TRACE () { \ + auto tc = tracing::traceBinaryOp(details::getState(lValue), details::getState(rValue)); \ + return RES_TYPE(tc); \ + } \ + return RES_TYPE(getRawValue(lValue) OP getRawValue(rValue)); \ } + DEFINE_BINARY_OPERATOR_HELPER(+, add, ADD, COMMON_RETURN_TYPE) DEFINE_BINARY_OPERATOR_HELPER(-, sub, SUB, COMMON_RETURN_TYPE) @@ -428,7 +429,7 @@ DEFINE_BINARY_OPERATOR_HELPER(|, bOr, BOR, COMMON_RETURN_TYPE) DEFINE_BINARY_OPERATOR_HELPER(^, bXOr, BXOR, COMMON_RETURN_TYPE) template -val neg(val& val) { +val neg(val& val) { #ifdef ENABLE_TRACING if (tracing::inTracer()) { auto tc = traceUnaryOp(val.state); @@ -445,23 +446,21 @@ LHS inline getRawValue(val& val) { } // namespace details -#define DEFINE_BINARY_OPERATOR(OP, FUNC) \ - template \ - requires(is_fundamental_value && (is_fundamental_value || convertible_to_fundamental) ) || \ - ((is_fundamental_value || convertible_to_fundamental) && is_fundamental_value) \ - auto inline operator OP(LHS&& left, RHS&& right) { \ - auto&& lhsV = make_value(std::forward(left)); \ - auto&& rhsV = make_value(std::forward(right)); \ - return details::FUNC(std::move(lhsV), std::move(rhsV)); \ +#define DEFINE_BINARY_OPERATOR(OP, FUNC) \ + template \ + requires(is_fundamental_value && (is_fundamental_value || convertible_to_fundamental) ) || ((is_fundamental_value || convertible_to_fundamental) && is_fundamental_value) \ + auto inline operator OP(LHS&& left, RHS&& right) { \ + auto&& lhsV = make_value(std::forward(left)); \ + auto&& rhsV = make_value(std::forward(right)); \ + return details::FUNC(std::move(lhsV), std::move(rhsV)); \ } -#define DEFINE_ARITHMETICAL_BINARY_OPERATOR(OP, FUNC) \ - template \ - requires(is_arithmetic_value && (is_arithmetic_value || convertible_to_fundamental) ) || \ - ((is_arithmetic_value || convertible_to_fundamental) && is_arithmetic_value) \ - auto inline operator OP(LHS&& left, RHS&& right) { \ - auto&& lhsV = make_value(std::forward(left)); \ - auto&& rhsV = make_value(std::forward(right)); \ - return details::FUNC(std::move(lhsV), std::move(rhsV)); \ +#define DEFINE_ARITHMETICAL_BINARY_OPERATOR(OP, FUNC) \ + template \ + requires(is_arithmetic_value && (is_arithmetic_value || convertible_to_fundamental) ) || ((is_arithmetic_value || convertible_to_fundamental) && is_arithmetic_value) \ + auto inline operator OP(LHS&& left, RHS&& right) { \ + auto&& lhsV = make_value(std::forward(left)); \ + auto&& rhsV = make_value(std::forward(right)); \ + return details::FUNC(std::move(lhsV), std::move(rhsV)); \ } DEFINE_ARITHMETICAL_BINARY_OPERATOR(+, add) diff --git a/nautilus/test/data/after_ssa/addArrayInt32.trace b/nautilus/test/data/after_ssa/addArrayInt32.trace index e9b5bc55..a78366ac 100644 --- a/nautilus/test/data/after_ssa/addArrayInt32.trace +++ b/nautilus/test/data/after_ssa/addArrayInt32.trace @@ -21,5 +21,5 @@ B1($3:i32,$4:i32,$1:ptr,$2:ptr) B2() RETURN $0 :void B3($4:i32,$3:i32,$1:ptr,$2:ptr) ControlFlowMerge - LT $5 $4 $3 :i32 + LT $5 $4 $3 :bool CMP $6 $5 B1($3,$4,$1,$2) B2() :void diff --git a/nautilus/test/data/after_ssa/andCondition.trace b/nautilus/test/data/after_ssa/andCondition.trace index 72e452e0..3d1975c6 100644 --- a/nautilus/test/data/after_ssa/andCondition.trace +++ b/nautilus/test/data/after_ssa/andCondition.trace @@ -1,9 +1,9 @@ B0($1:i32,$2:i32) CONST $3 1 :i32 CONST $4 8 :i32 - EQ $5 $1 $4 :i32 + EQ $5 $1 $4 :bool CONST $6 1 :i32 - EQ $7 $2 $6 :i32 + EQ $7 $2 $6 :bool AND $8 $5 $7 :bool CMP $9 $8 B1($3) B2($3) :void B1($3:i32) diff --git a/nautilus/test/data/after_ssa/andFunction.trace b/nautilus/test/data/after_ssa/andFunction.trace index 7fcf939b..571bc06e 100644 --- a/nautilus/test/data/after_ssa/andFunction.trace +++ b/nautilus/test/data/after_ssa/andFunction.trace @@ -2,14 +2,14 @@ B0($1:i32) CONST $2 :bool CONST $4 42 :i64 CAST $5 $1 :i64 - EQ $6 $5 $4 :i64 + EQ $6 $5 $4 :bool AND $7 $2 $6 :bool CONST $9 42 :i64 CAST $10 $1 :i64 - EQ $11 $10 $9 :i64 + EQ $11 $10 $9 :bool AND $12 $7 $11 :bool CONST $14 42 :i64 CAST $15 $1 :i64 - EQ $16 $15 $14 :i64 + EQ $16 $15 $14 :bool AND $17 $12 $16 :bool RETURN $17 :bool diff --git a/nautilus/test/data/after_ssa/collatz.trace b/nautilus/test/data/after_ssa/collatz.trace index 6fd82b20..d5432b3e 100644 --- a/nautilus/test/data/after_ssa/collatz.trace +++ b/nautilus/test/data/after_ssa/collatz.trace @@ -6,7 +6,7 @@ B1($2:i32,$1:i32) CONST $6 2 :i32 MOD $7 $1 $6 :i32 CONST $8 0 :i32 - EQ $9 $7 $8 :i32 + EQ $9 $7 $8 :bool CMP $10 $9 B3($2,$1) B4($2,$1) :void B2($2:i32) RETURN $2 :i32 @@ -23,7 +23,7 @@ B4($2:i32,$1:i32) CONST $22 1 :i32 JMP $0 B6($21,$2,$22) :void B5($2:i32,$1:i32,$3:i32) ControlFlowMerge - NEQ $4 $1 $3 :i32 + NEQ $4 $1 $3 :bool CMP $5 $4 B1($2,$1) B2($2) :void B6($1:i32,$2:i32,$13:i32) ControlFlowMerge ADD $14 $2 $13 :i32 diff --git a/nautilus/test/data/after_ssa/complexLogicalExpressions.trace b/nautilus/test/data/after_ssa/complexLogicalExpressions.trace index 5e439cfd..8034751d 100644 --- a/nautilus/test/data/after_ssa/complexLogicalExpressions.trace +++ b/nautilus/test/data/after_ssa/complexLogicalExpressions.trace @@ -1,14 +1,14 @@ B0($1:i32) CONST $2 0 :i32 CONST $3 5 :i32 - GT $4 $1 $3 :i32 + GT $4 $1 $3 :bool CONST $5 10 :i32 - LT $6 $1 $5 :i32 + LT $6 $1 $5 :bool AND $7 $4 $6 :bool CONST $8 15 :i32 - GT $9 $1 $8 :i32 + GT $9 $1 $8 :bool CONST $10 20 :i32 - LT $11 $1 $10 :i32 + LT $11 $1 $10 :bool AND $12 $9 $11 :bool OR $13 $7 $12 :bool CMP $14 $13 B1() B2($2) :void diff --git a/nautilus/test/data/after_ssa/compoundStatements.trace b/nautilus/test/data/after_ssa/compoundStatements.trace index 1429fabf..127ee009 100644 --- a/nautilus/test/data/after_ssa/compoundStatements.trace +++ b/nautilus/test/data/after_ssa/compoundStatements.trace @@ -1,7 +1,7 @@ B0($1:i32) CONST $2 0 :i32 CONST $3 5 :i32 - GT $4 $1 $3 :i32 + GT $4 $1 $3 :bool CMP $5 $4 B1() B2($2) :void B1() CONST $6 1 :i32 diff --git a/nautilus/test/data/after_ssa/conditionalReturn.trace b/nautilus/test/data/after_ssa/conditionalReturn.trace index 5e879284..092f9896 100644 --- a/nautilus/test/data/after_ssa/conditionalReturn.trace +++ b/nautilus/test/data/after_ssa/conditionalReturn.trace @@ -1,6 +1,6 @@ B0($1:i32) CONST $2 42 :i32 - EQ $3 $1 $2 :i32 + EQ $3 $1 $2 :bool CMP $4 $3 B1() B2() :void B1() CONST $5 1 :i32 diff --git a/nautilus/test/data/after_ssa/countDigits.trace b/nautilus/test/data/after_ssa/countDigits.trace index fcd4ab26..de0f3dcb 100644 --- a/nautilus/test/data/after_ssa/countDigits.trace +++ b/nautilus/test/data/after_ssa/countDigits.trace @@ -12,5 +12,5 @@ B1($2:i32,$1:i32) B2($2:i32) RETURN $2 :i32 B3($2:i32,$1:i32,$3:i32) ControlFlowMerge - NEQ $4 $1 $3 :i32 + NEQ $4 $1 $3 :bool CMP $5 $4 B1($2,$1) B2($2) :void diff --git a/nautilus/test/data/after_ssa/decimalToBinary.trace b/nautilus/test/data/after_ssa/decimalToBinary.trace index fc98a5ab..45253039 100644 --- a/nautilus/test/data/after_ssa/decimalToBinary.trace +++ b/nautilus/test/data/after_ssa/decimalToBinary.trace @@ -17,5 +17,5 @@ B3($1:i32,$3:i32,$2:i32,$4:i32) ControlFlowMerge CONST $10 2 :i32 DIV $11 $1 $10 :i32 CONST $12 0 :i32 - GT $13 $11 $12 :i32 + GT $13 $11 $12 :bool CMP $14 $13 B1($11,$9,$7) B2($7) :void diff --git a/nautilus/test/data/after_ssa/deeplyNestedIfElseCondition.trace b/nautilus/test/data/after_ssa/deeplyNestedIfElseCondition.trace index 0bb4d79f..700e2451 100644 --- a/nautilus/test/data/after_ssa/deeplyNestedIfElseCondition.trace +++ b/nautilus/test/data/after_ssa/deeplyNestedIfElseCondition.trace @@ -1,11 +1,11 @@ B0() CONST $1 5 :i32 CONST $2 8 :i32 - LT $3 $1 $2 :i32 + LT $3 $1 $2 :bool CMP $4 $3 B1($1) B2($1) :void B1($1:i32) CONST $5 6 :i32 - GT $6 $1 $5 :i32 + GT $6 $1 $5 :bool CMP $7 $6 B3($1) B4($1) :void B2($1:i32) CONST $13 20 :i32 @@ -19,13 +19,13 @@ B3($1:i32) JMP $0 B5($9,$10) :void B4($1:i32) CONST $16 6 :i32 - LT $17 $1 $16 :i32 + LT $17 $1 $16 :bool CMP $18 $17 B6($1) B7($1) :void B5($1:i32,$10:i32) ControlFlowMerge JMP $0 B10($1,$10) :void B6($1:i32) CONST $19 5 :i32 - EQ $20 $1 $19 :i32 + EQ $20 $1 $19 :bool CMP $21 $20 B8($1) B9($1) :void B7($1:i32) CONST $25 2 :i32 diff --git a/nautilus/test/data/after_ssa/deeplyNestedIfElseIfCondition.trace b/nautilus/test/data/after_ssa/deeplyNestedIfElseIfCondition.trace index 91f13051..b36b2d7e 100644 --- a/nautilus/test/data/after_ssa/deeplyNestedIfElseIfCondition.trace +++ b/nautilus/test/data/after_ssa/deeplyNestedIfElseIfCondition.trace @@ -1,7 +1,7 @@ B0() CONST $1 5 :i32 CONST $2 8 :i32 - LT $3 $1 $2 :i32 + LT $3 $1 $2 :bool CMP $4 $3 B1($1) B2($1) :void B1($1:i32) CONST $5 10 :i32 @@ -10,7 +10,7 @@ B1($1:i32) JMP $0 B5($6,$7) :void B2($1:i32) CONST $10 5 :i32 - EQ $11 $1 $10 :i32 + EQ $11 $1 $10 :bool CMP $12 $11 B3($1) B4($1) :void B3($1:i32) CONST $13 5 :i32 @@ -19,7 +19,7 @@ B3($1:i32) JMP $0 B5($14,$15) :void B4($1:i32) CONST $16 4 :i32 - EQ $17 $1 $16 :i32 + EQ $17 $1 $16 :bool CMP $18 $17 B6($1) B7($1) :void B5($1:i32,$7:i32) ControlFlowMerge JMP $0 B8($1,$7) :void diff --git a/nautilus/test/data/after_ssa/digitSum.trace b/nautilus/test/data/after_ssa/digitSum.trace index 002c637b..106c06de 100644 --- a/nautilus/test/data/after_ssa/digitSum.trace +++ b/nautilus/test/data/after_ssa/digitSum.trace @@ -13,5 +13,5 @@ B3($1:i32,$2:i32,$3:i32) ControlFlowMerge CONST $6 10 :i32 DIV $7 $1 $6 :i32 CONST $8 0 :i32 - GT $9 $7 $8 :i32 + GT $9 $7 $8 :bool CMP $10 $9 B1($7,$5) B2($5) :void diff --git a/nautilus/test/data/after_ssa/doubleIfCondition.trace b/nautilus/test/data/after_ssa/doubleIfCondition.trace index 611ac5eb..68e524de 100644 --- a/nautilus/test/data/after_ssa/doubleIfCondition.trace +++ b/nautilus/test/data/after_ssa/doubleIfCondition.trace @@ -1,7 +1,7 @@ B0() CONST $1 1 :i32 CONST $2 8 :i32 - EQ $3 $1 $2 :i32 + EQ $3 $1 $2 :bool CMP $4 $3 B1($1) B2($1) :void B1($1:i32) CONST $5 1 :i32 @@ -18,7 +18,7 @@ B4($1:i32) CONST $14 2 :i32 JMP $0 B6($1,$14) :void B5($1:i32,$5:i32) ControlFlowMerge - EQ $6 $1 $5 :i32 + EQ $6 $1 $5 :bool CMP $7 $6 B3($1) B4($1) :void B6($1:i32,$10:i32) ControlFlowMerge ADD $11 $1 $10 :i32 diff --git a/nautilus/test/data/after_ssa/elseOnlySumLoop.trace b/nautilus/test/data/after_ssa/elseOnlySumLoop.trace index 32fa893f..4cc127c3 100644 --- a/nautilus/test/data/after_ssa/elseOnlySumLoop.trace +++ b/nautilus/test/data/after_ssa/elseOnlySumLoop.trace @@ -5,7 +5,7 @@ B0() JMP $0 B5($1,$2,$3) :void B1($1:i32,$2:i32) CONST $6 50 :i32 - LT $7 $1 $6 :i32 + LT $7 $1 $6 :bool CMP $8 $7 B3($1,$2) B4($2,$1) :void B2($1:i32) RETURN $1 :i32 @@ -18,7 +18,7 @@ B4($2:i32,$1:i32) CONST $14 1 :i32 JMP $0 B6($13,$2,$14) :void B5($1:i32,$2:i32,$3:i32) ControlFlowMerge - LT $4 $2 $3 :i32 + LT $4 $2 $3 :bool CMP $5 $4 B1($1,$2) B2($1) :void B6($1:i32,$2:i32,$9:i32) ControlFlowMerge ADD $10 $2 $9 :i32 diff --git a/nautilus/test/data/after_ssa/factorial.trace b/nautilus/test/data/after_ssa/factorial.trace index ae12a096..fe6a1dce 100644 --- a/nautilus/test/data/after_ssa/factorial.trace +++ b/nautilus/test/data/after_ssa/factorial.trace @@ -11,5 +11,5 @@ B1($1:i32,$2:i32) B2($2:i32) RETURN $2 :i32 B3($2:i32,$1:i32,$3:i32) ControlFlowMerge - GT $4 $1 $3 :i32 + GT $4 $1 $3 :bool CMP $5 $4 B1($1,$2) B2($2) :void diff --git a/nautilus/test/data/after_ssa/fibonacci.trace b/nautilus/test/data/after_ssa/fibonacci.trace index fe829109..894aa0e1 100644 --- a/nautilus/test/data/after_ssa/fibonacci.trace +++ b/nautilus/test/data/after_ssa/fibonacci.trace @@ -12,5 +12,5 @@ B1($1:i32,$5:i32,$3:i32,$2:i32) B2($3:i32) RETURN $3 :i32 B3($3:i32,$5:i32,$1:i32,$2:i32) ControlFlowMerge - LTE $6 $5 $1 :i32 + LTE $6 $5 $1 :bool CMP $7 $6 B1($1,$5,$3,$2) B2($3) :void diff --git a/nautilus/test/data/after_ssa/gcd.trace b/nautilus/test/data/after_ssa/gcd.trace index c6a46864..e6557802 100644 --- a/nautilus/test/data/after_ssa/gcd.trace +++ b/nautilus/test/data/after_ssa/gcd.trace @@ -8,5 +8,5 @@ B1($1:i32,$2:i32) B2($1:i32) RETURN $1 :i32 B3($1:i32,$2:i32,$3:i32) ControlFlowMerge - NEQ $4 $2 $3 :i32 + NEQ $4 $2 $3 :bool CMP $5 $4 B1($1,$2) B2($1) :void diff --git a/nautilus/test/data/after_ssa/ifElseIfCondition.trace b/nautilus/test/data/after_ssa/ifElseIfCondition.trace index 0559a49d..8cf864a3 100644 --- a/nautilus/test/data/after_ssa/ifElseIfCondition.trace +++ b/nautilus/test/data/after_ssa/ifElseIfCondition.trace @@ -1,7 +1,7 @@ B0() CONST $1 1 :i32 CONST $2 8 :i32 - EQ $3 $1 $2 :i32 + EQ $3 $1 $2 :bool CMP $4 $3 B1($1) B2($1) :void B1($1:i32) CONST $5 14 :i32 @@ -10,7 +10,7 @@ B1($1:i32) JMP $0 B5($6,$7) :void B2($1:i32) CONST $10 1 :i32 - EQ $11 $1 $10 :i32 + EQ $11 $1 $10 :bool CMP $12 $11 B3($1) B4($1) :void B3($1:i32) CONST $13 20 :i32 diff --git a/nautilus/test/data/after_ssa/ifElseIfElse.trace b/nautilus/test/data/after_ssa/ifElseIfElse.trace index ff717370..77caeb2b 100644 --- a/nautilus/test/data/after_ssa/ifElseIfElse.trace +++ b/nautilus/test/data/after_ssa/ifElseIfElse.trace @@ -1,14 +1,14 @@ B0($1:i32) CONST $2 0 :i32 CONST $3 0 :i32 - EQ $4 $1 $3 :i32 + EQ $4 $1 $3 :bool CMP $5 $4 B1() B2($1) :void B1() CONST $6 10 :i32 JMP $0 B5($6) :void B2($1:i32) CONST $8 1 :i32 - EQ $9 $1 $8 :i32 + EQ $9 $1 $8 :bool CMP $10 $9 B3() B4() :void B3() CONST $11 20 :i32 diff --git a/nautilus/test/data/after_ssa/ifElseSumLoop.trace b/nautilus/test/data/after_ssa/ifElseSumLoop.trace index 6f89c830..0436820f 100644 --- a/nautilus/test/data/after_ssa/ifElseSumLoop.trace +++ b/nautilus/test/data/after_ssa/ifElseSumLoop.trace @@ -5,7 +5,7 @@ B0() JMP $0 B5($1,$2,$3) :void B1($2:i32,$1:i32) CONST $6 50 :i32 - LT $7 $1 $6 :i32 + LT $7 $1 $6 :bool CMP $8 $7 B3($2,$1) B4($2,$1) :void B2($1:i32) RETURN $1 :i32 @@ -20,7 +20,7 @@ B4($2:i32,$1:i32) CONST $16 1 :i32 JMP $0 B6($15,$2,$16) :void B5($1:i32,$2:i32,$3:i32) ControlFlowMerge - LT $4 $2 $3 :i32 + LT $4 $2 $3 :bool CMP $5 $4 B1($2,$1) B2($1) :void B6($1:i32,$2:i32,$11:i32) ControlFlowMerge ADD $12 $2 $11 :i32 diff --git a/nautilus/test/data/after_ssa/ifInsideLoop.trace b/nautilus/test/data/after_ssa/ifInsideLoop.trace index a23be470..212022db 100644 --- a/nautilus/test/data/after_ssa/ifInsideLoop.trace +++ b/nautilus/test/data/after_ssa/ifInsideLoop.trace @@ -6,7 +6,7 @@ B1($1:i32,$3:i32,$2:i32) CONST $6 2 :i32 MOD $7 $3 $6 :i32 CONST $8 0 :i32 - EQ $9 $7 $8 :i32 + EQ $9 $7 $8 :bool CMP $10 $9 B3($1,$3,$2) B4($2,$1,$3) :void B2($2:i32) RETURN $2 :i32 @@ -19,7 +19,7 @@ B4($2:i32,$1:i32,$3:i32) CONST $17 1 :i32 JMP $0 B6($2,$1,$3,$17) :void B5($2:i32,$3:i32,$1:i32) ControlFlowMerge - LT $4 $3 $1 :i32 + LT $4 $3 $1 :bool CMP $5 $4 B1($1,$3,$2) B2($2) :void B6($2:i32,$1:i32,$3:i32,$13:i32) ControlFlowMerge ADD $14 $3 $13 :i32 diff --git a/nautilus/test/data/after_ssa/ifNotEqual.trace b/nautilus/test/data/after_ssa/ifNotEqual.trace index 5413efa0..09b8f404 100644 --- a/nautilus/test/data/after_ssa/ifNotEqual.trace +++ b/nautilus/test/data/after_ssa/ifNotEqual.trace @@ -1,7 +1,7 @@ B0($1:i32) CONST $2 1 :i32 CONST $3 5 :i32 - NEQ $4 $1 $3 :i32 + NEQ $4 $1 $3 :bool CMP $5 $4 B1() B2($2) :void B1() CONST $6 2 :i32 diff --git a/nautilus/test/data/after_ssa/ifSumLoop.trace b/nautilus/test/data/after_ssa/ifSumLoop.trace index c2c4c71e..534cdcfc 100644 --- a/nautilus/test/data/after_ssa/ifSumLoop.trace +++ b/nautilus/test/data/after_ssa/ifSumLoop.trace @@ -5,7 +5,7 @@ B0() JMP $0 B5($1,$2,$3) :void B1($2:i32,$1:i32) CONST $6 50 :i32 - LT $7 $1 $6 :i32 + LT $7 $1 $6 :bool CMP $8 $7 B3($2,$1) B4($1,$2) :void B2($1:i32) RETURN $1 :i32 @@ -18,7 +18,7 @@ B4($1:i32,$2:i32) CONST $14 1 :i32 JMP $0 B6($1,$2,$14) :void B5($1:i32,$2:i32,$3:i32) ControlFlowMerge - LT $4 $2 $3 :i32 + LT $4 $2 $3 :bool CMP $5 $4 B1($2,$1) B2($1) :void B6($1:i32,$2:i32,$11:i32) ControlFlowMerge ADD $12 $2 $11 :i32 diff --git a/nautilus/test/data/after_ssa/ifThenCondition.trace b/nautilus/test/data/after_ssa/ifThenCondition.trace index 224275cf..db7eafd5 100644 --- a/nautilus/test/data/after_ssa/ifThenCondition.trace +++ b/nautilus/test/data/after_ssa/ifThenCondition.trace @@ -1,7 +1,7 @@ B0($1:i32) CONST $2 1 :i32 CONST $3 42 :i32 - EQ $4 $1 $3 :i32 + EQ $4 $1 $3 :bool CMP $5 $4 B1($2) B2($2) :void B1($2:i32) CONST $6 1 :i32 diff --git a/nautilus/test/data/after_ssa/ifThenElseCondition.trace b/nautilus/test/data/after_ssa/ifThenElseCondition.trace index fcf04f85..db6d95c9 100644 --- a/nautilus/test/data/after_ssa/ifThenElseCondition.trace +++ b/nautilus/test/data/after_ssa/ifThenElseCondition.trace @@ -1,7 +1,7 @@ B0($1:i32) CONST $2 1 :i32 CONST $3 42 :i32 - EQ $4 $1 $3 :i32 + EQ $4 $1 $3 :bool CMP $5 $4 B1($2) B2($2) :void B1($2:i32) CONST $6 1 :i32 diff --git a/nautilus/test/data/after_ssa/ifWithFunctionCall.trace b/nautilus/test/data/after_ssa/ifWithFunctionCall.trace index 14286e5b..ebff2bfe 100644 --- a/nautilus/test/data/after_ssa/ifWithFunctionCall.trace +++ b/nautilus/test/data/after_ssa/ifWithFunctionCall.trace @@ -3,7 +3,7 @@ B0($1:i32) CONST $4 2 :i32 MUL $5 $1 $4 :i32 CONST $6 10 :i32 - GT $7 $5 $6 :i32 + GT $7 $5 $6 :bool CMP $8 $7 B1() B2($2) :void B1() CONST $9 1 :i32 diff --git a/nautilus/test/data/after_ssa/ifWithTernary.trace b/nautilus/test/data/after_ssa/ifWithTernary.trace index 6e554905..7d2f3be0 100644 --- a/nautilus/test/data/after_ssa/ifWithTernary.trace +++ b/nautilus/test/data/after_ssa/ifWithTernary.trace @@ -1,6 +1,6 @@ B0($1:i32) CONST $2 5 :i32 - GT $3 $1 $2 :i32 + GT $3 $1 $2 :bool CMP $4 $3 B1($1) B2($1) :void B1($1:i32) CONST $5 10 :i32 @@ -16,7 +16,7 @@ B3() B4($5:i32) JMP $0 B6($5) :void B5($1:i32,$6:i32,$5:i32) ControlFlowMerge - EQ $7 $1 $6 :i32 + EQ $7 $1 $6 :bool CMP $8 $7 B3() B4($5) :void B6($5:i32) RETURN $5 :i32 diff --git a/nautilus/test/data/after_ssa/int16AddExpression.trace b/nautilus/test/data/after_ssa/int16AddExpression.trace index 17cd1386..fa4e99cb 100644 --- a/nautilus/test/data/after_ssa/int16AddExpression.trace +++ b/nautilus/test/data/after_ssa/int16AddExpression.trace @@ -1,4 +1,4 @@ B0($1:i16) CONST $2 5 :i16 - ADD $3 $1 $2 :i16 + ADD $3 $1 $2 :i32 RETURN $3 :i16 diff --git a/nautilus/test/data/after_ssa/int8AddExpression.trace b/nautilus/test/data/after_ssa/int8AddExpression.trace index 4259169d..c98a835f 100644 --- a/nautilus/test/data/after_ssa/int8AddExpression.trace +++ b/nautilus/test/data/after_ssa/int8AddExpression.trace @@ -1,4 +1,4 @@ B0($1:i8) CONST $2  :i8 - ADD $3 $2 $1 :i8 + ADD $3 $2 $1 :i32 RETURN $3 :i8 diff --git a/nautilus/test/data/after_ssa/isPrime.trace b/nautilus/test/data/after_ssa/isPrime.trace index 14c58024..90dd4279 100644 --- a/nautilus/test/data/after_ssa/isPrime.trace +++ b/nautilus/test/data/after_ssa/isPrime.trace @@ -2,7 +2,7 @@ B0($1:i32) CONST $2 :bool CONST $3 :bool CONST $4 1 :i32 - LTE $5 $1 $4 :i32 + LTE $5 $1 $4 :bool CMP $6 $5 B1($2) B2($2,$1,$3) :void B1($2:bool) JMP $0 B8($2) :void @@ -12,7 +12,7 @@ B2($2:bool,$1:i32,$3:bool) B3($2:bool,$1:i32,$8:i32,$3:bool) MOD $12 $1 $8 :i32 CONST $13 0 :i32 - EQ $14 $12 $13 :i32 + EQ $14 $12 $13 :bool CMP $15 $14 B5($2) B6($2,$1,$8,$3) :void B4($3:bool) JMP $0 B8($3) :void @@ -24,7 +24,7 @@ B6($2:bool,$1:i32,$8:i32,$3:bool) JMP $0 B7($2,$1,$19,$3) :void B7($2:bool,$1:i32,$8:i32,$3:bool) ControlFlowMerge MUL $9 $8 $8 :i32 - LTE $10 $9 $1 :i32 + LTE $10 $9 $1 :bool CMP $11 $10 B3($2,$1,$8,$3) B4($3) :void B8($2:bool) RETURN $2 :bool diff --git a/nautilus/test/data/after_ssa/logicalAnd.trace b/nautilus/test/data/after_ssa/logicalAnd.trace index a39396ab..d8bd92c8 100644 --- a/nautilus/test/data/after_ssa/logicalAnd.trace +++ b/nautilus/test/data/after_ssa/logicalAnd.trace @@ -1,9 +1,9 @@ B0($1:i32) CONST $2 0 :i32 CONST $3 5 :i32 - GT $4 $1 $3 :i32 + GT $4 $1 $3 :bool CONST $5 15 :i32 - LT $6 $1 $5 :i32 + LT $6 $1 $5 :bool AND $7 $4 $6 :bool CMP $8 $7 B1() B2($2) :void B1() diff --git a/nautilus/test/data/after_ssa/logicalOr.trace b/nautilus/test/data/after_ssa/logicalOr.trace index f019d294..7038ce8b 100644 --- a/nautilus/test/data/after_ssa/logicalOr.trace +++ b/nautilus/test/data/after_ssa/logicalOr.trace @@ -1,9 +1,9 @@ B0($1:i32) CONST $2 0 :i32 CONST $3 10 :i32 - EQ $4 $1 $3 :i32 + EQ $4 $1 $3 :bool CONST $5 20 :i32 - EQ $6 $1 $5 :i32 + EQ $6 $1 $5 :bool OR $7 $4 $6 :bool CMP $8 $7 B1() B2($2) :void B1() diff --git a/nautilus/test/data/after_ssa/logicalXOR.trace b/nautilus/test/data/after_ssa/logicalXOR.trace index fe2e5b4a..4597d543 100644 --- a/nautilus/test/data/after_ssa/logicalXOR.trace +++ b/nautilus/test/data/after_ssa/logicalXOR.trace @@ -1,9 +1,9 @@ B0($1:i32) CONST $2 0 :i32 CONST $3 10 :i32 - LT $4 $1 $3 :i32 + LT $4 $1 $3 :bool CONST $5 5 :i32 - GT $6 $1 $5 :i32 + GT $6 $1 $5 :bool NEQ $7 $4 $6 :bool CMP $8 $7 B1() B2($2) :void B1() diff --git a/nautilus/test/data/after_ssa/loopDirectCall.trace b/nautilus/test/data/after_ssa/loopDirectCall.trace index 0d330446..be24c63c 100644 --- a/nautilus/test/data/after_ssa/loopDirectCall.trace +++ b/nautilus/test/data/after_ssa/loopDirectCall.trace @@ -10,5 +10,5 @@ B1($1:i32,$4:i32,$2:i32,$3:i32) B2($3:i32) RETURN $3 :i32 B3($3:i32,$4:i32,$1:i32,$2:i32) ControlFlowMerge - LT $5 $4 $1 :i32 + LT $5 $4 $1 :bool CMP $6 $5 B1($1,$4,$2,$3) B2($3) :void diff --git a/nautilus/test/data/after_ssa/multipleConditions.trace b/nautilus/test/data/after_ssa/multipleConditions.trace index 0f90ea66..531e2d65 100644 --- a/nautilus/test/data/after_ssa/multipleConditions.trace +++ b/nautilus/test/data/after_ssa/multipleConditions.trace @@ -1,12 +1,12 @@ B0($1:i32) CONST $2 0 :i32 CONST $3 0 :i32 - GT $4 $1 $3 :i32 + GT $4 $1 $3 :bool CONST $5 10 :i32 - LT $6 $1 $5 :i32 + LT $6 $1 $5 :bool AND $7 $4 $6 :bool CONST $8 20 :i32 - EQ $9 $1 $8 :i32 + EQ $9 $1 $8 :bool OR $10 $7 $9 :bool CMP $11 $10 B1() B2($2) :void B1() diff --git a/nautilus/test/data/after_ssa/nestedElseOnlySumLoop.trace b/nautilus/test/data/after_ssa/nestedElseOnlySumLoop.trace index 3082db59..93625c1b 100644 --- a/nautilus/test/data/after_ssa/nestedElseOnlySumLoop.trace +++ b/nautilus/test/data/after_ssa/nestedElseOnlySumLoop.trace @@ -5,13 +5,13 @@ B0() JMP $0 B7($1,$2,$3) :void B1($1:i32,$2:i32) CONST $6 50 :i32 - LT $7 $1 $6 :i32 + LT $7 $1 $6 :bool CMP $8 $7 B3($1,$2) B4($2,$1) :void B2($1:i32) RETURN $1 :i32 B3($1:i32,$2:i32) CONST $9 40 :i32 - LT $10 $1 $9 :i32 + LT $10 $1 $9 :bool CMP $11 $10 B5($1,$2) B6($2,$1) :void B4($2:i32,$1:i32) CONST $15 1 :i32 @@ -27,7 +27,7 @@ B6($2:i32,$1:i32) CONST $20 1 :i32 JMP $0 B9($19,$2,$20) :void B7($1:i32,$2:i32,$3:i32) ControlFlowMerge - LT $4 $2 $3 :i32 + LT $4 $2 $3 :bool CMP $5 $4 B1($1,$2) B2($1) :void B8($1:i32,$2:i32,$12:i32) ControlFlowMerge JMP $0 B9($1,$2,$12) :void diff --git a/nautilus/test/data/after_ssa/nestedIf.trace b/nautilus/test/data/after_ssa/nestedIf.trace index 5acaf51e..7b87c8d1 100644 --- a/nautilus/test/data/after_ssa/nestedIf.trace +++ b/nautilus/test/data/after_ssa/nestedIf.trace @@ -1,11 +1,11 @@ B0($1:i32) CONST $2 1 :i32 CONST $3 20 :i32 - LT $4 $1 $3 :i32 + LT $4 $1 $3 :bool CMP $5 $4 B1($1) B2($2) :void B1($1:i32) CONST $6 10 :i32 - GT $7 $1 $6 :i32 + GT $7 $1 $6 :bool CMP $8 $7 B3() B4() :void B2($2:i32) JMP $0 B5($2) :void diff --git a/nautilus/test/data/after_ssa/nestedIfElseDifferentLevels.trace b/nautilus/test/data/after_ssa/nestedIfElseDifferentLevels.trace index 243f077f..2bcf08da 100644 --- a/nautilus/test/data/after_ssa/nestedIfElseDifferentLevels.trace +++ b/nautilus/test/data/after_ssa/nestedIfElseDifferentLevels.trace @@ -1,11 +1,11 @@ B0($1:i32) CONST $2 0 :i32 CONST $3 0 :i32 - GT $4 $1 $3 :i32 + GT $4 $1 $3 :bool CMP $5 $4 B1($1) B2() :void B1($1:i32) CONST $6 5 :i32 - LT $7 $1 $6 :i32 + LT $7 $1 $6 :bool CMP $8 $7 B3() B4($1) :void B2() CONST $11 -1 :i32 @@ -16,7 +16,7 @@ B3() B4($1:i32) CONST $13 2 :i32 CONST $14 6 :i32 - EQ $15 $1 $14 :i32 + EQ $15 $1 $14 :bool CMP $16 $15 B5() B6($13) :void B5() CONST $17 3 :i32 diff --git a/nautilus/test/data/after_ssa/nestedIfElseSumLoop.trace b/nautilus/test/data/after_ssa/nestedIfElseSumLoop.trace index 968d49db..380fcacd 100644 --- a/nautilus/test/data/after_ssa/nestedIfElseSumLoop.trace +++ b/nautilus/test/data/after_ssa/nestedIfElseSumLoop.trace @@ -5,13 +5,13 @@ B0() JMP $0 B7($1,$2,$3) :void B1($2:i32,$1:i32) CONST $6 50 :i32 - LT $7 $1 $6 :i32 + LT $7 $1 $6 :bool CMP $8 $7 B3($2,$1) B4($2,$1) :void B2($1:i32) RETURN $1 :i32 B3($2:i32,$1:i32) CONST $9 40 :i32 - LT $10 $1 $9 :i32 + LT $10 $1 $9 :bool CMP $11 $10 B5($2,$1) B6($2,$1) :void B4($2:i32,$1:i32) CONST $17 1 :i32 @@ -29,7 +29,7 @@ B6($2:i32,$1:i32) CONST $22 1 :i32 JMP $0 B9($21,$2,$22) :void B7($1:i32,$2:i32,$3:i32) ControlFlowMerge - LT $4 $2 $3 :i32 + LT $4 $2 $3 :bool CMP $5 $4 B1($2,$1) B2($1) :void B8($1:i32,$2:i32,$14:i32) ControlFlowMerge JMP $0 B9($1,$2,$14) :void diff --git a/nautilus/test/data/after_ssa/nestedIfNoElseCondition.trace b/nautilus/test/data/after_ssa/nestedIfNoElseCondition.trace index a49dff85..4f734186 100644 --- a/nautilus/test/data/after_ssa/nestedIfNoElseCondition.trace +++ b/nautilus/test/data/after_ssa/nestedIfNoElseCondition.trace @@ -1,6 +1,6 @@ B0($1:i32,$2:i32) CONST $3 42 :i32 - EQ $4 $1 $3 :i32 + EQ $4 $1 $3 :bool CMP $5 $4 B1($2) B2($2) :void B1($2:i32) CONST $6 4 :i32 @@ -11,7 +11,7 @@ B2($2:i32) CONST $13 9 :i32 ADD $14 $2 $13 :i32 CONST $15 8 :i32 - EQ $16 $14 $15 :i32 + EQ $16 $14 $15 :bool CMP $17 $16 B3($14) B4($14) :void B3($2:i32) CONST $18 14 :i32 diff --git a/nautilus/test/data/after_ssa/nestedIfSumLoop.trace b/nautilus/test/data/after_ssa/nestedIfSumLoop.trace index 8056e1d3..8d97cb4f 100644 --- a/nautilus/test/data/after_ssa/nestedIfSumLoop.trace +++ b/nautilus/test/data/after_ssa/nestedIfSumLoop.trace @@ -5,13 +5,13 @@ B0() JMP $0 B7($1,$2,$3) :void B1($2:i32,$1:i32) CONST $6 50 :i32 - LT $7 $1 $6 :i32 + LT $7 $1 $6 :bool CMP $8 $7 B3($2,$1) B4($2,$1) :void B2($1:i32) RETURN $1 :i32 B3($2:i32,$1:i32) CONST $9 40 :i32 - LT $10 $1 $9 :i32 + LT $10 $1 $9 :bool CMP $11 $10 B5($2,$1) B6($1,$2) :void B4($2:i32,$1:i32) CONST $17 1 :i32 @@ -27,7 +27,7 @@ B6($1:i32,$2:i32) CONST $20 1 :i32 JMP $0 B9($1,$2,$20) :void B7($1:i32,$2:i32,$3:i32) ControlFlowMerge - LT $4 $2 $3 :i32 + LT $4 $2 $3 :bool CMP $5 $4 B1($2,$1) B2($1) :void B8($1:i32,$2:i32,$14:i32) ControlFlowMerge JMP $0 B9($1,$2,$14) :void diff --git a/nautilus/test/data/after_ssa/nestedIfThenElseCondition.trace b/nautilus/test/data/after_ssa/nestedIfThenElseCondition.trace index fe2174b7..51dfe96f 100644 --- a/nautilus/test/data/after_ssa/nestedIfThenElseCondition.trace +++ b/nautilus/test/data/after_ssa/nestedIfThenElseCondition.trace @@ -1,13 +1,13 @@ B0($1:i32,$2:i32) CONST $3 42 :i32 - EQ $4 $1 $3 :i32 + EQ $4 $1 $3 :bool CMP $5 $4 B1($2) B2($2) :void B1($2:i32) CONST $6 2 :i32 JMP $0 B5($2,$6) :void B2($2:i32) CONST $11 8 :i32 - EQ $12 $2 $11 :i32 + EQ $12 $2 $11 :bool CMP $13 $12 B3($2) B4($2) :void B3($2:i32) CONST $14 2 :i32 diff --git a/nautilus/test/data/after_ssa/nestedSumLoop.trace b/nautilus/test/data/after_ssa/nestedSumLoop.trace index d6bb9d9b..d70f65da 100644 --- a/nautilus/test/data/after_ssa/nestedSumLoop.trace +++ b/nautilus/test/data/after_ssa/nestedSumLoop.trace @@ -18,8 +18,8 @@ B4($2:i32,$1:i32,$3:i32) ADD $16 $3 $15 :i32 JMP $0 B6($2,$16,$1) :void B5($2:i32,$1:i32,$3:i32,$6:i32) ControlFlowMerge - LT $7 $6 $1 :i32 + LT $7 $6 $1 :bool CMP $8 $7 B3($1,$3,$6,$2) B4($2,$1,$3) :void B6($2:i32,$3:i32,$1:i32) ControlFlowMerge - LT $4 $3 $1 :i32 + LT $4 $3 $1 :bool CMP $5 $4 B1($2,$1,$3) B2($2) :void diff --git a/nautilus/test/data/after_ssa/orCondition.trace b/nautilus/test/data/after_ssa/orCondition.trace index 70a69005..20277c27 100644 --- a/nautilus/test/data/after_ssa/orCondition.trace +++ b/nautilus/test/data/after_ssa/orCondition.trace @@ -1,9 +1,9 @@ B0($1:i32) CONST $2 1 :i32 CONST $3 8 :i32 - EQ $4 $1 $3 :i32 + EQ $4 $1 $3 :bool CONST $5 1 :i32 - EQ $6 $1 $5 :i32 + EQ $6 $1 $5 :bool OR $7 $4 $6 :bool CMP $8 $7 B1($2) B2($2) :void B1($2:i32) diff --git a/nautilus/test/data/after_ssa/reverseNumber.trace b/nautilus/test/data/after_ssa/reverseNumber.trace index 04599850..79de79f3 100644 --- a/nautilus/test/data/after_ssa/reverseNumber.trace +++ b/nautilus/test/data/after_ssa/reverseNumber.trace @@ -15,5 +15,5 @@ B3($1:i32,$2:i32,$3:i32) ControlFlowMerge CONST $8 10 :i32 DIV $9 $1 $8 :i32 CONST $10 0 :i32 - GT $11 $9 $10 :i32 + GT $11 $9 $10 :bool CMP $12 $11 B1($9,$7) B2($7) :void diff --git a/nautilus/test/data/after_ssa/shortCircuitEvaluation.trace b/nautilus/test/data/after_ssa/shortCircuitEvaluation.trace index f88f34ab..07dd0a20 100644 --- a/nautilus/test/data/after_ssa/shortCircuitEvaluation.trace +++ b/nautilus/test/data/after_ssa/shortCircuitEvaluation.trace @@ -1,11 +1,11 @@ B0($1:i32) CONST $2 0 :i32 CONST $3 0 :i32 - NEQ $4 $1 $3 :i32 + NEQ $4 $1 $3 :bool CONST $5 10 :i32 DIV $6 $5 $1 :i32 CONST $7 1 :i32 - GT $8 $6 $7 :i32 + GT $8 $6 $7 :bool AND $9 $4 $8 :bool CMP $10 $9 B1() B2($2) :void B1() diff --git a/nautilus/test/data/after_ssa/staticLoopWithDynamicLoop.trace b/nautilus/test/data/after_ssa/staticLoopWithDynamicLoop.trace index fa2a4273..044bf5c6 100644 --- a/nautilus/test/data/after_ssa/staticLoopWithDynamicLoop.trace +++ b/nautilus/test/data/after_ssa/staticLoopWithDynamicLoop.trace @@ -4,7 +4,7 @@ B0($1:i32) JMP $0 B9($2,$3,$1) :void B1($1:i32,$3:i32,$2:i32) CONST $6 5 :i32 - GT $7 $3 $6 :i32 + GT $7 $3 $6 :bool CMP $8 $7 B3($1,$3,$2) B4($1,$3,$2) :void B2($2:i32) RETURN $2 :i32 @@ -33,17 +33,17 @@ B8($1:i32,$3:i32,$2:i32) CONST $35 10 :i32 JMP $0 B12($1,$3,$2,$35) :void B9($2:i32,$3:i32,$1:i32) ControlFlowMerge - LT $4 $3 $1 :i32 + LT $4 $3 $1 :bool CMP $5 $4 B1($1,$3,$2) B2($2) :void B10($1:i32,$3:i32,$2:i32,$11:i32) ControlFlowMerge ADD $12 $2 $11 :i32 CONST $13 5 :i32 - GT $14 $3 $13 :i32 + GT $14 $3 $13 :bool CMP $15 $14 B5($1,$3,$12) B6($1,$3,$12) :void B11($1:i32,$3:i32,$2:i32,$18:i32) ControlFlowMerge ADD $19 $2 $18 :i32 CONST $20 5 :i32 - GT $21 $3 $20 :i32 + GT $21 $3 $20 :bool CMP $22 $21 B7($1,$3,$19) B8($1,$3,$19) :void B12($1:i32,$3:i32,$2:i32,$25:i32) ControlFlowMerge ADD $26 $2 $25 :i32 diff --git a/nautilus/test/data/after_ssa/sumArray.trace b/nautilus/test/data/after_ssa/sumArray.trace index 1f0545ee..cbd614c4 100644 --- a/nautilus/test/data/after_ssa/sumArray.trace +++ b/nautilus/test/data/after_ssa/sumArray.trace @@ -14,5 +14,5 @@ B1($2:i32,$4:i32,$3:i32,$1:ptr) B2($3:i32) RETURN $3 :i32 B3($3:i32,$4:i32,$2:i32,$1:ptr) ControlFlowMerge - LT $5 $4 $2 :i32 + LT $5 $4 $2 :bool CMP $6 $5 B1($2,$4,$3,$1) B2($3) :void diff --git a/nautilus/test/data/after_ssa/sumLoop.trace b/nautilus/test/data/after_ssa/sumLoop.trace index 5f372d9c..17d9e974 100644 --- a/nautilus/test/data/after_ssa/sumLoop.trace +++ b/nautilus/test/data/after_ssa/sumLoop.trace @@ -11,5 +11,5 @@ B1($1:i32,$3:i32,$2:i32) B2($2:i32) RETURN $2 :i32 B3($2:i32,$3:i32,$1:i32) ControlFlowMerge - LT $4 $3 $1 :i32 + LT $4 $3 $1 :bool CMP $5 $4 B1($1,$3,$2) B2($2) :void diff --git a/nautilus/test/data/after_ssa/sumOfNumbers.trace b/nautilus/test/data/after_ssa/sumOfNumbers.trace index b440b84c..9c85275c 100644 --- a/nautilus/test/data/after_ssa/sumOfNumbers.trace +++ b/nautilus/test/data/after_ssa/sumOfNumbers.trace @@ -10,5 +10,5 @@ B1($1:i32,$3:i32,$2:i32) B2($2:i32) RETURN $2 :i32 B3($2:i32,$3:i32,$1:i32) ControlFlowMerge - LTE $4 $3 $1 :i32 + LTE $4 $3 $1 :bool CMP $5 $4 B1($1,$3,$2) B2($2) :void diff --git a/nautilus/test/data/after_ssa/sumOfSquares.trace b/nautilus/test/data/after_ssa/sumOfSquares.trace index 9c0007e6..20f3e464 100644 --- a/nautilus/test/data/after_ssa/sumOfSquares.trace +++ b/nautilus/test/data/after_ssa/sumOfSquares.trace @@ -11,5 +11,5 @@ B1($1:i32,$3:i32,$2:i32) B2($2:i32) RETURN $2 :i32 B3($2:i32,$3:i32,$1:i32) ControlFlowMerge - LTE $4 $3 $1 :i32 + LTE $4 $3 $1 :bool CMP $5 $4 B1($1,$3,$2) B2($2) :void diff --git a/nautilus/test/data/after_ssa/varyingComplexity.trace b/nautilus/test/data/after_ssa/varyingComplexity.trace index 8bffb342..4431d9c0 100644 --- a/nautilus/test/data/after_ssa/varyingComplexity.trace +++ b/nautilus/test/data/after_ssa/varyingComplexity.trace @@ -1,22 +1,22 @@ B0($1:i32) CONST $2 0 :i32 CONST $3 5 :i32 - LT $4 $1 $3 :i32 + LT $4 $1 $3 :bool CMP $5 $4 B1() B2($1) :void B1() CONST $6 1 :i32 JMP $0 B7($6) :void B2($1:i32) CONST $8 5 :i32 - GTE $9 $1 $8 :i32 + GTE $9 $1 $8 :bool CONST $10 10 :i32 - LTE $11 $1 $10 :i32 + LTE $11 $1 $10 :bool AND $12 $9 $11 :bool CMP $13 $12 B3($1) B4() :void B3($1:i32) CONST $14 2 :i32 CONST $15 7 :i32 - EQ $16 $1 $15 :i32 + EQ $16 $1 $15 :bool CMP $17 $16 B5($14) B6($14) :void B4() CONST $21 3 :i32 diff --git a/nautilus/test/data/tracing/addArrayInt32.trace b/nautilus/test/data/tracing/addArrayInt32.trace index 049e43f6..31c9934c 100644 --- a/nautilus/test/data/tracing/addArrayInt32.trace +++ b/nautilus/test/data/tracing/addArrayInt32.trace @@ -31,5 +31,5 @@ B1() B2() RETURN $0 :void B3() ControlFlowMerge - LT $5 $4 $3 :i32 + LT $5 $4 $3 :bool CMP $6 $5 B1() B2() :void diff --git a/nautilus/test/data/tracing/andCondition.trace b/nautilus/test/data/tracing/andCondition.trace index 90b15e2b..df1dbc89 100644 --- a/nautilus/test/data/tracing/andCondition.trace +++ b/nautilus/test/data/tracing/andCondition.trace @@ -1,9 +1,9 @@ B0() CONST $3 1 :i32 CONST $4 8 :i32 - EQ $5 $1 $4 :i32 + EQ $5 $1 $4 :bool CONST $6 1 :i32 - EQ $7 $2 $6 :i32 + EQ $7 $2 $6 :bool AND $8 $5 $7 :bool CMP $9 $8 B1() B2() :void B1() diff --git a/nautilus/test/data/tracing/andFunction.trace b/nautilus/test/data/tracing/andFunction.trace index 719dbba7..96efa878 100644 --- a/nautilus/test/data/tracing/andFunction.trace +++ b/nautilus/test/data/tracing/andFunction.trace @@ -3,19 +3,19 @@ B0() ASSIGN $3 $2 :bool CONST $4 42 :i64 CAST $5 $1 :i64 - EQ $6 $5 $4 :i64 + EQ $6 $5 $4 :bool AND $7 $3 $6 :bool ASSIGN $2 $7 :bool ASSIGN $8 $2 :bool CONST $9 42 :i64 CAST $10 $1 :i64 - EQ $11 $10 $9 :i64 + EQ $11 $10 $9 :bool AND $12 $8 $11 :bool ASSIGN $2 $12 :bool ASSIGN $13 $2 :bool CONST $14 42 :i64 CAST $15 $1 :i64 - EQ $16 $15 $14 :i64 + EQ $16 $15 $14 :bool AND $17 $13 $16 :bool ASSIGN $2 $17 :bool RETURN $2 :bool diff --git a/nautilus/test/data/tracing/collatz.trace b/nautilus/test/data/tracing/collatz.trace index 5db947a6..76816a8a 100644 --- a/nautilus/test/data/tracing/collatz.trace +++ b/nautilus/test/data/tracing/collatz.trace @@ -6,7 +6,7 @@ B1() CONST $6 2 :i32 MOD $7 $1 $6 :i32 CONST $8 0 :i32 - EQ $9 $7 $8 :i32 + EQ $9 $7 $8 :bool CMP $10 $9 B3() B4() :void B2() RETURN $2 :i32 @@ -26,7 +26,7 @@ B4() ASSIGN $13 $22 :i32 JMP $0 B6() :void B5() ControlFlowMerge - NEQ $4 $1 $3 :i32 + NEQ $4 $1 $3 :bool CMP $5 $4 B1() B2() :void B6() ControlFlowMerge ADD $14 $2 $13 :i32 diff --git a/nautilus/test/data/tracing/complexLogicalExpressions.trace b/nautilus/test/data/tracing/complexLogicalExpressions.trace index 70d7ad69..bf7ff363 100644 --- a/nautilus/test/data/tracing/complexLogicalExpressions.trace +++ b/nautilus/test/data/tracing/complexLogicalExpressions.trace @@ -1,14 +1,14 @@ B0() CONST $2 0 :i32 CONST $3 5 :i32 - GT $4 $1 $3 :i32 + GT $4 $1 $3 :bool CONST $5 10 :i32 - LT $6 $1 $5 :i32 + LT $6 $1 $5 :bool AND $7 $4 $6 :bool CONST $8 15 :i32 - GT $9 $1 $8 :i32 + GT $9 $1 $8 :bool CONST $10 20 :i32 - LT $11 $1 $10 :i32 + LT $11 $1 $10 :bool AND $12 $9 $11 :bool OR $13 $7 $12 :bool CMP $14 $13 B1() B2() :void diff --git a/nautilus/test/data/tracing/compoundStatements.trace b/nautilus/test/data/tracing/compoundStatements.trace index 25c459c6..045ebdf5 100644 --- a/nautilus/test/data/tracing/compoundStatements.trace +++ b/nautilus/test/data/tracing/compoundStatements.trace @@ -1,7 +1,7 @@ B0() CONST $2 0 :i32 CONST $3 5 :i32 - GT $4 $1 $3 :i32 + GT $4 $1 $3 :bool CMP $5 $4 B1() B2() :void B1() CONST $6 1 :i32 diff --git a/nautilus/test/data/tracing/conditionalReturn.trace b/nautilus/test/data/tracing/conditionalReturn.trace index 91c8f453..903018e3 100644 --- a/nautilus/test/data/tracing/conditionalReturn.trace +++ b/nautilus/test/data/tracing/conditionalReturn.trace @@ -1,6 +1,6 @@ B0() CONST $2 42 :i32 - EQ $3 $1 $2 :i32 + EQ $3 $1 $2 :bool CMP $4 $3 B1() B2() :void B1() CONST $5 1 :i32 diff --git a/nautilus/test/data/tracing/countDigits.trace b/nautilus/test/data/tracing/countDigits.trace index 00c3b013..e2d5b9d3 100644 --- a/nautilus/test/data/tracing/countDigits.trace +++ b/nautilus/test/data/tracing/countDigits.trace @@ -15,5 +15,5 @@ B1() B2() RETURN $2 :i32 B3() ControlFlowMerge - NEQ $4 $1 $3 :i32 + NEQ $4 $1 $3 :bool CMP $5 $4 B1() B2() :void diff --git a/nautilus/test/data/tracing/decimalToBinary.trace b/nautilus/test/data/tracing/decimalToBinary.trace index 48d63132..2620e036 100644 --- a/nautilus/test/data/tracing/decimalToBinary.trace +++ b/nautilus/test/data/tracing/decimalToBinary.trace @@ -21,5 +21,5 @@ B3() ControlFlowMerge DIV $11 $1 $10 :i32 ASSIGN $1 $11 :i32 CONST $12 0 :i32 - GT $13 $1 $12 :i32 + GT $13 $1 $12 :bool CMP $14 $13 B1() B2() :void diff --git a/nautilus/test/data/tracing/deeplyNestedIfElseCondition.trace b/nautilus/test/data/tracing/deeplyNestedIfElseCondition.trace index d4351b04..36fd4e89 100644 --- a/nautilus/test/data/tracing/deeplyNestedIfElseCondition.trace +++ b/nautilus/test/data/tracing/deeplyNestedIfElseCondition.trace @@ -1,11 +1,11 @@ B0() CONST $1 5 :i32 CONST $2 8 :i32 - LT $3 $1 $2 :i32 + LT $3 $1 $2 :bool CMP $4 $3 B1() B2() :void B1() CONST $5 6 :i32 - GT $6 $1 $5 :i32 + GT $6 $1 $5 :bool CMP $7 $6 B3() B4() :void B2() CONST $13 20 :i32 @@ -22,13 +22,13 @@ B3() JMP $0 B5() :void B4() CONST $16 6 :i32 - LT $17 $1 $16 :i32 + LT $17 $1 $16 :bool CMP $18 $17 B6() B7() :void B5() ControlFlowMerge JMP $0 B10() :void B6() CONST $19 5 :i32 - EQ $20 $1 $19 :i32 + EQ $20 $1 $19 :bool CMP $21 $20 B8() B9() :void B7() CONST $25 2 :i32 diff --git a/nautilus/test/data/tracing/deeplyNestedIfElseIfCondition.trace b/nautilus/test/data/tracing/deeplyNestedIfElseIfCondition.trace index cd410849..20ac3e4f 100644 --- a/nautilus/test/data/tracing/deeplyNestedIfElseIfCondition.trace +++ b/nautilus/test/data/tracing/deeplyNestedIfElseIfCondition.trace @@ -1,7 +1,7 @@ B0() CONST $1 5 :i32 CONST $2 8 :i32 - LT $3 $1 $2 :i32 + LT $3 $1 $2 :bool CMP $4 $3 B1() B2() :void B1() CONST $5 10 :i32 @@ -11,7 +11,7 @@ B1() JMP $0 B5() :void B2() CONST $10 5 :i32 - EQ $11 $1 $10 :i32 + EQ $11 $1 $10 :bool CMP $12 $11 B3() B4() :void B3() CONST $13 5 :i32 @@ -22,7 +22,7 @@ B3() JMP $0 B5() :void B4() CONST $16 4 :i32 - EQ $17 $1 $16 :i32 + EQ $17 $1 $16 :bool CMP $18 $17 B6() B7() :void B5() ControlFlowMerge JMP $0 B8() :void diff --git a/nautilus/test/data/tracing/digitSum.trace b/nautilus/test/data/tracing/digitSum.trace index 1c3cff5a..a9a6697f 100644 --- a/nautilus/test/data/tracing/digitSum.trace +++ b/nautilus/test/data/tracing/digitSum.trace @@ -16,5 +16,5 @@ B3() ControlFlowMerge DIV $7 $1 $6 :i32 ASSIGN $1 $7 :i32 CONST $8 0 :i32 - GT $9 $1 $8 :i32 + GT $9 $1 $8 :bool CMP $10 $9 B1() B2() :void diff --git a/nautilus/test/data/tracing/doubleIfCondition.trace b/nautilus/test/data/tracing/doubleIfCondition.trace index 8661f049..879fcda9 100644 --- a/nautilus/test/data/tracing/doubleIfCondition.trace +++ b/nautilus/test/data/tracing/doubleIfCondition.trace @@ -1,7 +1,7 @@ B0() CONST $1 1 :i32 CONST $2 8 :i32 - EQ $3 $1 $2 :i32 + EQ $3 $1 $2 :bool CMP $4 $3 B1() B2() :void B1() CONST $5 1 :i32 @@ -21,7 +21,7 @@ B4() ASSIGN $10 $14 :i32 JMP $0 B6() :void B5() ControlFlowMerge - EQ $6 $1 $5 :i32 + EQ $6 $1 $5 :bool CMP $7 $6 B3() B4() :void B6() ControlFlowMerge ADD $11 $1 $10 :i32 diff --git a/nautilus/test/data/tracing/elseOnlySumLoop.trace b/nautilus/test/data/tracing/elseOnlySumLoop.trace index 5b93aacf..c2a76d1c 100644 --- a/nautilus/test/data/tracing/elseOnlySumLoop.trace +++ b/nautilus/test/data/tracing/elseOnlySumLoop.trace @@ -5,7 +5,7 @@ B0() JMP $0 B5() :void B1() CONST $6 50 :i32 - LT $7 $1 $6 :i32 + LT $7 $1 $6 :bool CMP $8 $7 B3() B4() :void B2() RETURN $1 :i32 @@ -20,7 +20,7 @@ B4() ASSIGN $9 $14 :i32 JMP $0 B6() :void B5() ControlFlowMerge - LT $4 $2 $3 :i32 + LT $4 $2 $3 :bool CMP $5 $4 B1() B2() :void B6() ControlFlowMerge ADD $10 $2 $9 :i32 diff --git a/nautilus/test/data/tracing/factorial.trace b/nautilus/test/data/tracing/factorial.trace index d09677f2..cc3d1349 100644 --- a/nautilus/test/data/tracing/factorial.trace +++ b/nautilus/test/data/tracing/factorial.trace @@ -15,5 +15,5 @@ B1() B2() RETURN $2 :i32 B3() ControlFlowMerge - GT $4 $1 $3 :i32 + GT $4 $1 $3 :bool CMP $5 $4 B1() B2() :void diff --git a/nautilus/test/data/tracing/fibonacci.trace b/nautilus/test/data/tracing/fibonacci.trace index cea3c6cc..786f1b93 100644 --- a/nautilus/test/data/tracing/fibonacci.trace +++ b/nautilus/test/data/tracing/fibonacci.trace @@ -16,5 +16,5 @@ B1() B2() RETURN $3 :i32 B3() ControlFlowMerge - LTE $6 $5 $1 :i32 + LTE $6 $5 $1 :bool CMP $7 $6 B1() B2() :void diff --git a/nautilus/test/data/tracing/gcd.trace b/nautilus/test/data/tracing/gcd.trace index 5a53617c..0d7b3725 100644 --- a/nautilus/test/data/tracing/gcd.trace +++ b/nautilus/test/data/tracing/gcd.trace @@ -12,5 +12,5 @@ B1() B2() RETURN $1 :i32 B3() ControlFlowMerge - NEQ $4 $2 $3 :i32 + NEQ $4 $2 $3 :bool CMP $5 $4 B1() B2() :void diff --git a/nautilus/test/data/tracing/ifElseIfCondition.trace b/nautilus/test/data/tracing/ifElseIfCondition.trace index f8b46441..9a30dde8 100644 --- a/nautilus/test/data/tracing/ifElseIfCondition.trace +++ b/nautilus/test/data/tracing/ifElseIfCondition.trace @@ -1,7 +1,7 @@ B0() CONST $1 1 :i32 CONST $2 8 :i32 - EQ $3 $1 $2 :i32 + EQ $3 $1 $2 :bool CMP $4 $3 B1() B2() :void B1() CONST $5 14 :i32 @@ -11,7 +11,7 @@ B1() JMP $0 B5() :void B2() CONST $10 1 :i32 - EQ $11 $1 $10 :i32 + EQ $11 $1 $10 :bool CMP $12 $11 B3() B4() :void B3() CONST $13 20 :i32 diff --git a/nautilus/test/data/tracing/ifElseIfElse.trace b/nautilus/test/data/tracing/ifElseIfElse.trace index 10f39979..ebe378e3 100644 --- a/nautilus/test/data/tracing/ifElseIfElse.trace +++ b/nautilus/test/data/tracing/ifElseIfElse.trace @@ -1,7 +1,7 @@ B0() CONST $2 0 :i32 CONST $3 0 :i32 - EQ $4 $1 $3 :i32 + EQ $4 $1 $3 :bool CMP $5 $4 B1() B2() :void B1() CONST $6 10 :i32 @@ -9,7 +9,7 @@ B1() RETURN $2 :i32 B2() CONST $8 1 :i32 - EQ $9 $1 $8 :i32 + EQ $9 $1 $8 :bool CMP $10 $9 B3() B4() :void B3() CONST $11 20 :i32 diff --git a/nautilus/test/data/tracing/ifElseSumLoop.trace b/nautilus/test/data/tracing/ifElseSumLoop.trace index e693b85a..95d3aab3 100644 --- a/nautilus/test/data/tracing/ifElseSumLoop.trace +++ b/nautilus/test/data/tracing/ifElseSumLoop.trace @@ -5,7 +5,7 @@ B0() JMP $0 B5() :void B1() CONST $6 50 :i32 - LT $7 $1 $6 :i32 + LT $7 $1 $6 :bool CMP $8 $7 B3() B4() :void B2() RETURN $1 :i32 @@ -23,7 +23,7 @@ B4() ASSIGN $11 $16 :i32 JMP $0 B6() :void B5() ControlFlowMerge - LT $4 $2 $3 :i32 + LT $4 $2 $3 :bool CMP $5 $4 B1() B2() :void B6() ControlFlowMerge ADD $12 $2 $11 :i32 diff --git a/nautilus/test/data/tracing/ifInsideLoop.trace b/nautilus/test/data/tracing/ifInsideLoop.trace index 847caa1c..d8ad0637 100644 --- a/nautilus/test/data/tracing/ifInsideLoop.trace +++ b/nautilus/test/data/tracing/ifInsideLoop.trace @@ -6,7 +6,7 @@ B1() CONST $6 2 :i32 MOD $7 $3 $6 :i32 CONST $8 0 :i32 - EQ $9 $7 $8 :i32 + EQ $9 $7 $8 :bool CMP $10 $9 B3() B4() :void B2() RETURN $2 :i32 @@ -21,7 +21,7 @@ B4() ASSIGN $13 $17 :i32 JMP $0 B6() :void B5() ControlFlowMerge - LT $4 $3 $1 :i32 + LT $4 $3 $1 :bool CMP $5 $4 B1() B2() :void B6() ControlFlowMerge ADD $14 $3 $13 :i32 diff --git a/nautilus/test/data/tracing/ifNotEqual.trace b/nautilus/test/data/tracing/ifNotEqual.trace index 24226eaa..7615a731 100644 --- a/nautilus/test/data/tracing/ifNotEqual.trace +++ b/nautilus/test/data/tracing/ifNotEqual.trace @@ -1,7 +1,7 @@ B0() CONST $2 1 :i32 CONST $3 5 :i32 - NEQ $4 $1 $3 :i32 + NEQ $4 $1 $3 :bool CMP $5 $4 B1() B2() :void B1() CONST $6 2 :i32 diff --git a/nautilus/test/data/tracing/ifSumLoop.trace b/nautilus/test/data/tracing/ifSumLoop.trace index 3dcdb2be..bbf0c322 100644 --- a/nautilus/test/data/tracing/ifSumLoop.trace +++ b/nautilus/test/data/tracing/ifSumLoop.trace @@ -5,7 +5,7 @@ B0() JMP $0 B5() :void B1() CONST $6 50 :i32 - LT $7 $1 $6 :i32 + LT $7 $1 $6 :bool CMP $8 $7 B3() B4() :void B2() RETURN $1 :i32 @@ -20,7 +20,7 @@ B4() ASSIGN $11 $14 :i32 JMP $0 B6() :void B5() ControlFlowMerge - LT $4 $2 $3 :i32 + LT $4 $2 $3 :bool CMP $5 $4 B1() B2() :void B6() ControlFlowMerge ADD $12 $2 $11 :i32 diff --git a/nautilus/test/data/tracing/ifThenCondition.trace b/nautilus/test/data/tracing/ifThenCondition.trace index 765d9289..2b268bc5 100644 --- a/nautilus/test/data/tracing/ifThenCondition.trace +++ b/nautilus/test/data/tracing/ifThenCondition.trace @@ -1,7 +1,7 @@ B0() CONST $2 1 :i32 CONST $3 42 :i32 - EQ $4 $1 $3 :i32 + EQ $4 $1 $3 :bool CMP $5 $4 B1() B2() :void B1() CONST $6 1 :i32 diff --git a/nautilus/test/data/tracing/ifThenElseCondition.trace b/nautilus/test/data/tracing/ifThenElseCondition.trace index f25d47e3..773cdf93 100644 --- a/nautilus/test/data/tracing/ifThenElseCondition.trace +++ b/nautilus/test/data/tracing/ifThenElseCondition.trace @@ -1,7 +1,7 @@ B0() CONST $2 1 :i32 CONST $3 42 :i32 - EQ $4 $1 $3 :i32 + EQ $4 $1 $3 :bool CMP $5 $4 B1() B2() :void B1() CONST $6 1 :i32 diff --git a/nautilus/test/data/tracing/ifWithFunctionCall.trace b/nautilus/test/data/tracing/ifWithFunctionCall.trace index 3c012ec6..3282622c 100644 --- a/nautilus/test/data/tracing/ifWithFunctionCall.trace +++ b/nautilus/test/data/tracing/ifWithFunctionCall.trace @@ -4,7 +4,7 @@ B0() CONST $4 2 :i32 MUL $5 $3 $4 :i32 CONST $6 10 :i32 - GT $7 $5 $6 :i32 + GT $7 $5 $6 :bool CMP $8 $7 B1() B2() :void B1() CONST $9 1 :i32 diff --git a/nautilus/test/data/tracing/ifWithTernary.trace b/nautilus/test/data/tracing/ifWithTernary.trace index cc07d7a0..f0029aef 100644 --- a/nautilus/test/data/tracing/ifWithTernary.trace +++ b/nautilus/test/data/tracing/ifWithTernary.trace @@ -1,6 +1,6 @@ B0() CONST $2 5 :i32 - GT $3 $1 $2 :i32 + GT $3 $1 $2 :bool CMP $4 $3 B1() B2() :void B1() CONST $5 10 :i32 @@ -19,5 +19,5 @@ B3() B4() RETURN $5 :i32 B5() ControlFlowMerge - EQ $7 $1 $6 :i32 + EQ $7 $1 $6 :bool CMP $8 $7 B3() B4() :void diff --git a/nautilus/test/data/tracing/int16AddExpression.trace b/nautilus/test/data/tracing/int16AddExpression.trace index c47bfaec..4f786865 100644 --- a/nautilus/test/data/tracing/int16AddExpression.trace +++ b/nautilus/test/data/tracing/int16AddExpression.trace @@ -1,4 +1,4 @@ B0() CONST $2 5 :i16 - ADD $3 $1 $2 :i16 + ADD $3 $1 $2 :i32 RETURN $3 :i16 diff --git a/nautilus/test/data/tracing/int8AddExpression.trace b/nautilus/test/data/tracing/int8AddExpression.trace index b5d4bc4f..74eb878c 100644 --- a/nautilus/test/data/tracing/int8AddExpression.trace +++ b/nautilus/test/data/tracing/int8AddExpression.trace @@ -1,4 +1,4 @@ B0() CONST $2  :i8 - ADD $3 $2 $1 :i8 + ADD $3 $2 $1 :i32 RETURN $3 :i8 diff --git a/nautilus/test/data/tracing/isPrime.trace b/nautilus/test/data/tracing/isPrime.trace index bb08960b..2506eea5 100644 --- a/nautilus/test/data/tracing/isPrime.trace +++ b/nautilus/test/data/tracing/isPrime.trace @@ -2,7 +2,7 @@ B0() CONST $2 :bool CONST $3 :bool CONST $4 1 :i32 - LTE $5 $1 $4 :i32 + LTE $5 $1 $4 :bool CMP $6 $5 B1() B2() :void B1() RETURN $2 :bool @@ -12,7 +12,7 @@ B2() B3() MOD $12 $1 $8 :i32 CONST $13 0 :i32 - EQ $14 $12 $13 :i32 + EQ $14 $12 $13 :bool CMP $15 $14 B5() B6() :void B4() RETURN $3 :bool @@ -25,5 +25,5 @@ B6() JMP $0 B7() :void B7() ControlFlowMerge MUL $9 $8 $8 :i32 - LTE $10 $9 $1 :i32 + LTE $10 $9 $1 :bool CMP $11 $10 B3() B4() :void diff --git a/nautilus/test/data/tracing/logicalAnd.trace b/nautilus/test/data/tracing/logicalAnd.trace index 6e403c1e..8a8ab338 100644 --- a/nautilus/test/data/tracing/logicalAnd.trace +++ b/nautilus/test/data/tracing/logicalAnd.trace @@ -1,9 +1,9 @@ B0() CONST $2 0 :i32 CONST $3 5 :i32 - GT $4 $1 $3 :i32 + GT $4 $1 $3 :bool CONST $5 15 :i32 - LT $6 $1 $5 :i32 + LT $6 $1 $5 :bool AND $7 $4 $6 :bool CMP $8 $7 B1() B2() :void B1() diff --git a/nautilus/test/data/tracing/logicalOr.trace b/nautilus/test/data/tracing/logicalOr.trace index c5325c53..0940a833 100644 --- a/nautilus/test/data/tracing/logicalOr.trace +++ b/nautilus/test/data/tracing/logicalOr.trace @@ -1,9 +1,9 @@ B0() CONST $2 0 :i32 CONST $3 10 :i32 - EQ $4 $1 $3 :i32 + EQ $4 $1 $3 :bool CONST $5 20 :i32 - EQ $6 $1 $5 :i32 + EQ $6 $1 $5 :bool OR $7 $4 $6 :bool CMP $8 $7 B1() B2() :void B1() diff --git a/nautilus/test/data/tracing/logicalXOR.trace b/nautilus/test/data/tracing/logicalXOR.trace index 380465e9..b365a91c 100644 --- a/nautilus/test/data/tracing/logicalXOR.trace +++ b/nautilus/test/data/tracing/logicalXOR.trace @@ -1,9 +1,9 @@ B0() CONST $2 0 :i32 CONST $3 10 :i32 - LT $4 $1 $3 :i32 + LT $4 $1 $3 :bool CONST $5 5 :i32 - GT $6 $1 $5 :i32 + GT $6 $1 $5 :bool NEQ $7 $4 $6 :bool CMP $8 $7 B1() B2() :void B1() diff --git a/nautilus/test/data/tracing/loopDirectCall.trace b/nautilus/test/data/tracing/loopDirectCall.trace index 94794c09..e245507a 100644 --- a/nautilus/test/data/tracing/loopDirectCall.trace +++ b/nautilus/test/data/tracing/loopDirectCall.trace @@ -16,5 +16,5 @@ B1() B2() RETURN $3 :i32 B3() ControlFlowMerge - LT $5 $4 $1 :i32 + LT $5 $4 $1 :bool CMP $6 $5 B1() B2() :void diff --git a/nautilus/test/data/tracing/multipleConditions.trace b/nautilus/test/data/tracing/multipleConditions.trace index 0b22849a..63481573 100644 --- a/nautilus/test/data/tracing/multipleConditions.trace +++ b/nautilus/test/data/tracing/multipleConditions.trace @@ -1,12 +1,12 @@ B0() CONST $2 0 :i32 CONST $3 0 :i32 - GT $4 $1 $3 :i32 + GT $4 $1 $3 :bool CONST $5 10 :i32 - LT $6 $1 $5 :i32 + LT $6 $1 $5 :bool AND $7 $4 $6 :bool CONST $8 20 :i32 - EQ $9 $1 $8 :i32 + EQ $9 $1 $8 :bool OR $10 $7 $9 :bool CMP $11 $10 B1() B2() :void B1() diff --git a/nautilus/test/data/tracing/nestedElseOnlySumLoop.trace b/nautilus/test/data/tracing/nestedElseOnlySumLoop.trace index 8e59c715..f72ec525 100644 --- a/nautilus/test/data/tracing/nestedElseOnlySumLoop.trace +++ b/nautilus/test/data/tracing/nestedElseOnlySumLoop.trace @@ -5,13 +5,13 @@ B0() JMP $0 B7() :void B1() CONST $6 50 :i32 - LT $7 $1 $6 :i32 + LT $7 $1 $6 :bool CMP $8 $7 B3() B4() :void B2() RETURN $1 :i32 B3() CONST $9 40 :i32 - LT $10 $1 $9 :i32 + LT $10 $1 $9 :bool CMP $11 $10 B5() B6() :void B4() CONST $15 1 :i32 @@ -31,7 +31,7 @@ B6() ASSIGN $12 $20 :i32 JMP $0 B9() :void B7() ControlFlowMerge - LT $4 $2 $3 :i32 + LT $4 $2 $3 :bool CMP $5 $4 B1() B2() :void B8() ControlFlowMerge JMP $0 B9() :void diff --git a/nautilus/test/data/tracing/nestedIf.trace b/nautilus/test/data/tracing/nestedIf.trace index 41c00179..46b2a613 100644 --- a/nautilus/test/data/tracing/nestedIf.trace +++ b/nautilus/test/data/tracing/nestedIf.trace @@ -1,11 +1,11 @@ B0() CONST $2 1 :i32 CONST $3 20 :i32 - LT $4 $1 $3 :i32 + LT $4 $1 $3 :bool CMP $5 $4 B1() B2() :void B1() CONST $6 10 :i32 - GT $7 $1 $6 :i32 + GT $7 $1 $6 :bool CMP $8 $7 B3() B4() :void B2() RETURN $2 :i32 diff --git a/nautilus/test/data/tracing/nestedIfElseDifferentLevels.trace b/nautilus/test/data/tracing/nestedIfElseDifferentLevels.trace index 7f9477b9..fec82153 100644 --- a/nautilus/test/data/tracing/nestedIfElseDifferentLevels.trace +++ b/nautilus/test/data/tracing/nestedIfElseDifferentLevels.trace @@ -1,11 +1,11 @@ B0() CONST $2 0 :i32 CONST $3 0 :i32 - GT $4 $1 $3 :i32 + GT $4 $1 $3 :bool CMP $5 $4 B1() B2() :void B1() CONST $6 5 :i32 - LT $7 $1 $6 :i32 + LT $7 $1 $6 :bool CMP $8 $7 B3() B4() :void B2() CONST $11 -1 :i32 @@ -19,7 +19,7 @@ B4() CONST $13 2 :i32 ASSIGN $2 $13 :i32 CONST $14 6 :i32 - EQ $15 $1 $14 :i32 + EQ $15 $1 $14 :bool CMP $16 $15 B5() B6() :void B5() CONST $17 3 :i32 diff --git a/nautilus/test/data/tracing/nestedIfElseSumLoop.trace b/nautilus/test/data/tracing/nestedIfElseSumLoop.trace index 0c2ca72b..5565b77b 100644 --- a/nautilus/test/data/tracing/nestedIfElseSumLoop.trace +++ b/nautilus/test/data/tracing/nestedIfElseSumLoop.trace @@ -5,13 +5,13 @@ B0() JMP $0 B7() :void B1() CONST $6 50 :i32 - LT $7 $1 $6 :i32 + LT $7 $1 $6 :bool CMP $8 $7 B3() B4() :void B2() RETURN $1 :i32 B3() CONST $9 40 :i32 - LT $10 $1 $9 :i32 + LT $10 $1 $9 :bool CMP $11 $10 B5() B6() :void B4() CONST $17 1 :i32 @@ -34,7 +34,7 @@ B6() ASSIGN $14 $22 :i32 JMP $0 B9() :void B7() ControlFlowMerge - LT $4 $2 $3 :i32 + LT $4 $2 $3 :bool CMP $5 $4 B1() B2() :void B8() ControlFlowMerge JMP $0 B9() :void diff --git a/nautilus/test/data/tracing/nestedIfNoElseCondition.trace b/nautilus/test/data/tracing/nestedIfNoElseCondition.trace index 029b25ac..3d211406 100644 --- a/nautilus/test/data/tracing/nestedIfNoElseCondition.trace +++ b/nautilus/test/data/tracing/nestedIfNoElseCondition.trace @@ -1,6 +1,6 @@ B0() CONST $3 42 :i32 - EQ $4 $1 $3 :i32 + EQ $4 $1 $3 :bool CMP $5 $4 B1() B2() :void B1() CONST $6 4 :i32 @@ -13,7 +13,7 @@ B2() ADD $14 $2 $13 :i32 ASSIGN $2 $14 :i32 CONST $15 8 :i32 - EQ $16 $2 $15 :i32 + EQ $16 $2 $15 :bool CMP $17 $16 B3() B4() :void B3() CONST $18 14 :i32 diff --git a/nautilus/test/data/tracing/nestedIfSumLoop.trace b/nautilus/test/data/tracing/nestedIfSumLoop.trace index 9bd95766..72ecd5b8 100644 --- a/nautilus/test/data/tracing/nestedIfSumLoop.trace +++ b/nautilus/test/data/tracing/nestedIfSumLoop.trace @@ -5,13 +5,13 @@ B0() JMP $0 B7() :void B1() CONST $6 50 :i32 - LT $7 $1 $6 :i32 + LT $7 $1 $6 :bool CMP $8 $7 B3() B4() :void B2() RETURN $1 :i32 B3() CONST $9 40 :i32 - LT $10 $1 $9 :i32 + LT $10 $1 $9 :bool CMP $11 $10 B5() B6() :void B4() CONST $17 1 :i32 @@ -31,7 +31,7 @@ B6() ASSIGN $14 $20 :i32 JMP $0 B9() :void B7() ControlFlowMerge - LT $4 $2 $3 :i32 + LT $4 $2 $3 :bool CMP $5 $4 B1() B2() :void B8() ControlFlowMerge JMP $0 B9() :void diff --git a/nautilus/test/data/tracing/nestedIfThenElseCondition.trace b/nautilus/test/data/tracing/nestedIfThenElseCondition.trace index 1cd8563a..1108edb6 100644 --- a/nautilus/test/data/tracing/nestedIfThenElseCondition.trace +++ b/nautilus/test/data/tracing/nestedIfThenElseCondition.trace @@ -1,13 +1,13 @@ B0() CONST $3 42 :i32 - EQ $4 $1 $3 :i32 + EQ $4 $1 $3 :bool CMP $5 $4 B1() B2() :void B1() CONST $6 2 :i32 JMP $0 B5() :void B2() CONST $11 8 :i32 - EQ $12 $2 $11 :i32 + EQ $12 $2 $11 :bool CMP $13 $12 B3() B4() :void B3() CONST $14 2 :i32 diff --git a/nautilus/test/data/tracing/nestedSumLoop.trace b/nautilus/test/data/tracing/nestedSumLoop.trace index 73a69fff..e08b67e3 100644 --- a/nautilus/test/data/tracing/nestedSumLoop.trace +++ b/nautilus/test/data/tracing/nestedSumLoop.trace @@ -21,8 +21,8 @@ B4() ASSIGN $3 $16 :i32 JMP $0 B6() :void B5() ControlFlowMerge - LT $7 $6 $1 :i32 + LT $7 $6 $1 :bool CMP $8 $7 B3() B4() :void B6() ControlFlowMerge - LT $4 $3 $1 :i32 + LT $4 $3 $1 :bool CMP $5 $4 B1() B2() :void diff --git a/nautilus/test/data/tracing/orCondition.trace b/nautilus/test/data/tracing/orCondition.trace index 69889a08..2924f637 100644 --- a/nautilus/test/data/tracing/orCondition.trace +++ b/nautilus/test/data/tracing/orCondition.trace @@ -1,9 +1,9 @@ B0() CONST $2 1 :i32 CONST $3 8 :i32 - EQ $4 $1 $3 :i32 + EQ $4 $1 $3 :bool CONST $5 1 :i32 - EQ $6 $1 $5 :i32 + EQ $6 $1 $5 :bool OR $7 $4 $6 :bool CMP $8 $7 B1() B2() :void B1() diff --git a/nautilus/test/data/tracing/reverseNumber.trace b/nautilus/test/data/tracing/reverseNumber.trace index 87d0b1fe..f5426ffa 100644 --- a/nautilus/test/data/tracing/reverseNumber.trace +++ b/nautilus/test/data/tracing/reverseNumber.trace @@ -18,5 +18,5 @@ B3() ControlFlowMerge DIV $9 $1 $8 :i32 ASSIGN $1 $9 :i32 CONST $10 0 :i32 - GT $11 $1 $10 :i32 + GT $11 $1 $10 :bool CMP $12 $11 B1() B2() :void diff --git a/nautilus/test/data/tracing/shortCircuitEvaluation.trace b/nautilus/test/data/tracing/shortCircuitEvaluation.trace index 692172d2..81347bf6 100644 --- a/nautilus/test/data/tracing/shortCircuitEvaluation.trace +++ b/nautilus/test/data/tracing/shortCircuitEvaluation.trace @@ -1,11 +1,11 @@ B0() CONST $2 0 :i32 CONST $3 0 :i32 - NEQ $4 $1 $3 :i32 + NEQ $4 $1 $3 :bool CONST $5 10 :i32 DIV $6 $5 $1 :i32 CONST $7 1 :i32 - GT $8 $6 $7 :i32 + GT $8 $6 $7 :bool AND $9 $4 $8 :bool CMP $10 $9 B1() B2() :void B1() diff --git a/nautilus/test/data/tracing/staticLoopWithDynamicLoop.trace b/nautilus/test/data/tracing/staticLoopWithDynamicLoop.trace index 0dab374a..b12aab08 100644 --- a/nautilus/test/data/tracing/staticLoopWithDynamicLoop.trace +++ b/nautilus/test/data/tracing/staticLoopWithDynamicLoop.trace @@ -4,7 +4,7 @@ B0() JMP $0 B9() :void B1() CONST $6 5 :i32 - GT $7 $3 $6 :i32 + GT $7 $3 $6 :bool CMP $8 $7 B3() B4() :void B2() RETURN $2 :i32 @@ -39,19 +39,19 @@ B8() ASSIGN $25 $35 :i32 JMP $0 B12() :void B9() ControlFlowMerge - LT $4 $3 $1 :i32 + LT $4 $3 $1 :bool CMP $5 $4 B1() B2() :void B10() ControlFlowMerge ADD $12 $2 $11 :i32 ASSIGN $2 $12 :i32 CONST $13 5 :i32 - GT $14 $3 $13 :i32 + GT $14 $3 $13 :bool CMP $15 $14 B5() B6() :void B11() ControlFlowMerge ADD $19 $2 $18 :i32 ASSIGN $2 $19 :i32 CONST $20 5 :i32 - GT $21 $3 $20 :i32 + GT $21 $3 $20 :bool CMP $22 $21 B7() B8() :void B12() ControlFlowMerge ADD $26 $2 $25 :i32 diff --git a/nautilus/test/data/tracing/sumArray.trace b/nautilus/test/data/tracing/sumArray.trace index ed1a9d82..b36fed72 100644 --- a/nautilus/test/data/tracing/sumArray.trace +++ b/nautilus/test/data/tracing/sumArray.trace @@ -19,5 +19,5 @@ B1() B2() RETURN $3 :i32 B3() ControlFlowMerge - LT $5 $4 $2 :i32 + LT $5 $4 $2 :bool CMP $6 $5 B1() B2() :void diff --git a/nautilus/test/data/tracing/sumLoop.trace b/nautilus/test/data/tracing/sumLoop.trace index 4066a8e0..e9f44097 100644 --- a/nautilus/test/data/tracing/sumLoop.trace +++ b/nautilus/test/data/tracing/sumLoop.trace @@ -13,5 +13,5 @@ B1() B2() RETURN $2 :i32 B3() ControlFlowMerge - LT $4 $3 $1 :i32 + LT $4 $3 $1 :bool CMP $5 $4 B1() B2() :void diff --git a/nautilus/test/data/tracing/sumOfNumbers.trace b/nautilus/test/data/tracing/sumOfNumbers.trace index 92b694b3..47641c7c 100644 --- a/nautilus/test/data/tracing/sumOfNumbers.trace +++ b/nautilus/test/data/tracing/sumOfNumbers.trace @@ -13,5 +13,5 @@ B1() B2() RETURN $2 :i32 B3() ControlFlowMerge - LTE $4 $3 $1 :i32 + LTE $4 $3 $1 :bool CMP $5 $4 B1() B2() :void diff --git a/nautilus/test/data/tracing/sumOfSquares.trace b/nautilus/test/data/tracing/sumOfSquares.trace index 00d86804..0c309cf7 100644 --- a/nautilus/test/data/tracing/sumOfSquares.trace +++ b/nautilus/test/data/tracing/sumOfSquares.trace @@ -13,5 +13,5 @@ B1() B2() RETURN $2 :i32 B3() ControlFlowMerge - LTE $4 $3 $1 :i32 + LTE $4 $3 $1 :bool CMP $5 $4 B1() B2() :void diff --git a/nautilus/test/data/tracing/varyingComplexity.trace b/nautilus/test/data/tracing/varyingComplexity.trace index 90a9860b..bbb7b06f 100644 --- a/nautilus/test/data/tracing/varyingComplexity.trace +++ b/nautilus/test/data/tracing/varyingComplexity.trace @@ -1,7 +1,7 @@ B0() CONST $2 0 :i32 CONST $3 5 :i32 - LT $4 $1 $3 :i32 + LT $4 $1 $3 :bool CMP $5 $4 B1() B2() :void B1() CONST $6 1 :i32 @@ -9,16 +9,16 @@ B1() RETURN $2 :i32 B2() CONST $8 5 :i32 - GTE $9 $1 $8 :i32 + GTE $9 $1 $8 :bool CONST $10 10 :i32 - LTE $11 $1 $10 :i32 + LTE $11 $1 $10 :bool AND $12 $9 $11 :bool CMP $13 $12 B3() B4() :void B3() CONST $14 2 :i32 ASSIGN $2 $14 :i32 CONST $15 7 :i32 - EQ $16 $1 $15 :i32 + EQ $16 $1 $15 :bool CMP $17 $16 B5() B6() :void B4() CONST $21 3 :i32 diff --git a/nautilus/test/execution-tests/ExecutionTest.cpp b/nautilus/test/execution-tests/ExecutionTest.cpp index b669247a..54deca49 100644 --- a/nautilus/test/execution-tests/ExecutionTest.cpp +++ b/nautilus/test/execution-tests/ExecutionTest.cpp @@ -29,6 +29,13 @@ val constructComplexReturnObject(val a, val b) { return t1 + t2; } +val makeConstantOfTracingValue(val ref) { + auto r = ref == 42; + bool concreteValue = r; + val res = concreteValue && r; + return res; +} + void addTest(engine::NautilusEngine& engine) { SECTION("staticCast") { @@ -927,9 +934,14 @@ TEST_CASE("Engine Compiler Test") { // wrong number of arguments after tracing" REQUIRE_THROWS(engine.registerFunction(constructComplexReturnObject)); } + SECTION("makeConstantOfTracingValue") { + // we assume that this throws a runtime exception with + // wrong number of arguments after tracing" + engine.registerFunction(makeConstantOfTracingValue); + // REQUIRE(); + } } } - } #endif } // namespace nautilus::engine