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/uses.ml

    r1568 r1572  
    1515let count r uses = Register.Map.add r (lookup uses r + 1) uses
    1616
     17let count_arg = function
     18  | RTL.Reg r -> count r
     19  | RTL.Imm _ -> fun x -> x
     20
    1721let examine_statement _ stmt uses =
    1822  match stmt with
     
    2327  | St_ind_inc _
    2428  | St_hdw_to_hdw _
    25   | St_set_hdw (_, RTL.Imm _, _)
    2629  | St_newframe _
    2730  | St_delframe _
     
    3235    uses
    3336  | St_get_hdw (r, _, _)
    34   | St_set_hdw (_, RTL.Reg r, _)
    3537  | St_framesize (r, _)
    3638  | St_pop (r, _)
    37   | St_push (r, _)
    38   | St_move (r, RTL.Imm _, _)
    3939  | St_addrH (r, _, _)
    4040  | St_addrL (r, _, _)
    4141  | St_cond (r, _, _) ->
    4242    count r uses
    43   | St_move (r1, RTL.Reg r2, _)
    44   | St_op1 (_, r1, r2, _)
    45   | St_op2 (_, r1, r2, RTL.Imm _, _)
    46   | St_call_ptr (r1, r2, _, _) ->
     43  | St_set_hdw (_, a, _)
     44  | St_push (a, _) ->
     45    count_arg a uses
     46  | St_move (r1, a2, _) ->
     47    count r1 (count_arg a2 uses)
     48  | St_call_ptr (r1, r2, _, _)
     49  | St_op1 (_, r1, r2, _) ->
    4750    count r1 (count r2 uses)
    48   | St_opaccsA (_, r1, r2, r3, _)
    49   | St_opaccsB (_, r1, r2, r3, _)
    50   | St_op2 (_, r1, r2, RTL.Reg r3, _)
    51   | St_load (r1, r2, r3, _)
    52   | St_store (r1, r2, r3, _) ->
    53     count r1 (count r2 (count r3 uses))
     51  | St_opaccsA (_, r, a1, a2, _)
     52  | St_opaccsB (_, r, a1, a2, _)
     53  | St_load (r, a1, a2, _)
     54  | St_op2 (_, r, a1, a2, _) ->
     55    count r (count_arg a1 (count_arg a1 uses))
     56  | St_store (a1, a2, a3, _) ->
     57    count_arg a1 (count_arg a2 (count_arg a3 uses))
    5458
    5559let examine_internal int_fun =
Note: See TracChangeset for help on using the changeset viewer.