From 66c374b28f9ddb67c4f86782b2970757198741ce Mon Sep 17 00:00:00 2001 From: Mylloon Date: Sun, 31 Dec 2023 14:30:16 +0100 Subject: [PATCH] newlines --- flap/src/x86-64/retrolixToX86_64.ml | 75 +++++++++++++++++++++++------ 1 file changed, 60 insertions(+), 15 deletions(-) diff --git a/flap/src/x86-64/retrolixToX86_64.ml b/flap/src/x86-64/retrolixToX86_64.ml index 48a92cb..4b30924 100644 --- a/flap/src/x86-64/retrolixToX86_64.ml +++ b/flap/src/x86-64/retrolixToX86_64.ml @@ -426,16 +426,55 @@ end module InstructionSelector : InstructionSelector = struct open T - let mov ~(dst : dst) ~(src : src) = failwith "Students! This is your job!" - let bin ins ~dst ~srcl ~srcr = failwith "Students! This is your job!" - let add ~dst ~srcl ~srcr = failwith "Students! This is your job!" - let sub ~dst ~srcl ~srcr = failwith "Students! This is your job!" - let mul ~dst ~srcl ~srcr = failwith "Students! This is your job!" - let div ~dst ~srcl ~srcr = failwith "Students! This is your job!" - let andl ~dst ~srcl ~srcr = failwith "Students! This is your job!" - let orl ~dst ~srcl ~srcr = failwith "Students! This is your job!" - let conditional_jump ~cc ~srcl ~srcr ~ll ~lr = failwith "Students! This is your job!" - let switch ?default ~discriminant ~cases () = failwith "Students! This is your job!" + let mov ~(dst : dst) ~(src : src) = + (* TODO *) + failwith "Students! This is your job!" + ;; + + let bin ins ~dst ~srcl ~srcr = + (* TODO *) + failwith "Students! This is your job!" + ;; + + let add ~dst ~srcl ~srcr = + (* TODO *) + failwith "Students! This is your job!" + ;; + + let sub ~dst ~srcl ~srcr = + (* TODO *) + failwith "Students! This is your job!" + ;; + + let mul ~dst ~srcl ~srcr = + (* TODO *) + failwith "Students! This is your job!" + ;; + + let div ~dst ~srcl ~srcr = + (* TODO *) + failwith "Students! This is your job!" + ;; + + let andl ~dst ~srcl ~srcr = + (* TODO *) + failwith "Students! This is your job!" + ;; + + let orl ~dst ~srcl ~srcr = + (* TODO *) + failwith "Students! This is your job!" + ;; + + let conditional_jump ~cc ~srcl ~srcr ~ll ~lr = + (* TODO *) + failwith "Students! This is your job!" + ;; + + let switch ?default ~discriminant ~cases () = + (* TODO *) + failwith "Students! This is your job!" + ;; end module FrameManager (IS : InstructionSelector) : FrameManager = struct @@ -461,23 +500,29 @@ module FrameManager (IS : InstructionSelector) : FrameManager = struct ;; let frame_descriptor ~params ~locals = - (* Student! Implement me! *) + (* TODO: Student! Implement me! *) { param_count = 0; locals_space = 0; stack_map = S.IdMap.empty } ;; - let location_of fd id = failwith "Students! This is your job!" + let location_of fd id = + (* TODO *) + failwith "Students! This is your job!" + ;; let function_prologue fd = - (* Student! Implement me! *) + (* TODO: Student! Implement me! *) [] ;; let function_epilogue fd = - (* Student! Implement me! *) + (* TODO: Student! Implement me! *) [] ;; - let call fd ~kind ~f ~args = failwith "Students! This is your job!" + let call fd ~kind ~f ~args = + (* TODO *) + failwith "Students! This is your job!" + ;; end module CG = Codegen (InstructionSelector) (FrameManager (InstructionSelector))