Utiliser bctrl plutot que blrl, evite de perturber la prediction des adresses de retour sur le G5
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@6129 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02master
parent
cc6da57a45
commit
96b512c1da
|
@ -548,15 +548,15 @@ let rec emit_instr i dslot =
|
|||
if toc then begin
|
||||
` lwz 0, 0({emit_reg i.arg.(0)})\n`;
|
||||
` stw 2, 20(1)\n`;
|
||||
` mtlr 0\n`;
|
||||
` mtctr 0\n`;
|
||||
` lwz 2, 4({emit_reg i.arg.(0)})\n`;
|
||||
record_frame i.live;
|
||||
` blrl\n`;
|
||||
` bctrl\n`;
|
||||
` lwz 2, 20(1)\n`
|
||||
end else begin
|
||||
` mtlr {emit_reg i.arg.(0)}\n`;
|
||||
` mtctr {emit_reg i.arg.(0)}\n`;
|
||||
record_frame i.live;
|
||||
` blrl\n`
|
||||
` bctrl\n`
|
||||
end
|
||||
| Lop(Icall_imm s) ->
|
||||
record_frame i.live;
|
||||
|
@ -605,10 +605,10 @@ let rec emit_instr i dslot =
|
|||
let n = frame_size() in
|
||||
` lwz 12, {emit_label lbl}(2) # {emit_symbol s}\n`;
|
||||
if !contains_calls then begin
|
||||
` lwz 11, {emit_int(n - 4)}(1)\n`;
|
||||
` lwz 0, 0(12)\n`;
|
||||
` lwz 2, 4(12)\n`;
|
||||
` mtctr 0\n`;
|
||||
` lwz 11, {emit_int(n - 4)}(1)\n`;
|
||||
` addi 1, 1, {emit_int n}\n`;
|
||||
` mtlr 11\n`
|
||||
end else begin
|
||||
|
@ -640,8 +640,8 @@ let rec emit_instr i dslot =
|
|||
external_functions := StringSet.add s !external_functions;
|
||||
` addis {emit_gpr 11}, 0, ha16(L{emit_symbol s}$non_lazy_ptr)\n`;
|
||||
` lwz {emit_gpr 11}, lo16(L{emit_symbol s}$non_lazy_ptr)({emit_gpr 11})\n`;
|
||||
` mtlr {emit_gpr 11}\n`;
|
||||
` blrl\n`
|
||||
` mtctr {emit_gpr 11}\n`;
|
||||
` bctrl\n`
|
||||
end else
|
||||
` bl {emit_codesymbol s}\n`
|
||||
end;
|
||||
|
|
|
@ -186,7 +186,7 @@ _caml_c_call:
|
|||
/* Save return address */
|
||||
mflr r25
|
||||
/* Get ready to call C function (address in 11) */
|
||||
mtlr r11
|
||||
mtctr r11
|
||||
/* Record lowest stack address and return address */
|
||||
Storeglobal r1, _caml_bottom_of_stack, r12
|
||||
Storeglobal r25, _caml_last_return_address, r12
|
||||
|
@ -194,7 +194,7 @@ _caml_c_call:
|
|||
Storeglobal r31, _caml_young_ptr, r11
|
||||
Storeglobal r29, _caml_exception_pointer, r11
|
||||
/* Call the function (address in link register) */
|
||||
blrl
|
||||
bctrl
|
||||
/* Restore return address (in 25, preserved by the C function) */
|
||||
mtlr r25
|
||||
/* Reload allocation pointer and allocation limit*/
|
||||
|
@ -303,9 +303,9 @@ L103:
|
|||
li r0, 0
|
||||
Storeglobal r0, _caml_last_return_address, r11
|
||||
/* Call the Caml code */
|
||||
mtlr r12
|
||||
mtctr r12
|
||||
L105:
|
||||
blrl
|
||||
bctrl
|
||||
/* Pop the trap frame, restoring caml_exception_pointer */
|
||||
lwz r9, 4(r1)
|
||||
Storeglobal r9, _caml_exception_pointer, r11
|
||||
|
|
Loading…
Reference in New Issue