diff options
author | xleroy <xleroy@fca1b0fc-160b-0410-b1d3-a4f43f01ea2e> | 2009-11-10 12:50:57 +0000 |
---|---|---|
committer | xleroy <xleroy@fca1b0fc-160b-0410-b1d3-a4f43f01ea2e> | 2009-11-10 12:50:57 +0000 |
commit | 74487f079dd56663f97f9731cea328931857495c (patch) | |
tree | 9de10b895da39adffaf66bff983d6ed573898068 /backend/LTL.v | |
parent | 0486654fac91947fec93d18a0738dd7aa10bcf96 (diff) | |
download | compcert-kvx-74487f079dd56663f97f9731cea328931857495c.tar.gz compcert-kvx-74487f079dd56663f97f9731cea328931857495c.zip |
Added support for jump tables in back end.
git-svn-id: https://yquem.inria.fr/compcert/svn/compcert/trunk@1171 fca1b0fc-160b-0410-b1d3-a4f43f01ea2e
Diffstat (limited to 'backend/LTL.v')
-rw-r--r-- | backend/LTL.v | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/backend/LTL.v b/backend/LTL.v index 2505566f..6a693361 100644 --- a/backend/LTL.v +++ b/backend/LTL.v @@ -42,6 +42,7 @@ Inductive instruction: Type := | Lcall: signature -> loc + ident -> list loc -> loc -> node -> instruction | Ltailcall: signature -> loc + ident -> list loc -> instruction | Lcond: condition -> list loc -> node -> node -> instruction + | Ljumptable: loc -> list node -> instruction | Lreturn: option loc -> instruction. Definition code: Type := PTree.t instruction. @@ -206,6 +207,13 @@ Inductive step: state -> trace -> state -> Prop := eval_condition cond (map rs args) = Some false -> step (State s f sp pc rs m) E0 (State s f sp ifnot rs m) + | exec_Ljumptable: + forall s f sp pc rs m arg tbl n pc', + (fn_code f)!pc = Some(Ljumptable arg tbl) -> + rs arg = Vint n -> + list_nth_z tbl (Int.signed n) = Some pc' -> + step (State s f sp pc rs m) + E0 (State s f sp pc' rs m) | exec_Lreturn: forall s f stk pc rs m or, (fn_code f)!pc = Some(Lreturn or) -> @@ -263,6 +271,7 @@ Definition successors_instr (i: instruction) : list node := | Lcall sig ros args res s => s :: nil | Ltailcall sig ros args => nil | Lcond cond args ifso ifnot => ifso :: ifnot :: nil + | Ljumptable arg tbl => tbl | Lreturn optarg => nil end. |