$NetBSD$ --- asmcomp/power/emit.mlp.orig 2007-05-10 18:41:12.000000000 +0200 +++ asmcomp/power/emit.mlp @@ -825,6 +825,30 @@ let rec emit_all i = emit_instr i None; emit_all i.next +(* Emission of the profiling prelude *) + +let emit_profile () = + match Config.system with + "bsd" -> + ` stwu 1, -32(1)\n`; + ` mflr 0\n`; + ` stw 0, 4(1)\n`; + ` stw 2, 8(1)\n`; + ` stw 3, 12(1)\n`; + ` stw 4, 16(1)\n`; + ` stw 5, 20(1)\n`; + ` stw 6, 24(1)\n`; + ` stw 7, 28(1)\n`; + ` bl {emit_symbol "_mcount"}\n`; + ` lwz 2, 8(1)\n`; + ` lwz 3, 12(1)\n`; + ` lwz 4, 16(1)\n`; + ` lwz 5, 20(1)\n`; + ` lwz 6, 24(1)\n`; + ` lwz 7, 28(1)\n`; + ` addic 1, 1, 32\n`; + | _ -> () (*unsupported yet*) + (* Emission of a function declaration *) let fundecl fundecl =