فهرست منبع

use a shift to divide by 2 in collatz

Quentin Carbonneaux 9 سال پیش
والد
کامیت
4ce295adad
1فایلهای تغییر یافته به همراه1 افزوده شده و 1 حذف شده
  1. 1 1
      test/collatz.ssa

+ 1 - 1
test/collatz.ssa

@@ -29,7 +29,7 @@ function $test() {
 	%n2 =w add %n1, 1
 	%n2 =w add %n1, 1
 	jmp @cloop
 	jmp @cloop
 @even
 @even
-	%n3 =w div %n0, 2
+	%n3 =w shr %n0, 1
 	jmp @cloop
 	jmp @cloop
 @getmemo                     # get the count for n0 in mem
 @getmemo                     # get the count for n0 in mem
 	%n0l =l extsw %n0
 	%n0l =l extsw %n0