GitLab will be upgraded to the 12.10.14-ce.0 on 28 Sept 2020 at 2.00pm (AEDT) to 2.30pm (AEDT). During the update, GitLab and Mattermost services will not be available. If you have any concerns with this, please talk to us at N110 (b) CSIT building.

Commit b5262087 authored by qinsoon's avatar qinsoon

Merge branch 'swapstack' of gitlab.anu.edu.au:mu/mu-impl-fast into swapstack

parents b0052927 6c445fa0
...@@ -16,7 +16,6 @@ from util import execute, compile_bundle, load_bundle, get_function; ...@@ -16,7 +16,6 @@ from util import execute, compile_bundle, load_bundle, get_function;
import pytest; import pytest;
import ctypes; import ctypes;
# passes on aarch64
def test_swapstack_simple(): def test_swapstack_simple():
compile_bundle( compile_bundle(
""" """
...@@ -35,7 +34,6 @@ def test_swapstack_simple(): ...@@ -35,7 +34,6 @@ def test_swapstack_simple():
""", "test_swapstack_simple"); """, "test_swapstack_simple");
assert(execute("test_swapstack_simple", []) == 3); assert(execute("test_swapstack_simple", []) == 3);
# passes on aarch64
def test_swapstack_swap_back(): def test_swapstack_swap_back():
compile_bundle( compile_bundle(
""" """
...@@ -56,7 +54,6 @@ def test_swapstack_swap_back(): ...@@ -56,7 +54,6 @@ def test_swapstack_swap_back():
""", "test_swapstack_swap_back"); """, "test_swapstack_swap_back");
assert(execute("test_swapstack_swap_back", []) == 3); assert(execute("test_swapstack_swap_back", []) == 3);
# segfaults on aarch64
def test_swapstack_pass_vals(): def test_swapstack_pass_vals():
compile_bundle( compile_bundle(
""" """
...@@ -68,33 +65,40 @@ def test_swapstack_pass_vals(): ...@@ -68,33 +65,40 @@ def test_swapstack_pass_vals():
.funcdef test_swapstack_pass_vals <main_sig> .funcdef test_swapstack_pass_vals <main_sig>
{ {
entry(<int<32>>argc <uptr<uptr<char>>>argv): entry(<int<32>>argc <uptr<uptr<char>>>argv):
cs = COMMINST uvm.current_stack()
s = COMMINST uvm.new_stack<[(stackref)->()]>(new_func) s = COMMINST uvm.new_stack<[(stackref)->()]>(new_func)
r = SWAPSTACK s RET_WITH<int<32>> PASS_VALUES<>() r = SWAPSTACK s RET_WITH<int<32>> PASS_VALUES<stackref>(cs)
RET r RET r
} }
""", "test_swapstack_pass_vals"); """, "test_swapstack_pass_vals");
assert(execute("test_swapstack_pass_vals", []) == 3); assert(execute("test_swapstack_pass_vals", []) == 3);
# Work in progress...
def test_swapstack_throw(): def test_swapstack_throw():
compile_bundle( compile_bundle(
""" """
.funcdef new_func <(stackref)->()> .funcdef new_func <(stackref)->()>
{ {
entry(<stackref>s): entry(<stackref>s):
SWAPSTACK s KILL_OLD PASS_VALUES<int<32>>(<int<32> 3) er = NEW <int<32>>
} eri = GETIREF <int<32>> er
.funcdef test_swapstack_pass_vals <main_sig> STORE <int<32>> eri <int<32>> 3
ev = REFCAST <ref<int<32>> ref<void>> er
SWAPSTACK s KILL_OLD THROW_EXC ev
}
.funcdef test_swapstack_throw <main_sig>
{ {
entry(<int<32>>argc <uptr<uptr<char>>>argv): entry(<int<32>>argc <uptr<uptr<char>>>argv):
s = COMMINST new_stack<[()->()]>(new_func) cs = COMMINST uvm.current_stack()
r = SWAPSTACK s RET_WITH<int<32>> PASS_VALUES<>() EXC(nor_dest(r) exc_dest()) s = COMMINST uvm.new_stack<[(stackref)->()]>(new_func)
r = SWAPSTACK s RET_WITH<int<32>> PASS_VALUES<stackref>(cs) EXC(nor_dest(r) exc_dest())
RET r RET r
nor_dest(<int<32>>): nor_dest(<int<32>> r):
RET <int<32>>0 RET <int<32>>0
exc_dest()[exc_param]: exc_dest()[exc_param]:
REFCAST <from_ty tot__ty> e = REFCAST <ref<void> ref<int<32>>> exc_param
RET <int<32>>0 evi = GETIREF <int<32>> e
ev = LOAD <int<32>> evi
RET ev
} }
""", "test_swapstack_pass_vals"); """, "test_swapstack_throw");
assert(execute("test_swapstack_pass_vals", []) == 3); assert(execute("test_swapstack_throw", []) == 3);
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