summaryrefslogtreecommitdiff
path: root/source
diff options
context:
space:
mode:
authorPaweł Dybiec <pdybiec@stud.cs.uni.wroc.pl>2019-01-28 00:01:14 +0100
committerPaweł Dybiec <pdybiec@stud.cs.uni.wroc.pl>2019-01-28 00:01:14 +0100
commit7dc538086db713e6c0518a2ecaa64a12ed845fe1 (patch)
treed36906c580f82af964bcea376f3a619791891d1c /source
parentUse folding module (diff)
Support for mov instructionmain
Diffstat (limited to 'source')
-rw-r--r--source/mod_student/constant_folding_analysis.ml1
1 files changed, 1 insertions, 0 deletions
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))