diff options
author | Quentin Carbonneaux <quentin.carbonneaux@yale.edu> | 2015-08-16 14:19:54 -0400 |
---|---|---|
committer | Quentin Carbonneaux <quentin.carbonneaux@yale.edu> | 2015-09-15 23:01:31 -0400 |
commit | 7bbd361083db3f08e173bbf384e7369ab5ffee57 (patch) | |
tree | ac03cab8b793006864c97dff7b0fbe91c0129f98 /lisc/test | |
parent | 27f4eae43eebb4990bad59c8becdca41d2fb865d (diff) | |
download | roux-7bbd361083db3f08e173bbf384e7369ab5ffee57.tar.gz |
add the mul instruction
Diffstat (limited to 'lisc/test')
-rw-r--r-- | lisc/test/collatz.ssa | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/lisc/test/collatz.ssa b/lisc/test/collatz.ssa index 9696194..8918c76 100644 --- a/lisc/test/collatz.ssa +++ b/lisc/test/collatz.ssa @@ -32,8 +32,7 @@ jnz %p, @odd, @even @odd - %nn =w add %n0, %n0 # compute %n2 = 3 * %n0 + 1 - %n1 =w add %n0, %nn + %n1 =w mul 3, %n0 # compute %n2 = 3 * %n0 + 1 %n2 =w add %n1, 1 jmp @cloop @@ -42,17 +41,15 @@ jmp @cloop @getmemo - %idx00 =l add %n0, %n0 - %idx0 =l add %idx00, %idx00 - %loc0 =l add %idx0, %mem - %cn0 =w load %loc0 - %c2 =w add %c0, %cn0 + %idx0 =l mul %n0, 4 + %loc0 =l add %idx0, %mem + %cn0 =w load %loc0 + %c2 =w add %c0, %cn0 @endcl %c =w phi @getmemo %c2, @cloop %c0 - %idx10 =l add %n, %n - %idx1 =l add %idx10, %idx10 + %idx1 =l mul %n, 4 %loc1 =l add %idx1, %mem storew %c, %loc1 # memorize the result %n9 =w add 1, %n |