aboutsummaryrefslogtreecommitdiffstats
path: root/mppa_k1c
diff options
context:
space:
mode:
authorDavid Monniaux <david.monniaux@univ-grenoble-alpes.fr>2019-04-28 09:15:00 +0200
committerDavid Monniaux <david.monniaux@univ-grenoble-alpes.fr>2019-04-28 09:15:00 +0200
commit19908e4a6813dc54d72d142a93a77fe41eed95a2 (patch)
tree568913e9bd4daa90d11ea79a4b28e7efcc5799a1 /mppa_k1c
parent39ee073b53eb49328cbd5d3d09375030f321424e (diff)
downloadcompcert-kvx-19908e4a6813dc54d72d142a93a77fe41eed95a2.tar.gz
compcert-kvx-19908e4a6813dc54d72d142a93a77fe41eed95a2.zip
some more on bitfield detection
Diffstat (limited to 'mppa_k1c')
-rw-r--r--mppa_k1c/SelectOp.vp11
-rw-r--r--mppa_k1c/SelectOpproof.v4
2 files changed, 10 insertions, 5 deletions
diff --git a/mppa_k1c/SelectOp.vp b/mppa_k1c/SelectOp.vp
index 2bd51f97..d0bd4f2d 100644
--- a/mppa_k1c/SelectOp.vp
+++ b/mppa_k1c/SelectOp.vp
@@ -342,10 +342,13 @@ Nondetfunction or (e1: expr) (e2: expr) :=
((Eop (Oshlimm start) (fld:::Enil)):::Enil)) =>
let zstart := Int.unsigned start in
let zstop := int_highest_bit mask in
- let mask' := Int.repr (zbitfield_mask zstop zstart) in
- if and_dec (Int.eq_dec mask mask')
- (Int.eq_dec nmask (Int.not mask'))
- then Eop Oor (e1:::e2:::Enil)
+ if is_bitfield zstop zstart
+ then
+ let mask' := Int.repr (zbitfield_mask zstop zstart) in
+ if and_dec (Int.eq_dec mask mask')
+ (Int.eq_dec nmask (Int.not mask'))
+ then Eop Oor (e1:::e2:::Enil)
+ else Eop Oor (e1:::e2:::Enil)
else Eop Oor (e1:::e2:::Enil)
| _, _ => Eop Oor (e1:::e2:::Enil)
end.
diff --git a/mppa_k1c/SelectOpproof.v b/mppa_k1c/SelectOpproof.v
index b8f37c7b..313786c8 100644
--- a/mppa_k1c/SelectOpproof.v
+++ b/mppa_k1c/SelectOpproof.v
@@ -701,7 +701,9 @@ Proof.
rewrite Int.or_commut.
rewrite Int.or_zero.
reflexivity.
- - destruct (and_dec _ _); apply DEFAULT.
+ - destruct (is_bitfield _ _).
+ + destruct (and_dec _ _); apply DEFAULT.
+ + apply DEFAULT.
- apply DEFAULT.
Qed.