Skip to content

Commit a6ecea0

Browse files
redianthusfilipeom
authored andcommitted
add support for Bv of size 16
1 parent 5187562 commit a6ecea0

File tree

3 files changed

+9
-0
lines changed

3 files changed

+9
-0
lines changed

src/smtml/bitvector.ml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@ let of_int8 v =
1717
(* TODO: add a check on v to make sure it is not too big ? *)
1818
make (Z.of_int v) 8
1919

20+
let of_int16 v =
21+
(* TODO: add a check on v to make sure it is not too big ? *)
22+
make (Z.of_int v) 16
23+
2024
let of_int32 v = make (Z.of_int32 v) 32
2125

2226
let of_int64 v = make (Z.of_int64 v) 64

src/smtml/bitvector.mli

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ val make : Z.t -> int -> t
44

55
val of_int8 : int -> t
66

7+
val of_int16 : int -> t
8+
79
val of_int32 : Int32.t -> t
810

911
val of_int64 : Int64.t -> t

src/smtml/mappings.ml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -813,6 +813,9 @@ module Make (M_with_make : M_with_make) : S_with_fresh = struct
813813
| Ty_bitv 8 ->
814814
let i8 = M.Interp.to_bitv v 8 in
815815
Value.Bitv (Bitvector.of_int8 (Int64.to_int i8))
816+
| Ty_bitv 16 ->
817+
let i16 = M.Interp.to_bitv v 16 in
818+
Value.Bitv (Bitvector.of_int16 (Int64.to_int i16))
816819
| Ty_bitv 32 ->
817820
let i32 = M.Interp.to_bitv v 32 in
818821
Value.Bitv (Bitvector.of_int32 (Int64.to_int32 i32))

0 commit comments

Comments
 (0)