commit ee46ff8dad6782a739fefd176e55a70754787917
parent 73b7d9b199f0e73821acdde4770995c8db413106
Author: Quentin Carbonneaux <quentin.carbonneaux@yale.edu>
Date: Mon, 14 Sep 2015 18:06:29 -0400
cosmetic indentation style fix
Diffstat:
17 files changed, 81 insertions(+), 81 deletions(-)
diff --git a/lisc/parse.c b/lisc/parse.c
@@ -807,7 +807,7 @@ printfn(Fn *fn, FILE *f)
fprintf(f, "function $%s {\n", fn->name);
for (b=fn->start; b; b=b->link) {
- fprintf(f, " @%s\n", b->name);
+ fprintf(f, "@%s\n", b->name);
for (p=b->phi; p; p=p->link) {
fprintf(f, "\t");
printref(p->to, fn, f);
diff --git a/lisc/test/align.ssa b/lisc/test/align.ssa
@@ -1,5 +1,5 @@
function $test {
- @start
+@start
%x =l alloc16 16
%y =l add %x, 8
%m =w rem %y, 16
diff --git a/lisc/test/alt.ssa b/lisc/test/alt.ssa
@@ -3,23 +3,23 @@
# handling of looping constructs
function $test {
- @start
+@start
%ten =w copy 10
%dum =w copy 0 # dummy live-through temporary
- @loop
+@loop
%alt =w phi @start 0, @left %alt1, @right %alt1
%cnt =w phi @start 100, @left %cnt, @right %cnt1
%alt1 =w sub 1, %alt
jnz %alt1, @right, @left
- @left
+@left
%x =w phi @loop 10, @left %x1
%x1 =w sub %x, 1
%z =w copy %x
jnz %z, @left, @loop
- @right
+@right
%cnt1 =w sub %cnt, %ten
jnz %cnt1, @loop, @end
- @end
+@end
%ret =w add %cnt, %dum
ret
}
diff --git a/lisc/test/collatz.ssa b/lisc/test/collatz.ssa
@@ -4,39 +4,39 @@
# memoize small collatz numbers
function $test {
- @start
+@start
%mem =l alloc4 4000
- @loop
+@loop
%n =w phi @start 1, @newm %n9, @oldm %n9
%cmax =w phi @start 0, @newm %c, @oldm %cmax
%fin =w cslt %n, 1000
jnz %fin, @cloop, @end
- @cloop
+@cloop
%n0 =w phi @loop %n, @odd %n2, @even %n3
%c0 =w phi @loop 0, @odd %c1, @even %c1
%no1 =w cne %n0, 1
jnz %no1, @iter0, @endcl
- @iter0
+@iter0
%ism =w cslt %n0, %n
jnz %ism, @getmemo, @iter1
- @iter1
+@iter1
%c1 =w add %c0, 1
%p =w and %n0, 1
jnz %p, @odd, @even
- @odd
+@odd
%n1 =w mul 3, %n0
%n2 =w add %n1, 1
jmp @cloop
- @even
+@even
%n3 =w div %n0, 2
jmp @cloop
- @getmemo # get the count for n0 in mem
+@getmemo # get the count for n0 in mem
%n0l =l sext %n0
%idx0 =l mul %n0l, 4
%loc0 =l add %idx0, %mem
%cn0 =w load %loc0
%c2 =w add %c0, %cn0
- @endcl # store the count for n in mem
+@endcl # store the count for n in mem
%c =w phi @getmemo %c2, @cloop %c0
%nl =l sext %n
%idx1 =l mul %nl, 4
@@ -45,11 +45,11 @@ function $test {
%n9 =w add 1, %n
%big =w csle %cmax, %c
jnz %big, @newm, @oldm
- @newm
+@newm
jmp @loop
- @oldm
+@oldm
jmp @loop
- @end
+@end
storew %cmax, $a
ret
}
diff --git a/lisc/test/cprime.ssa b/lisc/test/cprime.ssa
@@ -3,7 +3,7 @@
# following in comments
function $test {
- @start
+@start
%v0 =l alloc8 4
%v1 =l alloc8 4
%v2 =l alloc8 4
@@ -12,64 +12,64 @@ function $test {
storew 5, %v1
storew 11, %v2
storew 12, %v3
- @L0
+@L0
%v5 =w load %v1
%v6 =w cne %v5, 10001
jnz %v6, @L8, @L1
- @L8
+@L8
storew 1, %v4
%v7 =w load %v3
%v8 =w rem %v7, 2
%v9 =w ceq %v8, 0
jnz %v9, @L9, @L5
- @L9
+@L9
storew 0, %v4
- @L5
+@L5
storew 3, %v0
- @L2
+@L2
%v10 =w load %v0
%v11 =w load %v3
%v12 =w cslt %v10, %v11
jnz %v12, @L10, @L3
- @L10
+@L10
%v13 =w load %v3
%v14 =w load %v0
%v15 =w rem %v13, %v14
%v16 =w ceq %v15, 0
jnz %v16, @L11, @L4
- @L11
+@L11
storew 0, %v4
jmp @L3
- @L4
+@L4
%v17 =w load %v0
%v18 =w add %v17, 2
storew %v18, %v0
jmp @L2
- @L3
+@L3
%v19 =w load %v4
jnz %v19, @L12, @L6
- @L12
+@L12
%v20 =w load %v3
storew %v20, %v2
%v21 =w load %v1
%v22 =w add %v21, 1
storew %v22, %v1
- @L6
+@L6
%v23 =w load %v3
%v24 =w add %v23, 1
storew %v24, %v3
jmp @L0
- @L1
+@L1
%v25 =w load %v2
%v26 =w cne %v25, 104743
jnz %v26, @L13, @L7
- @L13
+@L13
storew 1, $a
ret
- @L7
+@L7
storew 0, $a
ret
- @end
+@end
ret
}
diff --git a/lisc/test/cup.ssa b/lisc/test/cup.ssa
@@ -1,12 +1,12 @@
# counts up from -1988 to 1991
function $test {
- @start
- @loop
+@start
+@loop
%n0 =l phi @start -1988, @loop %n1
%n1 =l add 1, %n0
%cmp =l csle 1991, %n1
jnz %cmp, @end, @loop
- @end
+@end
ret
}
diff --git a/lisc/test/eucl.ssa b/lisc/test/eucl.ssa
@@ -4,15 +4,15 @@
# swap of b and a
function $test {
- @start
+@start
- @loop
+@loop
%a =w phi @start 380, @loop %r
%b =w phi @start 747, @loop %a
%r =w rem %b, %a
jnz %r, @loop, @end
- @end
+@end
storew %a, $a
ret
}
diff --git a/lisc/test/fix1.ssa b/lisc/test/fix1.ssa
@@ -1,15 +1,15 @@
function $test {
- @start
+@start
%x =w copy 1
- @loop
+@loop
jnz %x, @noz, @isz
- @noz
+@noz
%x =w copy 0
jmp @end
- @isz
+@isz
%x =w copy 1
jmp @loop
- @end
+@end
%z =w add 10, %x
ret
}
diff --git a/lisc/test/fix2.ssa b/lisc/test/fix2.ssa
@@ -1,15 +1,15 @@
function $test {
- @start
+@start
%x =w copy 1
- @loop
+@loop
jnz %x, @noz, @isz
- @noz
+@noz
%x =w copy 0
jnz %x, @loop, @end
- @isz
+@isz
%x =w copy 1
jmp @loop
- @end
+@end
%z =w add 10, %x
ret
}
diff --git a/lisc/test/live.ssa b/lisc/test/live.ssa
@@ -6,16 +6,16 @@
# nothing should ever be live at the entry
function $test {
- @start
+@start
%b =w copy 0
%x =w copy 10
jnz 0, @loop, @left
- @left
+@left
jmp @inloop
- @loop
+@loop
%x1 =w add %x, 1
- @inloop
+@inloop
%b1 =w add %b, 1
- @endloop
+@endloop
jmp @loop
}
diff --git a/lisc/test/loop.ssa b/lisc/test/loop.ssa
@@ -2,15 +2,15 @@
# sums all integers from 100 to 0
function $test {
- @start
+@start
- @loop
+@loop
%s =w phi @start 100, @loop %s1
%n =w phi @start 0, @loop %n1
%n1 =w sub %n, 1
%s1 =w add %s, %n
jnz %n1, @loop, @end
- @end
+@end
ret
}
diff --git a/lisc/test/max.ssa b/lisc/test/max.ssa
@@ -6,21 +6,21 @@
# a output max
function $test {
- @start
- @loop
+@start
+@loop
%max =w phi @start -1, @new %byt, @old %max
%loc =l phi @start $b, @new %loc1, @old %loc1
%byt =w loadub %loc
%loc1 =l add 1, %loc
jnz %byt, @iter, @end
- @iter
+@iter
%cmp =w csle %max, %byt
jnz %cmp, @new, @old
- @new
+@new
jmp @loop
- @old
+@old
jmp @loop
- @end
+@end
storew %max, $a
ret
}
diff --git a/lisc/test/prime.ssa b/lisc/test/prime.ssa
@@ -2,25 +2,25 @@
# store it in a
function $test {
- @start
- @loop
+@start
+@loop
%n =w phi @start 5, @tloop %n, @yes %n1
%p =w phi @start 13, @tloop %p1, @yes %p1
%p1 =w add %p, 2
- @tloop
+@tloop
%t =w phi @loop 3, @next %t1
%r =w rem %p, %t
jnz %r, @next, @loop
- @next
+@next
%t1 =w add 2, %t
%tsq =w mul %t1, %t1
%c0 =w csgt %tsq, %p
jnz %c0, @yes, @tloop
- @yes
+@yes
%n1 =w add 1, %n
%c1 =w ceq 10001, %n1
jnz %c1, @end, @loop
- @end
+@end
storew %p, $a
ret
}
diff --git a/lisc/test/rpo.ssa b/lisc/test/rpo.ssa
@@ -1,12 +1,12 @@
function $test {
- @start
+@start
jmp @foo
- @baz
+@baz
jnz 1, @end, @foo
- @bar
+@bar
jmp @end
- @foo
+@foo
jnz 0, @bar, @baz
- @end
+@end
ret
}
diff --git a/lisc/test/spill.ssa b/lisc/test/spill.ssa
@@ -10,7 +10,7 @@
#
function $test {
- @start
+@start
%f =w copy 0 # here
%b =w copy 1
%c =w copy 2
diff --git a/lisc/test/spill1.ssa b/lisc/test/spill1.ssa
@@ -1,7 +1,7 @@
# stupid spilling test
function $test {
- @start
+@start
%x1 =w copy 10
%x2 =w add %x1, %x1
%x3 =w sub %x2, %x1
diff --git a/lisc/test/spill2.ssa b/lisc/test/spill2.ssa
@@ -5,11 +5,11 @@
# adapt it!
function $test {
- @start
+@start
%a =w copy 0
%b =w copy 0
- @loop
+@loop
%c =w phi @start 0, @loop %f
%d =w phi @start 0, @loop %g
%e =w phi @start 0, @loop %h
@@ -19,6 +19,6 @@ function $test {
%x =w csle %a, %b
jnz %x, @loop, @end
- @end
+@end
ret
}