File tree Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -54,7 +54,12 @@ let to_unsigned (x : nativeint) =
5454 x >>> 0
5555
5656let mk ~lo ~hi = {lo = to_unsigned lo ; hi}
57-
57+ (*
58+ module N = struct
59+ type nonrec t = t = private { hi : nativeint; lo : nativeint ; }
60+ end
61+ open N
62+ *)
5863let min_int = mk ~lo: 0n ~hi: (- 0x80000000n )
5964
6065let max_int =
@@ -111,7 +116,7 @@ let lsl_ ({lo; hi} as x) numBits =
111116 if numBits = 0 then
112117 x
113118 else if numBits > = 32 then
114- {lo = 0n ; hi = Caml_nativeint_extern. shift_left lo (numBits - 32 ) }
119+ mk ~lo: 0n ~hi: ( Caml_nativeint_extern. shift_left lo (numBits - 32 ))
115120 else
116121 mk ~lo: (Caml_nativeint_extern. shift_left lo numBits)
117122 ~hi:
@@ -413,8 +418,11 @@ let to_hex (x : int64) =
413418 else
414419 aux x_hi ^ Caml_utils. repeat pad " 0" ^ lo
415420
421+
416422let discard_sign (x : int64 ) : int64 =
417- unsafe_to_int64 { (unsafe_of_int64 x) with hi = Caml_nativeint_extern. logand 0x7fff_ffffn (unsafe_of_int64 x).hi }
423+ let v = unsafe_of_int64 x in
424+ unsafe_to_int64
425+ { v with hi = Caml_nativeint_extern. logand 0x7fff_ffffn v.hi }
418426
419427(* >>> 0 does not change its bit representation
420428 it simply makes sure it is an unsigned integer
You can’t perform that action at this time.
0 commit comments