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.
This commit is contained in:
Quentin Carbonneaux 2015-08-05 11:37:10 -04:00
parent 1477dffe32
commit 246a48ba94
6 changed files with 109 additions and 22 deletions

10
lisc/test/cup.ssa Normal file
View file

@ -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