diff options
author | David Monniaux <david.monniaux@univ-grenoble-alpes.fr> | 2019-04-25 11:17:19 +0200 |
---|---|---|
committer | David Monniaux <david.monniaux@univ-grenoble-alpes.fr> | 2019-04-25 11:17:19 +0200 |
commit | 5809fa295f23952a2d8b043f6da69d61da3568de (patch) | |
tree | 1e8890f40a837786d824d1a8cd401c16aee93832 /common | |
parent | bb185aa85ddf32feed61d7888c1b199fffdd821f (diff) | |
download | compcert-kvx-5809fa295f23952a2d8b043f6da69d61da3568de.tar.gz compcert-kvx-5809fa295f23952a2d8b043f6da69d61da3568de.zip |
progress
Diffstat (limited to 'common')
-rw-r--r-- | common/Values.v | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/common/Values.v b/common/Values.v index 837ed799..059a72d9 100644 --- a/common/Values.v +++ b/common/Values.v @@ -775,6 +775,20 @@ Definition extfz stop start v := let stop' := Z.add stop Z.one in match v with | Vint w => + Vint (Int.shru (Int.shl w (Int.repr (Z.sub Int.zwordsize stop'))) (Int.repr (Z.sub Int.zwordsize (Z.sub stop' start)))) + | _ => Vundef + end + else Vundef. + + +Definition extfs stop start v := + if (Z.leb start stop) + && (Z.geb start Z.zero) + && (Z.ltb stop Int.zwordsize) + then + let stop' := Z.add stop Z.one in + match v with + | Vint w => Vint (Int.shr (Int.shl w (Int.repr (Z.sub Int.zwordsize stop'))) (Int.repr (Z.sub Int.zwordsize (Z.sub stop' start)))) | _ => Vundef end |