This repository was archived by the owner on Dec 22, 2021. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +7
-10
lines changed Expand file tree Collapse file tree 2 files changed +7
-10
lines changed Original file line number Diff line number Diff line change 2020 val to_string : t -> string
2121 val bytewidth : int
2222 val of_strings : shape -> string list -> t
23- val of_bits : string -> t
24- val to_bits : t -> string
2523end
2624
2725module type S =
3533 val of_strings : shape -> string list -> t
3634end
3735
38- module Make (Rep : RepType ) : S with type bits = string =
36+ module Make (Rep : RepType ) : S with type bits = Rep. t =
3937struct
4038 type t = Rep .t
41- type bits = string
39+ type bits = Rep .t
4240
4341 let default = Rep. make Rep. bytewidth (chr 0 )
4442 let to_string = Rep. to_string (* FIXME very very wrong *)
45- let of_bits = Rep. of_bits
46- let to_bits = Rep. to_bits
43+ let of_bits x = x
44+ let to_bits x = x
4745 let of_strings = Rep. of_strings
4846end
Original file line number Diff line number Diff line change 11include Simd. Make
22 (struct
3- include Bytes
3+ include String
44 let bytewidth = 16
5- let of_bits = Bytes. of_string
6- let to_bits = Bytes. to_string
5+ let to_string s = s
76
87 let of_strings shape ss =
98 if List. length ss <> Simd. lanes shape then raise (Invalid_argument " wrong length" );
@@ -28,5 +27,5 @@ include Simd.Make
2827 List. iteri (fun i s -> set_int32_le b (i * 4 ) (F32. to_bits (F32. of_string s))) ss
2928 | Simd. F64x2 ->
3029 List. iteri (fun i s -> set_int64_le b (i * 8 ) (F64. to_bits (F64. of_string s))) ss);
31- b
30+ Bytes. to_string b
3231 end )
You can’t perform that action at this time.
0 commit comments