-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPrimOp-ByteArray.dl
147 lines (137 loc) · 13.4 KB
/
PrimOp-ByteArray.dl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
/*
HINT: is interpreted -/+
primop effectful
- "newByteArray#" :: T_Int64 -> {"State#" %s} -> {"GHC.Prim.Unit#" {"MutableByteArray#" %s}}
- "newPinnedByteArray#" :: T_Int64 -> {"State#" %s} -> {"GHC.Prim.Unit#" {"MutableByteArray#" %s}}
- "newAlignedPinnedByteArray#" :: T_Int64 -> T_Int64 -> {"State#" %s} -> {"GHC.Prim.Unit#" {"MutableByteArray#" %s}}
primop pure
- "isMutableByteArrayPinned#" :: {"MutableByteArray#" %s} -> T_Int64
- "isByteArrayPinned#" :: {"ByteArray#"} -> T_Int64
- "byteArrayContents#" :: {"ByteArray#"} -> T_Addr
- "sameMutableByteArray#" :: {"MutableByteArray#" %s} -> {"MutableByteArray#" %s} -> T_Int64
primop effectful
- "shrinkMutableByteArray#" :: {"MutableByteArray#" %s} -> T_Int64 -> {"State#" %s} -> {"GHC.Prim.(##)"}
- "resizeMutableByteArray#" :: {"MutableByteArray#" %s} -> T_Int64 -> {"State#" %s} -> {"GHC.Prim.Unit#" {"MutableByteArray#" %s}}
- "unsafeFreezeByteArray#" :: {"MutableByteArray#" %s} -> {"State#" %s} -> {"GHC.Prim.Unit#" {"ByteArray#"}}
primop pure
- "sizeofByteArray#" :: {"ByteArray#"} -> T_Int64
- "sizeofMutableByteArray#" :: {"MutableByteArray#" %s} -> T_Int64
- "getSizeofMutableByteArray#" :: {"MutableByteArray#" %s} -> {"State#" %s} -> {"GHC.Prim.Unit#" T_Int64}
- "indexCharArray#" :: {"ByteArray#"} -> T_Int64 -> T_Char
- "indexWideCharArray#" :: {"ByteArray#"} -> T_Int64 -> T_Char
- "indexIntArray#" :: {"ByteArray#"} -> T_Int64 -> T_Int64
- "indexWordArray#" :: {"ByteArray#"} -> T_Int64 -> T_Word64
- "indexAddrArray#" :: {"ByteArray#"} -> T_Int64 -> T_Addr
- "indexFloatArray#" :: {"ByteArray#"} -> T_Int64 -> T_Float
- "indexDoubleArray#" :: {"ByteArray#"} -> T_Int64 -> T_Double
- "indexStablePtrArray#" :: {"ByteArray#"} -> T_Int64 -> {"StablePtr#" %a}
- "indexInt8Array#" :: {"ByteArray#"} -> T_Int64 -> T_Int64
- "indexInt16Array#" :: {"ByteArray#"} -> T_Int64 -> T_Int64
- "indexInt32Array#" :: {"ByteArray#"} -> T_Int64 -> T_Int64
- "indexInt64Array#" :: {"ByteArray#"} -> T_Int64 -> T_Int64
- "indexWord8Array#" :: {"ByteArray#"} -> T_Int64 -> T_Word64
- "indexWord16Array#" :: {"ByteArray#"} -> T_Int64 -> T_Word64
- "indexWord32Array#" :: {"ByteArray#"} -> T_Int64 -> T_Word64
- "indexWord64Array#" :: {"ByteArray#"} -> T_Int64 -> T_Word64
- "indexWord8ArrayAsChar#" :: {"ByteArray#"} -> T_Int64 -> T_Char
- "indexWord8ArrayAsWideChar#" :: {"ByteArray#"} -> T_Int64 -> T_Char
- "indexWord8ArrayAsAddr#" :: {"ByteArray#"} -> T_Int64 -> T_Addr
- "indexWord8ArrayAsFloat#" :: {"ByteArray#"} -> T_Int64 -> T_Float
- "indexWord8ArrayAsDouble#" :: {"ByteArray#"} -> T_Int64 -> T_Double
- "indexWord8ArrayAsStablePtr#" :: {"ByteArray#"} -> T_Int64 -> {"StablePtr#" %a}
- "indexWord8ArrayAsInt16#" :: {"ByteArray#"} -> T_Int64 -> T_Int64
- "indexWord8ArrayAsInt32#" :: {"ByteArray#"} -> T_Int64 -> T_Int64
- "indexWord8ArrayAsInt64#" :: {"ByteArray#"} -> T_Int64 -> T_Int64
- "indexWord8ArrayAsInt#" :: {"ByteArray#"} -> T_Int64 -> T_Int64
- "indexWord8ArrayAsWord16#" :: {"ByteArray#"} -> T_Int64 -> T_Word64
- "indexWord8ArrayAsWord32#" :: {"ByteArray#"} -> T_Int64 -> T_Word64
- "indexWord8ArrayAsWord64#" :: {"ByteArray#"} -> T_Int64 -> T_Word64
- "indexWord8ArrayAsWord#" :: {"ByteArray#"} -> T_Int64 -> T_Word64
primop effectful
- "readCharArray#" :: {"MutableByteArray#" %s} -> T_Int64 -> {"State#" %s} -> {"GHC.Prim.Unit#" T_Char}
- "readWideCharArray#" :: {"MutableByteArray#" %s} -> T_Int64 -> {"State#" %s} -> {"GHC.Prim.Unit#" T_Char}
- "readIntArray#" :: {"MutableByteArray#" %s} -> T_Int64 -> {"State#" %s} -> {"GHC.Prim.Unit#" T_Int64}
- "readWordArray#" :: {"MutableByteArray#" %s} -> T_Int64 -> {"State#" %s} -> {"GHC.Prim.Unit#" T_Word64}
- "readAddrArray#" :: {"MutableByteArray#" %s} -> T_Int64 -> {"State#" %s} -> {"GHC.Prim.Unit#" T_Addr}
- "readFloatArray#" :: {"MutableByteArray#" %s} -> T_Int64 -> {"State#" %s} -> {"GHC.Prim.Unit#" T_Float}
- "readDoubleArray#" :: {"MutableByteArray#" %s} -> T_Int64 -> {"State#" %s} -> {"GHC.Prim.Unit#" T_Double}
- "readStablePtrArray#" :: {"MutableByteArray#" %s} -> T_Int64 -> {"State#" %s} -> {"GHC.Prim.Unit#" {"StablePtr#" %a}}
- "readInt8Array#" :: {"MutableByteArray#" %s} -> T_Int64 -> {"State#" %s} -> {"GHC.Prim.Unit#" T_Int64}
- "readInt16Array#" :: {"MutableByteArray#" %s} -> T_Int64 -> {"State#" %s} -> {"GHC.Prim.Unit#" T_Int64}
- "readInt32Array#" :: {"MutableByteArray#" %s} -> T_Int64 -> {"State#" %s} -> {"GHC.Prim.Unit#" T_Int64}
- "readInt64Array#" :: {"MutableByteArray#" %s} -> T_Int64 -> {"State#" %s} -> {"GHC.Prim.Unit#" T_Int64}
- "readWord8Array#" :: {"MutableByteArray#" %s} -> T_Int64 -> {"State#" %s} -> {"GHC.Prim.Unit#" T_Word64}
- "readWord16Array#" :: {"MutableByteArray#" %s} -> T_Int64 -> {"State#" %s} -> {"GHC.Prim.Unit#" T_Word64}
- "readWord32Array#" :: {"MutableByteArray#" %s} -> T_Int64 -> {"State#" %s} -> {"GHC.Prim.Unit#" T_Word64}
- "readWord64Array#" :: {"MutableByteArray#" %s} -> T_Int64 -> {"State#" %s} -> {"GHC.Prim.Unit#" T_Word64}
- "readWord8ArrayAsChar#" :: {"MutableByteArray#" %s} -> T_Int64 -> {"State#" %s} -> {"GHC.Prim.Unit#" T_Char}
- "readWord8ArrayAsWideChar#" :: {"MutableByteArray#" %s} -> T_Int64 -> {"State#" %s} -> {"GHC.Prim.Unit#" T_Char}
- "readWord8ArrayAsAddr#" :: {"MutableByteArray#" %s} -> T_Int64 -> {"State#" %s} -> {"GHC.Prim.Unit#" T_Addr}
- "readWord8ArrayAsFloat#" :: {"MutableByteArray#" %s} -> T_Int64 -> {"State#" %s} -> {"GHC.Prim.Unit#" T_Float}
- "readWord8ArrayAsDouble#" :: {"MutableByteArray#" %s} -> T_Int64 -> {"State#" %s} -> {"GHC.Prim.Unit#" T_Double}
- "readWord8ArrayAsStablePtr#" :: {"MutableByteArray#" %s} -> T_Int64 -> {"State#" %s} -> {"GHC.Prim.Unit#" {"StablePtr#" %a}}
- "readWord8ArrayAsInt16#" :: {"MutableByteArray#" %s} -> T_Int64 -> {"State#" %s} -> {"GHC.Prim.Unit#" T_Int64}
- "readWord8ArrayAsInt32#" :: {"MutableByteArray#" %s} -> T_Int64 -> {"State#" %s} -> {"GHC.Prim.Unit#" T_Int64}
- "readWord8ArrayAsInt64#" :: {"MutableByteArray#" %s} -> T_Int64 -> {"State#" %s} -> {"GHC.Prim.Unit#" T_Int64}
- "readWord8ArrayAsInt#" :: {"MutableByteArray#" %s} -> T_Int64 -> {"State#" %s} -> {"GHC.Prim.Unit#" T_Int64}
- "readWord8ArrayAsWord16#" :: {"MutableByteArray#" %s} -> T_Int64 -> {"State#" %s} -> {"GHC.Prim.Unit#" T_Word64}
- "readWord8ArrayAsWord32#" :: {"MutableByteArray#" %s} -> T_Int64 -> {"State#" %s} -> {"GHC.Prim.Unit#" T_Word64}
- "readWord8ArrayAsWord64#" :: {"MutableByteArray#" %s} -> T_Int64 -> {"State#" %s} -> {"GHC.Prim.Unit#" T_Word64}
- "readWord8ArrayAsWord#" :: {"MutableByteArray#" %s} -> T_Int64 -> {"State#" %s} -> {"GHC.Prim.Unit#" T_Word64}
- "writeCharArray#" :: {"MutableByteArray#" %s} -> T_Int64 -> T_Char -> {"State#" %s} -> {"GHC.Prim.(##)"}
- "writeWideCharArray#" :: {"MutableByteArray#" %s} -> T_Int64 -> T_Char -> {"State#" %s} -> {"GHC.Prim.(##)"}
- "writeIntArray#" :: {"MutableByteArray#" %s} -> T_Int64 -> T_Int64 -> {"State#" %s} -> {"GHC.Prim.(##)"}
- "writeWordArray#" :: {"MutableByteArray#" %s} -> T_Int64 -> T_Word64 -> {"State#" %s} -> {"GHC.Prim.(##)"}
- "writeAddrArray#" :: {"MutableByteArray#" %s} -> T_Int64 -> T_Addr -> {"State#" %s} -> {"GHC.Prim.(##)"}
- "writeFloatArray#" :: {"MutableByteArray#" %s} -> T_Int64 -> T_Float -> {"State#" %s} -> {"GHC.Prim.(##)"}
- "writeDoubleArray#" :: {"MutableByteArray#" %s} -> T_Int64 -> T_Double -> {"State#" %s} -> {"GHC.Prim.(##)"}
- "writeStablePtrArray#" :: {"MutableByteArray#" %s} -> T_Int64 -> {"StablePtr#" %a} -> {"State#" %s} -> {"GHC.Prim.(##)"}
- "writeInt8Array#" :: {"MutableByteArray#" %s} -> T_Int64 -> T_Int64 -> {"State#" %s} -> {"GHC.Prim.(##)"}
- "writeInt16Array#" :: {"MutableByteArray#" %s} -> T_Int64 -> T_Int64 -> {"State#" %s} -> {"GHC.Prim.(##)"}
- "writeInt32Array#" :: {"MutableByteArray#" %s} -> T_Int64 -> T_Int64 -> {"State#" %s} -> {"GHC.Prim.(##)"}
- "writeInt64Array#" :: {"MutableByteArray#" %s} -> T_Int64 -> T_Int64 -> {"State#" %s} -> {"GHC.Prim.(##)"}
- "writeWord8Array#" :: {"MutableByteArray#" %s} -> T_Int64 -> T_Word64 -> {"State#" %s} -> {"GHC.Prim.(##)"}
- "writeWord16Array#" :: {"MutableByteArray#" %s} -> T_Int64 -> T_Word64 -> {"State#" %s} -> {"GHC.Prim.(##)"}
- "writeWord32Array#" :: {"MutableByteArray#" %s} -> T_Int64 -> T_Word64 -> {"State#" %s} -> {"GHC.Prim.(##)"}
- "writeWord64Array#" :: {"MutableByteArray#" %s} -> T_Int64 -> T_Word64 -> {"State#" %s} -> {"GHC.Prim.(##)"}
- "writeWord8ArrayAsChar#" :: {"MutableByteArray#" %s} -> T_Int64 -> T_Char -> {"State#" %s} -> {"GHC.Prim.(##)"}
- "writeWord8ArrayAsWideChar#" :: {"MutableByteArray#" %s} -> T_Int64 -> T_Char -> {"State#" %s} -> {"GHC.Prim.(##)"}
- "writeWord8ArrayAsAddr#" :: {"MutableByteArray#" %s} -> T_Int64 -> T_Addr -> {"State#" %s} -> {"GHC.Prim.(##)"}
- "writeWord8ArrayAsFloat#" :: {"MutableByteArray#" %s} -> T_Int64 -> T_Float -> {"State#" %s} -> {"GHC.Prim.(##)"}
- "writeWord8ArrayAsDouble#" :: {"MutableByteArray#" %s} -> T_Int64 -> T_Double -> {"State#" %s} -> {"GHC.Prim.(##)"}
- "writeWord8ArrayAsStablePtr#" :: {"MutableByteArray#" %s} -> T_Int64 -> {"StablePtr#" %a} -> {"State#" %s} -> {"GHC.Prim.(##)"}
- "writeWord8ArrayAsInt16#" :: {"MutableByteArray#" %s} -> T_Int64 -> T_Int64 -> {"State#" %s} -> {"GHC.Prim.(##)"}
- "writeWord8ArrayAsInt32#" :: {"MutableByteArray#" %s} -> T_Int64 -> T_Int64 -> {"State#" %s} -> {"GHC.Prim.(##)"}
- "writeWord8ArrayAsInt64#" :: {"MutableByteArray#" %s} -> T_Int64 -> T_Int64 -> {"State#" %s} -> {"GHC.Prim.(##)"}
- "writeWord8ArrayAsInt#" :: {"MutableByteArray#" %s} -> T_Int64 -> T_Int64 -> {"State#" %s} -> {"GHC.Prim.(##)"}
- "writeWord8ArrayAsWord16#" :: {"MutableByteArray#" %s} -> T_Int64 -> T_Word64 -> {"State#" %s} -> {"GHC.Prim.(##)"}
- "writeWord8ArrayAsWord32#" :: {"MutableByteArray#" %s} -> T_Int64 -> T_Word64 -> {"State#" %s} -> {"GHC.Prim.(##)"}
- "writeWord8ArrayAsWord64#" :: {"MutableByteArray#" %s} -> T_Int64 -> T_Word64 -> {"State#" %s} -> {"GHC.Prim.(##)"}
- "writeWord8ArrayAsWord#" :: {"MutableByteArray#" %s} -> T_Int64 -> T_Word64 -> {"State#" %s} -> {"GHC.Prim.(##)"}
primop pure
- "compareByteArrays#" :: {"ByteArray#"} -> T_Int64 -> {"ByteArray#"} -> T_Int64 -> T_Int64 -> T_Int64
primop effectful
- "copyByteArray#" :: {"ByteArray#"} -> T_Int64 -> {"MutableByteArray#" %s} -> T_Int64 -> T_Int64 -> {"State#" %s} -> {"GHC.Prim.(##)"}
- "copyMutableByteArray#" :: {"MutableByteArray#" %s} -> T_Int64 -> {"MutableByteArray#" %s} -> T_Int64 -> T_Int64 -> {"State#" %s} -> {"GHC.Prim.(##)"}
- "copyByteArrayToAddr#" :: {"ByteArray#"} -> T_Int64 -> T_Addr -> T_Int64 -> {"State#" %s} -> {"GHC.Prim.(##)"}
- "copyMutableByteArrayToAddr#" :: {"MutableByteArray#" %s} -> T_Int64 -> T_Addr -> T_Int64 -> {"State#" %s} -> {"GHC.Prim.(##)"}
- "copyAddrToByteArray#" :: T_Addr -> {"MutableByteArray#" %s} -> T_Int64 -> T_Int64 -> {"State#" %s} -> {"GHC.Prim.(##)"}
- "setByteArray#" :: {"MutableByteArray#" %s} -> T_Int64 -> T_Int64 -> T_Int64 -> {"State#" %s} -> {"GHC.Prim.(##)"}
- "atomicReadIntArray#" :: {"MutableByteArray#" %s} -> T_Int64 -> {"State#" %s} -> {"GHC.Prim.Unit#" T_Int64}
- "atomicWriteIntArray#" :: {"MutableByteArray#" %s} -> T_Int64 -> T_Int64 -> {"State#" %s} -> {"GHC.Prim.(##)"}
- "casIntArray#" :: {"MutableByteArray#" %s} -> T_Int64 -> T_Int64 -> T_Int64 -> {"State#" %s} -> {"GHC.Prim.Unit#" T_Int64}
- "fetchAddIntArray#" :: {"MutableByteArray#" %s} -> T_Int64 -> T_Int64 -> {"State#" %s} -> {"GHC.Prim.Unit#" T_Int64}
- "fetchSubIntArray#" :: {"MutableByteArray#" %s} -> T_Int64 -> T_Int64 -> {"State#" %s} -> {"GHC.Prim.Unit#" T_Int64}
- "fetchAndIntArray#" :: {"MutableByteArray#" %s} -> T_Int64 -> T_Int64 -> {"State#" %s} -> {"GHC.Prim.Unit#" T_Int64}
- "fetchNandIntArray#" :: {"MutableByteArray#" %s} -> T_Int64 -> T_Int64 -> {"State#" %s} -> {"GHC.Prim.Unit#" T_Int64}
- "fetchOrIntArray#" :: {"MutableByteArray#" %s} -> T_Int64 -> T_Int64 -> {"State#" %s} -> {"GHC.Prim.Unit#" T_Int64}
- "fetchXorIntArray#" :: {"MutableByteArray#" %s} -> T_Int64 -> T_Int64 -> {"State#" %s} -> {"GHC.Prim.Unit#" T_Int64}
*/
/*
NOTE: all StablePtr is accessible via T_Addr and ByteArray#
HINT: ByteArray is a strict data structure
Q: do we want to collect content for every type?
A: it would be as meaningful as collecting this for arithmetic operations ; In conclusion it is not necessary.
NOTE: StablePtr is a global container.
ByteArray operations can not return unlifted values, thust they are not interpreted.
*/