Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --- cmmgen.ml.orig 2008-06-02 15:35:14.000626000 -0400
- +++ cmmgen.ml 2008-06-02 16:32:42.000314000 -0400
- @@ -173,22 +173,26 @@
- let test_bool = function
- Cop(Caddi, [Cop(Clsl, [c; Cconst_int 1]); Cconst_int 1]) -> c
- | Cop(Clsl, [c; Cconst_int 1]) -> c
- | c -> Cop(Ccmpi Cne, [c; Cconst_int 1])
- (* Float *)
- let box_float c = Cop(Calloc, [alloc_float_header; c])
- -let unbox_float = function
- +let rec unbox_float = function
- Cop(Calloc, [header; c]) -> c
- + | Clet(id, exp, body) -> Clet(id, exp, unbox_float body)
- + | Cifthenelse(cond, e1, e2) -> Cifthenelse(cond, unbox_float e1, unbox_float e2)
- + | Csequence(e1, e2) -> Csequence(e1, unbox_float e2)
- + (* do we need to push through more constructs ? *)
- | c -> Cop(Cload Double_u, [c])
- (* Complex *)
- let box_complex c_re c_im =
- Cop(Calloc, [alloc_floatarray_header 2; c_re; c_im])
- let complex_re c = Cop(Cload Double_u, [c])
- let complex_im c = Cop(Cload Double_u,
- [Cop(Cadda, [c; Cconst_int size_float])])
Add Comment
Please, Sign In to add comment