summary refs log tree commit diff
path: root/lisc/test
diff options
context:
space:
mode:
authorQuentin Carbonneaux <quentin.carbonneaux@yale.edu>2015-08-05 11:37:10 -0400
committerQuentin Carbonneaux <quentin.carbonneaux@yale.edu>2015-09-15 23:01:30 -0400
commit246a48ba94b92e6c1e02964d46269e0903b7a723 (patch)
tree5bbb97fa09f78af4c2c3f4db3b8c958b724fbbe6 /lisc/test
parent1477dffe32ae769c15ee49e77c5f0856bd0f56ea (diff)
downloadroux-246a48ba94b92e6c1e02964d46269e0903b7a723.tar.gz
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.
Diffstat (limited to 'lisc/test')
-rw-r--r--lisc/test/cup.ssa10
1 files changed, 10 insertions, 0 deletions
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