File tree Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -44,6 +44,11 @@ import Data.Array
44
44
import System.Metrics.Distribution.Internal (Stats (.. ))
45
45
import System.Metrics.ThreadId
46
46
47
+ -- Three cases for these definitions
48
+ -- 64-bit, GHC has Int64
49
+ -- 64-bit, GHC doesn't have Int64
50
+ -- 32-bit
51
+
47
52
-- 64-bit machine, Int ~ Int64, do it the fast way:
48
53
#if SIZEOF_HSINT == 8
49
54
@@ -87,7 +92,25 @@ writeInt64Array = writeIntArray##
87
92
#endif
88
93
89
94
#else
95
+ -- NB: I've only tested these with the WASM backend:
96
+
97
+ intToInt64 :: Int ## -> Int64 ##
98
+ intToInt64 = intToInt64##
99
+
100
+ plusInt64 :: Int64 ## -> Int64 ## -> Int64 ##
101
+ plusInt64 = plusInt64##
102
+
103
+ eqInt64 :: Int64 ## -> Int64 ## -> Int ##
104
+ eqInt64 = eqInt64##
105
+
106
+ readInt64Array :: MutableByteArray ## d -> Int ## -> State ## d -> (## State ## d , Int64 ## ## )
107
+ readInt64Array = readInt64Array##
108
+
109
+ writeInt64Array :: MutableByteArray ## d -> Int ## -> Int64 ## -> State ## d -> State ## d
110
+ writeInt64Array = writeInt64Array##
111
+
90
112
-- I don't know a better way on 32-bit machines...
113
+ int64ToDouble :: Int64 ## -> Double ##
91
114
int64ToDouble i =
92
115
case fromIntegral (I64 ## i) of (D ## d) -> d
93
116
#endif
You can’t perform that action at this time.
0 commit comments