summary refs log tree commit diff
diff options
context:
space:
mode:
authorQuentin Carbonneaux <quentin.carbonneaux@yale.edu>2015-11-11 21:21:17 -0500
committerQuentin Carbonneaux <quentin.carbonneaux@yale.edu>2015-11-11 21:21:17 -0500
commitd3f1cd94833b33c2817312dfd67100693987083f (patch)
tree7d6f243b62bbd26bdf46db8e468b76e2dc931da5
parent33a4b128a9486d9cebe33f8c3ae4a5ebca1d4046 (diff)
downloadroux-d3f1cd94833b33c2817312dfd67100693987083f.tar.gz
add new ssa fixing example
-rw-r--r--lisc/test/fix4.ssa28
1 files changed, 28 insertions, 0 deletions
diff --git a/lisc/test/fix4.ssa b/lisc/test/fix4.ssa
new file mode 100644
index 0000000..7ca8e2d
--- /dev/null
+++ b/lisc/test/fix4.ssa
@@ -0,0 +1,28 @@
+function $test() {
+@start
+	%x =w copy 3
+	%n =w copy 2
+@loop
+	%c =w ceq %n, 10000
+	%t =w copy 3
+	jnz %c, @end, @next
+@next
+	%t =w copy 3
+	%x =w add %x, 2
+@tloop
+	%s =w mul %t, %t
+	%c =w csgt %s, %x
+	jnz %c, @prime, @test
+@test
+	%r =w rem %x, %t
+	jnz %r, @tnext, @loop
+@tnext
+	%t =w add %t, 2
+	jmp @tloop
+@prime
+	%n =w add %n, 1
+	jmp @loop
+@end
+	storew %x, $a
+	ret
+}