From 246a48ba94b92e6c1e02964d46269e0903b7a723 Mon Sep 17 00:00:00 2001 From: Quentin Carbonneaux Date: Wed, 5 Aug 2015 11:37:10 -0400 Subject: start work on comparisons There are two things I overlooked so far. 1. Binary instructions like cmp that do not have a result in registers need the size suffix sometimes, for example when comparing a spill location with a constant. 2. The register allocator needs to be adapted to support the comparison instruction: it is not possible to compare two spill locations without using a register. --- lisc/test/cup.ssa | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 lisc/test/cup.ssa (limited to 'lisc/test') diff --git a/lisc/test/cup.ssa b/lisc/test/cup.ssa new file mode 100644 index 0000000..64f2ab4 --- /dev/null +++ b/lisc/test/cup.ssa @@ -0,0 +1,10 @@ +# counts up + +@start +@loop + %n0 =w phi @start -1988, @loop %n1 + %n1 =w add 1, %n0 + %cmp =w csle %n1, 1000 + jez %cmp, @end, @loop +@end + ret -- cgit 1.4.1