From 96b512c1da80960bde15ec04bd30cf2c93883e82 Mon Sep 17 00:00:00 2001 From: Xavier Leroy Date: Sun, 22 Feb 2004 14:56:25 +0000 Subject: [PATCH] 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-0dff7051ff02 --- asmcomp/power/emit.mlp | 14 +++++++------- asmrun/power-rhapsody.S | 8 ++++---- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/asmcomp/power/emit.mlp b/asmcomp/power/emit.mlp index 4a2a5d035..85a8b7a6f 100644 --- a/asmcomp/power/emit.mlp +++ b/asmcomp/power/emit.mlp @@ -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; diff --git a/asmrun/power-rhapsody.S b/asmrun/power-rhapsody.S index 0d2f252bc..e483c90ad 100644 --- a/asmrun/power-rhapsody.S +++ b/asmrun/power-rhapsody.S @@ -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