Commit 930fc8a1 authored by zygzagZ's avatar zygzagZ

Fix last test (bad Phi XCHG), fix test runner, update README

parent 4c49b115
......@@ -2,4 +2,16 @@ Paweł Charyło
pc394130
Kompilowanie: make
Używam makefile i g++
\ No newline at end of file
Używam makefile i g++
Alokacja rejestrów zgodnie z algorytmem opisanym w pracy naukowej Pereira, Palsberg 2009 o alokacji rejestrów dla programów SSA (bez pre-spillingu, heurystyka "spill least-used color").
Zaplanowane rozszerzenia:
- gcse
- tablice
- klasy z dziedziczeniem i metodami wirtualnymi
- odśmiecanie
Pliki używane do kompilacji:
- runtime.o wygenerowany z runtime.c (make lib/runtime.o)
- libc.a pasujący pod i386 skopiowany z lokalnego systemu (brak na students)
......@@ -307,7 +307,7 @@ void Compiler::generatePhiXCHG(const map<VariablePtr, VariablePtr> &varMap) {
}
} else {
append("MOVL", rj, ri);
rj = ri;
rj = 0;
}
}
// load from memory
......@@ -433,6 +433,7 @@ void Compiler::generateQAssign(QAssign &q) {
string jLoc = Register(j) != edx ? getRef(j) : "-4(%esp)";
if (j->constExpr) {
auto free = to_set(Register::assignable) - alives;
free.erase(Register("edx"));
if (!free.empty()) {
auto reg = *free.begin();
append("MOVL", jLoc, reg);
......
......@@ -10,6 +10,7 @@ function red {
function green {
echo -e "${GREEN}$@${NONE}"
}
VALGRIND=""
make -j8 && for i in lat/lattests/good/*.lat; do
t=$((t+1))
......@@ -25,7 +26,7 @@ make -j8 && for i in lat/lattests/good/*.lat; do
inp=/dev/null
fi
if ! diff <( timeout 2 ${i%.*} < "$inp" ) "${i%.*}.output"; then
if ! diff <( $VALGRIND timeout 2 ${i%.*} < "$inp" ) "${i%.*}.output"; then
red "ERROR $i"
exit 1
fi
......@@ -39,6 +40,17 @@ done && green good OK && for ext in `ls tests/good/`; do
ok=0;
break;
fi
if [ -f "${i%.*}.input" ]; then
inp="${i%.*}.input"
else
inp=/dev/null
fi
if ! diff <( $VALGRIND timeout 2 ${i%.*} < "$inp" ) "${i%.*}.output"; then
red "ERROR $i"
ok=0;
fi
done
if [ $ok -eq 1 ]; then
green "OK: $ext passed!"
......@@ -69,6 +81,12 @@ done && green "OK: $t bad+ tests passed!" && for ext in `ls lat/lattests/extensi
ok=0;
break;
fi
if ! diff <( $VALGRIND timeout 2 ${i%.*} < "$inp" ) "${i%.*}.output"; then
red "ERROR $i"
exit 1
fi
done
if [ $ok -eq 1 ]; then
green "OK: $ext passed!"
......@@ -83,6 +101,18 @@ done && for ext in `ls tests/extensions`; do
ok=0;
break;
fi
if [ -f "${i%.*}.input" ]; then
inp="${i%.*}.input"
else
inp=/dev/null
fi
if ! diff <( $VALGRIND timeout 2 ${i%.*} < "$inp" ) "${i%.*}.output"; then
red "ERROR $i"
exit 1
fi
done
if [ $ok -eq 1 ]; then
green "OK: $ext passed!"
......
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