aboutsummaryrefslogtreecommitdiffstats
path: root/mppa_k1c/Op.v
diff options
context:
space:
mode:
authorDavid Monniaux <david.monniaux@univ-grenoble-alpes.fr>2019-04-03 18:23:11 +0200
committerDavid Monniaux <david.monniaux@univ-grenoble-alpes.fr>2019-04-03 18:23:11 +0200
commit616f939e3ac7ff052f0eb7bce8c16873730ddf0e (patch)
treef6b304eaa992b8f9f2d12ee44337dc0e0028efb9 /mppa_k1c/Op.v
parent629252b160fd4b909231bcad6edcf6f254aca0d6 (diff)
parentf4b802ecd426fe594009817fde6df2dde8e08df2 (diff)
downloadcompcert-kvx-616f939e3ac7ff052f0eb7bce8c16873730ddf0e.tar.gz
compcert-kvx-616f939e3ac7ff052f0eb7bce8c16873730ddf0e.zip
Merge remote-tracking branch 'origin/mppa-work' into mppa-ternary
Diffstat (limited to 'mppa_k1c/Op.v')
-rw-r--r--mppa_k1c/Op.v11
1 files changed, 8 insertions, 3 deletions
diff --git a/mppa_k1c/Op.v b/mppa_k1c/Op.v
index ec3f1077..10e4a350 100644
--- a/mppa_k1c/Op.v
+++ b/mppa_k1c/Op.v
@@ -189,6 +189,7 @@ Inductive operation : Type :=
addressing. *)
Inductive addressing: Type :=
+ | Aindexed2: addressing (**r Address is [r1 + r2] *)
| Aindexed: ptrofs -> addressing (**r Address is [r1 + offset] *)
| Aglobal: ident -> ptrofs -> addressing (**r Address is global plus offset *)
| Ainstack: ptrofs -> addressing. (**r Address is [stack_pointer + offset] *)
@@ -423,6 +424,7 @@ Definition eval_addressing
(F V: Type) (genv: Genv.t F V) (sp: val)
(addr: addressing) (vl: list val) : option val :=
match addr, vl with
+ | Aindexed2, v1 :: v2 :: nil => Some (Val.addl v1 v2)
| Aindexed n, v1 :: nil => Some (Val.offset_ptr v1 n)
| Aglobal s ofs, nil => Some (Genv.symbol_address genv s ofs)
| Ainstack n, nil => Some (Val.offset_ptr sp n)
@@ -610,6 +612,7 @@ Definition type_of_operation (op: operation) : list typ * typ :=
Definition type_of_addressing (addr: addressing) : list typ :=
match addr with
+ | Aindexed2 => Tptr :: Tptr :: nil
| Aindexed _ => Tptr :: nil
| Aglobal _ _ => nil
| Ainstack _ => nil
@@ -959,6 +962,7 @@ Qed.
Definition offset_addressing (addr: addressing) (delta: Z) : option addressing :=
match addr with
+ | Aindexed2 => None
| Aindexed n => Some(Aindexed (Ptrofs.add n (Ptrofs.repr delta)))
| Aglobal id n => Some(Aglobal id (Ptrofs.add n (Ptrofs.repr delta)))
| Ainstack n => Some(Ainstack (Ptrofs.add n (Ptrofs.repr delta)))
@@ -1390,9 +1394,10 @@ Lemma eval_addressing_inj:
exists v2, eval_addressing ge2 sp2 addr vl2 = Some v2 /\ Val.inject f v1 v2.
Proof.
intros. destruct addr; simpl in H2; simpl; FuncInv; InvInject; TrivialExists.
- apply Val.offset_ptr_inject; auto.
- apply H; simpl; auto.
- apply Val.offset_ptr_inject; auto.
+ - apply Val.addl_inject; auto.
+ - apply Val.offset_ptr_inject; auto.
+ - apply H; simpl; auto.
+ - apply Val.offset_ptr_inject; auto.
Qed.
End EVAL_COMPAT.