This repository was archived by the owner on Dec 22, 2021. It is now read-only.
File tree 2 files changed +7
-10
lines changed
2 files changed +7
-10
lines changed Original file line number Diff line number Diff line change 20
20
val to_string : t -> string
21
21
val bytewidth : int
22
22
val of_strings : shape -> string list -> t
23
- val of_bits : string -> t
24
- val to_bits : t -> string
25
23
end
26
24
27
25
module type S =
35
33
val of_strings : shape -> string list -> t
36
34
end
37
35
38
- module Make (Rep : RepType ) : S with type bits = string =
36
+ module Make (Rep : RepType ) : S with type bits = Rep. t =
39
37
struct
40
38
type t = Rep .t
41
- type bits = string
39
+ type bits = Rep .t
42
40
43
41
let default = Rep. make Rep. bytewidth (chr 0 )
44
42
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
47
45
let of_strings = Rep. of_strings
48
46
end
Original file line number Diff line number Diff line change 1
1
include Simd. Make
2
2
(struct
3
- include Bytes
3
+ include String
4
4
let bytewidth = 16
5
- let of_bits = Bytes. of_string
6
- let to_bits = Bytes. to_string
5
+ let to_string s = s
7
6
8
7
let of_strings shape ss =
9
8
if List. length ss <> Simd. lanes shape then raise (Invalid_argument " wrong length" );
@@ -28,5 +27,5 @@ include Simd.Make
28
27
List. iteri (fun i s -> set_int32_le b (i * 4 ) (F32. to_bits (F32. of_string s))) ss
29
28
| Simd. F64x2 ->
30
29
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
32
31
end )
You can’t perform that action at this time.
0 commit comments