aboutsummaryrefslogtreecommitdiffstats
path: root/powerpc/PrintAsm.ml
diff options
context:
space:
mode:
authorxleroy <xleroy@fca1b0fc-160b-0410-b1d3-a4f43f01ea2e>2011-04-16 08:20:45 +0000
committerxleroy <xleroy@fca1b0fc-160b-0410-b1d3-a4f43f01ea2e>2011-04-16 08:20:45 +0000
commitabb6fbfe333173acfeeb9304f9c529778e58ff1c (patch)
treed30ab1346fd80d006943e0d9c81264bac17f161c /powerpc/PrintAsm.ml
parent12696ae9f6c34aaffc668711d96beda51a783832 (diff)
downloadcompcert-abb6fbfe333173acfeeb9304f9c529778e58ff1c.tar.gz
compcert-abb6fbfe333173acfeeb9304f9c529778e58ff1c.zip
Preliminary support for 'aligned' and 'section' attributes, gcc-style. New-style handling of sections for IA32 and ARM. Work in progress, to be tested.
git-svn-id: https://yquem.inria.fr/compcert/svn/compcert/trunk@1635 fca1b0fc-160b-0410-b1d3-a4f43f01ea2e
Diffstat (limited to 'powerpc/PrintAsm.ml')
-rw-r--r--powerpc/PrintAsm.ml14
1 files changed, 10 insertions, 4 deletions
diff --git a/powerpc/PrintAsm.ml b/powerpc/PrintAsm.ml
index c0f9294e..71d73c0b 100644
--- a/powerpc/PrintAsm.ml
+++ b/powerpc/PrintAsm.ml
@@ -192,9 +192,12 @@ let name_of_section_MacOS = function
| Section_const -> ".const"
| Section_small_const -> ".const"
| Section_string -> ".const"
- | Section_literal -> ".const_data"
- | Section_jumptable -> ".text"
- | Section_user _ -> assert false
+ | Section_literal -> ".literal8"
+ | Section_jumptable -> ".const"
+ | Section_user(s, wr, ex) ->
+ sprintf ".section %s, %s, %s"
+ (if wr then "__DATA" else "__TEXT") s
+ (if ex then "regular, pure_instructions" else "regular")
let name_of_section_Linux = function
| Section_text -> ".text"
@@ -479,7 +482,10 @@ let print_instruction oc labels = function
fprintf oc " bt %a, %a\n" crbit bit label (transl_label lbl)
| Pbtbl(r, tbl) ->
let lbl = new_label() in
- fprintf oc "%s begin pseudoinstr btbl(%a, %a)\n" comment ireg r label lbl;
+ fprintf oc "%s begin pseudoinstr btbl(%a)\n comment ireg r;
+ fprintf oc "%s jumptable [ " comment;
+ List.iter (fun l -> fprintf oc "%a " (transl_label l)) tbl;
+ fprintf oc "]\n";
fprintf oc " addis %a, %a, %a\n" ireg GPR12 ireg r label_high lbl;
fprintf oc " lwz %a, %a(%a)\n" ireg GPR12 label_low lbl ireg GPR12;
fprintf oc " mtctr %a\n" ireg GPR12;