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-0dff7051ff02master
parent
dc79ea388d
commit
dc6ebc037f
|
@ -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 ->
|
||||
|
|
|
@ -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`;
|
||||
|
|
|
@ -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 =
|
||||
|
|
Loading…
Reference in New Issue