diff options
author | Xavier Leroy <xavier.leroy@inria.fr> | 1996-05-24 15:17:03 +0000 |
---|---|---|
committer | Xavier Leroy <xavier.leroy@inria.fr> | 1996-05-24 15:17:03 +0000 |
commit | dc6ebc037f00060a629ec44398a4a9024541f81d (patch) | |
tree | 92aa7e259d5917b39866403f3f01dfa0776340dd | |
parent | dc79ea388d62ed18337c82ae67a312e87f324dd3 (diff) |
Coupure de Ipush_mem en deux instructions pour eviter une recursion croisee entre Arch et Cmm
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@838 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
-rw-r--r-- | asmcomp/arch_i386.ml | 11 | ||||
-rw-r--r-- | asmcomp/emit_i386.mlp | 10 | ||||
-rw-r--r-- | asmcomp/proc_i386.ml | 7 |
3 files changed, 16 insertions, 12 deletions
diff --git a/asmcomp/arch_i386.ml b/asmcomp/arch_i386.ml index 93e7be963..047b16040 100644 --- a/asmcomp/arch_i386.ml +++ b/asmcomp/arch_i386.ml @@ -28,7 +28,8 @@ type specific_operation = | Ipush (* Push regs on stack *) | Ipush_int of int (* Push an integer constant *) | Ipush_symbol of string (* Push a symbol *) - | Ipush_load of Cmm.machtype_component * addressing_mode (* Load and push *) + | Ipush_load of addressing_mode (* Load a scalar and push *) + | Ipush_load_float of addressing_mode (* Load a float and push *) | Isubfrev | Idivfrev (* Reversed float sub and div *) | Ifloatarithmem of float_operation * addressing_mode (* float arith w/mem *) @@ -108,12 +109,12 @@ let print_specific_operation printreg op arg = print_string "push "; print_int n | Ipush_symbol s -> print_string "push \""; print_string s; print_string "\"" - | Ipush_load(Cmm.Float, addr) -> - print_string "pushfloat ["; print_addressing printreg addr arg; - print_string "]" - | Ipush_load(_, addr) -> + | Ipush_load addr -> print_string "push ["; print_addressing printreg addr arg; print_string "]" + | Ipush_load_float addr -> + print_string "pushfloat ["; print_addressing printreg addr arg; + print_string "]" | Isubfrev -> printreg arg.(0); print_string " -f(rev) "; printreg arg.(1) | Idivfrev -> diff --git a/asmcomp/emit_i386.mlp b/asmcomp/emit_i386.mlp index a6e78d5f5..9c23148db 100644 --- a/asmcomp/emit_i386.mlp +++ b/asmcomp/emit_i386.mlp @@ -533,13 +533,13 @@ let emit_instr i = | Lop(Ispecific(Ipush_symbol s)) -> ` pushl ${emit_symbol s}\n`; stack_offset := !stack_offset + 4 - | Lop(Ispecific(Ipush_load(ty, addr))) -> - if ty = Float then begin - ` pushl {emit_addressing (offset_addressing addr 4) i.arg 0}\n`; - stack_offset := !stack_offset + 4 - end; + | Lop(Ispecific(Ipush_load addr)) -> ` pushl {emit_addressing addr i.arg 0}\n`; stack_offset := !stack_offset + 4 + | Lop(Ispecific(Ipush_load_float addr)) -> + ` pushl {emit_addressing (offset_addressing addr 4) i.arg 0}\n`; + ` pushl {emit_addressing addr i.arg 0}\n`; + stack_offset := !stack_offset + 8 | Lop(Ispecific(Ifloatarithmem(op, addr))) -> if i.arg.(0) <> tos then ` fldl {emit_reg i.arg.(0)}\n`; diff --git a/asmcomp/proc_i386.ml b/asmcomp/proc_i386.ml index b29a657a1..4aceef499 100644 --- a/asmcomp/proc_i386.ml +++ b/asmcomp/proc_i386.ml @@ -253,9 +253,12 @@ let select_push exp = Cconst_int n -> (Ispecific(Ipush_int n), Ctuple []) | Cconst_pointer n -> (Ispecific(Ipush_int n), Ctuple []) | Cconst_symbol s -> (Ispecific(Ipush_symbol s), Ctuple []) - | Cop(Cload ty, [loc]) when Array.length ty = 1 -> + | Cop(Cload ty, [loc]) when ty = typ_float -> let (addr, arg) = select_addressing loc in - (Ispecific(Ipush_load(ty.(0), addr)), arg) + (Ispecific(Ipush_load_float addr), arg) + | Cop(Cload ty, [loc]) when ty = typ_addr or ty = typ_int -> + let (addr, arg) = select_addressing loc in + (Ispecific(Ipush_load addr), arg) | _ -> (Ispecific(Ipush), exp) let pseudoregs_for_operation op arg res = |