Ignore:
Timestamp:
Apr 4, 2011, 5:18:15 PM (10 years ago)
Author:
ayache
Message:

New memory model and bug fixes in 8051 branch. Added primitive operations in interpreters from Clight to LIN.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • Deliverables/D2.2/8051/src/RTLabs/RTLabs.mli

    r486 r740  
    99   RTLabs is the last language of the frontend. It is intended to
    1010   ease retargetting. *)
    11 
    12 
    13 (* From the RTLabs point of view, a pseudo-register can represent a physical
    14    location or a pointer. When instruction selection is over, a pseudo-register
    15    represents a physical location. Thus, some operations --- those on pointers
    16    --- may involve several pseudo-registers when a pointer value is more than
    17    one physical location (which is the case of the 8051). *)
    18 
    19 type registers = Register.t list
    2011
    2112
     
    5243  | St_cost of CostLabel.t * Label.t
    5344
    54   (* Assign a constant to registers. Parameters are the destination registers,
     45  (* Assign a constant to registers. Parameters are the destination register,
    5546     the constant and the label of the next statement. *)
    56   | St_cst of registers * AST.cst * Label.t
     47  | St_cst of Register.t * AST.cst * Label.t
    5748
    5849  (* Application of an unary operation. Parameters are the operation, the
    59      destination registers, the argument registers and the label of the next
     50     destination register, the argument register and the label of the next
    6051     statement. *)
    61   | St_op1 of AST.op1 * registers * registers * Label.t
     52  | St_op1 of AST.op1 * Register.t * Register.t * Label.t
    6253
    6354  (* Application of a binary operation. Parameters are the operation, the
    64      destination register, the argument registers and the label of the next
     55     destination register, the two argument registers and the label of the next
    6556     statement. *)
    66   | St_op2 of AST.op2 * registers * registers * registers * Label.t
     57  | St_op2 of AST.op2 * Register.t * Register.t * Register.t * Label.t
    6758
    68   (* Memory load. Parameters are the size and type of what to load,
    69      the addressing mode and its arguments, the destination register
    70      and the label of the next statement. *)
    71   | St_load of Memory.memory_q * addressing * registers list *
    72                registers * Label.t
     59  (* 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
     61     of the next statement. *)
     62  | St_load of Memory.quantity * addressing * Register.t list * Register.t *
     63               Label.t
    7364
    74   (* Memory store. Parameters are the size and type of what to store,
    75      the addressing mode and its arguments, the source register
    76      and the label of the next statement. *)
    77   | St_store of Memory.memory_q * addressing * registers list *
    78                 registers * Label.t
     65  (* 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
     67     next statement. *)
     68  | St_store of Memory.quantity * addressing * Register.t list * Register.t *
     69                Label.t
    7970
    8071  (* Call to a function given its name. Parameters are the name of the
    8172     function, the arguments of the function, the destination
    82      registers, the signature of the function and the label of the next
     73     register, the signature of the function and the label of the next
    8374     statement. *)
    84   | St_call_id of AST.ident * registers list * registers *
     75  | St_call_id of AST.ident * Register.t list * Register.t *
    8576                  AST.signature * Label.t
    8677
    87   (* Call to a function given its address. Parameters are registers
     78  (* Call to a function given its address. Parameters are the register
    8879     holding the address of the function, the arguments of the
    89      function, the destination registers, the signature of the function
     80     function, the destination register, the signature of the function
    9081     and the label of the next statement. This statement with an
    9182     [St_op] before can represent a [St_call_id]. However, we
    9283     differenciate the two to allow translation to a formalism with no
    9384     function pointer. *)
    94   | St_call_ptr of registers * registers list * registers *
     85  | St_call_ptr of Register.t * Register.t list * Register.t *
    9586                   AST.signature * Label.t
    9687
    97   (* Tail call to a function given its name. Parameters are the name
    98      of the function, the arguments of the function, the destination
    99      register, the signature of the function and the label of the next
    100      statement. *)
    101   | St_tailcall_id of AST.ident * registers list * AST.signature
     88  (* Tail call to a function given its name. Parameters are the name of the
     89     function, the arguments of the function, the signature of the function and
     90     the label of the next statement. *)
     91  | St_tailcall_id of AST.ident * Register.t list * AST.signature
    10292
    103   (* Tail call to a function given its address. Parameters are a
    104      register holding the address of the function, the arguments of
    105      the function, the destination register, the signature of the
    106      function and the label of the next statement. Same remark as for
    107      the [St_call_ptr]. *)
    108   | St_tailcall_ptr of registers * registers list * AST.signature
     93  (* Tail call to a function given its address. Parameters are a register
     94     holding the address of the function, the arguments of the function, the
     95     signature of the function and the label of the next statement. Same remark
     96     as for the [St_call_ptr]. *)
     97  | St_tailcall_ptr of Register.t * Register.t list * AST.signature
    10998
    11099  (* Constant branch. Parameters are the constant, the label to go to when the
     
    117106     true (not 0), and the label to go to when the operation on the
    118107     argument evaluates to false (0). *)
    119   | St_cond1 of AST.op1 * registers * Label.t * Label.t
     108  | St_cond1 of AST.op1 * Register.t * Label.t * Label.t
    120109
    121110  (* Binary branch. Parameters are the operation, its arguments, the
     
    123112     true (not 0), and the label to go to when the operation on the
    124113     arguments evaluates to false (0). *)
    125   | St_cond2 of AST.op2 * registers * registers * Label.t * Label.t
     114  | St_cond2 of AST.op2 * Register.t * Register.t * Label.t * Label.t
    126115
    127116  (* Jump statement. Parameters are a register and a list of
    128117     labels. The execution will go to the [n]th label of the list of
    129118     labels, where [n] is the natural value held in the register. *)
    130   | St_jumptable of registers * Label.t list
     119  | St_jumptable of Register.t * Label.t list
    131120
    132121  (* Return statement. *)
    133   | St_return of registers
     122  | St_return of Register.t
    134123
    135124
     
    140129      f_runiverse : Register.universe ;
    141130      f_sig       : AST.signature ;
    142       f_result    : registers ;
    143       f_params    : registers list ;
    144       f_locals    : registers list ;
     131      f_result    : Register.t ;
     132      f_params    : Register.t list ;
     133      f_locals    : Register.t list ;
     134      f_ptrs      : Register.t list ;
    145135      f_stacksize : int ;
    146136      f_graph     : graph ;
Note: See TracChangeset for help on using the changeset viewer.