Ignore:
Timestamp:
Mar 2, 2011, 11:06:58 PM (9 years ago)
Author:
ayache
Message:

Bug fixs and signed division hack in D2.2.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • Deliverables/D2.2/8051/src/LIN/LINToASM.ml

    r619 r624  
    8787
    8888let rec remove_following_cost_label lbl = function
    89   | [] -> assert false (* wrong labelling *)
     89  | [] -> (None, []) (* no labelling *)
    9090  | LIN.St_label lbl' :: LIN.St_cost cost_lbl :: code when lbl' = lbl ->
    91     (cost_lbl, LIN.St_label lbl' :: code)
     91    (Some cost_lbl, LIN.St_label lbl' :: code)
    9292  | stmt :: code ->
    9393    let (cost_lbl, code') = remove_following_cost_label lbl code in
     
    102102         as to not introduce an imprecision. *)
    103103      let (cost_lbl, code') = remove_following_cost_label lbl code in
    104       let tmp_lbl = Label.Gen.fresh tmp_universe in
    105       [`WithLabel (`JZ (`Label tmp_lbl)) ;
    106        `Cost cost_lbl ; `Jmp lbl ;
    107        `Label tmp_lbl] @
    108       (aux code')
     104      (match cost_lbl with
     105        | None -> aux code'
     106        | Some cost_lbl ->
     107          let tmp_lbl = Label.Gen.fresh tmp_universe in
     108          [`WithLabel (`JZ (`Label tmp_lbl)) ;
     109           `Cost cost_lbl ; `Jmp lbl ;
     110           `Label tmp_lbl] @
     111            (aux code'))
    109112    | stmt :: code -> (translate_statement glbls_addr stmt) @ (aux code) in
    110113  aux
Note: See TracChangeset for help on using the changeset viewer.