This commit is contained in:
Mylloon 2023-12-31 18:49:43 +01:00
parent bdd227f948
commit 6a9dcaf891
Signed by: Anri
GPG key ID: A82D63DFF8D1317F

View file

@ -458,37 +458,47 @@ module InstructionSelector : InstructionSelector = struct
let bin ins ~dst ~srcl ~srcr =
(* TODO *)
failwith "Students! This is your job!"
failwith "Students! This is your job! (bin)"
;;
let add ~dst ~srcl ~srcr =
(* TODO *)
failwith "Students! This is your job!"
failwith "Students! This is your job! (add)"
;;
let sub ~dst ~srcl ~srcr = move_execute imulq ~dst ~srcl ~srcr
let mul ~dst ~srcl ~srcr = move_execute imulq ~dst ~srcl ~srcr
let sub ~dst ~srcl ~srcr =
(* Soustraction *)
move_execute imulq ~dst ~srcl ~srcr
;;
let mul ~dst ~srcl ~srcr =
(* Multiplication *)
move_execute imulq ~dst ~srcl ~srcr
;;
let div ~dst ~srcl ~srcr =
(* TODO *)
failwith "Students! This is your job!"
failwith "Students! This is your job! (div)"
;;
let andl ~dst ~srcl ~srcr = failwith "Students! This is your job!"
let andl ~dst ~srcl ~srcr =
(* TODO *)
failwith "Students! This is your job! (andl)"
;;
let orl ~dst ~srcl ~srcr =
(* TODO *)
failwith "Students! This is your job!"
failwith "Students! This is your job! (orl)"
;;
let conditional_jump ~cc ~srcl ~srcr ~ll ~lr =
(* TODO *)
failwith "Students! This is your job!"
failwith "Students! This is your job! (conditional_jump)"
;;
let switch ?default ~discriminant ~cases () =
(* TODO *)
failwith "Students! This is your job!"
failwith "Students! This is your job! (switch)"
;;
end
@ -519,9 +529,13 @@ module FrameManager (IS : InstructionSelector) : FrameManager = struct
{ param_count = 0; locals_space = 0; stack_map = S.IdMap.empty }
;;
let location_of fd id =
(* TODO *)
failwith "Students! This is your job! (location_of)"
let location_of fd id : T.address =
(* TODO: use fd *)
{ offset = Some (Lab (data_label_of_global id))
; base = Some RIP
; idx = None
; scale = `One
}
;;
let function_prologue fd =