10/31
This commit is contained in:
parent
579e163f8e
commit
566f8e2d36
1 changed files with 9 additions and 2 deletions
|
@ -492,8 +492,15 @@ module InstructionSelector : InstructionSelector = struct
|
|||
;;
|
||||
|
||||
let conditional_jump ~cc ~srcl ~srcr ~ll ~lr =
|
||||
(* TODO *)
|
||||
failwith "Students! This is your job! (conditional_jump)"
|
||||
(* Déplace src left vers r15 *)
|
||||
[ Instruction (movq ~src:srcl ~dst:r15)
|
||||
(* Compare src right avec r15 (= src left) ***)
|
||||
; Instruction (cmpq ~src1:srcr ~src2:r15)
|
||||
(* Si condition est vrai jump vers le label ll *)
|
||||
; Instruction (jccl ~cc ~tgt:ll)
|
||||
(* Sinon on va jump vers le label lr par défaut *****)
|
||||
; Instruction (jmpl ~tgt:lr)
|
||||
]
|
||||
;;
|
||||
|
||||
let switch ?default ~discriminant ~cases () =
|
||||
|
|
Reference in a new issue