bin
This commit is contained in:
parent
4db39f807f
commit
fba41fee18
1 changed files with 7 additions and 11 deletions
|
@ -452,28 +452,24 @@ module InstructionSelector : InstructionSelector = struct
|
|||
| _ -> execute ~dst (movq ~src)
|
||||
;;
|
||||
|
||||
let move_execute f ~dst ~srcl ~srcr =
|
||||
mov ~src:srcr ~dst:r15 @ execute ~dst (f ~src:srcl)
|
||||
;;
|
||||
|
||||
let bin ins ~dst ~srcl ~srcr =
|
||||
(* TODO *)
|
||||
failwith "Students! This is your job! (bin)"
|
||||
(* Opération binaire *)
|
||||
mov ~src:srcr ~dst:r15 @ execute ~dst (ins ~src:srcl)
|
||||
;;
|
||||
|
||||
let add ~dst ~srcl ~srcr =
|
||||
(* Addition *)
|
||||
move_execute addq ~dst ~srcl ~srcr
|
||||
bin addq ~dst ~srcl ~srcr
|
||||
;;
|
||||
|
||||
let sub ~dst ~srcl ~srcr =
|
||||
(* Soustraction *)
|
||||
move_execute subq ~dst ~srcl:srcr ~srcr:srcl
|
||||
bin subq ~dst ~srcl:srcr ~srcr:srcl
|
||||
;;
|
||||
|
||||
let mul ~dst ~srcl ~srcr =
|
||||
(* Multiplication *)
|
||||
move_execute imulq ~dst ~srcl ~srcr
|
||||
bin imulq ~dst ~srcl ~srcr
|
||||
;;
|
||||
|
||||
let div ~dst ~srcl ~srcr =
|
||||
|
@ -489,12 +485,12 @@ module InstructionSelector : InstructionSelector = struct
|
|||
|
||||
let andl ~dst ~srcl ~srcr =
|
||||
(* ET *)
|
||||
move_execute andq ~dst ~srcl ~srcr
|
||||
bin andq ~dst ~srcl ~srcr
|
||||
;;
|
||||
|
||||
let orl ~dst ~srcl ~srcr =
|
||||
(* OU *)
|
||||
move_execute orq ~dst ~srcl ~srcr
|
||||
bin orq ~dst ~srcl ~srcr
|
||||
;;
|
||||
|
||||
let conditional_jump ~cc ~srcl ~srcr ~ll ~lr =
|
||||
|
|
Reference in a new issue