Ignore:
Timestamp:
Nov 28, 2011, 3:13:14 PM (8 years ago)
Author:
tranquil
Message:
  • corrected previous bug
  • finished propagating immediates
File:
1 edited

Legend:

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

    r1568 r1572  
    143143let ret_regs = set_of_list I8051.rets
    144144
     145let add_arg : RTL.argument -> L.property -> L.property = function
     146  | RTL.Reg r -> L.join (L.psingleton r)
     147  | RTL.Imm _ -> fun x -> x
     148
    145149let used (stmt : statement) : L.t =
    146150  match stmt with
     
    156160  (* | St_int _ *)
    157161  | St_clear_carry _
    158   | St_set_carry _
    159   | St_set_hdw (_, RTL.Imm _, _)
    160   | St_move (_, RTL.Imm _, _) ->
     162  | St_set_carry _ ->
    161163    L.bottom
    162164  | St_call_id (_, nparams, _) ->
     
    171173  | St_hdw_to_hdw (_, r, _) ->
    172174    L.hsingleton r
    173   | St_op2 (I8051.Addc, _, r1, RTL.Reg r2, _) ->
    174     L.join (L.join (L.psingleton r1) (L.psingleton r2))
    175       (L.hsingleton I8051.carry)
    176   | St_op2 (I8051.Addc, _, r1, RTL.Imm _, _) ->
    177     L.join (L.psingleton r1) (L.hsingleton I8051.carry)
    178   | St_set_hdw (_, RTL.Reg r, _)
    179   | St_push (r, _)
    180   | St_move (_, RTL.Reg r, _)
    181175  | St_op1 (_, _, r, _)
    182   | St_op2 (_, _, r, RTL.Imm _, _)
    183176  | St_cond (r, _, _) ->
    184177    L.psingleton r
    185   | St_opaccsA (_, _, r1, r2, _)
    186   | St_opaccsB (_, _, r1, r2, _)
    187   | St_op2 (_, _, r1, RTL.Reg r2, _)
    188   | St_load (_, r1, r2, _) ->
    189     L.join (L.psingleton r1) (L.psingleton r2)
    190   | St_store (r1, r2, r3, _) ->
    191     L.join (L.join (L.psingleton r1) (L.psingleton r2)) (L.psingleton r3)
     178  | St_set_hdw (_, a, _)
     179  | St_push (a, _)
     180  | St_move (_, a, _) ->
     181    add_arg a L.bottom
     182  | St_op2 ((I8051.Addc | I8051.Sub), _, a1, a2, _) ->
     183    add_arg a1 (add_arg a2 (L.hsingleton I8051.carry))
     184  | St_opaccsA (_, _, a1, a2, _)
     185  | St_opaccsB (_, _, a1, a2, _)
     186  | St_op2 (_, _, a1, a2, _)
     187  | St_load (_, a1, a2, _) ->
     188    add_arg a1 (add_arg a2 L.bottom)
     189  | St_store (a1, a2, a3, _) ->
     190    add_arg a1 (add_arg a2 (add_arg a3 L.bottom))
    192191  | St_newframe _
    193192  | St_delframe _ ->
Note: See TracChangeset for help on using the changeset viewer.