diff options
Diffstat (limited to 'powerpc')
-rw-r--r-- | powerpc/AsmToJSON.ml | 18 | ||||
-rw-r--r-- | powerpc/Asmexpand.ml | 4 | ||||
-rw-r--r-- | powerpc/TargetPrinter.ml | 58 |
3 files changed, 40 insertions, 40 deletions
diff --git a/powerpc/AsmToJSON.ml b/powerpc/AsmToJSON.ml index dd7306fc..3d28c102 100644 --- a/powerpc/AsmToJSON.ml +++ b/powerpc/AsmToJSON.ml @@ -177,12 +177,12 @@ let p_instruction oc ic = | Pandi_ (ir1,ir2,c) -> instruction "Pandi_" [Ireg ir1; Ireg ir2; Constant c] | Pandis_ (ir1,ir2,c) -> instruction "Pandis_" [Ireg ir1; Ireg ir2; Constant c] | Pb l -> instruction "Pb" [ALabel l] - | Pbctr _ -> instruction "Pbctr" [] - | Pbctrl _ -> instruction "Pbctrl" [] + | Pbctr s -> instruction "Pbctr" [] + | Pbctrl s -> instruction "Pbctrl" [] | Pbdnz l -> instruction "Pbdnz" [ALabel l] | Pbf (cr,l) -> instruction "Pbf" [Crbit cr; ALabel l] - | Pbl (i,_) -> instruction "Pbl" [Atom i] - | Pbs (i,_) -> instruction "Pbs" [Atom i] + | Pbl (i,s) -> instruction "Pbl" [Atom i] + | Pbs (i,s) -> instruction "Pbs" [Atom i] | Pblr -> instruction "Pblr" [] | Pbt (cr,l) -> instruction "Pbt" [Crbit cr; ALabel l] | Pbtbl (i,lb) -> instruction "Pbtbl" ((Ireg i)::(List.map (fun a -> ALabel a) lb)) @@ -208,13 +208,13 @@ let p_instruction oc ic = | Pextsb (ir1,ir2) -> instruction "Pextsb" [Ireg ir1; Ireg ir2] | Pextsh (ir1,ir2) -> instruction "Pextsh" [Ireg ir1; Ireg ir2] | Pextsw (ir1,ir2) -> instruction "Pextsw" [Ireg ir1; Ireg ir2] - | Pfreeframe _ -> assert false (* Should not occur *) + | Pfreeframe (c,i) -> assert false (* Should not occur *) | Pfabs (fr1,fr2) | Pfabss (fr1,fr2) -> instruction "Pfabs" [Freg fr1; Freg fr2] | Pfadd (fr1,fr2,fr3) -> instruction "Pfadd" [Freg fr1; Freg fr2; Freg fr3] | Pfadds (fr1,fr2,fr3) -> instruction "Pfadds" [Freg fr1; Freg fr2; Freg fr3] | Pfcmpu (fr1,fr2) -> instruction "Pfcmpu" [Freg fr1; Freg fr2] - | Pfcfi _ -> () (* Should not occur *) + | Pfcfi (ir,fr) -> () (* Should not occur *) | Pfcfid (fr1,fr2) -> instruction "Pfcfid" [Freg fr1; Freg fr2] | Pfcfiu _ (* Should not occur *) | Pfcti _ (* Should not occur *) @@ -224,14 +224,14 @@ let p_instruction oc ic = | Pfctiwz (fr1,fr2) -> instruction "Pfctiwz" [Freg fr1; Freg fr2] | Pfdiv (fr1,fr2,fr3) -> instruction "Pfdiv" [Freg fr1; Freg fr2; Freg fr3] | Pfdivs (fr1,fr2,fr3) -> instruction "Pfdivs" [Freg fr1; Freg fr2; Freg fr3] - | Pfmake _ -> ()(* Should not occur *) + | Pfmake (fr,ir1,ir2) -> ()(* Should not occur *) | Pfmr (fr1,fr2) -> instruction "Pfmr" [Freg fr1; Freg fr2] | Pfmul (fr1,fr2,fr3) -> instruction "Pfmul" [Freg fr1; Freg fr2; Freg fr3] | Pfmuls(fr1,fr2,fr3) -> instruction "Pfmuls" [Freg fr1; Freg fr2; Freg fr3] | Pfneg (fr1,fr2) | Pfnegs (fr1,fr2) -> instruction "Pfneg" [Freg fr1; Freg fr2] | Pfrsp (fr1,fr2) -> instruction "Pfrsp" [Freg fr1; Freg fr2] - | Pfxdp _ -> () (* Should not occur *) + | Pfxdp (fr1,fr2) -> () (* Should not occur *) | Pfsub (fr1,fr2,fr3) -> instruction "Pfsub" [Freg fr1; Freg fr2; Freg fr3] | Pfsubs (fr1,fr2,fr3) -> instruction "Pfsubs" [Freg fr1; Freg fr2; Freg fr3] | Pfmadd (fr1,fr2,fr3,fr4) -> instruction "Pfmadd" [Freg fr1; Freg fr2; Freg fr3; Freg fr4] @@ -271,7 +271,7 @@ let p_instruction oc ic = | Plwbrx (ir1,ir2,ir3) -> instruction "Plwbrx" [Ireg ir1; Ireg ir2; Ireg ir3] | Pmbar c -> instruction "Pmbar" [Constant (Cint c)] | Pmfcr ir -> instruction "Pmfcr" [Ireg ir] - | Pmfcrbit _ -> () (* Should not occur *) + | Pmfcrbit (ir,crb) -> () (* Should not occur *) | Pmflr ir -> instruction "Pmflr" [Ireg ir] | Pmr (ir1,ir2) -> instruction "Pmr" [Ireg ir1; Ireg ir2] | Pmtctr ir -> instruction "Pmtctr" [Ireg ir] diff --git a/powerpc/Asmexpand.ml b/powerpc/Asmexpand.ml index a6795030..86b74ab1 100644 --- a/powerpc/Asmexpand.ml +++ b/powerpc/Asmexpand.ml @@ -120,7 +120,7 @@ let memcpy_big_arg arg tmp = | _ -> assert false -let expand_builtin_memcpy_big sz _ src dst = +let expand_builtin_memcpy_big sz al src dst = assert (sz >= 4); emit_loadimm GPR0 (Z.of_uint (sz / 4)); emit (Pmtctr GPR0); @@ -721,7 +721,7 @@ let expand_instruction instr = emit (Prlwinm(r1, r1, Z.of_uint (1 + num_crbit bit), _1)) | Pbuiltin(ef, args, res) -> begin match ef with - | EF_builtin(name, _) -> + | EF_builtin(name, sg) -> expand_builtin_inline (camlstring_of_coqstring name) args res | EF_vload chunk -> expand_builtin_vload chunk args res diff --git a/powerpc/TargetPrinter.ml b/powerpc/TargetPrinter.ml index 93d73d5c..99407da7 100644 --- a/powerpc/TargetPrinter.ml +++ b/powerpc/TargetPrinter.ml @@ -229,7 +229,7 @@ module Diab_System : SYSTEM = let name = name_of_section sec in assert (name <> "COMM"); match sec with - | Section_debug_info (Some _) -> + | Section_debug_info (Some s) -> fprintf oc " %s\n" name; fprintf oc " .sectionlink .debug_info\n" | _ -> @@ -239,13 +239,13 @@ module Diab_System : SYSTEM = print_file_line_d2 oc comment file line (* Emit .cfi directives *) - let cfi_startproc _ = () + let cfi_startproc oc = () - let cfi_endproc _ = () + let cfi_endproc oc = () - let cfi_adjust _ _ = () + let cfi_adjust oc delta = () - let cfi_rel_offset _ _ _ = () + let cfi_rel_offset oc reg ofs = () let debug_section oc sec = match sec with @@ -380,7 +380,7 @@ module Target (System : SYSTEM):TARGET = fprintf oc " addis %a, %a, %a\n" ireg r1 ireg_or_zero r2 constant c | Paddze(r1, r2) -> fprintf oc " addze %a, %a\n" ireg r1 ireg r2 - | Pallocframe _ -> + | Pallocframe(sz, ofs, _) -> assert false | Pand_(r1, r2, r3) -> fprintf oc " and. %a, %a, %a\n" ireg r1 ireg r2 ireg r3 @@ -392,9 +392,9 @@ module Target (System : SYSTEM):TARGET = fprintf oc " andis. %a, %a, %a\n" ireg r1 ireg r2 constant c | Pb lbl -> fprintf oc " b %a\n" label (transl_label lbl) - | Pbctr _ -> + | Pbctr sg -> fprintf oc " bctr\n" - | Pbctrl _ -> + | Pbctrl sg -> fprintf oc " bctrl\n" | Pbdnz lbl -> fprintf oc " bdnz %a\n" label (transl_label lbl) @@ -409,9 +409,9 @@ module Target (System : SYSTEM):TARGET = fprintf oc " b %a\n" label (transl_label lbl); fprintf oc "%a:\n" label next end - | Pbl(s, _) -> + | Pbl(s, sg) -> fprintf oc " bl %a\n" symbol s - | Pbs(s, _) -> + | Pbs(s, sg) -> fprintf oc " b %a\n" symbol s | Pblr -> fprintf oc " blr\n" @@ -483,7 +483,7 @@ module Target (System : SYSTEM):TARGET = fprintf oc " extsh %a, %a\n" ireg r1 ireg r2 | Pextsw(r1, r2) -> fprintf oc " extsw %a, %a\n" ireg r1 ireg r2 - | Pfreeframe _ -> + | Pfreeframe(sz, ofs) -> assert false | Pfabs(r1, r2) | Pfabss(r1, r2) -> fprintf oc " fabs %a, %a\n" freg r1 freg r2 @@ -493,17 +493,17 @@ module Target (System : SYSTEM):TARGET = fprintf oc " fadds %a, %a, %a\n" freg r1 freg r2 freg r3 | Pfcmpu(r1, r2) -> fprintf oc " fcmpu %a, %a, %a\n" creg 0 freg r1 freg r2 - | Pfcfi _ -> + | Pfcfi(r1, r2) -> assert false | Pfcfid(r1, r2) -> fprintf oc " fcfid %a, %a\n" freg r1 freg r2 - | Pfcfiu _ -> + | Pfcfiu(r1, r2) -> assert false - | Pfcti _ -> + | Pfcti(r1, r2) -> assert false | Pfctidz(r1, r2) -> fprintf oc " fctidz %a, %a\n" freg r1 freg r2 - | Pfctiu _ -> + | Pfctiu(r1, r2) -> assert false | Pfctiw(r1, r2) -> fprintf oc " fctiw %a, %a\n" freg r1 freg r2 @@ -513,7 +513,7 @@ module Target (System : SYSTEM):TARGET = fprintf oc " fdiv %a, %a, %a\n" freg r1 freg r2 freg r3 | Pfdivs(r1, r2, r3) -> fprintf oc " fdivs %a, %a, %a\n" freg r1 freg r2 freg r3 - | Pfmake _ -> + | Pfmake(rd, r1, r2) -> assert false | Pfmr(r1, r2) -> fprintf oc " fmr %a, %a\n" freg r1 freg r2 @@ -525,7 +525,7 @@ module Target (System : SYSTEM):TARGET = fprintf oc " fneg %a, %a\n" freg r1 freg r2 | Pfrsp(r1, r2) -> fprintf oc " frsp %a, %a\n" freg r1 freg r2 - | Pfxdp _ -> + | Pfxdp(r1, r2) -> assert false | Pfsub(r1, r2, r3) -> fprintf oc " fsub %a, %a, %a\n" freg r1 freg r2 freg r3 @@ -603,7 +603,7 @@ module Target (System : SYSTEM):TARGET = fprintf oc " mbar %ld\n" (camlint_of_coqint mo) | Pmfcr(r1) -> fprintf oc " mfcr %a\n" ireg r1 - | Pmfcrbit _ -> + | Pmfcrbit(r1, bit) -> assert false | Pmflr(r1) -> fprintf oc " mflr %a\n" ireg r1 @@ -719,13 +719,13 @@ module Target (System : SYSTEM):TARGET = fprintf oc "%a:\n" label (transl_label lbl) | Pbuiltin(ef, args, res) -> begin match ef with - | EF_annot(txt, _) -> + | EF_annot(txt, targs) -> fprintf oc "%s annotation: " comment; print_annot_text preg_annot "r1" oc (camlstring_of_coqstring txt) args - | EF_debug(kind, txt, _) -> + | EF_debug(kind, txt, targs) -> print_debug_info comment print_file_line preg_annot "r1" oc (P.to_int kind) (extern_atom txt) args - | EF_inline_asm(txt, sg, _) -> + | EF_inline_asm(txt, sg, clob) -> fprintf oc "%s begin inline assembly\n\t" comment; print_inline_asm preg oc (camlstring_of_coqstring txt) sg args res; fprintf oc "%s end inline assembly\n" comment @@ -750,14 +750,14 @@ module Target (System : SYSTEM):TARGET = PowerPC instructions. We can over-approximate. *) let instr_size = function - | Pbf _ -> 2 - | Pbt _ -> 2 - | Pbtbl _ -> 5 - | Plfi _ -> 2 - | Plfis _ -> 2 - | Plabel _-> 0 - | Pbuiltin ((EF_annot _ | EF_debug _), _, _) -> 0 - | Pbuiltin _ -> 3 + | Pbf(bit, lbl) -> 2 + | Pbt(bit, lbl) -> 2 + | Pbtbl(r, tbl) -> 5 + | Plfi(r1, c) -> 2 + | Plfis(r1, c) -> 2 + | Plabel lbl -> 0 + | Pbuiltin((EF_annot _ | EF_debug _), args, res) -> 0 + | Pbuiltin(ef, args, res) -> 3 | Pcfi_adjust _ | Pcfi_rel_offset _ -> 0 | _ -> 1 |