Skip to content
Snippets Groups Projects
Commit 784a040f authored by Putegnat Theo's avatar Putegnat Theo
Browse files

Fonction OK

parent 700b9c20
No related branches found
No related tags found
No related merge requests found
......@@ -325,7 +325,7 @@ let ltl_instrs_of_linear_instr fname live_out allocation
| Rcall (rd, callee_fname, rargs) ->
caller_save live_out allocation rargs
>>! fun to_save ->
let (save_a_regs, arg_saved, ofs) =
let (save_regs_instructions, arg_saved, ofs) =
save_caller_save
(List.of_seq (Set.to_seq to_save))
(- (numspilled+1)) in
......@@ -333,14 +333,21 @@ let ltl_instrs_of_linear_instr fname live_out allocation
>>= (fun (pass_param_instr,npush) ->
match rd with
| Some rd ->
OK ( pass_param_instr
@ [LAddi (reg_sp , reg_sp , ofs)]
let instr_for_result_move = make_loc_mov (Reg reg_a0)
(Hashtbl.find allocation rd) in
OK ( save_regs_instructions
@ [LAddi (reg_sp , reg_s0 , (ofs) * Archi.wordsize())]
@ pass_param_instr
@ [LCall callee_fname]
@ [LMov (rd, reg_a0)]
@ instr_for_result_move
@ [LAddi (reg_sp, reg_sp, npush * Archi.wordsize())]
@ (restore_caller_save arg_saved))
| None ->
OK ( pass_param_instr @ [LCall callee_fname]
@ [LAddi (reg_sp , reg_sp , npush)]
OK ( save_regs_instructions
@ [LAddi (reg_sp , reg_s0 , (ofs) * Archi.wordsize())]
@ pass_param_instr
@ [LCall callee_fname]
@ [LAddi (reg_sp , reg_sp , npush * Archi.wordsize())]
@ (restore_caller_save arg_saved)))
| Rret r ->
load_loc reg_tmp1 allocation r >>= fun (l,r) ->
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment