Ignore:
Timestamp:
May 19, 2011, 4:03:04 PM (9 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/RTLabs/RTLabs.mli

    r740 r818  
    99   RTLabs is the last language of the frontend. It is intended to
    1010   ease retargetting. *)
    11 
    12 
    13 (* The following type represents the possible addresses to load from or store to
    14    memory. *)
    15 
    16 type addressing =
    17 
    18   (* Address is r1 + offset *)
    19   | Aindexed of AST.immediate
    20 
    21   (* Address is r1 + r2 *)
    22   | Aindexed2
    23 
    24   (* Address is symbol + offset *)
    25   | Aglobal of AST.ident * AST.immediate
    26 
    27   (* Address is symbol + offset + r1 *)
    28   | Abased of AST.ident * AST.immediate
    29 
    30   (* Address is stack_pointer + offset *)
    31   | Ainstack of AST.immediate
    3211
    3312
     
    5837
    5938  (* Memory load. Parameters are the size in bytes of what to load, the
    60      addressing mode and its arguments, the destination register and the label
     39     register containing the address, the destination register and the label
    6140     of the next statement. *)
    62   | St_load of Memory.quantity * addressing * Register.t list * Register.t *
    63                Label.t
     41  | St_load of AST.quantity * Register.t * Register.t * Label.t
    6442
    6543  (* Memory store. Parameters are the size in bytes of what to store, the
    66      addressing mode and its arguments, the source register and the label of the
     44     register containing the address, the source register and the label of the
    6745     next statement. *)
    68   | St_store of Memory.quantity * addressing * Register.t list * Register.t *
    69                 Label.t
     46  | St_store of AST.quantity * Register.t * Register.t * Label.t
    7047
    7148  (* Call to a function given its name. Parameters are the name of the
     
    7350     register, the signature of the function and the label of the next
    7451     statement. *)
    75   | St_call_id of AST.ident * Register.t list * Register.t *
     52  | St_call_id of AST.ident * Register.t list * Register.t option *
    7653                  AST.signature * Label.t
    7754
     
    8360     differenciate the two to allow translation to a formalism with no
    8461     function pointer. *)
    85   | St_call_ptr of Register.t * Register.t list * Register.t *
     62  | St_call_ptr of Register.t * Register.t list * Register.t option *
    8663                   AST.signature * Label.t
    8764
     
    9774  | St_tailcall_ptr of Register.t * Register.t list * AST.signature
    9875
    99   (* Constant branch. Parameters are the constant, the label to go to when the
    100      constant evaluates to true (not 0), and the label to go to when the
    101      constant evaluates to false (0). *)
    102   | St_condcst of AST.cst * Label.t * Label.t
    103 
    104   (* Unary branch. Parameters are the operation, its argument, the
    105      label to go to when the operation on the argument evaluates to
    106      true (not 0), and the label to go to when the operation on the
    107      argument evaluates to false (0). *)
    108   | St_cond1 of AST.op1 * Register.t * Label.t * Label.t
    109 
    110   (* Binary branch. Parameters are the operation, its arguments, the
    111      label to go to when the operation on the arguments evaluates to
    112      true (not 0), and the label to go to when the operation on the
    113      arguments evaluates to false (0). *)
    114   | St_cond2 of AST.op2 * Register.t * Register.t * Label.t * Label.t
     76  (* Branch. Parameters are the register holding the value to branch on, the
     77     label to go to when the value evaluates to true (not 0), and the label
     78     to go to when the value evaluates to false (0). *)
     79  | St_cond of Register.t * Label.t * Label.t
    11580
    11681  (* Jump statement. Parameters are a register and a list of
     
    12085
    12186  (* Return statement. *)
    122   | St_return of Register.t
     87  | St_return of Register.t option
    12388
    12489
     
    12893    { f_luniverse : Label.Gen.universe ;
    12994      f_runiverse : Register.universe ;
    130       f_sig       : AST.signature ;
    131       f_result    : Register.t ;
    132       f_params    : Register.t list ;
    133       f_locals    : Register.t list ;
    134       f_ptrs      : Register.t list ;
    135       f_stacksize : int ;
     95      f_result    : (Register.t * AST.sig_type) option ;
     96      f_params    : (Register.t * AST.sig_type) list ;
     97      f_locals    : (Register.t * AST.sig_type) list ;
     98      f_stacksize : AST.abstract_size ;
    13699      f_graph     : graph ;
    137100      f_entry     : Label.t ;
     
    146109
    147110type program =
    148     { vars   : (AST.ident * int (* size *)) list ;
     111    { vars   : (AST.ident * AST.abstract_size) list ;
    149112      functs : (AST.ident * function_def) list ;
    150113      main   : AST.ident option }
Note: See TracChangeset for help on using the changeset viewer.