Skip to content

Instantly share code, notes, and snippets.

Created September 21, 2010 18:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/590149 to your computer and use it in GitHub Desktop.
Save anonymous/590149 to your computer and use it in GitHub Desktop.
pmichaud@plum:~/parrot/trunk$ diff -u fib.pir fib-lex.pir
--- fib.pir 2010-09-21 12:57:35.000000000 -0500
+++ fib-lex.pir 2010-09-21 13:02:51.000000000 -0500
@@ -85,18 +85,15 @@
set $N20, $P19
islt $I21, $N20, 2.0
if $I21, if_18
- find_lex $P23, "$n"
- sub $P24, $P23, 1
+ sub $P24, $P19, 1
$P25 = "fib"($P24)
- find_lex $P26, "$n"
- sub $P27, $P26, 2
+ sub $P27, $P19, 2
$N28 = "fib"($P27)
add $P29, $P25, $N28
set $P17, $P29
goto if_18_end
if_18:
- find_lex $P22, "$n"
- set $P17, $P22
+ set $P17, $P19
if_18_end:
.annotate 'line', 3
.return ($P17)
pmichaud@plum:~/parrot/trunk$ ./parrot fib.pir
fib(29) = 514229
time = 3.51273202896118
pmichaud@plum:~/parrot/trunk$ ./parrot fib-lex.pir
fib(29) = 514229
time = 3.15895199775696
pmichaud@plum:~/parrot/trunk$
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment