Skip to content

Commit

Permalink
supprime inc/dec
Browse files Browse the repository at this point in the history
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/newoolab2@6320 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
  • Loading branch information
Jacques Garrigue committed May 25, 2004
1 parent 08a9f39 commit 8a77b71
Showing 1 changed file with 10 additions and 13 deletions.
23 changes: 10 additions & 13 deletions asmcomp/i386/emit.mlp
Expand Up @@ -495,7 +495,10 @@ let emit_instr fallthrough i =
let lbl_call_gc = new_label() in
let lbl_frame = record_frame_label i.live in
` jb {emit_label lbl_call_gc}\n`;
` leal 4(%eax), {emit_reg i.res.(0)}\n`;
if i.res.(0).loc = Reg 0 then
` addl $4, %eax\n`
else
` leal 4(%eax), {emit_reg i.res.(0)}\n`;
call_gc_sites :=
{ gc_lbl = lbl_call_gc;
gc_return_lbl = lbl_redo;
Expand All @@ -508,7 +511,10 @@ let emit_instr fallthrough i =
| _ -> ` movl ${emit_int n}, %eax\n`;
` call {emit_symbol "caml_allocN"}\n`
end;
`{record_frame i.live} leal 4(%eax), {emit_reg i.res.(0)}\n`
if i.res.(0).loc = Reg 0 then
`{record_frame i.live} addl $4, %eax\n`
else
`{record_frame i.live} leal 4(%eax), {emit_reg i.res.(0)}\n`
end
| Lop(Iintop(Icomp cmp)) ->
` cmpl {emit_reg i.arg.(1)}, {emit_reg i.arg.(0)}\n`;
Expand Down Expand Up @@ -539,10 +545,6 @@ let emit_instr fallthrough i =
` {emit_string(instr_for_intop op)} {emit_reg i.arg.(1)}, {emit_reg i.res.(0)}\n`
| Lop(Iintop_imm(Iadd, n)) when i.arg.(0).loc <> i.res.(0).loc ->
` leal {emit_int n}({emit_reg i.arg.(0)}), {emit_reg i.res.(0)}\n`
| Lop(Iintop_imm(Iadd, 1) | Iintop_imm(Isub, -1)) ->
` incl {emit_reg i.res.(0)}\n`
| Lop(Iintop_imm(Iadd, -1) | Iintop_imm(Isub, 1)) ->
` decl {emit_reg i.res.(0)}\n`
| Lop(Iintop_imm(Idiv, n)) ->
let l = Misc.log2 n in
let lbl = new_label() in
Expand Down Expand Up @@ -615,18 +617,13 @@ let emit_instr fallthrough i =
| Lop(Ispecific(Ilea addr)) ->
begin match addr with
Iindexed n when i.arg.(0).loc = i.res.(0).loc ->
if n = 1 then
` incl {emit_reg i.res.(0)}\n`
else if n = -1 then
` decl {emit_reg i.res.(0)}\n`
else
` addl ${emit_int n}, {emit_reg i.res.(0)}\n`
` addl ${emit_int n}, {emit_reg i.res.(0)}\n`
| Iindexed2 0 when i.arg.(0).loc = i.res.(0).loc ->
` addl {emit_reg i.arg.(1)}, {emit_reg i.res.(0)}\n`
| Iindexed2 0 when i.arg.(1).loc = i.res.(0).loc ->
` addl {emit_reg i.arg.(0)}, {emit_reg i.res.(0)}\n`
| _ ->
` lea {emit_addressing addr i.arg 0}, {emit_reg i.res.(0)}\n`
` leal {emit_addressing addr i.arg 0}, {emit_reg i.res.(0)}\n`
end
| Lop(Ispecific(Istore_int(n, addr))) ->
` movl ${emit_nativeint n}, {emit_addressing addr i.arg 0}\n`
Expand Down

0 comments on commit 8a77b71

Please sign in to comment.