Просмотр исходного кода

Assembly printer now prints opimized load instructions

Taddeus Kroes 12 лет назад
Родитель
Сommit
494df9d5b5
2 измененных файлов с 2 добавлено и 1 удалено
  1. 0 1
      README.md
  2. 2 0
      phases/print.ml

+ 0 - 1
README.md

@@ -11,7 +11,6 @@ Issues & TODO
   reading from stdin.
 - Documentation for each phase, in ocamldoc format.
 - Create automated testsuite runner.
-- Assembly printer should print optimized instructions.
 - Erronous array initialisation needs more insightfull error messages and array
   assignment needs better better type checking.
 - Typechecking now gives an error when integers are not in the 32-bit range, as

+ 2 - 0
phases/print.ml

@@ -72,6 +72,8 @@ let rec instr2str = function
         tab ^ prefix ctype ^ "store" ^ suffix scope ^ " " ^ si index
 
     (* Load *)
+    | Load (ctype, Current, index) when index >= 0 & index <= 3 ->
+        tab ^ prefix ctype ^ "load_" ^ si index
     | Load (ctype, scope, index) ->
         tab ^ prefix ctype ^ "load" ^ suffix scope ^ " " ^ si index
     | LoadConst (ctype, index) ->