Changeset 888 for src/RTLabs


Ignore:
Timestamp:
Jun 6, 2011, 4:28:07 PM (9 years ago)
Author:
campbell
Message:

Use simplified conditionals in RTLabs, following the prototype.

Location:
src/RTLabs
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src/RTLabs/semantics.ma

    r887 r888  
    140140      ret ? 〈E0, Callstate fd vs (retdst f) fs (free m (sp f))〉
    141141
    142   | St_condcst cst ltrue lfalse ⇒
    143       ! v ← opt_to_res … (msg FailedConstant) (eval_constant (find_symbol … ge) (sp f) cst);
     142  | St_cond src ltrue lfalse ⇒
     143      ! v ← reg_retrieve (locals f) src;
    144144      ! b ← eval_bool_of_val v;
    145       ret ? 〈E0, build_state f fs m (if b then ltrue else lfalse)〉
    146   | St_cond1 op src ltrue lfalse ⇒
    147       ! v ← reg_retrieve (locals f) src;
    148       ! v' ← opt_to_res … (msg FailedOp) (eval_unop op v);
    149       ! b ← eval_bool_of_val v';
    150       ret ? 〈E0, build_state f fs m (if b then ltrue else lfalse)〉
    151   | St_cond2 op src1 src2 ltrue lfalse ⇒
    152       ! v1 ← reg_retrieve (locals f) src1;
    153       ! v2 ← reg_retrieve (locals f) src2;
    154       ! v' ← opt_to_res … (msg FailedOp) (eval_binop op v1 v2);
    155       ! b ← eval_bool_of_val v';
    156145      ret ? 〈E0, build_state f fs m (if b then ltrue else lfalse)〉
    157146
  • src/RTLabs/syntax.ma

    r887 r888  
    2424| St_tailcall_id : ident → list register → statement
    2525| St_tailcall_ptr : register → list register → statement
    26 (* Um, what? *)
    27 | St_condcst : constant → label → label → statement
    28 | St_cond1 : unary_operation → register → label → label → statement
    29 | St_cond2 : binary_operation → register → register → label → label → statement
     26| St_cond : register → label → label → statement
    3027| St_jumptable : register → list label → statement
    3128| St_return : statement
Note: See TracChangeset for help on using the changeset viewer.