summaryrefslogtreecommitdiff
path: root/backend/LTLin.v
diff options
context:
space:
mode:
authorGravatar xleroy <xleroy@fca1b0fc-160b-0410-b1d3-a4f43f01ea2e>2009-11-10 12:50:57 +0000
committerGravatar xleroy <xleroy@fca1b0fc-160b-0410-b1d3-a4f43f01ea2e>2009-11-10 12:50:57 +0000
commit74487f079dd56663f97f9731cea328931857495c (patch)
tree9de10b895da39adffaf66bff983d6ed573898068 /backend/LTLin.v
parent0486654fac91947fec93d18a0738dd7aa10bcf96 (diff)
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/LTLin.v')
-rw-r--r--backend/LTLin.v8
1 files changed, 8 insertions, 0 deletions
diff --git a/backend/LTLin.v b/backend/LTLin.v
index 10b7d83..e353338 100644
--- a/backend/LTLin.v
+++ b/backend/LTLin.v
@@ -50,6 +50,7 @@ Inductive instruction: Type :=
| Llabel: label -> instruction
| Lgoto: label -> instruction
| Lcond: condition -> list loc -> label -> instruction
+ | Ljumptable: loc -> list label -> instruction
| Lreturn: option loc -> instruction.
Definition code: Type := list instruction.
@@ -204,6 +205,13 @@ Inductive step: state -> trace -> state -> Prop :=
eval_condition cond (map rs args) = Some false ->
step (State s f sp (Lcond cond args lbl :: b) rs m)
E0 (State s f sp b rs m)
+ | exec_Ljumptable:
+ forall s f sp arg tbl b rs m n lbl b',
+ rs arg = Vint n ->
+ list_nth_z tbl (Int.signed n) = Some lbl ->
+ find_label lbl f.(fn_code) = Some b' ->
+ step (State s f sp (Ljumptable arg tbl :: b) rs m)
+ E0 (State s f sp b' rs m)
| exec_Lreturn:
forall s f stk rs m or b,
step (State s f (Vptr stk Int.zero) (Lreturn or :: b) rs m)