Vous avez reçu un message "Your GitLab account has been locked ..." ? Pas d'inquiétude : lisez cet article https://docs.gricad-pages.univ-grenoble-alpes.fr/help/unlock/

Commit 97c9a374 authored by Léo Gourdin's avatar Léo Gourdin
Browse files

debug prints uniformized

parent ec52206b
...@@ -22,13 +22,11 @@ open! Integers ...@@ -22,13 +22,11 @@ open! Integers
open Camlcoq open Camlcoq
open Option open Option
open AST open AST
open Printf open DebugPrint
(** Mini CSE (a dynamic numbering is applied during expansion. (** Mini CSE (a dynamic numbering is applied during expansion.
The CSE algorithm is inspired by the "static" one used in backend/CSE.v *) The CSE algorithm is inspired by the "static" one used in backend/CSE.v *)
let exp_debug = false
(** Managing virtual registers and node index *) (** Managing virtual registers and node index *)
let reg = ref 1 let reg = ref 1
...@@ -80,9 +78,9 @@ type numb = { ...@@ -80,9 +78,9 @@ type numb = {
} }
let print_list_pos l = let print_list_pos l =
if exp_debug then eprintf "["; debug "[";
List.iter (fun i -> if exp_debug then eprintf "%d;" (p2i i)) l; List.iter (fun i -> debug "%d;" (p2i i)) l;
if exp_debug then eprintf "]\n" debug "]\n"
let empty_numbering () = let empty_numbering () =
{ nnext = 1; seqs = []; nreg = Hashtbl.create 100; nval = Hashtbl.create 100 } { nnext = 1; seqs = []; nreg = Hashtbl.create 100; nval = Hashtbl.create 100 }
...@@ -93,11 +91,11 @@ let rec get_nvalues vn = function ...@@ -93,11 +91,11 @@ let rec get_nvalues vn = function
let v = let v =
match Hashtbl.find_opt !vn.nreg r with match Hashtbl.find_opt !vn.nreg r with
| Some v -> | Some v ->
if exp_debug then eprintf "getnval r=%d |-> v=%d\n" (p2i r) v; debug "getnval r=%d |-> v=%d\n" (p2i r) v;
v v
| None -> | None ->
let n = !vn.nnext in let n = !vn.nnext in
if exp_debug then eprintf "getnval r=%d |-> v=%d\n" (p2i r) n; debug "getnval r=%d |-> v=%d\n" (p2i r) n;
!vn.nnext <- !vn.nnext + 1; !vn.nnext <- !vn.nnext + 1;
Hashtbl.replace !vn.nreg r n; Hashtbl.replace !vn.nreg r n;
Hashtbl.replace !vn.nval n [ r ]; Hashtbl.replace !vn.nval n [ r ];
...@@ -112,17 +110,17 @@ let get_nval_ornil vn v = ...@@ -112,17 +110,17 @@ let get_nval_ornil vn v =
let forget_reg vn rd = let forget_reg vn rd =
match Hashtbl.find_opt !vn.nreg rd with match Hashtbl.find_opt !vn.nreg rd with
| Some v -> | Some v ->
if exp_debug then eprintf "forget_reg: r=%d |-> v=%d\n" (p2i rd) v; debug "forget_reg: r=%d |-> v=%d\n" (p2i rd) v;
let old_regs = get_nval_ornil vn v in let old_regs = get_nval_ornil vn v in
if exp_debug then eprintf "forget_reg: old_regs are:\n"; debug "forget_reg: old_regs are:\n";
print_list_pos old_regs; print_list_pos old_regs;
Hashtbl.replace !vn.nval v Hashtbl.replace !vn.nval v
(List.filter (fun n -> not (P.eq n rd)) old_regs) (List.filter (fun n -> not (P.eq n rd)) old_regs)
| None -> | None ->
if exp_debug then eprintf "forget_reg: no mapping for r=%d\n" (p2i rd) debug "forget_reg: no mapping for r=%d\n" (p2i rd)
let update_reg vn rd v = let update_reg vn rd v =
if exp_debug then eprintf "update_reg: update v=%d with r=%d\n" v (p2i rd); debug "update_reg: update v=%d with r=%d\n" v (p2i rd);
forget_reg vn rd; forget_reg vn rd;
let old_regs = get_nval_ornil vn v in let old_regs = get_nval_ornil vn v in
Hashtbl.replace !vn.nval v (rd :: old_regs) Hashtbl.replace !vn.nval v (rd :: old_regs)
...@@ -132,7 +130,7 @@ let rec find_valnum_rhs rh = function ...@@ -132,7 +130,7 @@ let rec find_valnum_rhs rh = function
| Seq (v, rh') :: tl -> if rh = rh' then Some v else find_valnum_rhs rh tl | Seq (v, rh') :: tl -> if rh = rh' then Some v else find_valnum_rhs rh tl
let set_unknown vn rd = let set_unknown vn rd =
if exp_debug then eprintf "set_unknown: rd=%d\n" (p2i rd); debug "set_unknown: rd=%d\n" (p2i rd);
forget_reg vn rd; forget_reg vn rd;
Hashtbl.remove !vn.nreg rd Hashtbl.remove !vn.nreg rd
...@@ -141,19 +139,19 @@ let set_res_unknown vn res = match res with BR r -> set_unknown vn r | _ -> () ...@@ -141,19 +139,19 @@ let set_res_unknown vn res = match res with BR r -> set_unknown vn r | _ -> ()
let addrhs vn rd rh = let addrhs vn rd rh =
match find_valnum_rhs rh !vn.seqs with match find_valnum_rhs rh !vn.seqs with
| Some vres -> | Some vres ->
if exp_debug then eprintf "addrhs: Some v=%d\n" vres; debug "addrhs: Some v=%d\n" vres;
Hashtbl.replace !vn.nreg rd vres; Hashtbl.replace !vn.nreg rd vres;
update_reg vn rd vres update_reg vn rd vres
| None -> | None ->
let n = !vn.nnext in let n = !vn.nnext in
if exp_debug then eprintf "addrhs: None v=%d\n" n; debug "addrhs: None v=%d\n" n;
!vn.nnext <- !vn.nnext + 1; !vn.nnext <- !vn.nnext + 1;
!vn.seqs <- Seq (n, rh) :: !vn.seqs; !vn.seqs <- Seq (n, rh) :: !vn.seqs;
update_reg vn rd n; update_reg vn rd n;
Hashtbl.replace !vn.nreg rd n Hashtbl.replace !vn.nreg rd n
let addsop vn v op rd = let addsop vn v op rd =
if exp_debug then eprintf "addsop\n"; debug "addsop\n";
if op = Omove then ( if op = Omove then (
update_reg vn rd (List.hd v); update_reg vn rd (List.hd v);
Hashtbl.replace !vn.nreg rd (List.hd v)) Hashtbl.replace !vn.nreg rd (List.hd v))
...@@ -167,11 +165,11 @@ let rec kill_mem_operations = function ...@@ -167,11 +165,11 @@ let rec kill_mem_operations = function
| eq :: tl -> eq :: kill_mem_operations tl | eq :: tl -> eq :: kill_mem_operations tl
let reg_valnum vn v = let reg_valnum vn v =
if exp_debug then eprintf "reg_valnum: trying to find a mapping for v=%d\n" v; debug "reg_valnum: trying to find a mapping for v=%d\n" v;
match Hashtbl.find !vn.nval v with match Hashtbl.find !vn.nval v with
| [] -> None | [] -> None
| r :: rs -> | r :: rs ->
if exp_debug then eprintf "reg_valnum: found a mapping r=%d\n" (p2i r); debug "reg_valnum: found a mapping r=%d\n" (p2i r);
Some r Some r
let rec reg_valnums vn = function let rec reg_valnums vn = function
...@@ -216,7 +214,7 @@ let addinst vn op args rd = ...@@ -216,7 +214,7 @@ let addinst vn op args rd =
let rh = Sop (op, v) in let rh = Sop (op, v) in
match find_rhs vn rh with match find_rhs vn rh with
| Some r -> | Some r ->
if exp_debug then eprintf "addinst: rhs found with r=%d\n" (p2i r); debug "addinst: rhs found with r=%d\n" (p2i r);
Sr r Sr r
| None -> | None ->
addsop vn v op rd; addsop vn v op rd;
...@@ -627,8 +625,7 @@ let get_regs_inst = function ...@@ -627,8 +625,7 @@ let get_regs_inst = function
(** Modify pathmap according to the size of the expansion list *) (** Modify pathmap according to the size of the expansion list *)
let write_pathmap initial esize pm' = let write_pathmap initial esize pm' =
if exp_debug then debug "write_pathmap: initial=%d, esize=%d\n" (p2i initial) esize;
eprintf "write_pathmap: initial=%d, esize=%d\n" (p2i initial) esize;
let path = get_some @@ PTree.get initial !pm' in let path = get_some @@ PTree.get initial !pm' in
let npsize = Camlcoq.Nat.of_int (esize + Camlcoq.Nat.to_int path.psize) in let npsize = Camlcoq.Nat.of_int (esize + Camlcoq.Nat.to_int path.psize) in
let path' = let path' =
...@@ -655,7 +652,7 @@ let get_arguments vn vals args = ...@@ -655,7 +652,7 @@ let get_arguments vn vals args =
(** Update the code tree with the expansion list *) (** Update the code tree with the expansion list *)
let rec write_tree vn exp initial current code' new_order fturn = let rec write_tree vn exp initial current code' new_order fturn =
if exp_debug then eprintf "wt: node is %d\n" !node; debug "wt: node is %d\n" !node;
let target_node, next_node = let target_node, next_node =
if fturn then (P.to_int initial, current) else (current, current - 1) if fturn then (P.to_int initial, current) else (current, current - 1)
in in
...@@ -685,7 +682,7 @@ let rec write_tree vn exp initial current code' new_order fturn = ...@@ -685,7 +682,7 @@ let rec write_tree vn exp initial current code' new_order fturn =
(** Main expansion function - TODO gourdinl to split? *) (** Main expansion function - TODO gourdinl to split? *)
let expanse (sb : superblock) code pm = let expanse (sb : superblock) code pm =
if exp_debug then eprintf "#### New superblock for expansion oracle\n"; debug "#### New superblock for expansion oracle\n";
let new_order = ref [] in let new_order = ref [] in
let liveins = ref sb.liveins in let liveins = ref sb.liveins in
let exp = ref [] in let exp = ref [] in
...@@ -699,129 +696,129 @@ let expanse (sb : superblock) code pm = ...@@ -699,129 +696,129 @@ let expanse (sb : superblock) code pm =
was_branch := false; was_branch := false;
was_exp := false; was_exp := false;
let inst = get_some @@ PTree.get n code in let inst = get_some @@ PTree.get n code in
if exp_debug then eprintf "We are checking node %d\n" (p2i n); debug "We are checking node %d\n" (p2i n);
(match inst with (match inst with
(* Expansion of conditions - Ocmp *) (* Expansion of conditions - Ocmp *)
| Iop (Ocmp (Ccomp c), a1 :: a2 :: nil, dest, succ) -> | Iop (Ocmp (Ccomp c), a1 :: a2 :: nil, dest, succ) ->
if exp_debug then eprintf "Iop/Ccomp\n"; debug "Iop/Ccomp\n";
exp := cond_int32s vn false c a1 a2 dest; exp := cond_int32s vn false c a1 a2 dest;
exp := extract_final vn !exp dest succ; exp := extract_final vn !exp dest succ;
was_exp := true was_exp := true
| Iop (Ocmp (Ccompu c), a1 :: a2 :: nil, dest, succ) -> | Iop (Ocmp (Ccompu c), a1 :: a2 :: nil, dest, succ) ->
if exp_debug then eprintf "Iop/Ccompu\n"; debug "Iop/Ccompu\n";
exp := cond_int32u vn false c a1 a2 dest; exp := cond_int32u vn false c a1 a2 dest;
exp := extract_final vn !exp dest succ; exp := extract_final vn !exp dest succ;
was_exp := true was_exp := true
| Iop (Ocmp (Ccompimm (c, imm)), a1 :: nil, dest, succ) -> | Iop (Ocmp (Ccompimm (c, imm)), a1 :: nil, dest, succ) ->
if exp_debug then eprintf "Iop/Ccompimm\n"; debug "Iop/Ccompimm\n";
exp := expanse_condimm_int32s vn c a1 imm dest; exp := expanse_condimm_int32s vn c a1 imm dest;
exp := extract_final vn !exp dest succ; exp := extract_final vn !exp dest succ;
was_exp := true was_exp := true
| Iop (Ocmp (Ccompuimm (c, imm)), a1 :: nil, dest, succ) -> | Iop (Ocmp (Ccompuimm (c, imm)), a1 :: nil, dest, succ) ->
if exp_debug then eprintf "Iop/Ccompuimm\n"; debug "Iop/Ccompuimm\n";
exp := expanse_condimm_int32u vn c a1 imm dest; exp := expanse_condimm_int32u vn c a1 imm dest;
exp := extract_final vn !exp dest succ; exp := extract_final vn !exp dest succ;
was_exp := true was_exp := true
| Iop (Ocmp (Ccompl c), a1 :: a2 :: nil, dest, succ) -> | Iop (Ocmp (Ccompl c), a1 :: a2 :: nil, dest, succ) ->
if exp_debug then eprintf "Iop/Ccompl\n"; debug "Iop/Ccompl\n";
exp := cond_int64s vn false c a1 a2 dest; exp := cond_int64s vn false c a1 a2 dest;
exp := extract_final vn !exp dest succ; exp := extract_final vn !exp dest succ;
was_exp := true was_exp := true
| Iop (Ocmp (Ccomplu c), a1 :: a2 :: nil, dest, succ) -> | Iop (Ocmp (Ccomplu c), a1 :: a2 :: nil, dest, succ) ->
if exp_debug then eprintf "Iop/Ccomplu\n"; debug "Iop/Ccomplu\n";
exp := cond_int64u vn false c a1 a2 dest; exp := cond_int64u vn false c a1 a2 dest;
exp := extract_final vn !exp dest succ; exp := extract_final vn !exp dest succ;
was_exp := true was_exp := true
| Iop (Ocmp (Ccomplimm (c, imm)), a1 :: nil, dest, succ) -> | Iop (Ocmp (Ccomplimm (c, imm)), a1 :: nil, dest, succ) ->
if exp_debug then eprintf "Iop/Ccomplimm\n"; debug "Iop/Ccomplimm\n";
exp := expanse_condimm_int64s vn c a1 imm dest; exp := expanse_condimm_int64s vn c a1 imm dest;
exp := extract_final vn !exp dest succ; exp := extract_final vn !exp dest succ;
was_exp := true was_exp := true
| Iop (Ocmp (Ccompluimm (c, imm)), a1 :: nil, dest, succ) -> | Iop (Ocmp (Ccompluimm (c, imm)), a1 :: nil, dest, succ) ->
if exp_debug then eprintf "Iop/Ccompluimm\n"; debug "Iop/Ccompluimm\n";
exp := expanse_condimm_int64u vn c a1 imm dest; exp := expanse_condimm_int64u vn c a1 imm dest;
exp := extract_final vn !exp dest succ; exp := extract_final vn !exp dest succ;
was_exp := true was_exp := true
| Iop (Ocmp (Ccompf c), f1 :: f2 :: nil, dest, succ) -> | Iop (Ocmp (Ccompf c), f1 :: f2 :: nil, dest, succ) ->
if exp_debug then eprintf "Iop/Ccompf\n"; debug "Iop/Ccompf\n";
exp := expanse_cond_fp vn false cond_float c f1 f2 dest; exp := expanse_cond_fp vn false cond_float c f1 f2 dest;
exp := extract_final vn !exp dest succ; exp := extract_final vn !exp dest succ;
was_exp := true was_exp := true
| Iop (Ocmp (Cnotcompf c), f1 :: f2 :: nil, dest, succ) -> | Iop (Ocmp (Cnotcompf c), f1 :: f2 :: nil, dest, succ) ->
if exp_debug then eprintf "Iop/Cnotcompf\n"; debug "Iop/Cnotcompf\n";
exp := expanse_cond_fp vn true cond_float c f1 f2 dest; exp := expanse_cond_fp vn true cond_float c f1 f2 dest;
exp := extract_final vn !exp dest succ; exp := extract_final vn !exp dest succ;
was_exp := true was_exp := true
| Iop (Ocmp (Ccompfs c), f1 :: f2 :: nil, dest, succ) -> | Iop (Ocmp (Ccompfs c), f1 :: f2 :: nil, dest, succ) ->
if exp_debug then eprintf "Iop/Ccompfs\n"; debug "Iop/Ccompfs\n";
exp := expanse_cond_fp vn false cond_single c f1 f2 dest; exp := expanse_cond_fp vn false cond_single c f1 f2 dest;
exp := extract_final vn !exp dest succ; exp := extract_final vn !exp dest succ;
was_exp := true was_exp := true
| Iop (Ocmp (Cnotcompfs c), f1 :: f2 :: nil, dest, succ) -> | Iop (Ocmp (Cnotcompfs c), f1 :: f2 :: nil, dest, succ) ->
if exp_debug then eprintf "Iop/Cnotcompfs\n"; debug "Iop/Cnotcompfs\n";
exp := expanse_cond_fp vn true cond_single c f1 f2 dest; exp := expanse_cond_fp vn true cond_single c f1 f2 dest;
exp := extract_final vn !exp dest succ; exp := extract_final vn !exp dest succ;
was_exp := true was_exp := true
(* Expansion of branches - Ccomp *) (* Expansion of branches - Ccomp *)
| Icond (Ccomp c, a1 :: a2 :: nil, succ1, succ2, info) -> | Icond (Ccomp c, a1 :: a2 :: nil, succ1, succ2, info) ->
if exp_debug then eprintf "Icond/Ccomp\n"; debug "Icond/Ccomp\n";
exp := cbranch_int32s false c a1 a2 info succ1 succ2 []; exp := cbranch_int32s false c a1 a2 info succ1 succ2 [];
was_branch := true; was_branch := true;
was_exp := true was_exp := true
| Icond (Ccompu c, a1 :: a2 :: nil, succ1, succ2, info) -> | Icond (Ccompu c, a1 :: a2 :: nil, succ1, succ2, info) ->
if exp_debug then eprintf "Icond/Ccompu\n"; debug "Icond/Ccompu\n";
exp := cbranch_int32u false c a1 a2 info succ1 succ2 []; exp := cbranch_int32u false c a1 a2 info succ1 succ2 [];
was_branch := true; was_branch := true;
was_exp := true was_exp := true
| Icond (Ccompimm (c, imm), a1 :: nil, succ1, succ2, info) -> | Icond (Ccompimm (c, imm), a1 :: nil, succ1, succ2, info) ->
if exp_debug then eprintf "Icond/Ccompimm\n"; debug "Icond/Ccompimm\n";
exp := expanse_cbranchimm_int32s vn c a1 imm info succ1 succ2; exp := expanse_cbranchimm_int32s vn c a1 imm info succ1 succ2;
was_branch := true; was_branch := true;
was_exp := true was_exp := true
| Icond (Ccompuimm (c, imm), a1 :: nil, succ1, succ2, info) -> | Icond (Ccompuimm (c, imm), a1 :: nil, succ1, succ2, info) ->
if exp_debug then eprintf "Icond/Ccompuimm\n"; debug "Icond/Ccompuimm\n";
exp := expanse_cbranchimm_int32u vn c a1 imm info succ1 succ2; exp := expanse_cbranchimm_int32u vn c a1 imm info succ1 succ2;
was_branch := true; was_branch := true;
was_exp := true was_exp := true
| Icond (Ccompl c, a1 :: a2 :: nil, succ1, succ2, info) -> | Icond (Ccompl c, a1 :: a2 :: nil, succ1, succ2, info) ->
if exp_debug then eprintf "Icond/Ccompl\n"; debug "Icond/Ccompl\n";
exp := cbranch_int64s false c a1 a2 info succ1 succ2 []; exp := cbranch_int64s false c a1 a2 info succ1 succ2 [];
was_branch := true; was_branch := true;
was_exp := true was_exp := true
| Icond (Ccomplu c, a1 :: a2 :: nil, succ1, succ2, info) -> | Icond (Ccomplu c, a1 :: a2 :: nil, succ1, succ2, info) ->
if exp_debug then eprintf "Icond/Ccomplu\n"; debug "Icond/Ccomplu\n";
exp := cbranch_int64u false c a1 a2 info succ1 succ2 []; exp := cbranch_int64u false c a1 a2 info succ1 succ2 [];
was_branch := true; was_branch := true;
was_exp := true was_exp := true
| Icond (Ccomplimm (c, imm), a1 :: nil, succ1, succ2, info) -> | Icond (Ccomplimm (c, imm), a1 :: nil, succ1, succ2, info) ->
if exp_debug then eprintf "Icond/Ccomplimm\n"; debug "Icond/Ccomplimm\n";
exp := expanse_cbranchimm_int64s vn c a1 imm info succ1 succ2; exp := expanse_cbranchimm_int64s vn c a1 imm info succ1 succ2;
was_branch := true; was_branch := true;
was_exp := true was_exp := true
| Icond (Ccompluimm (c, imm), a1 :: nil, succ1, succ2, info) -> | Icond (Ccompluimm (c, imm), a1 :: nil, succ1, succ2, info) ->
if exp_debug then eprintf "Icond/Ccompluimm\n"; debug "Icond/Ccompluimm\n";
exp := expanse_cbranchimm_int64u vn c a1 imm info succ1 succ2; exp := expanse_cbranchimm_int64u vn c a1 imm info succ1 succ2;
was_branch := true; was_branch := true;
was_exp := true was_exp := true
| Icond (Ccompf c, f1 :: f2 :: nil, succ1, succ2, info) -> | Icond (Ccompf c, f1 :: f2 :: nil, succ1, succ2, info) ->
if exp_debug then eprintf "Icond/Ccompf\n"; debug "Icond/Ccompf\n";
exp := exp :=
expanse_cbranch_fp vn false cond_float c f1 f2 info succ1 succ2; expanse_cbranch_fp vn false cond_float c f1 f2 info succ1 succ2;
was_branch := true; was_branch := true;
was_exp := true was_exp := true
| Icond (Cnotcompf c, f1 :: f2 :: nil, succ1, succ2, info) -> | Icond (Cnotcompf c, f1 :: f2 :: nil, succ1, succ2, info) ->
if exp_debug then eprintf "Icond/Cnotcompf\n"; debug "Icond/Cnotcompf\n";
exp := expanse_cbranch_fp vn true cond_float c f1 f2 info succ1 succ2; exp := expanse_cbranch_fp vn true cond_float c f1 f2 info succ1 succ2;
was_branch := true; was_branch := true;
was_exp := true was_exp := true
| Icond (Ccompfs c, f1 :: f2 :: nil, succ1, succ2, info) -> | Icond (Ccompfs c, f1 :: f2 :: nil, succ1, succ2, info) ->
if exp_debug then eprintf "Icond/Ccompfs\n"; debug "Icond/Ccompfs\n";
exp := exp :=
expanse_cbranch_fp vn false cond_single c f1 f2 info succ1 succ2; expanse_cbranch_fp vn false cond_single c f1 f2 info succ1 succ2;
was_branch := true; was_branch := true;
was_exp := true was_exp := true
| Icond (Cnotcompfs c, f1 :: f2 :: nil, succ1, succ2, info) -> | Icond (Cnotcompfs c, f1 :: f2 :: nil, succ1, succ2, info) ->
if exp_debug then eprintf "Icond/Cnotcompfs\n"; debug "Icond/Cnotcompfs\n";
exp := exp :=
expanse_cbranch_fp vn true cond_single c f1 f2 info succ1 succ2; expanse_cbranch_fp vn true cond_single c f1 f2 info succ1 succ2;
was_branch := true; was_branch := true;
...@@ -830,7 +827,7 @@ let expanse (sb : superblock) code pm = ...@@ -830,7 +827,7 @@ let expanse (sb : superblock) code pm =
(if not !was_exp then (if not !was_exp then
match inst with match inst with
| Iop (Ofloatconst f, nil, dest, succ) -> | Iop (Ofloatconst f, nil, dest, succ) ->
if exp_debug then eprintf "Iop/Ofloatconst\n"; debug "Iop/Ofloatconst\n";
let r = r2pi () in let r = r2pi () in
let l = loadimm64 vn r (Floats.Float.to_bits f) in let l = loadimm64 vn r (Floats.Float.to_bits f) in
let r', l' = extract_arg l in let r', l' = extract_arg l in
...@@ -838,7 +835,7 @@ let expanse (sb : superblock) code pm = ...@@ -838,7 +835,7 @@ let expanse (sb : superblock) code pm =
exp := extract_final vn !exp dest succ; exp := extract_final vn !exp dest succ;
was_exp := true was_exp := true
| Iop (Osingleconst f, nil, dest, succ) -> | Iop (Osingleconst f, nil, dest, succ) ->
if exp_debug then eprintf "Iop/Osingleconst\n"; debug "Iop/Osingleconst\n";
let r = r2pi () in let r = r2pi () in
let l = loadimm32 vn r (Floats.Float32.to_bits f) in let l = loadimm32 vn r (Floats.Float32.to_bits f) in
let r', l' = extract_arg l in let r', l' = extract_arg l in
...@@ -846,57 +843,57 @@ let expanse (sb : superblock) code pm = ...@@ -846,57 +843,57 @@ let expanse (sb : superblock) code pm =
exp := extract_final vn !exp dest succ; exp := extract_final vn !exp dest succ;
was_exp := true was_exp := true
| Iop (Ointconst n, nil, dest, succ) -> | Iop (Ointconst n, nil, dest, succ) ->
if exp_debug then eprintf "Iop/Ointconst\n"; debug "Iop/Ointconst\n";
exp := loadimm32 vn dest n; exp := loadimm32 vn dest n;
exp := extract_final vn !exp dest succ; exp := extract_final vn !exp dest succ;
was_exp := true was_exp := true
| Iop (Olongconst n, nil, dest, succ) -> | Iop (Olongconst n, nil, dest, succ) ->
if exp_debug then eprintf "Iop/Olongconst\n"; debug "Iop/Olongconst\n";
exp := loadimm64 vn dest n; exp := loadimm64 vn dest n;
exp := extract_final vn !exp dest succ; exp := extract_final vn !exp dest succ;
was_exp := true was_exp := true
| Iop (Oaddimm n, a1 :: nil, dest, succ) -> | Iop (Oaddimm n, a1 :: nil, dest, succ) ->
if exp_debug then eprintf "Iop/Oaddimm\n"; debug "Iop/Oaddimm\n";
exp := addimm32 vn a1 dest n None; exp := addimm32 vn a1 dest n None;
exp := extract_final vn !exp dest succ; exp := extract_final vn !exp dest succ;
was_exp := true was_exp := true
| Iop (Oaddlimm n, a1 :: nil, dest, succ) -> | Iop (Oaddlimm n, a1 :: nil, dest, succ) ->
if exp_debug then eprintf "Iop/Oaddlimm\n"; debug "Iop/Oaddlimm\n";
exp := addimm64 vn a1 dest n None; exp := addimm64 vn a1 dest n None;
exp := extract_final vn !exp dest succ; exp := extract_final vn !exp dest succ;
was_exp := true was_exp := true
| Iop (Oandimm n, a1 :: nil, dest, succ) -> | Iop (Oandimm n, a1 :: nil, dest, succ) ->
if exp_debug then eprintf "Iop/Oandimm\n"; debug "Iop/Oandimm\n";
exp := andimm32 vn a1 dest n; exp := andimm32 vn a1 dest n;
exp := extract_final vn !exp dest succ; exp := extract_final vn !exp dest succ;
was_exp := true was_exp := true
| Iop (Oandlimm n, a1 :: nil, dest, succ) -> | Iop (Oandlimm n, a1 :: nil, dest, succ) ->
if exp_debug then eprintf "Iop/Oandlimm\n"; debug "Iop/Oandlimm\n";
exp := andimm64 vn a1 dest n; exp := andimm64 vn a1 dest n;
exp := extract_final vn !exp dest succ; exp := extract_final vn !exp dest succ;
was_exp := true was_exp := true
| Iop (Oorimm n, a1 :: nil, dest, succ) -> | Iop (Oorimm n, a1 :: nil, dest, succ) ->
if exp_debug then eprintf "Iop/Oorimm\n"; debug "Iop/Oorimm\n";
exp := orimm32 vn a1 dest n; exp := orimm32 vn a1 dest n;
exp := extract_final vn !exp dest succ; exp := extract_final vn !exp dest succ;
was_exp := true was_exp := true
| Iop (Oorlimm n, a1 :: nil, dest, succ) -> | Iop (Oorlimm n, a1 :: nil, dest, succ) ->
if exp_debug then eprintf "Iop/Oorlimm\n"; debug "Iop/Oorlimm\n";
exp := orimm64 vn a1 dest n; exp := orimm64 vn a1 dest n;
exp := extract_final vn !exp dest succ; exp := extract_final vn !exp dest succ;
was_exp := true was_exp := true
| Iop (Oxorimm n, a1 :: nil, dest, succ) -> | Iop (Oxorimm n, a1 :: nil, dest, succ) ->
if exp_debug then eprintf "Iop/Oxorimm\n"; debug "Iop/Oxorimm\n";
exp := xorimm32 vn a1 dest n; exp := xorimm32 vn a1 dest n;
exp := extract_final vn !exp dest succ; exp := extract_final vn !exp dest succ;
was_exp := true was_exp := true
| Iop (Oxorlimm n, a1 :: nil, dest, succ) -> | Iop (Oxorlimm n, a1 :: nil, dest, succ) ->
if exp_debug then eprintf "Iop/Oxorlimm\n"; debug "Iop/Oxorlimm\n";
exp := xorimm64 vn a1 dest n; exp := xorimm64 vn a1 dest n;
exp := extract_final vn !exp dest succ; exp := extract_final vn !exp dest succ;
was_exp := true was_exp := true
| Iop (Ocast8signed, a1 :: nil, dest, succ) -> | Iop (Ocast8signed, a1 :: nil, dest, succ) ->
if exp_debug then eprintf "Iop/cast8signed\n"