aboutsummaryrefslogtreecommitdiffstats
path: root/common
diff options
context:
space:
mode:
authorDavid Monniaux <david.monniaux@univ-grenoble-alpes.fr>2019-04-24 22:20:13 +0200
committerDavid Monniaux <david.monniaux@univ-grenoble-alpes.fr>2019-04-24 22:20:13 +0200
commit59089e5d11428dd224b3239bc7f5db602df9b177 (patch)
treed317db6712c80bc4dc45d3ef20bfa1cfb7b57213 /common
parentaa3ac1afb0b05a2d80f697c2179b59f8c73c83fb (diff)
downloadcompcert-kvx-59089e5d11428dd224b3239bc7f5db602df9b177.tar.gz
compcert-kvx-59089e5d11428dd224b3239bc7f5db602df9b177.zip
begin bitfields
Diffstat (limited to 'common')
-rw-r--r--common/Values.v15
1 files changed, 15 insertions, 0 deletions
diff --git a/common/Values.v b/common/Values.v
index a20dd567..ae8d31f3 100644
--- a/common/Values.v
+++ b/common/Values.v
@@ -766,6 +766,21 @@ Definition rolml (v: val) (amount: int) (mask: int64): val :=
| _ => Vundef
end.
+
+Definition extfz stop start v :=
+ if (Int.cmp Cle start stop)
+ && (Int.cmp Cge start Int.zero)
+ && (Int.cmp Clt stop Int.iwordsize)
+ then
+ let stop' := Int.add stop Int.one in
+ match v with
+ | Vint w =>
+ Vint (Int.shr (Int.shl w (Int.sub Int.iwordsize stop')) (Int.sub Int.iwordsize (Int.sub stop' start)))
+ | _ => Vundef
+ end
+ else Vundef.
+
+
(** Comparisons *)
Section COMPARISONS.