diff options
author | Quentin Carbonneaux <quentin.carbonneaux@yale.edu> | 2015-10-23 17:44:38 -0400 |
---|---|---|
committer | Quentin Carbonneaux <quentin.carbonneaux@yale.edu> | 2015-10-30 13:20:42 -0400 |
commit | 47a34dbd510ff890c4016d12ec8fbeaf5ae6e9c3 (patch) | |
tree | 4ed6b8e83e269dc48fafe5701a552c03c853651c /lisc/test | |
parent | 6d264a2594d286fb513ff89afc6b984033ee4cda (diff) | |
download | roux-47a34dbd510ff890c4016d12ec8fbeaf5ae6e9c3.tar.gz |
turn sum.ssa more C style
Diffstat (limited to 'lisc/test')
-rw-r--r-- | lisc/test/sum.ssa | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/lisc/test/sum.ssa b/lisc/test/sum.ssa index 0f8a793..3578dd7 100644 --- a/lisc/test/sum.ssa +++ b/lisc/test/sum.ssa @@ -2,19 +2,18 @@ function w $sum(l %arr, w %num) { @start - %n0 =w sub %num, 1 @loop - %n1 =w phi @start %n0, @loop1 %n2 + %n1 =w phi @start %num, @loop1 %n2 %s0 =w phi @start 0, @loop1 %s1 - %c =w cslt %n1, 0 + %n2 =w sub %n1, 1 + %c =w csle %n1, 0 jnz %c, @end, @loop1 @loop1 - %idx0 =l extuw %n1 + %idx0 =l extuw %n2 %idx1 =l mul 4, %idx0 %idx2 =l add %idx1, %arr %w =w loadw %idx2 %s1 =w add %w, %s0 - %n2 =w sub %n1, 1 jmp @loop @end ret %s0 |