diff options
Diffstat (limited to 'powerpc')
-rw-r--r-- | powerpc/ConstpropOp.vp | 8 | ||||
-rw-r--r-- | powerpc/ConstpropOpproof.v | 3 | ||||
-rw-r--r-- | powerpc/Op.v | 7 |
3 files changed, 13 insertions, 5 deletions
diff --git a/powerpc/ConstpropOp.vp b/powerpc/ConstpropOp.vp index 60b5c63c..c39ccdb1 100644 --- a/powerpc/ConstpropOp.vp +++ b/powerpc/ConstpropOp.vp @@ -95,8 +95,12 @@ Nondetfunction eval_static_operation (op: operation) (vl: list approx) := | Osubimm n, I n1 :: nil => I (Int.sub n n1) | Omul, I n1 :: I n2 :: nil => I(Int.mul n1 n2) | Omulimm n, I n1 :: nil => I(Int.mul n1 n) - | Odiv, I n1 :: I n2 :: nil => if Int.eq n2 Int.zero then Unknown else I(Int.divs n1 n2) - | Odivu, I n1 :: I n2 :: nil => if Int.eq n2 Int.zero then Unknown else I(Int.divu n1 n2) + | Odiv, I n1 :: I n2 :: nil => + if Int.eq n2 Int.zero then Unknown else + if Int.eq n1 (Int.repr Int.min_signed) && Int.eq n2 Int.mone then Unknown + else I(Int.divs n1 n2) + | Odivu, I n1 :: I n2 :: nil => + if Int.eq n2 Int.zero then Unknown else I(Int.divu n1 n2) | Oand, I n1 :: I n2 :: nil => I(Int.and n1 n2) | Oandimm n, I n1 :: nil => I(Int.and n1 n) | Oor, I n1 :: I n2 :: nil => I(Int.or n1 n2) diff --git a/powerpc/ConstpropOpproof.v b/powerpc/ConstpropOpproof.v index 1c050bdb..eef39448 100644 --- a/powerpc/ConstpropOpproof.v +++ b/powerpc/ConstpropOpproof.v @@ -139,7 +139,8 @@ Proof. rewrite Val.sub_add_opp. rewrite Val.add_assoc. simpl. rewrite Int.sub_add_opp. auto. - destruct (Int.eq n2 Int.zero); inv H0; simpl; auto. + destruct (Int.eq n2 Int.zero). inv H0. + destruct (Int.eq n1 (Int.repr Int.min_signed) && Int.eq n2 Int.mone); inv H0; simpl; auto. destruct (Int.eq n2 Int.zero); inv H0; simpl; auto. destruct (Int.ltu n2 Int.iwordsize); simpl; auto. diff --git a/powerpc/Op.v b/powerpc/Op.v index 986ea8c4..353c51c9 100644 --- a/powerpc/Op.v +++ b/powerpc/Op.v @@ -333,7 +333,9 @@ Proof with (try exact I). destruct v0... destruct v0; destruct v1... destruct v0... - destruct v0; destruct v1; simpl in *; inv H0. destruct (Int.eq i0 Int.zero); inv H2... + destruct v0; destruct v1; simpl in *; inv H0. + destruct (Int.eq i0 Int.zero + || Int.eq i (Int.repr Int.min_signed) && Int.eq i0 Int.mone); inv H2... destruct v0; destruct v1; simpl in *; inv H0. destruct (Int.eq i0 Int.zero); inv H2... destruct v0; destruct v1... destruct v0... @@ -758,7 +760,8 @@ Proof. inv H4; inv H2; simpl; auto. inv H4; simpl; auto. inv H4; inv H3; simpl in H1; inv H1. simpl. - destruct (Int.eq i0 Int.zero); inv H2. TrivialExists. + destruct (Int.eq i0 Int.zero + || Int.eq i (Int.repr Int.min_signed) && Int.eq i0 Int.mone); inv H2. TrivialExists. inv H4; inv H3; simpl in H1; inv H1. simpl. destruct (Int.eq i0 Int.zero); inv H2. TrivialExists. inv H4; inv H2; simpl; auto. |