From 7dc538086db713e6c0518a2ecaa64a12ed845fe1 Mon Sep 17 00:00:00 2001 From: Paweł Dybiec Date: Mon, 28 Jan 2019 00:01:14 +0100 Subject: Support for mov instruction --- source/mod_student/constant_folding_analysis.ml | 1 + 1 file changed, 1 insertion(+) diff --git a/source/mod_student/constant_folding_analysis.ml b/source/mod_student/constant_folding_analysis.ml index 6e0f728..cbe5827 100644 --- a/source/mod_student/constant_folding_analysis.ml +++ b/source/mod_student/constant_folding_analysis.ml @@ -51,6 +51,7 @@ module Make() = struct in let output = match instr with | I_Add (r,l1,l2) -> aux r l1 l2 (fun a b -> Some (Int32.add a b)) + | I_Move (r,l1) -> aux r l1 l1 (fun a b -> Some a) | I_Sub (r,l1,l2) -> aux r l1 l2 (fun a b -> Some (Int32.sub a b)) | I_Div (r,l1,l2) -> aux r l1 l2 (fun a b -> if b=Int32.zero then None else Some(Int32.div a b)) | I_Mul (r,l1,l2) -> aux r l1 l2 (fun a b -> Some (Int32.mul a b)) -- cgit 1.4.1