div
This commit is contained in:
parent
5a17c4164e
commit
f86829dd3a
1 changed files with 6 additions and 2 deletions
|
@ -477,8 +477,12 @@ module InstructionSelector : InstructionSelector = struct
|
|||
;;
|
||||
|
||||
let div ~dst ~srcl ~srcr =
|
||||
(* TODO *)
|
||||
failwith "Students! This is your job! (div)"
|
||||
(* Division *)
|
||||
let rax = `Reg X86_64_Architecture.RAX in
|
||||
mov ~src:srcl ~dst:rax
|
||||
@ mov ~src:srcr ~dst:r15
|
||||
@ [ Instruction cqto; Instruction (idivq ~src:r15)]
|
||||
@ mov ~dst ~src:rax
|
||||
;;
|
||||
|
||||
let andl ~dst ~srcl ~srcr =
|
||||
|
|
Reference in a new issue