diff options
author | xleroy <xleroy@fca1b0fc-160b-0410-b1d3-a4f43f01ea2e> | 2014-01-02 15:59:11 +0000 |
---|---|---|
committer | xleroy <xleroy@fca1b0fc-160b-0410-b1d3-a4f43f01ea2e> | 2014-01-02 15:59:11 +0000 |
commit | 29e0c9b2c99a437fc9dfab66e1abdd546a5308d6 (patch) | |
tree | 2c3e924125d9b91e5e9b57b87c80f5b5ce9c6710 /arm/PrintAsm.ml | |
parent | c71e155dbbf34fa17d14e8eee50a019c8ccfd6f5 (diff) | |
download | compcert-29e0c9b2c99a437fc9dfab66e1abdd546a5308d6.tar.gz compcert-29e0c9b2c99a437fc9dfab66e1abdd546a5308d6.zip |
Updated ARM backend wrt new static analyses and optimizations.
NeedOp, Deadcode: must have distinct needs per argument of an operator.
This change remains to be propagated to IA32 and PPC.
git-svn-id: https://yquem.inria.fr/compcert/svn/compcert/trunk@2399 fca1b0fc-160b-0410-b1d3-a4f43f01ea2e
Diffstat (limited to 'arm/PrintAsm.ml')
-rw-r--r-- | arm/PrintAsm.ml | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/arm/PrintAsm.ml b/arm/PrintAsm.ml index 6398ba3b..99dfa467 100644 --- a/arm/PrintAsm.ml +++ b/arm/PrintAsm.ml @@ -106,9 +106,9 @@ let movimm oc dst n = match Asmgen.decompose_int n with | [] -> assert false | hd::tl as l -> - fprintf oc " mov %s, #%a\n" dst coqint hd + fprintf oc " mov %s, #%a\n" dst coqint hd; List.iter - (fun n -> fprintf oc " orr %s, %s, #%a" dst dst coqint n) + (fun n -> fprintf oc " orr %s, %s, #%a\n" dst dst coqint n) tl; List.length l @@ -116,9 +116,9 @@ let addimm oc dst src n = match Asmgen.decompose_int n with | [] -> assert false | hd::tl as l -> - fprintf oc " add %s, %s, #%a\n" dst src coqint hd + fprintf oc " add %s, %s, #%a\n" dst src coqint hd; List.iter - (fun n -> fprintf oc " add %s, %s, #%a" dst dst coqint n) + (fun n -> fprintf oc " add %s, %s, #%a\n" dst dst coqint n) tl; List.length l @@ -126,9 +126,9 @@ let subimm oc dst src n = match Asmgen.decompose_int n with | [] -> assert false | hd::tl as l -> - fprintf oc " sub %s, %s, #%a\n" dst src coqint hd + fprintf oc " sub %s, %s, #%a\n" dst src coqint hd; List.iter - (fun n -> fprintf oc " sub %s, %s, #%a" dst dst coqint n) + (fun n -> fprintf oc " sub %s, %s, #%a\n" dst dst coqint n) tl; List.length l @@ -425,7 +425,7 @@ let print_builtin_va_start oc r = Int32.add (next_arg_location 0 0 (!current_function_sig).sig_args) !current_function_stacksize in - let n = addimm oc "r14" "sp" (coqint_of_camlint ofs); + let n = addimm oc "r14" "sp" (coqint_of_camlint ofs) in fprintf oc " str r14, [%a, #0]\n" ireg r; n + 1 @@ -716,10 +716,10 @@ let print_instruction oc = function fprintf oc " mov r12, sp\n"; if (!current_function_sig).sig_cc.cc_vararg then begin fprintf oc " push {r0, r1, r2, r3}\n"; - cfi_adjust oc 16 + cfi_adjust oc 16l end; let sz' = camlint_of_coqint sz in - let ninstr = subimm "sp" "sp" sz in + let ninstr = subimm oc "sp" "sp" sz in cfi_adjust oc sz'; fprintf oc " str r12, [sp, #%a]\n" coqint ofs; current_function_stacksize := sz'; @@ -727,7 +727,7 @@ let print_instruction oc = function | Pfreeframe(sz, ofs) -> let sz = if (!current_function_sig).sig_cc.cc_vararg - then coqint_of_camlint (Int32.add 16l (camlint_of_coqint sz) + then coqint_of_camlint (Int32.add 16l (camlint_of_coqint sz)) else sz in if Asmgen.is_immed_arith sz then fprintf oc " add sp, sp, #%a\n" coqint sz @@ -805,6 +805,7 @@ let rec print_instructions oc instrs = let print_function oc name fn = Hashtbl.clear current_function_labels; reset_constants(); + current_function_sig := fn.fn_sig; currpos := 0; let text = match C2C.atom_sections name with |