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:
parent
1477dffe32
commit
246a48ba94
6 changed files with 109 additions and 22 deletions
10
lisc/test/cup.ssa
Normal file
10
lisc/test/cup.ssa
Normal 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
|
Loading…
Add table
Add a link
Reference in a new issue