Ignore:
Timestamp:
May 19, 2011, 4:03:04 PM (8 years ago)
Author:
ayache
Message:

32 and 16 bits operations support in D2.2/8051

File:
1 edited

Legend:

Unmodified
Added
Removed
  • Deliverables/D2.2/8051/src/ERTL/liveness.ml

    r486 r818  
    3030  | St_int (_, _, l)
    3131  | St_move (_, _, l)
    32   | St_opaccs (_, _, _, _, l)
     32  | St_opaccsA (_, _, _, _, l)
     33  | St_opaccsB (_, _, _, _, l)
    3334  | St_op1 (_, _, _, l)
    3435  | St_op2 (_, _, _, _, l)
    3536  | St_clear_carry l
     37  | St_set_carry l
    3638  | St_load (_, _, _, l)
    3739  | St_store (_, _, _, l)
    3840  | St_call_id (_, _, l) ->
    3941    Label.Set.singleton l
    40   | St_condacc (_, l1, l2) ->
     42  | St_cond (_, l1, l2) ->
    4143    Label.Set.add l1 (Label.Set.singleton l2)
    4244
     
    115117  | St_cost _
    116118  | St_push _
    117   | St_clear_carry _
    118119  | St_store _
    119   | St_condacc _
     120  | St_cond _
    120121  | St_return _ ->
    121122    L.bottom
     123  | St_clear_carry _
     124  | St_set_carry _ ->
     125    Register.Set.empty, I8051.RegisterSet.singleton I8051.carry
    122126  | St_op2 (I8051.Add, r, _, _, _)
    123127  | St_op2 (I8051.Addc, r, _, _, _)
    124128  | St_op2 (I8051.Sub, r, _, _, _) ->
    125129    L.join (L.hsingleton I8051.carry) (L.psingleton r)
    126   | St_op1 (I8051.Inc, r, _, _) ->
    127     L.join (L.hsingleton I8051.carry) (L.psingleton r)
     130  | St_op1 (I8051.Inc, r, _, _)
    128131  | St_get_hdw (r, _, _)
    129132  | St_framesize (r, _)
     
    133136  | St_addrL (r, _, _)
    134137  | St_move (r, _, _)
    135   | St_opaccs (_, r, _, _, _)
     138  | St_opaccsA (_, r, _, _, _)
     139  | St_opaccsB (_, r, _, _, _)
    136140  | St_op1 (_, r, _, _)
    137141  | St_op2 (_, r, _, _, _)
     
    153157(* This is the set of variables used at (read by) a statement. *)
    154158
    155 let dptr =
    156   I8051.RegisterSet.add I8051.dph (I8051.RegisterSet.singleton I8051.dpl)
     159let set_of_list =
     160  let f set r = I8051.RegisterSet.add r set in
     161  List.fold_left f I8051.RegisterSet.empty
     162
     163let ret_regs = set_of_list I8051.rets
    157164
    158165let used (stmt : statement) : L.t =
     
    166173  | St_addrL _
    167174  | St_int _
    168   | St_clear_carry _ ->
     175  | St_clear_carry _
     176  | St_set_carry _ ->
    169177    L.bottom
    170178  | St_call_id (_, nparams, _) ->
     
    179187  | St_move (_, r, _)
    180188  | St_op1 (_, _, r, _)
    181   | St_condacc (r, _, _) ->
     189  | St_cond (r, _, _) ->
    182190    L.psingleton r
    183191  | St_op2 (I8051.Addc, _, r1, r2, _) ->
    184192    L.join (L.join (L.psingleton r1) (L.psingleton r2))
    185193      (L.hsingleton I8051.carry)
    186   | St_opaccs (_, _, r1, r2, _)
     194  | St_opaccsA (_, _, r1, r2, _)
     195  | St_opaccsB (_, _, r1, r2, _)
    187196  | St_op2 (_, _, r1, r2, _)
    188197  | St_load (_, r1, r2, _) ->
     
    194203    L.join (L.hsingleton I8051.spl) (L.hsingleton I8051.sph)   
    195204  | St_return _ ->
    196     Register.Set.empty, I8051.RegisterSet.union I8051.callee_saved dptr
     205    Register.Set.empty, I8051.RegisterSet.union I8051.callee_saved ret_regs
    197206
    198207(* A statement is considered pure if it has no side effect, that is, if
     
    218227  | St_push _
    219228  | St_clear_carry _
     229  | St_set_carry _
    220230  | St_store _
    221231  | St_call_id _
    222   | St_condacc _
     232  | St_cond _
    223233  | St_return _ ->
    224234    None
     
    229239  | St_addrL (r, _, l)
    230240  | St_move (r, _, l)
    231   | St_opaccs (_, r, _, _, l)
     241  | St_opaccsA (_, r, _, _, l)
     242  | St_opaccsB (_, r, _, _, l)
    232243  | St_op1 (_, r, _, l)
    233244  | St_op2 (_, r, _, _, l)
Note: See TracChangeset for help on using the changeset viewer.