Ajout qq trucs
This commit is contained in:
parent
4021911ba8
commit
57f67d98e6
1 changed files with 11 additions and 10 deletions
|
@ -438,9 +438,9 @@ module InstructionSelector : InstructionSelector = struct
|
||||||
;;
|
;;
|
||||||
|
|
||||||
let mov ~(dst : dst) ~(src : src) =
|
let mov ~(dst : dst) ~(src : src) =
|
||||||
|
match src, dst with
|
||||||
(* Si les sources sont égaux (même adresse ou même registre),
|
(* Si les sources sont égaux (même adresse ou même registre),
|
||||||
on ne bouge rien *)
|
on ne bouge rien *)
|
||||||
match src, dst with
|
|
||||||
| `Reg x, `Reg y when x = y -> []
|
| `Reg x, `Reg y when x = y -> []
|
||||||
| `Addr x, `Addr y when x = y -> []
|
| `Addr x, `Addr y when x = y -> []
|
||||||
(* Si au moins un des deux est un accès mémoire,
|
(* Si au moins un des deux est un accès mémoire,
|
||||||
|
@ -462,13 +462,13 @@ module InstructionSelector : InstructionSelector = struct
|
||||||
;;
|
;;
|
||||||
|
|
||||||
let add ~dst ~srcl ~srcr =
|
let add ~dst ~srcl ~srcr =
|
||||||
(* TODO *)
|
(* Addition *)
|
||||||
failwith "Students! This is your job! (add)"
|
move_execute addq ~dst ~srcl ~srcr
|
||||||
;;
|
;;
|
||||||
|
|
||||||
let sub ~dst ~srcl ~srcr =
|
let sub ~dst ~srcl ~srcr =
|
||||||
(* Soustraction *)
|
(* Soustraction *)
|
||||||
move_execute imulq ~dst ~srcl ~srcr
|
move_execute subq ~dst ~srcl ~srcr
|
||||||
;;
|
;;
|
||||||
|
|
||||||
let mul ~dst ~srcl ~srcr =
|
let mul ~dst ~srcl ~srcr =
|
||||||
|
@ -482,13 +482,13 @@ module InstructionSelector : InstructionSelector = struct
|
||||||
;;
|
;;
|
||||||
|
|
||||||
let andl ~dst ~srcl ~srcr =
|
let andl ~dst ~srcl ~srcr =
|
||||||
(* TODO *)
|
(* ET *)
|
||||||
failwith "Students! This is your job! (andl)"
|
move_execute andq ~dst ~srcl ~srcr
|
||||||
;;
|
;;
|
||||||
|
|
||||||
let orl ~dst ~srcl ~srcr =
|
let orl ~dst ~srcl ~srcr =
|
||||||
(* TODO *)
|
(* OU *)
|
||||||
failwith "Students! This is your job! (orl)"
|
move_execute orq ~dst ~srcl ~srcr
|
||||||
;;
|
;;
|
||||||
|
|
||||||
let conditional_jump ~cc ~srcl ~srcr ~ll ~lr =
|
let conditional_jump ~cc ~srcl ~srcr ~ll ~lr =
|
||||||
|
@ -549,8 +549,9 @@ module FrameManager (IS : InstructionSelector) : FrameManager = struct
|
||||||
;;
|
;;
|
||||||
|
|
||||||
let call fd ~kind ~f ~args =
|
let call fd ~kind ~f ~args =
|
||||||
(* TODO *)
|
(* TODO: je segfault.. *)
|
||||||
failwith "Students! This is your job! (call)"
|
(* Appelle la fonction *)
|
||||||
|
[ T.Instruction (T.calldi ~tgt:f) ]
|
||||||
;;
|
;;
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Reference in a new issue