1st draft of merging with develop branch: Hopefully passing rustfmt

parent c075b1e4
Pipeline #836 failed with stages
in 31 minutes and 3 seconds
......@@ -56,19 +56,25 @@ fn built() {
#[cfg(feature = "sel4-rumprun-target-side")]
#[cfg(target_arch = "x86_64")]
fn main() {
use std::path::Path;
let mut compiler_name = String::new();
compiler_name.push_str("x86_64-rumprun-netbsd-gcc");
gcc::Config::new().flag("-O3").flag("-c")
.compiler(Path::new(compiler_name.as_str()))
.file("src/runtime/runtime_x64_sel4_rumprun_sysv.c")
.compile("libruntime_c.a");
gcc::Config::new().flag("-O3").flag("-c")
.compiler(Path::new(compiler_name.as_str()))
.file("src/runtime/runtime_asm_x64_sel4_rumprun_sysv.S")
.compile("libruntime_asm.a");
gcc::Config::new().flag("-O3").flag("-c")
.compiler(Path::new(compiler_name.as_str()))
.file("zebu_c_helpers.c")
.compile("libzebu_c_helpers.a");
use std::path::Path;
let mut compiler_name = String::new();
compiler_name.push_str("x86_64-rumprun-netbsd-gcc");
gcc::Config::new()
.flag("-O3")
.flag("-c")
.compiler(Path::new(compiler_name.as_str()))
.file("src/runtime/runtime_x64_sel4_rumprun_sysv.c")
.compile("libruntime_c.a");
gcc::Config::new()
.flag("-O3")
.flag("-c")
.compiler(Path::new(compiler_name.as_str()))
.file("src/runtime/runtime_asm_x64_sel4_rumprun_sysv.S")
.compile("libruntime_asm.a");
gcc::Config::new()
.flag("-O3")
.flag("-c")
.compiler(Path::new(compiler_name.as_str()))
.file("zebu_c_helpers.c")
.compile("libzebu_c_helpers.a");
}
This diff is collapsed.
......@@ -31,7 +31,7 @@ use self::mu::linkutils::aot;
#[test]
fn test_allocation_fastpath() {
build_and_run_test! (allocation_fastpath, allocation_fastpath_test1);
build_and_run_test!(allocation_fastpath, allocation_fastpath_test1);
}
fn allocation_fastpath() -> VM {
......@@ -79,9 +79,12 @@ fn allocation_fastpath() -> VM {
});
define_func_ver!((vm) allocation_fastpath_v1 (entry: blk_entry) {blk_entry});
emit_test! ((vm) (allocation_fastpath allocation_fastpath_test1 allocation_fastpath_test1_v1 --- (sig)));
emit_test! ((vm)
allocation_fastpath, allocation_fastpath_test1, allocation_fastpath_test1_v1,
sig,
);
vm
}
......@@ -181,8 +184,11 @@ pub fn alloc_new() -> VM {
define_func_ver!((vm) alloc_new_v1 (entry: blk_0) {
blk_0
});
emit_test! ((vm) (alloc_new alloc_new_test1 alloc_new_test1_v1 --- (alloc_new_sig)));
emit_test! ((vm)
alloc_new, alloc_new_test1, alloc_new_test1_v1,
alloc_new_sig,
);
vm
}
......@@ -71,10 +71,23 @@ fn udiv() -> VM {
define_func_ver!((vm) udiv_v1(entry: blk_entry) {
blk_entry
});
emit_test! ((vm) (udiv udiv_test1 udiv_test1_v1 III (udiv_sig, int64(22), int64(4), int64(5))));
emit_test! ((vm) (udiv udiv_test2 udiv_test2_v1 III (udiv_sig, int64(27), int64(7), int64(3))));
emit_test! ((vm)
udiv, udiv_test1, udiv_test1_v1,
Int, Int RET Int,
EQ,
udiv_sig,
int64(22), int64(4) RET int64(5),
);
emit_test! ((vm)
udiv, udiv_test2, udiv_test2_v1,
Int, Int RET Int,
EQ,
udiv_sig,
int64(27), int64(7) RET int64(3),
);
vm
}
......@@ -117,10 +130,23 @@ fn sdiv() -> VM {
define_func_ver!((vm) sdiv_v1(entry: blk_entry) {
blk_entry
});
emit_test! ((vm) (sdiv sdiv_test1 sdiv_test1_v1 III (sdiv_sig, int64(8), int64(2), int64(4))));
emit_test! ((vm) (sdiv sdiv_test2 sdiv_test2_v2 III (sdiv_sig, int64(8), int64(-3i64 as u64), int64(-2i64 as u64))));
emit_test! ((vm)
sdiv, sdiv_test1, sdiv_test1_v1,
Int, Int RET Int,
EQ,
sdiv_sig,
int64(8), int64(2) RET int64(4),
);
emit_test! ((vm)
sdiv, sdiv_test2, sdiv_test2_v1,
Int, Int RET Int,
EQ,
sdiv_sig,
int64(8), int64(-3i64 as u64) RET int64(-2i64 as u64),
);
vm
}
......@@ -163,10 +189,22 @@ fn shl() -> VM {
define_func_ver!((vm) shl_v1(entry: blk_entry) {
blk_entry
});
emit_test! ((vm) (shl shl_test1 shl_test1_v1 III (shl_sig, int64(1), int64(2), int64(4))));
emit_test! ((vm) (shl shl_test2 shl_test2_v1 III (shl_sig, int64(2), int64(2), int64(8))));
emit_test! ((vm)
shl, shl_test1, shl_test1_v1,
Int, Int RET Int,
EQ,
shl_sig,
int64(1), int64(2) RET int64(4),
);
emit_test! ((vm)
shl, shl_test2, shl_test2_v1,
Int, Int RET Int,
EQ,
shl_sig,
int64(2), int64(2) RET int64(8),
);
vm
}
......@@ -208,9 +246,15 @@ fn lshr() -> VM {
define_func_ver!((vm) lshr_v1(entry: blk_entry) {
blk_entry
});
emit_test! ((vm) (lshr lshr_test1 lshr_test1_v1 III (lshr_sig, int64(8), int64(3), int64(1))));
emit_test! ((vm)
lshr, lshr_test1, lshr_test1_v1,
Int, Int RET Int,
EQ,
lshr_sig,
int64(8), int64(3) RET int64(1),
);
vm
}
......@@ -247,9 +291,15 @@ fn add() -> VM {
});
define_func_ver!((vm) add_v1 (entry: blk_entry) {blk_entry});
emit_test! ((vm) (add add_test1 add_test1_v1 III (sig, int64(22), int64(27), int64(49))));
emit_test! ((vm)
add, add_test1, add_test1_v1,
Int, Int RET Int,
EQ,
sig,
int64(22), int64(27) RET int64(49),
);
vm
}
......@@ -291,12 +341,36 @@ fn add_int64_n() -> VM {
});
define_func_ver!((vm) add_int64_n_v1 (entry: blk_entry) {blk_entry});
emit_test! ((vm) (add_int64_n add_int64_n_test1 add_int64_n_test1_v1 III (sig, int64(1), int64(1), int1(0))));
emit_test! ((vm) (add_int64_n add_int64_n_test2 add_int64_n_test2_v1 III (sig, int64(1), int64(-2i64 as u64), int1(1))));
emit_test! ((vm) (add_int64_n add_int64_n_test3 add_int64_n_test3_v1 III (sig, int64(1), int64(-1i64 as u64), int1(0))));
emit_test! ((vm) (add_int64_n add_int64_n_test4 add_int64_n_test4_v1 III (sig, int64(-1i64 as u64), int64(-1i64 as u64), int1(1))));
emit_test! ((vm)
add_int64_n, add_int64_n_test1, add_int64_n_test1_v1,
Int, Int RET Int,
EQ,
sig,
int64(1), int64(1) RET int1(0),
);
emit_test! ((vm)
add_int64_n, add_int64_n_test2, add_int64_n_test2_v1,
Int, Int RET Int,
EQ,
sig,
int64(1), int64(-2i64 as u64) RET int1(1),
);
emit_test! ((vm)
add_int64_n, add_int64_n_test3, add_int64_n_test3_v1,
Int, Int RET Int,
EQ,
sig,
int64(1), int64(-1i64 as u64) RET int1(0),
);
emit_test! ((vm)
add_int64_n, add_int64_n_test4, add_int64_n_test4_v1,
Int, Int RET Int,
EQ,
sig,
int64(-1i64 as u64), int64(-1i64 as u64) RET int1(1),
);
vm
}
......@@ -337,11 +411,29 @@ fn add_int64_z() -> VM {
});
define_func_ver!((vm) add_int64_z_v1 (entry: blk_entry) {blk_entry});
emit_test! ((vm) (add_int64_z add_int64_z_test1 add_int64_z_test1_v1 III (sig, int64(1), int64(1), int1(0))));
emit_test! ((vm) (add_int64_z add_int64_z_test2 add_int64_z_test2_v1 III (sig, int64(1), int64(-2i64 as u64), int1(0))));
emit_test! ((vm) (add_int64_z add_int64_z_test3 add_int64_z_test3_v1 III (sig, int64(1), int64(-1i64 as u64), int1(1))));
emit_test! ((vm)
add_int64_z, add_int64_z_test1, add_int64_z_test1_v1,
Int, Int RET Int,
EQ,
sig,
int64(1), int64(1) RET int1(0),
);
emit_test! ((vm)
add_int64_z, add_int64_z_test2, add_int64_z_test2_v1,
Int, Int RET Int,
EQ,
sig,
int64(1), int64(-2i64 as u64) RET int1(0),
);
emit_test! ((vm)
add_int64_z, add_int64_z_test3, add_int64_z_test3_v1,
Int, Int RET Int,
EQ,
sig,
int64(1), int64(-1i64 as u64) RET int1(1),
);
vm
}
......@@ -381,10 +473,22 @@ fn add_int64_c() -> VM {
});
define_func_ver!((vm) add_int64_c_v1 (entry: blk_entry) {blk_entry});
emit_test! ((vm) (add_int64_c add_int64_c_test1 add_int64_c_test1_v1 III (sig, int64(u64::MAX), int64(1), int1(1))));
emit_test! ((vm) (add_int64_c add_int64_c_test2 add_int64_c_test2_v1 III (sig, int64(i64::MAX as u64), int64(0), int1(0))));
emit_test! ((vm)
add_int64_c, add_int64_c_test1, add_int64_c_test1_v1,
Int, Int RET Int,
EQ,
sig,
int64(u64::MAX), int64(1) RET int1(1),
);
emit_test! ((vm)
add_int64_c, add_int64_c_test2, add_int64_c_test2_v1,
Int, Int RET Int,
EQ,
sig,
int64(i64::MAX as u64), int64(0) RET int1(0),
);
vm
}
......@@ -426,12 +530,36 @@ fn add_int64_v() -> VM {
});
define_func_ver!((vm) add_int64_v_v1 (entry: blk_entry) {blk_entry});
emit_test! ((vm) (add_int64_v add_int64_v_test1 add_int64_v_test1_v1 III (sig, int64(i64::MAX as u64), int64(1), int1(1))));
emit_test! ((vm) (add_int64_v add_int64_v_test2 add_int64_v_test2_v1 III (sig, int64(i64::MAX as u64), int64(0), int1(0))));
emit_test! ((vm) (add_int64_v add_int64_v_test3 add_int64_v_test3_v1 III (sig, int64(i64::MIN as u64), int64(0), int1(0))));
emit_test! ((vm) (add_int64_v add_int64_v_test4 add_int64_v_test4_v1 III (sig, int64(i64::MIN as u64), int64(-1i64 as u64), int1(1))));
emit_test! ((vm)
add_int64_v, add_int64_v_test1, add_int64_v_test1_v1,
Int, Int RET Int,
EQ,
sig,
int64(i64::MAX as u64), int64(1) RET int1(1),
);
emit_test! ((vm)
add_int64_v, add_int64_v_test2, add_int64_v_test2_v1,
Int, Int RET Int,
EQ,
sig,
int64(i64::MAX as u64), int64(0) RET int1(0),
);
emit_test! ((vm)
add_int64_v, add_int64_v_test3, add_int64_v_test3_v1,
Int, Int RET Int,
EQ,
sig,
int64(i64::MIN as u64), int64(0) RET int1(0),
);
emit_test! ((vm)
add_int64_v, add_int64_v_test4, add_int64_v_test4_v1,
Int, Int RET Int,
EQ,
sig,
int64(i64::MIN as u64), int64(-1i64 as u64) RET int1(1),
);
vm
}
......@@ -504,9 +632,21 @@ fn add_int64_nzc() -> VM {
});
define_func_ver!((vm) add_int64_nzc_v1 (entry: blk_entry) {blk_entry});
emit_test! ((vm) (add_int64_nzc add_int64_nzc_test1 add_int64_nzc_test1_v1 III (sig, int64(u64::MAX), int64(1), int8(0b110))));
emit_test! ((vm) (add_int64_nzc add_int64_nzc_test2 add_int64_nzc_test2_v1 III (sig, int64(u64::MAX), int64(0), int8(0b001))));
emit_test! ((vm)
add_int64_nzc, add_int64_nzc_test1, add_int64_nzc_test1_v1,
Int, Int RET Int,
EQ,
sig,
int64(u64::MAX), int64(1) RET int8(0b110),
);
emit_test! ((vm)
add_int64_nzc, add_int64_nzc_test2, add_int64_nzc_test2_v1,
Int, Int RET Int,
EQ,
sig,
int64(u64::MAX), int64(0) RET int8(0b001),
);
vm
}
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment