Commit 7d018fc8 authored by Isaac Oscar Gariano's avatar Isaac Oscar Gariano

Manual merge of develop into swapstack

parent 7e8bd1a4
...@@ -689,9 +689,9 @@ macro_rules! emit_test { ...@@ -689,9 +689,9 @@ macro_rules! emit_test {
$ty1: ident($in1: expr), $ty2: ident($in2: expr) RET $ty3: ident($out: expr), $ty1: ident($in1: expr), $ty2: ident($in2: expr) RET $ty3: ident($out: expr),
) => { ) => {
typedef! (($vm) int1 = mu_int(1)); typedef! (($vm) int1 = mu_int(1));
typedef! (($vm) int64t = mu_int(64)); typedef! (($vm) int32t = mu_int(32));
constdef! (($vm) <int64t> int64_pass = Constant::Int(0)); constdef! (($vm) <int32t> int64_pass = Constant::Int(0));
constdef! (($vm) <int64t> int64_fail = Constant::Int(1)); constdef! (($vm) <int32t> int64_fail = Constant::Int(1));
constdef! (($vm) <$ty1> f64_0 = Constant::$Arg1Type($in1)); constdef! (($vm) <$ty1> f64_0 = Constant::$Arg1Type($in1));
constdef! (($vm) <$ty2> f64_1 = Constant::$Arg2Type($in2)); constdef! (($vm) <$ty2> f64_1 = Constant::$Arg2Type($in2));
constdef! (($vm) <$ty3> f64_2 = Constant::$Arg3Type($out)); constdef! (($vm) <$ty3> f64_2 = Constant::$Arg3Type($out));
...@@ -728,7 +728,7 @@ macro_rules! emit_test { ...@@ -728,7 +728,7 @@ macro_rules! emit_test {
cmp_res = CMPOP (CmpOp::$CMPType) result f64_2_local cmp_res = CMPOP (CmpOp::$CMPType) result f64_2_local
); );
ssa! (($vm, $tester_name) <int64t> blk_entry_ret); ssa! (($vm, $tester_name) <int32t> blk_entry_ret);
inst! (($vm, $tester_name) blk_entry_inst_select: inst! (($vm, $tester_name) blk_entry_inst_select:
blk_entry_ret = SELECT cmp_res int64_pass_local int64_fail_local blk_entry_ret = SELECT cmp_res int64_pass_local int64_fail_local
); );
...@@ -740,7 +740,7 @@ macro_rules! emit_test { ...@@ -740,7 +740,7 @@ macro_rules! emit_test {
THREADEXIT THREADEXIT
); );
define_block! (($vm, $tester_name) blk_entry(a, b) { define_block! (($vm, $tester_name) blk_entry() {
blk_entry_call, blk_entry_call,
blk_entry_cmp, blk_entry_cmp,
blk_entry_inst_select, blk_entry_inst_select,
...@@ -769,9 +769,9 @@ macro_rules! emit_test { ...@@ -769,9 +769,9 @@ macro_rules! emit_test {
$ty1: ident($in1: expr) RET $ty3: ident($out: expr), $ty1: ident($in1: expr) RET $ty3: ident($out: expr),
) => { ) => {
typedef! (($vm) int1 = mu_int(1)); typedef! (($vm) int1 = mu_int(1));
typedef! (($vm) int64t = mu_int(64)); typedef! (($vm) int32t = mu_int(32));
constdef! (($vm) <int64t> int64_pass = Constant::Int(0)); constdef! (($vm) <int32t> int64_pass = Constant::Int(0));
constdef! (($vm) <int64t> int64_fail = Constant::Int(1)); constdef! (($vm) <int32t> int64_fail = Constant::Int(1));
constdef! (($vm) <$ty1> f64_0 = Constant::$Arg1Type($in1)); constdef! (($vm) <$ty1> f64_0 = Constant::$Arg1Type($in1));
constdef! (($vm) <$ty3> f64_2 = Constant::$Arg3Type($out)); constdef! (($vm) <$ty3> f64_2 = Constant::$Arg3Type($out));
...@@ -802,7 +802,7 @@ macro_rules! emit_test { ...@@ -802,7 +802,7 @@ macro_rules! emit_test {
cmp_res = CMPOP (CmpOp::$CMPType) result f64_2_local cmp_res = CMPOP (CmpOp::$CMPType) result f64_2_local
); );
ssa! (($vm, $tester_name) <int64t> blk_entry_ret); ssa! (($vm, $tester_name) <int32t> blk_entry_ret);
inst! (($vm, $tester_name) blk_entry_inst_select: inst! (($vm, $tester_name) blk_entry_inst_select:
blk_entry_ret = SELECT cmp_res int64_pass_local int64_fail_local blk_entry_ret = SELECT cmp_res int64_pass_local int64_fail_local
); );
...@@ -813,7 +813,7 @@ macro_rules! emit_test { ...@@ -813,7 +813,7 @@ macro_rules! emit_test {
inst! (($vm, $tester_name) blk_entry_inst_exit: inst! (($vm, $tester_name) blk_entry_inst_exit:
THREADEXIT THREADEXIT
); );
define_block! (($vm, $tester_name) blk_entry(a) { define_block! (($vm, $tester_name) blk_entry() {
blk_entry_call, blk_entry_call,
blk_entry_cmp, blk_entry_cmp,
blk_entry_inst_select, blk_entry_inst_select,
...@@ -838,9 +838,9 @@ macro_rules! emit_test { ...@@ -838,9 +838,9 @@ macro_rules! emit_test {
RET $ty1: ident($in1: expr), RET $ty1: ident($in1: expr),
) => { ) => {
typedef! (($vm) int1 = mu_int(1)); typedef! (($vm) int1 = mu_int(1));
typedef! (($vm) int64t = mu_int(64)); typedef! (($vm) int32t = mu_int(32));
constdef! (($vm) <int64t> int64_pass = Constant::Int(0)); constdef! (($vm) <int32t> int64_pass = Constant::Int(0));
constdef! (($vm) <int64t> int64_fail = Constant::Int(1)); constdef! (($vm) <int32t> int64_fail = Constant::Int(1));
constdef! (($vm) <$ty1> arg_0 = Constant::$Arg1Type($in1)); constdef! (($vm) <$ty1> arg_0 = Constant::$Arg1Type($in1));
funcsig! (($vm) tester_sig = () -> ()); funcsig! (($vm) tester_sig = () -> ());
funcdecl! (($vm) <tester_sig> $test_name); funcdecl! (($vm) <tester_sig> $test_name);
...@@ -868,7 +868,7 @@ macro_rules! emit_test { ...@@ -868,7 +868,7 @@ macro_rules! emit_test {
cmp_res = CMPOP (CmpOp::$CMPType) result arg_0_local cmp_res = CMPOP (CmpOp::$CMPType) result arg_0_local
); );
ssa! (($vm, $tester_name) <int64t> blk_entry_ret); ssa! (($vm, $tester_name) <int32t> blk_entry_ret);
inst! (($vm, $tester_name) blk_entry_inst_select: inst! (($vm, $tester_name) blk_entry_inst_select:
blk_entry_ret = SELECT cmp_res int64_pass_local int64_fail_local blk_entry_ret = SELECT cmp_res int64_pass_local int64_fail_local
); );
...@@ -903,9 +903,9 @@ macro_rules! emit_test { ...@@ -903,9 +903,9 @@ macro_rules! emit_test {
$test_sig: ident, $test_sig: ident,
) => { ) => {
typedef! (($vm) int1 = mu_int(1)); typedef! (($vm) int1 = mu_int(1));
typedef! (($vm) int64t = mu_int(64)); typedef! (($vm) int32t = mu_int(32));
constdef! (($vm) <int64t> int64_pass = Constant::Int(0)); constdef! (($vm) <int32t> int64_pass = Constant::Int(0));
constdef! (($vm) <int64t> int64_fail = Constant::Int(1)); constdef! (($vm) <int32t> int64_fail = Constant::Int(1));
funcsig! (($vm) tester_sig = () -> ()); funcsig! (($vm) tester_sig = () -> ());
funcdecl! (($vm) <tester_sig> $test_name); funcdecl! (($vm) <tester_sig> $test_name);
...@@ -966,9 +966,9 @@ macro_rules! emit_test { ...@@ -966,9 +966,9 @@ macro_rules! emit_test {
RET $ty7: ident($out: expr), RET $ty7: ident($out: expr),
) => { ) => {
typedef! (($vm) int1 = mu_int(1)); typedef! (($vm) int1 = mu_int(1));
typedef! (($vm) int64t = mu_int(64)); typedef! (($vm) int32t = mu_int(32));
constdef! (($vm) <int64t> int64_pass = Constant::Int(0)); constdef! (($vm) <int32t> int64_pass = Constant::Int(0));
constdef! (($vm) <int64t> int64_fail = Constant::Int(1)); constdef! (($vm) <int32t> int64_fail = Constant::Int(1));
constdef! (($vm) <$ty1> arg_0 = Constant::$Arg1Type($in1)); constdef! (($vm) <$ty1> arg_0 = Constant::$Arg1Type($in1));
constdef! (($vm) <$ty2> arg_1 = Constant::$Arg2Type($in2)); constdef! (($vm) <$ty2> arg_1 = Constant::$Arg2Type($in2));
constdef! (($vm) <$ty3> arg_2 = Constant::$Arg3Type($in3)); constdef! (($vm) <$ty3> arg_2 = Constant::$Arg3Type($in3));
...@@ -1018,7 +1018,7 @@ macro_rules! emit_test { ...@@ -1018,7 +1018,7 @@ macro_rules! emit_test {
cmp_res = CMPOP (CmpOp::$CMPType) result arg_6_local cmp_res = CMPOP (CmpOp::$CMPType) result arg_6_local
); );
ssa! (($vm, $tester_name) <int64t> blk_entry_ret); ssa! (($vm, $tester_name) <int32t> blk_entry_ret);
inst! (($vm, $tester_name) blk_entry_inst_select: inst! (($vm, $tester_name) blk_entry_inst_select:
blk_entry_ret = SELECT cmp_res int64_pass_local int64_fail_local blk_entry_ret = SELECT cmp_res int64_pass_local int64_fail_local
); );
...@@ -1030,7 +1030,7 @@ macro_rules! emit_test { ...@@ -1030,7 +1030,7 @@ macro_rules! emit_test {
THREADEXIT THREADEXIT
); );
define_block! (($vm, $tester_name) blk_entry(a, b, c, d, e, f) { define_block! (($vm, $tester_name) blk_entry() {
blk_entry_call, blk_entry_call,
blk_entry_cmp, blk_entry_cmp,
blk_entry_inst_select, blk_entry_inst_select,
...@@ -1058,9 +1058,9 @@ macro_rules! emit_test { ...@@ -1058,9 +1058,9 @@ macro_rules! emit_test {
RET $ty4: ident($out: expr), RET $ty4: ident($out: expr),
) => { ) => {
typedef! (($vm) int1 = mu_int(1)); typedef! (($vm) int1 = mu_int(1));
typedef! (($vm) int64t = mu_int(64)); typedef! (($vm) int32t = mu_int(32));
constdef! (($vm) <int64t> int64_pass = Constant::Int(0)); constdef! (($vm) <int32t> int64_pass = Constant::Int(0));
constdef! (($vm) <int64t> int64_fail = Constant::Int(1)); constdef! (($vm) <int32t> int64_fail = Constant::Int(1));
constdef! (($vm) <$ty1> arg_0 = Constant::$Arg1Type($in1)); constdef! (($vm) <$ty1> arg_0 = Constant::$Arg1Type($in1));
constdef! (($vm) <$ty2> arg_1 = Constant::$Arg2Type($in2)); constdef! (($vm) <$ty2> arg_1 = Constant::$Arg2Type($in2));
constdef! (($vm) <$ty2> arg_2 = Constant::$Arg3Type($in3)); constdef! (($vm) <$ty2> arg_2 = Constant::$Arg3Type($in3));
...@@ -1100,7 +1100,7 @@ macro_rules! emit_test { ...@@ -1100,7 +1100,7 @@ macro_rules! emit_test {
cmp_res = CMPOP (CmpOp::$CMPType) result arg_3_local cmp_res = CMPOP (CmpOp::$CMPType) result arg_3_local
); );
ssa! (($vm, $tester_name) <int64t> blk_entry_ret); ssa! (($vm, $tester_name) <int32t> blk_entry_ret);
inst! (($vm, $tester_name) blk_entry_inst_select: inst! (($vm, $tester_name) blk_entry_inst_select:
blk_entry_ret = SELECT cmp_res int64_pass_local int64_fail_local blk_entry_ret = SELECT cmp_res int64_pass_local int64_fail_local
); );
...@@ -1112,7 +1112,7 @@ macro_rules! emit_test { ...@@ -1112,7 +1112,7 @@ macro_rules! emit_test {
THREADEXIT THREADEXIT
); );
define_block! (($vm, $tester_name) blk_entry(a, b) { define_block! (($vm, $tester_name) blk_entry() {
blk_entry_call, blk_entry_call,
blk_entry_cmp, blk_entry_cmp,
blk_entry_inst_select, blk_entry_inst_select,
......
...@@ -131,31 +131,31 @@ fn test_pass_1arg_by_stack() { ...@@ -131,31 +131,31 @@ fn test_pass_1arg_by_stack() {
fn pass_1arg_by_stack() -> VM { fn pass_1arg_by_stack() -> VM {
let vm = VM::new_with_opts("init_mu --disable-inline"); let vm = VM::new_with_opts("init_mu --disable-inline");
typedef!((vm) int64 = mu_int(64)); typedef! ((vm) int64 = mu_int(64));
constdef!((vm) <int64> int64_0 = Constant::Int(0)); constdef! ((vm) <int64> int64_0 = Constant::Int(0));
constdef!((vm) <int64> int64_1 = Constant::Int(1)); constdef! ((vm) <int64> int64_1 = Constant::Int(1));
constdef!((vm) <int64> int64_2 = Constant::Int(2)); constdef! ((vm) <int64> int64_2 = Constant::Int(2));
// foo7 // foo7
funcsig!((vm) foo7_sig = (int64, int64, int64, int64, int64, int64, int64, int64, int64) funcsig! ((vm) foo7_sig = (int64, int64, int64, int64, int64, int64, int64, int64, int64)
-> (int64)); -> (int64));
funcdecl!((vm) <foo7_sig> foo7); funcdecl! ((vm) <foo7_sig> foo7);
funcdef!((vm) <foo7_sig> foo7 VERSION foo7_v1); funcdef! ((vm) <foo7_sig> foo7 VERSION foo7_v1);
// blk_entry // blk_entry
ssa!((vm, foo7_v1) <int64> v0); ssa! ((vm, foo7_v1) <int64> v0);
ssa!((vm, foo7_v1) <int64> v1); ssa! ((vm, foo7_v1) <int64> v1);
ssa!((vm, foo7_v1) <int64> v2); ssa! ((vm, foo7_v1) <int64> v2);
ssa!((vm, foo7_v1) <int64> v3); ssa! ((vm, foo7_v1) <int64> v3);
ssa!((vm, foo7_v1) <int64> v4); ssa! ((vm, foo7_v1) <int64> v4);
ssa!((vm, foo7_v1) <int64> v5); ssa! ((vm, foo7_v1) <int64> v5);
ssa!((vm, foo7_v1) <int64> v6); ssa! ((vm, foo7_v1) <int64> v6);
ssa!((vm, foo7_v1) <int64> v7); ssa! ((vm, foo7_v1) <int64> v7);
ssa!((vm, foo7_v1) <int64> v8); ssa! ((vm, foo7_v1) <int64> v8);
block!((vm, foo7_v1) blk_entry); block! ((vm, foo7_v1) blk_entry);
inst!((vm, foo7_v1) blk_entry_ret: inst! ((vm, foo7_v1) blk_entry_ret:
RET (v8) RET (v8)
); );
...@@ -166,20 +166,20 @@ fn pass_1arg_by_stack() -> VM { ...@@ -166,20 +166,20 @@ fn pass_1arg_by_stack() -> VM {
define_func_ver!((vm) foo7_v1 (entry: blk_entry) {blk_entry}); define_func_ver!((vm) foo7_v1 (entry: blk_entry) {blk_entry});
// pass_1arg_by_stack // pass_1arg_by_stack
funcsig!((vm) sig = () -> (int64)); funcsig! ((vm) sig = () -> (int64));
funcdecl!((vm) <sig> pass_1arg_by_stack); funcdecl! ((vm) <sig> pass_1arg_by_stack);
funcdef!((vm) <sig> pass_1arg_by_stack VERSION pass_1arg_by_stack_v1); funcdef! ((vm) <sig> pass_1arg_by_stack VERSION pass_1arg_by_stack_v1);
typedef!((vm) type_funcref_foo7 = mu_funcref(foo7_sig)); typedef! ((vm) type_funcref_foo7 = mu_funcref(foo7_sig));
constdef!((vm) <type_funcref_foo7> const_funcref_foo7 = Constant::FuncRef(vm.id_of("foo7"))); constdef! ((vm) <type_funcref_foo7> const_funcref_foo7 = Constant::FuncRef(vm.id_of("foo7")));
// blk_entry // blk_entry
consta!((vm, pass_1arg_by_stack_v1) int64_0_local = int64_0); consta! ((vm, pass_1arg_by_stack_v1) int64_0_local = int64_0);
consta!((vm, pass_1arg_by_stack_v1) int64_1_local = int64_1); consta! ((vm, pass_1arg_by_stack_v1) int64_1_local = int64_1);
block!((vm, pass_1arg_by_stack_v1) blk_entry); block! ((vm, pass_1arg_by_stack_v1) blk_entry);
block!((vm, pass_1arg_by_stack_v1) blk_main); block! ((vm, pass_1arg_by_stack_v1) blk_main);
inst!((vm, pass_1arg_by_stack_v1) blk_entry_branch: inst! ((vm, pass_1arg_by_stack_v1) blk_entry_branch:
BRANCH blk_main ( BRANCH blk_main (
int64_0_local, int64_0_local,
int64_0_local, int64_0_local,
...@@ -197,25 +197,25 @@ fn pass_1arg_by_stack() -> VM { ...@@ -197,25 +197,25 @@ fn pass_1arg_by_stack() -> VM {
define_block!((vm, pass_1arg_by_stack_v1) blk_entry() {blk_entry_branch}); define_block!((vm, pass_1arg_by_stack_v1) blk_entry() {blk_entry_branch});
// blk_main // blk_main
ssa!((vm, pass_1arg_by_stack_v1) <int64> a0); ssa! ((vm, pass_1arg_by_stack_v1) <int64> a0);
ssa!((vm, pass_1arg_by_stack_v1) <int64> a1); ssa! ((vm, pass_1arg_by_stack_v1) <int64> a1);
ssa!((vm, pass_1arg_by_stack_v1) <int64> a2); ssa! ((vm, pass_1arg_by_stack_v1) <int64> a2);
ssa!((vm, pass_1arg_by_stack_v1) <int64> a3); ssa! ((vm, pass_1arg_by_stack_v1) <int64> a3);
ssa!((vm, pass_1arg_by_stack_v1) <int64> a4); ssa! ((vm, pass_1arg_by_stack_v1) <int64> a4);
ssa!((vm, pass_1arg_by_stack_v1) <int64> a5); ssa! ((vm, pass_1arg_by_stack_v1) <int64> a5);
ssa!((vm, pass_1arg_by_stack_v1) <int64> a6); ssa! ((vm, pass_1arg_by_stack_v1) <int64> a6);
ssa!((vm, pass_1arg_by_stack_v1) <int64> a7); ssa! ((vm, pass_1arg_by_stack_v1) <int64> a7);
ssa!((vm, pass_1arg_by_stack_v1) <int64> a8); ssa! ((vm, pass_1arg_by_stack_v1) <int64> a8);
consta!((vm, pass_1arg_by_stack_v1) const_funcref_foo7_local = const_funcref_foo7); consta! ((vm, pass_1arg_by_stack_v1) const_funcref_foo7_local = const_funcref_foo7);
ssa!((vm, pass_1arg_by_stack_v1) <int64> retval); ssa! ((vm, pass_1arg_by_stack_v1) <int64> retval);
inst!((vm, pass_1arg_by_stack_v1) blk_main_call: inst! ((vm, pass_1arg_by_stack_v1) blk_main_call:
retval = retval =
EXPRCALL (CallConvention::Mu, is_abort: false) EXPRCALL (CallConvention::Mu, is_abort: false)
const_funcref_foo7_local (a0, a1, a2, a3, a4, a5, a6, a7, a8) const_funcref_foo7_local (a0, a1, a2, a3, a4, a5, a6, a7, a8)
); );
inst!((vm, pass_1arg_by_stack_v1) blk_main_ret: inst! ((vm, pass_1arg_by_stack_v1) blk_main_ret:
RET (retval) RET (retval)
); );
...@@ -230,7 +230,7 @@ fn pass_1arg_by_stack() -> VM { ...@@ -230,7 +230,7 @@ fn pass_1arg_by_stack() -> VM {
}); });
emit_test!((vm) emit_test!((vm)
pass_1arg_by_stack pass_1arg_by_stack_test1 pass_1arg_by_stack_test1_v1, pass_1arg_by_stack, pass_1arg_by_stack_test1, pass_1arg_by_stack_test1_v1,
RET Int, RET Int,
EQ, EQ,
sig, sig,
...@@ -244,28 +244,28 @@ fn pass_1arg_by_stack() -> VM { ...@@ -244,28 +244,28 @@ fn pass_1arg_by_stack() -> VM {
fn pass_1arg_by_stack() -> VM { fn pass_1arg_by_stack() -> VM {
let vm = VM::new_with_opts("init_mu --disable-inline"); let vm = VM::new_with_opts("init_mu --disable-inline");
typedef!((vm) int64 = mu_int(64)); typedef! ((vm) int64 = mu_int(64));
constdef!((vm) <int64> int64_0 = Constant::Int(0)); constdef! ((vm) <int64> int64_0 = Constant::Int(0));
constdef!((vm) <int64> int64_1 = Constant::Int(1)); constdef! ((vm) <int64> int64_1 = Constant::Int(1));
constdef!((vm) <int64> int64_2 = Constant::Int(2)); constdef! ((vm) <int64> int64_2 = Constant::Int(2));
// foo7 // foo7
funcsig!((vm) foo7_sig = (int64, int64, int64, int64, int64, int64, int64) -> (int64)); funcsig! ((vm) foo7_sig = (int64, int64, int64, int64, int64, int64, int64) -> (int64));
funcdecl!((vm) <foo7_sig> foo7); funcdecl! ((vm) <foo7_sig> foo7);
funcdef!((vm) <foo7_sig> foo7 VERSION foo7_v1); funcdef! ((vm) <foo7_sig> foo7 VERSION foo7_v1);
// blk_entry // blk_entry
ssa!((vm, foo7_v1) <int64> v0); ssa! ((vm, foo7_v1) <int64> v0);
ssa!((vm, foo7_v1) <int64> v1); ssa! ((vm, foo7_v1) <int64> v1);
ssa!((vm, foo7_v1) <int64> v2); ssa! ((vm, foo7_v1) <int64> v2);
ssa!((vm, foo7_v1) <int64> v3); ssa! ((vm, foo7_v1) <int64> v3);
ssa!((vm, foo7_v1) <int64> v4); ssa! ((vm, foo7_v1) <int64> v4);
ssa!((vm, foo7_v1) <int64> v5); ssa! ((vm, foo7_v1) <int64> v5);
ssa!((vm, foo7_v1) <int64> v6); ssa! ((vm, foo7_v1) <int64> v6);
block!((vm, foo7_v1) blk_entry); block! ((vm, foo7_v1) blk_entry);
inst!((vm, foo7_v1) blk_entry_ret: inst! ((vm, foo7_v1) blk_entry_ret:
RET (v6) RET (v6)
); );
...@@ -276,20 +276,20 @@ fn pass_1arg_by_stack() -> VM { ...@@ -276,20 +276,20 @@ fn pass_1arg_by_stack() -> VM {
define_func_ver!((vm) foo7_v1 (entry: blk_entry) {blk_entry}); define_func_ver!((vm) foo7_v1 (entry: blk_entry) {blk_entry});
// pass_1arg_by_stack // pass_1arg_by_stack
funcsig!((vm) sig = () -> (int64)); funcsig! ((vm) sig = () -> (int64));
funcdecl!((vm) <sig> pass_1arg_by_stack); funcdecl! ((vm) <sig> pass_1arg_by_stack);
funcdef!((vm) <sig> pass_1arg_by_stack VERSION pass_1arg_by_stack_v1); funcdef! ((vm) <sig> pass_1arg_by_stack VERSION pass_1arg_by_stack_v1);
typedef!((vm) type_funcref_foo7 = mu_funcref(foo7_sig)); typedef! ((vm) type_funcref_foo7 = mu_funcref(foo7_sig));
constdef!((vm) <type_funcref_foo7> const_funcref_foo7 = Constant::FuncRef(vm.id_of("foo7"))); constdef! ((vm) <type_funcref_foo7> const_funcref_foo7 = Constant::FuncRef(vm.id_of("foo7")));
// blk_entry // blk_entry
consta!((vm, pass_1arg_by_stack_v1) int64_0_local = int64_0); consta! ((vm, pass_1arg_by_stack_v1) int64_0_local = int64_0);
consta!((vm, pass_1arg_by_stack_v1) int64_1_local = int64_1); consta! ((vm, pass_1arg_by_stack_v1) int64_1_local = int64_1);
block!((vm, pass_1arg_by_stack_v1) blk_entry); block! ((vm, pass_1arg_by_stack_v1) blk_entry);
block!((vm, pass_1arg_by_stack_v1) blk_main); block! ((vm, pass_1arg_by_stack_v1) blk_main);
inst!((vm, pass_1arg_by_stack_v1) blk_entry_branch: inst! ((vm, pass_1arg_by_stack_v1) blk_entry_branch:
BRANCH blk_main ( BRANCH blk_main (
int64_0_local, int64_0_local,
int64_0_local, int64_0_local,
...@@ -305,23 +305,23 @@ fn pass_1arg_by_stack() -> VM { ...@@ -305,23 +305,23 @@ fn pass_1arg_by_stack() -> VM {
define_block!((vm, pass_1arg_by_stack_v1) blk_entry() {blk_entry_branch}); define_block!((vm, pass_1arg_by_stack_v1) blk_entry() {blk_entry_branch});
// blk_main // blk_main
ssa!((vm, pass_1arg_by_stack_v1) <int64> a0); ssa! ((vm, pass_1arg_by_stack_v1) <int64> a0);
ssa!((vm, pass_1arg_by_stack_v1) <int64> a1); ssa! ((vm, pass_1arg_by_stack_v1) <int64> a1);
ssa!((vm, pass_1arg_by_stack_v1) <int64> a2); ssa! ((vm, pass_1arg_by_stack_v1) <int64> a2);
ssa!((vm, pass_1arg_by_stack_v1) <int64> a3); ssa! ((vm, pass_1arg_by_stack_v1) <int64> a3);
ssa!((vm, pass_1arg_by_stack_v1) <int64> a4); ssa! ((vm, pass_1arg_by_stack_v1) <int64> a4);
ssa!((vm, pass_1arg_by_stack_v1) <int64> a5); ssa! ((vm, pass_1arg_by_stack_v1) <int64> a5);
ssa!((vm, pass_1arg_by_stack_v1) <int64> a6); ssa! ((vm, pass_1arg_by_stack_v1) <int64> a6);
consta!((vm, pass_1arg_by_stack_v1) const_funcref_foo7_local = const_funcref_foo7); consta! ((vm, pass_1arg_by_stack_v1) const_funcref_foo7_local = const_funcref_foo7);
ssa!((vm, pass_1arg_by_stack_v1) <int64> retval); ssa! ((vm, pass_1arg_by_stack_v1) <int64> retval);
inst!((vm, pass_1arg_by_stack_v1) blk_main_call: inst! ((vm, pass_1arg_by_stack_v1) blk_main_call:
retval = retval =
EXPRCALL (CallConvention::Mu, is_abort: false) EXPRCALL (CallConvention::Mu, is_abort: false)
const_funcref_foo7_local (a0, a1, a2, a3, a4, a5, a6) const_funcref_foo7_local (a0, a1, a2, a3, a4, a5, a6)
); );
inst!((vm, pass_1arg_by_stack_v1) blk_main_ret: inst! ((vm, pass_1arg_by_stack_v1) blk_main_ret:
RET (retval) RET (retval)
); );
...@@ -335,12 +335,12 @@ fn pass_1arg_by_stack() -> VM { ...@@ -335,12 +335,12 @@ fn pass_1arg_by_stack() -> VM {
blk_main blk_main
}); });
emit_test!((vm) emit_test! ((vm)
pass_1arg_by_stack, pass_1arg_by_stack_test1, pass_1arg_by_stack_test1_v1, pass_1arg_by_stack, pass_1arg_by_stack_test1, pass_1arg_by_stack_test1_v1,
RET Int, RET Int,
EQ, EQ,
sig, sig,
RET int64(1u64), RET int64(1u64),
); );
vm vm
...@@ -356,32 +356,32 @@ fn test_pass_2args_by_stack() { ...@@ -356,32 +356,32 @@ fn test_pass_2args_by_stack() {
fn pass_2args_by_stack() -> VM { fn pass_2args_by_stack() -> VM {
let vm = VM::new_with_opts("init_mu --disable-inline"); let vm = VM::new_with_opts("init_mu --disable-inline");
typedef!((vm) int64 = mu_int(64)); typedef! ((vm) int64 = mu_int(64));
constdef!((vm) <int64> int64_0 = Constant::Int(0)); constdef! ((vm) <int64> int64_0 = Constant::Int(0));
constdef!((vm) <int64> int64_1 = Constant::Int(1)); constdef! ((vm) <int64> int64_1 = Constant::Int(1));
constdef!((vm) <int64> int64_2 = Constant::Int(2)); constdef! ((vm) <int64> int64_2 = Constant::Int(2));
// foo8 // foo8
funcsig!((vm) foo8_sig = (int64, int64, int64, int64, int64, funcsig! ((vm) foo8_sig = (int64, int64, int64, int64, int64,
int64, int64, int64, int64, int64) -> (int64)); int64, int64, int64, int64, int64) -> (int64));
funcdecl!((vm) <foo8_sig> foo8); funcdecl! ((vm) <foo8_sig> foo8);
funcdef!((vm) <foo8_sig> foo8 VERSION foo8_v1); funcdef! ((vm) <foo8_sig> foo8 VERSION foo8_v1);
// blk_entry // blk_entry
ssa!((vm, foo8_v1) <int64> v0); ssa! ((vm, foo8_v1) <int64> v0);
ssa!((vm, foo8_v1) <int64> v1); ssa! ((vm, foo8_v1) <int64> v1);
ssa!((vm, foo8_v1) <int64> v2); ssa! ((vm, foo8_v1) <int64> v2);
ssa!((vm, foo8_v1) <int64> v3); ssa! ((vm, foo8_v1) <int64> v3);
ssa!((vm, foo8_v1) <int64> v4); ssa! ((vm, foo8_v1) <int64> v4);
ssa!((vm, foo8_v1) <int64> v5); ssa! ((vm, foo8_v1) <int64> v5);
ssa!((vm, foo8_v1) <int64> v6); ssa! ((vm, foo8_v1) <int64> v6);
ssa!((vm, foo8_v1) <int64> v7); ssa! ((vm, foo8_v1) <int64> v7);
ssa!((vm, foo8_v1) <int64> v8); ssa! ((vm, foo8_v1) <int64> v8);
ssa!((vm, foo8_v1) <int64> v9); ssa! ((vm, foo8_v1) <int64> v9);
block!((vm, foo8_v1) blk_entry); block! ((vm, foo8_v1) blk_entry);
inst!((vm, foo8_v1) blk_entry_ret: inst! ((vm, foo8_v1) blk_entry_ret:
RET (v9) RET (v9)
); );
...@@ -392,21 +392,21 @@ fn pass_2args_by_stack() -> VM { ...@@ -392,21 +392,21 @@ fn pass_2args_by_stack() -> VM {
define_func_ver!((vm) foo8_v1 (entry: blk_entry) {blk_entry}); define_func_ver!((vm) foo8_v1 (entry: blk_entry) {blk_entry});
// pass_2args_by_stack // pass_2args_by_stack
funcsig!((vm) sig = () -> (int64)); funcsig! ((vm) sig = () -> (int64));
funcdecl!((vm) <sig> pass_2args_by_stack); funcdecl! ((vm) <sig> pass_2args_by_stack);
funcdef!((vm) <sig> pass_2args_by_stack VERSION pass_2args_by_stack_v1); funcdef! ((vm) <sig> pass_2args_by_stack VERSION pass_2args_by_stack_v1);
typedef!((vm) type_funcref_foo8 = mu_funcref(foo8_sig)); typedef! ((vm) type_funcref_foo8 = mu_funcref(foo8_sig));
constdef!((vm) <type_funcref_foo8> const_funcref_foo8 = Constant::FuncRef(vm.id_of("foo8"))); constdef! ((vm) <type_funcref_foo8> const_funcref_foo8 = Constant::FuncRef(vm.id_of("foo8")));
// blk_entry // blk_entry
consta!((vm, pass_2args_by_stack_v1) int64_0_local = int64_0); consta! ((vm, pass_2args_by_stack_v1) int64_0_local = int64_0);
consta!((vm, pass_2args_by_stack_v1) int64_1_local = int64_1); consta! ((vm, pass_2args_by_stack_v1) int64_1_local = int64_1);
consta!((vm, pass_2args_by_stack_v1) int64_2_local = int64_2); consta! ((vm, pass_2args_by_stack_v1) int64_2_local = int64_2);
block!((vm, pass_2args_by_stack_v1) blk_entry); block! ((vm, pass_2args_by_stack_v1) blk_entry);
block!((vm, pass_2args_by_stack_v1) blk_main); block! ((vm, pass_2args_by_stack_v1) blk_main);
inst!((vm, pass_2args_by_stack_v1) blk_entry_branch: inst! ((vm, pass_2args_by_stack_v1) blk_entry_branch:
BRANCH blk_main ( BRANCH blk_main (
int64_0_local, int64_0_local,
int64_0_local, int64_0_local,
...@@ -425,20 +425,20 @@ fn pass_2args_by_stack() -> VM { ...@@ -425,20 +425,20 @@ fn pass_2args_by_stack() -> VM {
define_block!((vm, pass_2args_by_stack_v1) blk_entry() {blk_entry_branch}); define_block!((vm, pass_2args_by_stack_v1) blk_entry() {blk_entry_branch});
// blk_main // blk_main
ssa!((vm, pass_2args_by_stack_v1) <int64> a0); ssa! ((vm, pass_2args_by_stack_v1) <int64> a0);
ssa!((vm, pass_2args_by_stack_v1) <int64> a1); ssa! ((vm, pass_2args_by_stack_v1) <int64> a1);
ssa!((vm, pass_2args_by_stack_v1) <int64> a2); ssa! ((vm, pass_2args_by_stack_v1) <int64> a2);
ssa!((vm, pass_2args_by_stack_v1) <int64> a3); ssa! ((vm, pass_2args_by_stack_v1) <int64> a3);
ssa!((vm, pass_2args_by_stack_v1) <int64> a4); ssa! ((vm, pass_2args_by_stack_v1) <int64> a4);
ssa!((vm, pass_2args_by_stack_v1) <int64> a5); ssa! ((vm, pass_2args_by_stack_v1) <int64> a5);
ssa!((vm, pass_2args_by_stack_v1) <int64> a6); ssa! ((vm, pass_2args_by_stack_v1) <int64> a6);
ssa!((vm, pass_2args_by_stack_v1) <int64> a7); ssa! ((vm, pass_2args_by_stack_v1) <int64> a7);
ssa!((vm, pass_2args_by_stack_v1) <int64> a8); ssa! ((vm, pass_2args_by_stack_v1) <int64> a8);
ssa!((vm, pass_2args_by_stack_v1) <int64> a9); ssa! ((vm, pass_2args_by_stack_v1) <int64> a9);
consta!((vm, pass_2args_by_stack_v1) const_funcref_foo8_local = const_funcref_foo8); consta! ((vm, pass_2args_by_stack_v1) const_funcref_foo8_local = const_funcref_foo8);
ssa!((vm, pass_2args_by_stack_v1) <int64> retval); ssa! ((vm, pass_2args_by_stack_v1) <int64> retval);
inst!((vm, pass_2args_by_stack_v1) blk_main_call: inst! ((vm, pass_2args_by_stack_v1) blk_main_call:
retval = retval =
EXPRCALL (CallConvention::Mu, is_abort: false) EXPRCALL (CallConvention::Mu, is_abort: false)
const_funcref_foo8_local (a0, a1, a2, a3, a4, a5, a6, a7, a8, a9) const_funcref_foo8_local (a0, a1, a2, a3, a4, a5, a6, a7, a8, a9)
...@@ -459,7 +459,7 @@ fn pass_2args_by_stack() -> VM { ...@@ -459,7 +459,7 @@ fn pass_2args_by_stack() -> VM {
}); });
emit_test!((vm) emit_test!((vm)
pass_2args_by_stack pass_2args_by_stack_test1 pass_2args_by_stack_test1_v1, pass_2args_by_stack, pass_2args_by_stack_test1, pass_2args_by_stack_test1_v1,
RET Int, RET Int,
EQ, EQ,
sig, sig,
...@@ -473,30 +473,30 @@ fn pass_2args_by_stack() -> VM { ...@@ -473,30 +473,30 @@ fn pass_2args_by_stack() -> VM {
fn pass_2args_by_stack() -> VM { fn pass_2args_by_stack() -> VM {
let vm = VM::new_with_opts("init_mu --disable-inline"); let vm = VM::new_with_opts("init_mu --disable-inline");
typedef!((vm) int64 = mu_int(64)); typedef! ((vm) int64 = mu_int(64));
constdef!((vm) <int64> int64_0 = Constant::Int(0)); constdef! ((vm) <int64> int64_0 = Constant::Int(0));
constdef!((vm) <int64> int64_1 = Constant::Int(1)); constdef! ((vm) <int64> int64_1 = Constant::Int(1));
constdef!((vm) <int64> int64_2 = Constant::Int(2)); constdef! ((vm) <int64> int64_2 = Constant::Int(2));
// foo8 // foo8
funcsig!((vm) foo8_sig = (int64, int64, int64, int64, int64, int64, int64, int64) funcsig! ((vm) foo8_sig = (int64, int64, int64, int64, int64, int64, int64, int64)
-> (int64));