summaryrefslogtreecommitdiff
path: root/lib/coq/Sail_operators.v
diff options
context:
space:
mode:
authorBrian Campbell2018-06-08 17:53:24 +0100
committerBrian Campbell2018-06-12 11:58:42 +0100
commit59e94cd92f7c232be7b9147202514f95c08ff459 (patch)
tree3da7838a5931bf8b3a459b1c68edbffaa74ee152 /lib/coq/Sail_operators.v
parent0903f6dd0b6d51fde7b9b3bd45216f02fee4bd85 (diff)
Coq: add more to library
Diffstat (limited to 'lib/coq/Sail_operators.v')
-rw-r--r--lib/coq/Sail_operators.v12
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/coq/Sail_operators.v b/lib/coq/Sail_operators.v
index 8183daea..f94276e9 100644
--- a/lib/coq/Sail_operators.v
+++ b/lib/coq/Sail_operators.v
@@ -242,4 +242,16 @@ Definition ugteq_bv := ucmp_bv (>=)
Definition sgteq_bv := scmp_bv (>=)
*)
+(*val get_slice_int_bv : forall 'a. Bitvector 'a => integer -> integer -> integer -> 'a*)
+Definition get_slice_int_bv {a} `{Bitvector a} len n lo : a :=
+ let hi := lo + len - 1 in
+ let bs := bools_of_int (hi + 1) n in
+ of_bools (subrange_list false bs hi lo).
+
+(*val set_slice_int_bv : forall 'a. Bitvector 'a => integer -> integer -> integer -> 'a -> integer
+Definition set_slice_int_bv {a} `{Bitvector a} len n lo (v : a) :=
+ let hi := lo + len - 1 in
+ let bs := bits_of_int (hi + 1) n in
+ maybe_failwith (signed_of_bits (update_subrange_list false bs hi lo (bits_of v))).*)
+
End Bitvectors.