diff options
author | xleroy <xleroy@fca1b0fc-160b-0410-b1d3-a4f43f01ea2e> | 2010-05-26 11:59:09 +0000 |
---|---|---|
committer | xleroy <xleroy@fca1b0fc-160b-0410-b1d3-a4f43f01ea2e> | 2010-05-26 11:59:09 +0000 |
commit | f0db487d8c8798b9899be03bf65bcb12524b9186 (patch) | |
tree | aa9c57edf987fed973dfebd0de067be7bcdb089c /powerpc/PrintAsm.ml | |
parent | ee8556f646ac19726f012fff78fffdee39f5be63 (diff) | |
download | compcert-f0db487d8c8798b9899be03bf65bcb12524b9186.tar.gz compcert-f0db487d8c8798b9899be03bf65bcb12524b9186.zip |
Updated Caml parts to match new representation for global variables.
*/PrintAsm.ml: watch out for large stack frames in Pallocframe.
git-svn-id: https://yquem.inria.fr/compcert/svn/compcert/trunk@1349 fca1b0fc-160b-0410-b1d3-a4f43f01ea2e
Diffstat (limited to 'powerpc/PrintAsm.ml')
-rw-r--r-- | powerpc/PrintAsm.ml | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/powerpc/PrintAsm.ml b/powerpc/PrintAsm.ml index 1fdb1a91..6ef0083e 100644 --- a/powerpc/PrintAsm.ml +++ b/powerpc/PrintAsm.ml @@ -401,10 +401,16 @@ let print_instruction oc labels = function and hi = camlint_of_coqint hi and ofs = camlint_of_coqint ofs in let sz = Int32.sub hi lo in - (* Keep stack 16-aligned *) - let sz16 = Int32.logand (Int32.add sz 15l) 0xFFFF_FFF0l in assert (ofs = 0l); - fprintf oc " stwu %a, %ld(%a)\n" ireg GPR1 (Int32.neg sz16) ireg GPR1 + (* Keep stack 16-aligned *) + let adj = Int32.neg (Int32.logand (Int32.add sz 15l) 0xFFFF_FFF0l) in + if adj >= -0x8000l then + fprintf oc " stwu %a, %ld(%a)\n" ireg GPR1 adj ireg GPR1 + else begin + fprintf oc " addis %a, 0, %ld\n" ireg GPR12 (Int32.shift_right_logical adj 16); + fprintf oc " ori %a, %a, %ld\n" ireg GPR12 ireg GPR12 (Int32.logand adj 0xFFFFl); + fprintf oc " stwux %a, %a, %a\n" ireg GPR1 ireg GPR1 ireg GPR12 + end | Pand_(r1, r2, r3) -> fprintf oc " and. %a, %a, %a\n" ireg r1 ireg r2 ireg r3 | Pandc(r1, r2, r3) -> @@ -889,12 +895,12 @@ let print_init_data oc name id = else List.iter (print_init oc) id -let print_var oc (Coq_pair(Coq_pair(name, init_data), _)) = - match init_data with +let print_var oc (Coq_pair(name, v)) = + match v.gvar_init with | [] -> () | _ -> let init = - match init_data with [Init_space _] -> false | _ -> true in + match v.gvar_init with [Init_space _] -> false | _ -> true in let sec = Sections.section_for_variable name init and align = @@ -907,7 +913,7 @@ let print_var oc (Coq_pair(Coq_pair(name, init_data), _)) = if not (C2Clight.atom_is_static name) then fprintf oc " .globl %a\n" symbol name; fprintf oc "%a:\n" symbol name; - print_init_data oc name init_data; + print_init_data oc name v.gvar_init; if target <> MacOS then begin fprintf oc " .type %a, @object\n" symbol name; fprintf oc " .size %a, . - %a\n" symbol name symbol name |