diff options
Diffstat (limited to 'x86')
-rw-r--r-- | x86/Asm.v | 2 | ||||
-rw-r--r-- | x86/Asmexpand.ml | 7 | ||||
-rw-r--r-- | x86/TargetPrinter.ml | 4 |
3 files changed, 7 insertions, 6 deletions
@@ -284,6 +284,7 @@ Inductive instruction: Type := | Pmovsb | Pmovsw | Pmovw_rm (rd: ireg) (ad: addrmode) + | Pnop | Prep_movsl | Psbbl_rr (rd: ireg) (r2: ireg) | Psqrtsd (rd: freg) (r1: freg) @@ -1001,6 +1002,7 @@ Definition exec_instr (f: function) (i: instruction) (rs: regset) (m: mem) : out | Pmovsb | Pmovsw | Pmovw_rm _ _ + | Pnop | Prep_movsl | Psbbl_rr _ _ | Psqrtsd _ _ diff --git a/x86/Asmexpand.ml b/x86/Asmexpand.ml index 99666920..16426ce3 100644 --- a/x86/Asmexpand.ml +++ b/x86/Asmexpand.ml @@ -475,7 +475,7 @@ let expand_builtin_inline name args res = () (* no operation *) | "__builtin_nop", [], _ -> - emit (Pmov_rr (RAX,RAX)) + emit Pnop (* Catch-all *) | _ -> raise (Error ("unrecognized builtin " ^ name)) @@ -632,10 +632,7 @@ let preg_to_dwarf = function let expand_function id fn = try set_current_function fn; - if !Clflags.option_g then - expand_debug id (int_reg_to_dwarf RSP) preg_to_dwarf expand_instruction fn.fn_code - else - List.iter expand_instruction fn.fn_code; + expand id (int_reg_to_dwarf RSP) preg_to_dwarf expand_instruction fn.fn_code; Errors.OK (get_current_function ()) with Error s -> Errors.Error (Errors.msg (coqstring_of_camlstring s)) diff --git a/x86/TargetPrinter.ml b/x86/TargetPrinter.ml index 1bb8c226..3ac2f36e 100644 --- a/x86/TargetPrinter.ml +++ b/x86/TargetPrinter.ml @@ -791,6 +791,8 @@ module Target(System: SYSTEM):TARGET = fprintf oc " movsw\n"; | Pmovw_rm (rd, a) -> fprintf oc " movw %a, %a\n" addressing a ireg16 rd + | Pnop -> + fprintf oc " nop\n" | Prep_movsl -> fprintf oc " rep movsl\n" | Psbbl_rr (res,a1) -> @@ -814,7 +816,7 @@ module Target(System: SYSTEM):TARGET = | 1 -> let annot = annot_text preg_annot "esp" (camlstring_of_coqstring txt) args in fprintf oc "%s annotation: %S\n" comment annot | 2 -> let lbl = new_label () in - fprintf oc "%a: \n" label lbl; + fprintf oc "%a:\n" label lbl; let sp = if Archi.ptr64 then "rsp" else "esp" in add_ais_annot lbl preg_ais_annot sp (camlstring_of_coqstring txt) args | _ -> assert false |