| ... |
... |
@@ -87,17 +87,27 @@ cgOpApp (StgPrimCallOp primcall) args _res_ty |
|
87
|
87
|
; emitCall (NativeNodeCall, NativeReturn) fun cmm_args }
|
|
88
|
88
|
|
|
89
|
89
|
cmmPrimOpApp :: StgToCmmConfig -> PrimOp -> [CmmExpr] -> Maybe Type -> FCode ReturnKind
|
|
90
|
|
-cmmPrimOpApp cfg primop cmm_args mres_ty =
|
|
91
|
|
- case emitPrimOp cfg primop cmm_args of
|
|
92
|
|
- PrimopCmmEmit_Internal f ->
|
|
93
|
|
- let
|
|
94
|
|
- -- if the result type isn't explicitly given, we directly use the
|
|
95
|
|
- -- result type of the primop.
|
|
96
|
|
- res_ty = fromMaybe (primOpResultType primop) mres_ty
|
|
97
|
|
- in emitReturn =<< f res_ty
|
|
98
|
|
- PrimopCmmEmit_External -> do
|
|
99
|
|
- let fun = CmmLit (CmmLabel (mkRtsPrimOpLabel primop))
|
|
100
|
|
- emitCall (NativeNodeCall, NativeReturn) fun cmm_args
|
|
|
90
|
+cmmPrimOpApp cfg primop cmm_args mres_ty = do
|
|
|
91
|
+ let PrimopCmmEmit _inline f = emitPrimOp cfg primop cmm_args
|
|
|
92
|
+ let
|
|
|
93
|
+ -- if the result type isn't explicitly given, we directly use the
|
|
|
94
|
+ -- result type of the primop.
|
|
|
95
|
+ res_ty = fromMaybe (primOpResultType primop) mres_ty
|
|
|
96
|
+ f res_ty
|
|
|
97
|
+
|
|
|
98
|
+externalPrimop :: PrimOp -> [CmmExpr] -> PrimopCmmEmit
|
|
|
99
|
+externalPrimop primop args = outOfLinePrimop (callExternalPrimop primop args)
|
|
|
100
|
+
|
|
|
101
|
+outOfLinePrimop :: FCode ReturnKind -> PrimopCmmEmit
|
|
|
102
|
+outOfLinePrimop code = PrimopCmmEmit
|
|
|
103
|
+ { primopCmmInline = False
|
|
|
104
|
+ , primopCmmCode = \_res_ty -> code
|
|
|
105
|
+ }
|
|
|
106
|
+
|
|
|
107
|
+callExternalPrimop :: PrimOp -> [CmmExpr] -> FCode ReturnKind
|
|
|
108
|
+callExternalPrimop primop args = do
|
|
|
109
|
+ let fun = CmmLit (CmmLabel (mkRtsPrimOpLabel primop))
|
|
|
110
|
+ emitCall (NativeNodeCall, NativeReturn) fun args
|
|
101
|
111
|
|
|
102
|
112
|
|
|
103
|
113
|
-- | Interpret the argument as an unsigned value, assuming the value
|
| ... |
... |
@@ -121,8 +131,7 @@ asUnsigned w n = n .&. (bit (widthInBits w) - 1) |
|
121
|
131
|
|
|
122
|
132
|
shouldInlinePrimOp :: StgToCmmConfig -> PrimOp -> [CmmExpr] -> Bool
|
|
123
|
133
|
shouldInlinePrimOp cfg op args = case emitPrimOp cfg op args of
|
|
124
|
|
- PrimopCmmEmit_External -> False
|
|
125
|
|
- PrimopCmmEmit_Internal _ -> True
|
|
|
134
|
+ PrimopCmmEmit inline _ -> inline
|
|
126
|
135
|
|
|
127
|
136
|
-- TODO: Several primop implementations (e.g. 'doNewByteArrayOp') use
|
|
128
|
137
|
-- ByteOff (or some other fixed width signed type) to represent
|
| ... |
... |
@@ -153,103 +162,135 @@ emitPrimOp cfg primop = |
|
153
|
162
|
NewByteArrayOp_Char -> \case
|
|
154
|
163
|
[(CmmLit (CmmInt n w))]
|
|
155
|
164
|
| asUnsigned w n <= max_inl_alloc_size
|
|
156
|
|
- -> opIntoRegs $ \ [res] -> doNewByteArrayOp res (fromInteger n)
|
|
157
|
|
- _ -> PrimopCmmEmit_External
|
|
|
165
|
+ -> inlinePrimop $ \ [res] -> doNewByteArrayOp res (fromInteger n)
|
|
|
166
|
+ args -> externalPrimop primop args
|
|
158
|
167
|
|
|
159
|
168
|
NewArrayOp -> \case
|
|
160
|
169
|
[(CmmLit (CmmInt n w)), init]
|
|
161
|
170
|
| wordsToBytes platform (asUnsigned w n) <= max_inl_alloc_size
|
|
162
|
|
- -> opIntoRegs $ \[res] -> doNewArrayOp res (arrPtrsRep platform (fromInteger n)) mkMAP_DIRTY_infoLabel
|
|
|
171
|
+ -> inlinePrimop $ \[res] -> doNewArrayOp res (arrPtrsRep platform (fromInteger n)) mkMAP_DIRTY_infoLabel
|
|
163
|
172
|
[ (mkIntExpr platform (fromInteger n),
|
|
164
|
173
|
fixedHdrSize profile + pc_OFFSET_StgMutArrPtrs_ptrs (platformConstants platform))
|
|
165
|
174
|
, (mkIntExpr platform (nonHdrSizeW (arrPtrsRep platform (fromInteger n))),
|
|
166
|
175
|
fixedHdrSize profile + pc_OFFSET_StgMutArrPtrs_size (platformConstants platform))
|
|
167
|
176
|
]
|
|
168
|
177
|
(fromInteger n) init
|
|
169
|
|
- _ -> PrimopCmmEmit_External
|
|
|
178
|
+ args -> externalPrimop primop args
|
|
170
|
179
|
|
|
171
|
180
|
CopyArrayOp -> \case
|
|
172
|
181
|
[src, src_off, dst, dst_off, (CmmLit (CmmInt n _))] ->
|
|
173
|
|
- opIntoRegs $ \ [] -> doCopyArrayOp src src_off dst dst_off (fromInteger n)
|
|
174
|
|
- _ -> PrimopCmmEmit_External
|
|
|
182
|
+ inlinePrimop $ \ [] -> doCopyArrayOp src src_off dst dst_off (fromInteger n)
|
|
|
183
|
+ [src, src_off, dst, dst_off, n] ->
|
|
|
184
|
+ outOfLinePrimop $ do
|
|
|
185
|
+ profile <- getProfile
|
|
|
186
|
+ platform <- getPlatform
|
|
|
187
|
+ whenCheckBounds $ ifNonZero n $ do
|
|
|
188
|
+ emitRangeBoundsCheck src_off n (ptrArraySize platform profile src)
|
|
|
189
|
+ emitRangeBoundsCheck dst_off n (ptrArraySize platform profile dst)
|
|
|
190
|
+ callExternalPrimop CopyArrayOp [src, src_off, dst, dst_off, n]
|
|
|
191
|
+ _ -> panic "CopyArrayOp"
|
|
175
|
192
|
|
|
176
|
193
|
CopyMutableArrayOp -> \case
|
|
177
|
194
|
[src, src_off, dst, dst_off, (CmmLit (CmmInt n _))] ->
|
|
178
|
|
- opIntoRegs $ \ [] -> doCopyMutableArrayOp src src_off dst dst_off (fromInteger n)
|
|
179
|
|
- _ -> PrimopCmmEmit_External
|
|
|
195
|
+ inlinePrimop $ \ [] -> doCopyMutableArrayOp src src_off dst dst_off (fromInteger n)
|
|
|
196
|
+ [src, src_off, dst, dst_off, n] ->
|
|
|
197
|
+ outOfLinePrimop $ do
|
|
|
198
|
+ profile <- getProfile
|
|
|
199
|
+ platform <- getPlatform
|
|
|
200
|
+ whenCheckBounds $ ifNonZero n $ do
|
|
|
201
|
+ emitRangeBoundsCheck src_off n (ptrArraySize platform profile src)
|
|
|
202
|
+ emitRangeBoundsCheck dst_off n (ptrArraySize platform profile dst)
|
|
|
203
|
+ callExternalPrimop CopyMutableArrayOp [src, src_off, dst, dst_off, n]
|
|
|
204
|
+ _ -> panic "CopyMutableArrayOp"
|
|
180
|
205
|
|
|
181
|
206
|
CloneArrayOp -> \case
|
|
182
|
207
|
[src, src_off, (CmmLit (CmmInt n w))]
|
|
183
|
208
|
| wordsToBytes platform (asUnsigned w n) <= max_inl_alloc_size
|
|
184
|
|
- -> opIntoRegs $ \ [res] -> emitCloneArray mkMAP_FROZEN_CLEAN_infoLabel res src src_off (fromInteger n)
|
|
185
|
|
- _ -> PrimopCmmEmit_External
|
|
|
209
|
+ -> inlinePrimop $ \ [res] -> emitCloneArray mkMAP_FROZEN_CLEAN_infoLabel res src src_off (fromInteger n)
|
|
|
210
|
+ args -> externalPrimop primop args
|
|
186
|
211
|
|
|
187
|
212
|
CloneMutableArrayOp -> \case
|
|
188
|
213
|
[src, src_off, (CmmLit (CmmInt n w))]
|
|
189
|
214
|
| wordsToBytes platform (asUnsigned w n) <= max_inl_alloc_size
|
|
190
|
|
- -> opIntoRegs $ \ [res] -> emitCloneArray mkMAP_DIRTY_infoLabel res src src_off (fromInteger n)
|
|
191
|
|
- _ -> PrimopCmmEmit_External
|
|
|
215
|
+ -> inlinePrimop $ \ [res] -> emitCloneArray mkMAP_DIRTY_infoLabel res src src_off (fromInteger n)
|
|
|
216
|
+ args -> externalPrimop primop args
|
|
192
|
217
|
|
|
193
|
218
|
FreezeArrayOp -> \case
|
|
194
|
219
|
[src, src_off, (CmmLit (CmmInt n w))]
|
|
195
|
220
|
| wordsToBytes platform (asUnsigned w n) <= max_inl_alloc_size
|
|
196
|
|
- -> opIntoRegs $ \ [res] -> emitCloneArray mkMAP_FROZEN_CLEAN_infoLabel res src src_off (fromInteger n)
|
|
197
|
|
- _ -> PrimopCmmEmit_External
|
|
|
221
|
+ -> inlinePrimop $ \ [res] -> emitCloneArray mkMAP_FROZEN_CLEAN_infoLabel res src src_off (fromInteger n)
|
|
|
222
|
+ args -> externalPrimop primop args
|
|
198
|
223
|
|
|
199
|
224
|
ThawArrayOp -> \case
|
|
200
|
225
|
[src, src_off, (CmmLit (CmmInt n w))]
|
|
201
|
226
|
| wordsToBytes platform (asUnsigned w n) <= max_inl_alloc_size
|
|
202
|
|
- -> opIntoRegs $ \ [res] -> emitCloneArray mkMAP_DIRTY_infoLabel res src src_off (fromInteger n)
|
|
203
|
|
- _ -> PrimopCmmEmit_External
|
|
|
227
|
+ -> inlinePrimop $ \ [res] -> emitCloneArray mkMAP_DIRTY_infoLabel res src src_off (fromInteger n)
|
|
|
228
|
+ args -> externalPrimop primop args
|
|
204
|
229
|
|
|
205
|
230
|
NewSmallArrayOp -> \case
|
|
206
|
231
|
[(CmmLit (CmmInt n w)), init]
|
|
207
|
232
|
| wordsToBytes platform (asUnsigned w n) <= max_inl_alloc_size
|
|
208
|
|
- -> opIntoRegs $ \ [res] ->
|
|
|
233
|
+ -> inlinePrimop $ \ [res] ->
|
|
209
|
234
|
doNewArrayOp res (smallArrPtrsRep (fromInteger n)) mkSMAP_DIRTY_infoLabel
|
|
210
|
235
|
[ (mkIntExpr platform (fromInteger n),
|
|
211
|
236
|
fixedHdrSize profile + pc_OFFSET_StgSmallMutArrPtrs_ptrs (platformConstants platform))
|
|
212
|
237
|
]
|
|
213
|
238
|
(fromInteger n) init
|
|
214
|
|
- _ -> PrimopCmmEmit_External
|
|
|
239
|
+ args -> externalPrimop primop args
|
|
215
|
240
|
|
|
216
|
241
|
CopySmallArrayOp -> \case
|
|
217
|
242
|
[src, src_off, dst, dst_off, (CmmLit (CmmInt n _))] ->
|
|
218
|
|
- opIntoRegs $ \ [] -> doCopySmallArrayOp src src_off dst dst_off (fromInteger n)
|
|
219
|
|
- _ -> PrimopCmmEmit_External
|
|
|
243
|
+ inlinePrimop $ \ [] -> doCopySmallArrayOp src src_off dst dst_off (fromInteger n)
|
|
|
244
|
+ [src, src_off, dst, dst_off, n] ->
|
|
|
245
|
+ outOfLinePrimop $ do
|
|
|
246
|
+ profile <- getProfile
|
|
|
247
|
+ platform <- getPlatform
|
|
|
248
|
+ whenCheckBounds $ ifNonZero n $ do
|
|
|
249
|
+ emitRangeBoundsCheck src_off n (smallPtrArraySize platform profile src)
|
|
|
250
|
+ emitRangeBoundsCheck dst_off n (smallPtrArraySize platform profile dst)
|
|
|
251
|
+ callExternalPrimop CopySmallArrayOp [src, src_off, dst, dst_off, n]
|
|
|
252
|
+ _ -> panic "CopySmallArrayOp"
|
|
220
|
253
|
|
|
221
|
254
|
CopySmallMutableArrayOp -> \case
|
|
222
|
255
|
[src, src_off, dst, dst_off, (CmmLit (CmmInt n _))] ->
|
|
223
|
|
- opIntoRegs $ \ [] -> doCopySmallMutableArrayOp src src_off dst dst_off (fromInteger n)
|
|
224
|
|
- _ -> PrimopCmmEmit_External
|
|
|
256
|
+ inlinePrimop $ \ [] -> doCopySmallMutableArrayOp src src_off dst dst_off (fromInteger n)
|
|
|
257
|
+ [src, src_off, dst, dst_off, n] ->
|
|
|
258
|
+ outOfLinePrimop $ do
|
|
|
259
|
+ profile <- getProfile
|
|
|
260
|
+ platform <- getPlatform
|
|
|
261
|
+ whenCheckBounds $ ifNonZero n $ do
|
|
|
262
|
+ emitRangeBoundsCheck src_off n (smallPtrArraySize platform profile src)
|
|
|
263
|
+ emitRangeBoundsCheck dst_off n (smallPtrArraySize platform profile dst)
|
|
|
264
|
+ callExternalPrimop CopySmallMutableArrayOp [src, src_off, dst, dst_off, n]
|
|
|
265
|
+ _ -> panic "CopySmallMutableArrayOp"
|
|
225
|
266
|
|
|
226
|
267
|
CloneSmallArrayOp -> \case
|
|
227
|
268
|
[src, src_off, (CmmLit (CmmInt n w))]
|
|
228
|
269
|
| wordsToBytes platform (asUnsigned w n) <= max_inl_alloc_size
|
|
229
|
|
- -> opIntoRegs $ \ [res] -> emitCloneSmallArray mkSMAP_FROZEN_CLEAN_infoLabel res src src_off (fromInteger n)
|
|
230
|
|
- _ -> PrimopCmmEmit_External
|
|
|
270
|
+ -> inlinePrimop $ \ [res] -> emitCloneSmallArray mkSMAP_FROZEN_CLEAN_infoLabel res src src_off (fromInteger n)
|
|
|
271
|
+ args -> externalPrimop primop args
|
|
231
|
272
|
|
|
232
|
273
|
CloneSmallMutableArrayOp -> \case
|
|
233
|
274
|
[src, src_off, (CmmLit (CmmInt n w))]
|
|
234
|
275
|
| wordsToBytes platform (asUnsigned w n) <= max_inl_alloc_size
|
|
235
|
|
- -> opIntoRegs $ \ [res] -> emitCloneSmallArray mkSMAP_DIRTY_infoLabel res src src_off (fromInteger n)
|
|
236
|
|
- _ -> PrimopCmmEmit_External
|
|
|
276
|
+ -> inlinePrimop $ \ [res] -> emitCloneSmallArray mkSMAP_DIRTY_infoLabel res src src_off (fromInteger n)
|
|
|
277
|
+ args -> externalPrimop primop args
|
|
237
|
278
|
|
|
238
|
279
|
FreezeSmallArrayOp -> \case
|
|
239
|
280
|
[src, src_off, (CmmLit (CmmInt n w))]
|
|
240
|
281
|
| wordsToBytes platform (asUnsigned w n) <= max_inl_alloc_size
|
|
241
|
|
- -> opIntoRegs $ \ [res] -> emitCloneSmallArray mkSMAP_FROZEN_CLEAN_infoLabel res src src_off (fromInteger n)
|
|
242
|
|
- _ -> PrimopCmmEmit_External
|
|
|
282
|
+ -> inlinePrimop $ \ [res] -> emitCloneSmallArray mkSMAP_FROZEN_CLEAN_infoLabel res src src_off (fromInteger n)
|
|
|
283
|
+ args -> externalPrimop primop args
|
|
243
|
284
|
|
|
244
|
285
|
ThawSmallArrayOp -> \case
|
|
245
|
286
|
[src, src_off, (CmmLit (CmmInt n w))]
|
|
246
|
287
|
| wordsToBytes platform (asUnsigned w n) <= max_inl_alloc_size
|
|
247
|
|
- -> opIntoRegs $ \ [res] -> emitCloneSmallArray mkSMAP_DIRTY_infoLabel res src src_off (fromInteger n)
|
|
248
|
|
- _ -> PrimopCmmEmit_External
|
|
|
288
|
+ -> inlinePrimop $ \ [res] -> emitCloneSmallArray mkSMAP_DIRTY_infoLabel res src src_off (fromInteger n)
|
|
|
289
|
+ args -> externalPrimop primop args
|
|
249
|
290
|
|
|
250
|
291
|
-- First we handle various awkward cases specially.
|
|
251
|
292
|
|
|
252
|
|
- ParOp -> \[arg] -> opIntoRegs $ \[res] ->
|
|
|
293
|
+ ParOp -> \[arg] -> inlinePrimop $ \[res] ->
|
|
253
|
294
|
-- for now, just implement this in a C function
|
|
254
|
295
|
-- later, we might want to inline it.
|
|
255
|
296
|
emitCCall
|
| ... |
... |
@@ -257,7 +298,7 @@ emitPrimOp cfg primop = |
|
257
|
298
|
(CmmLit (CmmLabel (mkForeignLabel (fsLit "newSpark") ForeignLabelInExternalPackage IsFunction)))
|
|
258
|
299
|
[(baseExpr platform, AddrHint), (arg,AddrHint)]
|
|
259
|
300
|
|
|
260
|
|
- SparkOp -> \[arg] -> opIntoRegs $ \[res] -> do
|
|
|
301
|
+ SparkOp -> \[arg] -> inlinePrimop $ \[res] -> do
|
|
261
|
302
|
-- returns the value of arg in res. We're going to therefore
|
|
262
|
303
|
-- refer to arg twice (once to pass to newSpark(), and once to
|
|
263
|
304
|
-- assign to res), so put it in a temporary.
|
| ... |
... |
@@ -269,24 +310,24 @@ emitPrimOp cfg primop = |
|
269
|
310
|
[(baseExpr platform, AddrHint), ((CmmReg (CmmLocal tmp)), AddrHint)]
|
|
270
|
311
|
emitAssign (CmmLocal res) (CmmReg (CmmLocal tmp))
|
|
271
|
312
|
|
|
272
|
|
- GetCCSOfOp -> \[arg] -> opIntoRegs $ \[res] -> do
|
|
|
313
|
+ GetCCSOfOp -> \[arg] -> inlinePrimop $ \[res] -> do
|
|
273
|
314
|
let
|
|
274
|
315
|
val
|
|
275
|
316
|
| profileIsProfiling profile = costCentreFrom platform (cmmUntag platform arg)
|
|
276
|
317
|
| otherwise = CmmLit (zeroCLit platform)
|
|
277
|
318
|
emitAssign (CmmLocal res) val
|
|
278
|
319
|
|
|
279
|
|
- GetCurrentCCSOp -> \[_] -> opIntoRegs $ \[res] ->
|
|
|
320
|
+ GetCurrentCCSOp -> \[_] -> inlinePrimop $ \[res] ->
|
|
280
|
321
|
emitAssign (CmmLocal res) (cccsExpr platform)
|
|
281
|
322
|
|
|
282
|
|
- MyThreadIdOp -> \[] -> opIntoRegs $ \[res] ->
|
|
|
323
|
+ MyThreadIdOp -> \[] -> inlinePrimop $ \[res] ->
|
|
283
|
324
|
emitAssign (CmmLocal res) (currentTSOExpr platform)
|
|
284
|
325
|
|
|
285
|
|
- ReadMutVarOp -> \[mutv] -> opIntoRegs $ \[res] ->
|
|
|
326
|
+ ReadMutVarOp -> \[mutv] -> inlinePrimop $ \[res] ->
|
|
286
|
327
|
emitPrimCall [res] (MO_AtomicRead (wordWidth platform) MemOrderAcquire)
|
|
287
|
328
|
[ cmmOffsetW platform mutv (fixedHdrSizeW profile) ]
|
|
288
|
329
|
|
|
289
|
|
- WriteMutVarOp -> \[mutv, var] -> opIntoRegs $ \[] -> do
|
|
|
330
|
+ WriteMutVarOp -> \[mutv, var] -> inlinePrimop $ \[] -> do
|
|
290
|
331
|
old_val <- CmmLocal <$> newTemp (cmmExprType platform var)
|
|
291
|
332
|
emitAssign old_val (cmmLoadIndexW platform mutv (fixedHdrSizeW profile) (gcWord platform))
|
|
292
|
333
|
|
| ... |
... |
@@ -299,14 +340,14 @@ emitPrimOp cfg primop = |
|
299
|
340
|
[ cmmOffsetW platform mutv (fixedHdrSizeW profile), var ]
|
|
300
|
341
|
emitDirtyMutVar mutv (CmmReg old_val)
|
|
301
|
342
|
|
|
302
|
|
- AtomicSwapMutVarOp -> \[mutv, val] -> opIntoRegs $ \[res] -> do
|
|
|
343
|
+ AtomicSwapMutVarOp -> \[mutv, val] -> inlinePrimop $ \[res] -> do
|
|
303
|
344
|
let dst = cmmOffsetW platform mutv (fixedHdrSizeW profile)
|
|
304
|
345
|
emitPrimCall [res] (MO_Xchg (wordWidth platform)) [dst, val]
|
|
305
|
346
|
emitDirtyMutVar mutv (CmmReg (CmmLocal res))
|
|
306
|
347
|
|
|
307
|
348
|
-- #define sizzeofByteArrayzh(r,a) \
|
|
308
|
349
|
-- r = ((StgArrBytes *)(a))->bytes
|
|
309
|
|
- SizeofByteArrayOp -> \[arg] -> opIntoRegs $ \[res] ->
|
|
|
350
|
+ SizeofByteArrayOp -> \[arg] -> inlinePrimop $ \[res] ->
|
|
310
|
351
|
emitAssign (CmmLocal res) (byteArraySize platform profile arg)
|
|
311
|
352
|
|
|
312
|
353
|
-- #define sizzeofMutableByteArrayzh(r,a) \
|
| ... |
... |
@@ -315,37 +356,37 @@ emitPrimOp cfg primop = |
|
315
|
356
|
|
|
316
|
357
|
-- #define getSizzeofMutableByteArrayzh(r,a) \
|
|
317
|
358
|
-- r = ((StgArrBytes *)(a))->bytes
|
|
318
|
|
- GetSizeofMutableByteArrayOp -> \[arg] -> opIntoRegs $ \[res] ->
|
|
|
359
|
+ GetSizeofMutableByteArrayOp -> \[arg] -> inlinePrimop $ \[res] ->
|
|
319
|
360
|
emitAssign (CmmLocal res) (byteArraySize platform profile arg)
|
|
320
|
361
|
|
|
321
|
362
|
|
|
322
|
363
|
-- #define touchzh(o) /* nothing */
|
|
323
|
|
- TouchOp -> \args@[_] -> opIntoRegs $ \res@[] ->
|
|
|
364
|
+ TouchOp -> \args@[_] -> inlinePrimop $ \res@[] ->
|
|
324
|
365
|
emitPrimCall res MO_Touch args
|
|
325
|
366
|
|
|
326
|
367
|
-- #define byteArrayContentszh(r,a) r = BYTE_ARR_CTS(a)
|
|
327
|
|
- ByteArrayContents_Char -> \[arg] -> opIntoRegs $ \[res] ->
|
|
|
368
|
+ ByteArrayContents_Char -> \[arg] -> inlinePrimop $ \[res] ->
|
|
328
|
369
|
emitAssign (CmmLocal res) (cmmOffsetB platform arg (arrWordsHdrSize profile))
|
|
329
|
370
|
|
|
330
|
371
|
-- #define mutableByteArrayContentszh(r,a) r = BYTE_ARR_CTS(a)
|
|
331
|
|
- MutableByteArrayContents_Char -> \[arg] -> opIntoRegs $ \[res] ->
|
|
|
372
|
+ MutableByteArrayContents_Char -> \[arg] -> inlinePrimop $ \[res] ->
|
|
332
|
373
|
emitAssign (CmmLocal res) (cmmOffsetB platform arg (arrWordsHdrSize profile))
|
|
333
|
374
|
|
|
334
|
375
|
-- #define stableNameToIntzh(r,s) (r = ((StgStableName *)s)->sn)
|
|
335
|
|
- StableNameToIntOp -> \[arg] -> opIntoRegs $ \[res] ->
|
|
|
376
|
+ StableNameToIntOp -> \[arg] -> inlinePrimop $ \[res] ->
|
|
336
|
377
|
emitAssign (CmmLocal res) (cmmLoadIndexW platform arg (fixedHdrSizeW profile) (bWord platform))
|
|
337
|
378
|
|
|
338
|
379
|
EqStablePtrOp -> opTranslate (mo_wordEq platform)
|
|
339
|
380
|
|
|
340
|
|
- ReallyUnsafePtrEqualityOp -> \[arg1, arg2] -> opIntoRegs $ \[res] ->
|
|
|
381
|
+ ReallyUnsafePtrEqualityOp -> \[arg1, arg2] -> inlinePrimop $ \[res] ->
|
|
341
|
382
|
emitAssign (CmmLocal res) (CmmMachOp (mo_wordEq platform) [arg1,arg2])
|
|
342
|
383
|
|
|
343
|
384
|
-- #define addrToHValuezh(r,a) r=(P_)a
|
|
344
|
|
- AddrToAnyOp -> \[arg] -> opIntoRegs $ \[res] ->
|
|
|
385
|
+ AddrToAnyOp -> \[arg] -> inlinePrimop $ \[res] ->
|
|
345
|
386
|
emitAssign (CmmLocal res) arg
|
|
346
|
387
|
|
|
347
|
388
|
-- #define hvalueToAddrzh(r, a) r=(W_)a
|
|
348
|
|
- AnyToAddrOp -> \[arg] -> opIntoRegs $ \[res] ->
|
|
|
389
|
+ AnyToAddrOp -> \[arg] -> inlinePrimop $ \[res] ->
|
|
349
|
390
|
emitAssign (CmmLocal res) arg
|
|
350
|
391
|
|
|
351
|
392
|
{- Freezing arrays-of-ptrs requires changing an info table, for the
|
| ... |
... |
@@ -358,45 +399,45 @@ emitPrimOp cfg primop = |
|
358
|
399
|
-- SET_INFO((StgClosure *)a,&stg_MUT_ARR_PTRS_FROZEN_DIRTY_info);
|
|
359
|
400
|
-- r = a;
|
|
360
|
401
|
-- }
|
|
361
|
|
- UnsafeFreezeArrayOp -> \[arg] -> opIntoRegs $ \[res] ->
|
|
|
402
|
+ UnsafeFreezeArrayOp -> \[arg] -> inlinePrimop $ \[res] ->
|
|
362
|
403
|
emit $ catAGraphs
|
|
363
|
404
|
[ setInfo arg (CmmLit (CmmLabel mkMAP_FROZEN_DIRTY_infoLabel)),
|
|
364
|
405
|
mkAssign (CmmLocal res) arg ]
|
|
365
|
|
- UnsafeFreezeSmallArrayOp -> \[arg] -> opIntoRegs $ \[res] ->
|
|
|
406
|
+ UnsafeFreezeSmallArrayOp -> \[arg] -> inlinePrimop $ \[res] ->
|
|
366
|
407
|
emit $ catAGraphs
|
|
367
|
408
|
[ setInfo arg (CmmLit (CmmLabel mkSMAP_FROZEN_DIRTY_infoLabel)),
|
|
368
|
409
|
mkAssign (CmmLocal res) arg ]
|
|
369
|
410
|
|
|
370
|
411
|
-- #define unsafeFreezzeByteArrayzh(r,a) r=(a)
|
|
371
|
|
- UnsafeFreezeByteArrayOp -> \[arg] -> opIntoRegs $ \[res] ->
|
|
|
412
|
+ UnsafeFreezeByteArrayOp -> \[arg] -> inlinePrimop $ \[res] ->
|
|
372
|
413
|
emitAssign (CmmLocal res) arg
|
|
373
|
414
|
|
|
374
|
415
|
-- #define unsafeThawByteArrayzh(r,a) r=(a)
|
|
375
|
|
- UnsafeThawByteArrayOp -> \[arg] -> opIntoRegs $ \[res] ->
|
|
|
416
|
+ UnsafeThawByteArrayOp -> \[arg] -> inlinePrimop $ \[res] ->
|
|
376
|
417
|
emitAssign (CmmLocal res) arg
|
|
377
|
418
|
|
|
378
|
419
|
-- Reading/writing pointer arrays
|
|
379
|
420
|
|
|
380
|
|
- ReadArrayOp -> \[obj, ix] -> opIntoRegs $ \[res] ->
|
|
|
421
|
+ ReadArrayOp -> \[obj, ix] -> inlinePrimop $ \[res] ->
|
|
381
|
422
|
doReadPtrArrayOp res obj ix
|
|
382
|
|
- IndexArrayOp -> \[obj, ix] -> opIntoRegs $ \[res] ->
|
|
|
423
|
+ IndexArrayOp -> \[obj, ix] -> inlinePrimop $ \[res] ->
|
|
383
|
424
|
doReadPtrArrayOp res obj ix
|
|
384
|
|
- WriteArrayOp -> \[obj, ix, v] -> opIntoRegs $ \[] ->
|
|
|
425
|
+ WriteArrayOp -> \[obj, ix, v] -> inlinePrimop $ \[] ->
|
|
385
|
426
|
doWritePtrArrayOp obj ix v
|
|
386
|
427
|
|
|
387
|
|
- ReadSmallArrayOp -> \[obj, ix] -> opIntoRegs $ \[res] ->
|
|
|
428
|
+ ReadSmallArrayOp -> \[obj, ix] -> inlinePrimop $ \[res] ->
|
|
388
|
429
|
doReadSmallPtrArrayOp res obj ix
|
|
389
|
|
- IndexSmallArrayOp -> \[obj, ix] -> opIntoRegs $ \[res] ->
|
|
|
430
|
+ IndexSmallArrayOp -> \[obj, ix] -> inlinePrimop $ \[res] ->
|
|
390
|
431
|
doReadSmallPtrArrayOp res obj ix
|
|
391
|
|
- WriteSmallArrayOp -> \[obj,ix,v] -> opIntoRegs $ \[] ->
|
|
|
432
|
+ WriteSmallArrayOp -> \[obj,ix,v] -> inlinePrimop $ \[] ->
|
|
392
|
433
|
doWriteSmallPtrArrayOp obj ix v
|
|
393
|
434
|
|
|
394
|
435
|
-- Getting the size of pointer arrays
|
|
395
|
436
|
|
|
396
|
|
- SizeofArrayOp -> \[arg] -> opIntoRegs $ \[res] ->
|
|
|
437
|
+ SizeofArrayOp -> \[arg] -> inlinePrimop $ \[res] ->
|
|
397
|
438
|
emitAssign (CmmLocal res) (ptrArraySize platform profile arg)
|
|
398
|
439
|
SizeofMutableArrayOp -> emitPrimOp cfg SizeofArrayOp
|
|
399
|
|
- SizeofSmallArrayOp -> \[arg] -> opIntoRegs $ \[res] ->
|
|
|
440
|
+ SizeofSmallArrayOp -> \[arg] -> inlinePrimop $ \[res] ->
|
|
400
|
441
|
emitAssign (CmmLocal res) (smallPtrArraySize platform profile arg)
|
|
401
|
442
|
|
|
402
|
443
|
SizeofSmallMutableArrayOp -> emitPrimOp cfg SizeofSmallArrayOp
|
| ... |
... |
@@ -404,550 +445,550 @@ emitPrimOp cfg primop = |
|
404
|
445
|
|
|
405
|
446
|
-- IndexXXXoffAddr
|
|
406
|
447
|
|
|
407
|
|
- IndexOffAddrOp_Char -> \args -> opIntoRegs $ \res ->
|
|
|
448
|
+ IndexOffAddrOp_Char -> \args -> inlinePrimop $ \res ->
|
|
408
|
449
|
doIndexOffAddrOp (Just (mo_u_8ToWord platform)) b8 res args
|
|
409
|
|
- IndexOffAddrOp_WideChar -> \args -> opIntoRegs $ \res ->
|
|
|
450
|
+ IndexOffAddrOp_WideChar -> \args -> inlinePrimop $ \res ->
|
|
410
|
451
|
doIndexOffAddrOp (Just (mo_u_32ToWord platform)) b32 res args
|
|
411
|
|
- IndexOffAddrOp_Int -> \args -> opIntoRegs $ \res ->
|
|
|
452
|
+ IndexOffAddrOp_Int -> \args -> inlinePrimop $ \res ->
|
|
412
|
453
|
doIndexOffAddrOp Nothing (bWord platform) res args
|
|
413
|
|
- IndexOffAddrOp_Word -> \args -> opIntoRegs $ \res ->
|
|
|
454
|
+ IndexOffAddrOp_Word -> \args -> inlinePrimop $ \res ->
|
|
414
|
455
|
doIndexOffAddrOp Nothing (bWord platform) res args
|
|
415
|
|
- IndexOffAddrOp_Addr -> \args -> opIntoRegs $ \res ->
|
|
|
456
|
+ IndexOffAddrOp_Addr -> \args -> inlinePrimop $ \res ->
|
|
416
|
457
|
doIndexOffAddrOp Nothing (bWord platform) res args
|
|
417
|
|
- IndexOffAddrOp_Float -> \args -> opIntoRegs $ \res ->
|
|
|
458
|
+ IndexOffAddrOp_Float -> \args -> inlinePrimop $ \res ->
|
|
418
|
459
|
doIndexOffAddrOp Nothing f32 res args
|
|
419
|
|
- IndexOffAddrOp_Double -> \args -> opIntoRegs $ \res ->
|
|
|
460
|
+ IndexOffAddrOp_Double -> \args -> inlinePrimop $ \res ->
|
|
420
|
461
|
doIndexOffAddrOp Nothing f64 res args
|
|
421
|
|
- IndexOffAddrOp_StablePtr -> \args -> opIntoRegs $ \res ->
|
|
|
462
|
+ IndexOffAddrOp_StablePtr -> \args -> inlinePrimop $ \res ->
|
|
422
|
463
|
doIndexOffAddrOp Nothing (bWord platform) res args
|
|
423
|
|
- IndexOffAddrOp_Int8 -> \args -> opIntoRegs $ \res ->
|
|
|
464
|
+ IndexOffAddrOp_Int8 -> \args -> inlinePrimop $ \res ->
|
|
424
|
465
|
doIndexOffAddrOp Nothing b8 res args
|
|
425
|
|
- IndexOffAddrOp_Int16 -> \args -> opIntoRegs $ \res ->
|
|
|
466
|
+ IndexOffAddrOp_Int16 -> \args -> inlinePrimop $ \res ->
|
|
426
|
467
|
doIndexOffAddrOp Nothing b16 res args
|
|
427
|
|
- IndexOffAddrOp_Int32 -> \args -> opIntoRegs $ \res ->
|
|
|
468
|
+ IndexOffAddrOp_Int32 -> \args -> inlinePrimop $ \res ->
|
|
428
|
469
|
doIndexOffAddrOp Nothing b32 res args
|
|
429
|
|
- IndexOffAddrOp_Int64 -> \args -> opIntoRegs $ \res ->
|
|
|
470
|
+ IndexOffAddrOp_Int64 -> \args -> inlinePrimop $ \res ->
|
|
430
|
471
|
doIndexOffAddrOp Nothing b64 res args
|
|
431
|
|
- IndexOffAddrOp_Word8 -> \args -> opIntoRegs $ \res ->
|
|
|
472
|
+ IndexOffAddrOp_Word8 -> \args -> inlinePrimop $ \res ->
|
|
432
|
473
|
doIndexOffAddrOp Nothing b8 res args
|
|
433
|
|
- IndexOffAddrOp_Word16 -> \args -> opIntoRegs $ \res ->
|
|
|
474
|
+ IndexOffAddrOp_Word16 -> \args -> inlinePrimop $ \res ->
|
|
434
|
475
|
doIndexOffAddrOp Nothing b16 res args
|
|
435
|
|
- IndexOffAddrOp_Word32 -> \args -> opIntoRegs $ \res ->
|
|
|
476
|
+ IndexOffAddrOp_Word32 -> \args -> inlinePrimop $ \res ->
|
|
436
|
477
|
doIndexOffAddrOp Nothing b32 res args
|
|
437
|
|
- IndexOffAddrOp_Word64 -> \args -> opIntoRegs $ \res ->
|
|
|
478
|
+ IndexOffAddrOp_Word64 -> \args -> inlinePrimop $ \res ->
|
|
438
|
479
|
doIndexOffAddrOp Nothing b64 res args
|
|
439
|
480
|
|
|
440
|
481
|
-- ReadXXXoffAddr, which are identical, for our purposes, to IndexXXXoffAddr.
|
|
441
|
482
|
|
|
442
|
|
- ReadOffAddrOp_Char -> \args -> opIntoRegs $ \res ->
|
|
|
483
|
+ ReadOffAddrOp_Char -> \args -> inlinePrimop $ \res ->
|
|
443
|
484
|
doIndexOffAddrOp (Just (mo_u_8ToWord platform)) b8 res args
|
|
444
|
|
- ReadOffAddrOp_WideChar -> \args -> opIntoRegs $ \res ->
|
|
|
485
|
+ ReadOffAddrOp_WideChar -> \args -> inlinePrimop $ \res ->
|
|
445
|
486
|
doIndexOffAddrOp (Just (mo_u_32ToWord platform)) b32 res args
|
|
446
|
|
- ReadOffAddrOp_Int -> \args -> opIntoRegs $ \res ->
|
|
|
487
|
+ ReadOffAddrOp_Int -> \args -> inlinePrimop $ \res ->
|
|
447
|
488
|
doIndexOffAddrOp Nothing (bWord platform) res args
|
|
448
|
|
- ReadOffAddrOp_Word -> \args -> opIntoRegs $ \res ->
|
|
|
489
|
+ ReadOffAddrOp_Word -> \args -> inlinePrimop $ \res ->
|
|
449
|
490
|
doIndexOffAddrOp Nothing (bWord platform) res args
|
|
450
|
|
- ReadOffAddrOp_Addr -> \args -> opIntoRegs $ \res ->
|
|
|
491
|
+ ReadOffAddrOp_Addr -> \args -> inlinePrimop $ \res ->
|
|
451
|
492
|
doIndexOffAddrOp Nothing (bWord platform) res args
|
|
452
|
|
- ReadOffAddrOp_Float -> \args -> opIntoRegs $ \res ->
|
|
|
493
|
+ ReadOffAddrOp_Float -> \args -> inlinePrimop $ \res ->
|
|
453
|
494
|
doIndexOffAddrOp Nothing f32 res args
|
|
454
|
|
- ReadOffAddrOp_Double -> \args -> opIntoRegs $ \res ->
|
|
|
495
|
+ ReadOffAddrOp_Double -> \args -> inlinePrimop $ \res ->
|
|
455
|
496
|
doIndexOffAddrOp Nothing f64 res args
|
|
456
|
|
- ReadOffAddrOp_StablePtr -> \args -> opIntoRegs $ \res ->
|
|
|
497
|
+ ReadOffAddrOp_StablePtr -> \args -> inlinePrimop $ \res ->
|
|
457
|
498
|
doIndexOffAddrOp Nothing (bWord platform) res args
|
|
458
|
|
- ReadOffAddrOp_Int8 -> \args -> opIntoRegs $ \res ->
|
|
|
499
|
+ ReadOffAddrOp_Int8 -> \args -> inlinePrimop $ \res ->
|
|
459
|
500
|
doIndexOffAddrOp Nothing b8 res args
|
|
460
|
|
- ReadOffAddrOp_Int16 -> \args -> opIntoRegs $ \res ->
|
|
|
501
|
+ ReadOffAddrOp_Int16 -> \args -> inlinePrimop $ \res ->
|
|
461
|
502
|
doIndexOffAddrOp Nothing b16 res args
|
|
462
|
|
- ReadOffAddrOp_Int32 -> \args -> opIntoRegs $ \res ->
|
|
|
503
|
+ ReadOffAddrOp_Int32 -> \args -> inlinePrimop $ \res ->
|
|
463
|
504
|
doIndexOffAddrOp Nothing b32 res args
|
|
464
|
|
- ReadOffAddrOp_Int64 -> \args -> opIntoRegs $ \res ->
|
|
|
505
|
+ ReadOffAddrOp_Int64 -> \args -> inlinePrimop $ \res ->
|
|
465
|
506
|
doIndexOffAddrOp Nothing b64 res args
|
|
466
|
|
- ReadOffAddrOp_Word8 -> \args -> opIntoRegs $ \res ->
|
|
|
507
|
+ ReadOffAddrOp_Word8 -> \args -> inlinePrimop $ \res ->
|
|
467
|
508
|
doIndexOffAddrOp Nothing b8 res args
|
|
468
|
|
- ReadOffAddrOp_Word16 -> \args -> opIntoRegs $ \res ->
|
|
|
509
|
+ ReadOffAddrOp_Word16 -> \args -> inlinePrimop $ \res ->
|
|
469
|
510
|
doIndexOffAddrOp Nothing b16 res args
|
|
470
|
|
- ReadOffAddrOp_Word32 -> \args -> opIntoRegs $ \res ->
|
|
|
511
|
+ ReadOffAddrOp_Word32 -> \args -> inlinePrimop $ \res ->
|
|
471
|
512
|
doIndexOffAddrOp Nothing b32 res args
|
|
472
|
|
- ReadOffAddrOp_Word64 -> \args -> opIntoRegs $ \res ->
|
|
|
513
|
+ ReadOffAddrOp_Word64 -> \args -> inlinePrimop $ \res ->
|
|
473
|
514
|
doIndexOffAddrOp Nothing b64 res args
|
|
474
|
515
|
|
|
475
|
516
|
-- IndexWord8OffAddrAsXXX
|
|
476
|
517
|
|
|
477
|
|
- IndexOffAddrOp_Word8AsChar -> \args -> opIntoRegs $ \res ->
|
|
|
518
|
+ IndexOffAddrOp_Word8AsChar -> \args -> inlinePrimop $ \res ->
|
|
478
|
519
|
doIndexOffAddrOpAs (Just (mo_u_8ToWord platform)) b8 b8 res args
|
|
479
|
|
- IndexOffAddrOp_Word8AsWideChar -> \args -> opIntoRegs $ \res ->
|
|
|
520
|
+ IndexOffAddrOp_Word8AsWideChar -> \args -> inlinePrimop $ \res ->
|
|
480
|
521
|
doIndexOffAddrOpAs (Just (mo_u_32ToWord platform)) b32 b8 res args
|
|
481
|
|
- IndexOffAddrOp_Word8AsInt -> \args -> opIntoRegs $ \res ->
|
|
|
522
|
+ IndexOffAddrOp_Word8AsInt -> \args -> inlinePrimop $ \res ->
|
|
482
|
523
|
doIndexOffAddrOpAs Nothing (bWord platform) b8 res args
|
|
483
|
|
- IndexOffAddrOp_Word8AsWord -> \args -> opIntoRegs $ \res ->
|
|
|
524
|
+ IndexOffAddrOp_Word8AsWord -> \args -> inlinePrimop $ \res ->
|
|
484
|
525
|
doIndexOffAddrOpAs Nothing (bWord platform) b8 res args
|
|
485
|
|
- IndexOffAddrOp_Word8AsAddr -> \args -> opIntoRegs $ \res ->
|
|
|
526
|
+ IndexOffAddrOp_Word8AsAddr -> \args -> inlinePrimop $ \res ->
|
|
486
|
527
|
doIndexOffAddrOpAs Nothing (bWord platform) b8 res args
|
|
487
|
|
- IndexOffAddrOp_Word8AsFloat -> \args -> opIntoRegs $ \res ->
|
|
|
528
|
+ IndexOffAddrOp_Word8AsFloat -> \args -> inlinePrimop $ \res ->
|
|
488
|
529
|
doIndexOffAddrOpAs Nothing f32 b8 res args
|
|
489
|
|
- IndexOffAddrOp_Word8AsDouble -> \args -> opIntoRegs $ \res ->
|
|
|
530
|
+ IndexOffAddrOp_Word8AsDouble -> \args -> inlinePrimop $ \res ->
|
|
490
|
531
|
doIndexOffAddrOpAs Nothing f64 b8 res args
|
|
491
|
|
- IndexOffAddrOp_Word8AsStablePtr -> \args -> opIntoRegs $ \res ->
|
|
|
532
|
+ IndexOffAddrOp_Word8AsStablePtr -> \args -> inlinePrimop $ \res ->
|
|
492
|
533
|
doIndexOffAddrOpAs Nothing (bWord platform) b8 res args
|
|
493
|
|
- IndexOffAddrOp_Word8AsInt16 -> \args -> opIntoRegs $ \res ->
|
|
|
534
|
+ IndexOffAddrOp_Word8AsInt16 -> \args -> inlinePrimop $ \res ->
|
|
494
|
535
|
doIndexOffAddrOpAs Nothing b16 b8 res args
|
|
495
|
|
- IndexOffAddrOp_Word8AsInt32 -> \args -> opIntoRegs $ \res ->
|
|
|
536
|
+ IndexOffAddrOp_Word8AsInt32 -> \args -> inlinePrimop $ \res ->
|
|
496
|
537
|
doIndexOffAddrOpAs Nothing b32 b8 res args
|
|
497
|
|
- IndexOffAddrOp_Word8AsInt64 -> \args -> opIntoRegs $ \res ->
|
|
|
538
|
+ IndexOffAddrOp_Word8AsInt64 -> \args -> inlinePrimop $ \res ->
|
|
498
|
539
|
doIndexOffAddrOpAs Nothing b64 b8 res args
|
|
499
|
|
- IndexOffAddrOp_Word8AsWord16 -> \args -> opIntoRegs $ \res ->
|
|
|
540
|
+ IndexOffAddrOp_Word8AsWord16 -> \args -> inlinePrimop $ \res ->
|
|
500
|
541
|
doIndexOffAddrOpAs Nothing b16 b8 res args
|
|
501
|
|
- IndexOffAddrOp_Word8AsWord32 -> \args -> opIntoRegs $ \res ->
|
|
|
542
|
+ IndexOffAddrOp_Word8AsWord32 -> \args -> inlinePrimop $ \res ->
|
|
502
|
543
|
doIndexOffAddrOpAs Nothing b32 b8 res args
|
|
503
|
|
- IndexOffAddrOp_Word8AsWord64 -> \args -> opIntoRegs $ \res ->
|
|
|
544
|
+ IndexOffAddrOp_Word8AsWord64 -> \args -> inlinePrimop $ \res ->
|
|
504
|
545
|
doIndexOffAddrOpAs Nothing b64 b8 res args
|
|
505
|
546
|
|
|
506
|
547
|
-- ReadWord8OffAddrAsXXX, identical to IndexWord8OffAddrAsXXX
|
|
507
|
548
|
|
|
508
|
|
- ReadOffAddrOp_Word8AsChar -> \args -> opIntoRegs $ \res ->
|
|
|
549
|
+ ReadOffAddrOp_Word8AsChar -> \args -> inlinePrimop $ \res ->
|
|
509
|
550
|
doIndexOffAddrOpAs (Just (mo_u_8ToWord platform)) b8 b8 res args
|
|
510
|
|
- ReadOffAddrOp_Word8AsWideChar -> \args -> opIntoRegs $ \res ->
|
|
|
551
|
+ ReadOffAddrOp_Word8AsWideChar -> \args -> inlinePrimop $ \res ->
|
|
511
|
552
|
doIndexOffAddrOpAs (Just (mo_u_32ToWord platform)) b32 b8 res args
|
|
512
|
|
- ReadOffAddrOp_Word8AsInt -> \args -> opIntoRegs $ \res ->
|
|
|
553
|
+ ReadOffAddrOp_Word8AsInt -> \args -> inlinePrimop $ \res ->
|
|
513
|
554
|
doIndexOffAddrOpAs Nothing (bWord platform) b8 res args
|
|
514
|
|
- ReadOffAddrOp_Word8AsWord -> \args -> opIntoRegs $ \res ->
|
|
|
555
|
+ ReadOffAddrOp_Word8AsWord -> \args -> inlinePrimop $ \res ->
|
|
515
|
556
|
doIndexOffAddrOpAs Nothing (bWord platform) b8 res args
|
|
516
|
|
- ReadOffAddrOp_Word8AsAddr -> \args -> opIntoRegs $ \res ->
|
|
|
557
|
+ ReadOffAddrOp_Word8AsAddr -> \args -> inlinePrimop $ \res ->
|
|
517
|
558
|
doIndexOffAddrOpAs Nothing (bWord platform) b8 res args
|
|
518
|
|
- ReadOffAddrOp_Word8AsFloat -> \args -> opIntoRegs $ \res ->
|
|
|
559
|
+ ReadOffAddrOp_Word8AsFloat -> \args -> inlinePrimop $ \res ->
|
|
519
|
560
|
doIndexOffAddrOpAs Nothing f32 b8 res args
|
|
520
|
|
- ReadOffAddrOp_Word8AsDouble -> \args -> opIntoRegs $ \res ->
|
|
|
561
|
+ ReadOffAddrOp_Word8AsDouble -> \args -> inlinePrimop $ \res ->
|
|
521
|
562
|
doIndexOffAddrOpAs Nothing f64 b8 res args
|
|
522
|
|
- ReadOffAddrOp_Word8AsStablePtr -> \args -> opIntoRegs $ \res ->
|
|
|
563
|
+ ReadOffAddrOp_Word8AsStablePtr -> \args -> inlinePrimop $ \res ->
|
|
523
|
564
|
doIndexOffAddrOpAs Nothing (bWord platform) b8 res args
|
|
524
|
|
- ReadOffAddrOp_Word8AsInt16 -> \args -> opIntoRegs $ \res ->
|
|
|
565
|
+ ReadOffAddrOp_Word8AsInt16 -> \args -> inlinePrimop $ \res ->
|
|
525
|
566
|
doIndexOffAddrOpAs Nothing b16 b8 res args
|
|
526
|
|
- ReadOffAddrOp_Word8AsInt32 -> \args -> opIntoRegs $ \res ->
|
|
|
567
|
+ ReadOffAddrOp_Word8AsInt32 -> \args -> inlinePrimop $ \res ->
|
|
527
|
568
|
doIndexOffAddrOpAs Nothing b32 b8 res args
|
|
528
|
|
- ReadOffAddrOp_Word8AsInt64 -> \args -> opIntoRegs $ \res ->
|
|
|
569
|
+ ReadOffAddrOp_Word8AsInt64 -> \args -> inlinePrimop $ \res ->
|
|
529
|
570
|
doIndexOffAddrOpAs Nothing b64 b8 res args
|
|
530
|
|
- ReadOffAddrOp_Word8AsWord16 -> \args -> opIntoRegs $ \res ->
|
|
|
571
|
+ ReadOffAddrOp_Word8AsWord16 -> \args -> inlinePrimop $ \res ->
|
|
531
|
572
|
doIndexOffAddrOpAs Nothing b16 b8 res args
|
|
532
|
|
- ReadOffAddrOp_Word8AsWord32 -> \args -> opIntoRegs $ \res ->
|
|
|
573
|
+ ReadOffAddrOp_Word8AsWord32 -> \args -> inlinePrimop $ \res ->
|
|
533
|
574
|
doIndexOffAddrOpAs Nothing b32 b8 res args
|
|
534
|
|
- ReadOffAddrOp_Word8AsWord64 -> \args -> opIntoRegs $ \res ->
|
|
|
575
|
+ ReadOffAddrOp_Word8AsWord64 -> \args -> inlinePrimop $ \res ->
|
|
535
|
576
|
doIndexOffAddrOpAs Nothing b64 b8 res args
|
|
536
|
577
|
|
|
537
|
578
|
-- WriteWord8ArrayAsXXX
|
|
538
|
|
- WriteOffAddrOp_Word8AsChar -> \args -> opIntoRegs $ \res ->
|
|
|
579
|
+ WriteOffAddrOp_Word8AsChar -> \args -> inlinePrimop $ \res ->
|
|
539
|
580
|
doWriteOffAddrOp (Just (mo_WordTo8 platform)) b8 res args
|
|
540
|
|
- WriteOffAddrOp_Word8AsWideChar -> \args -> opIntoRegs $ \res ->
|
|
|
581
|
+ WriteOffAddrOp_Word8AsWideChar -> \args -> inlinePrimop $ \res ->
|
|
541
|
582
|
doWriteOffAddrOp (Just (mo_WordTo32 platform)) b8 res args
|
|
542
|
|
- WriteOffAddrOp_Word8AsInt -> \args -> opIntoRegs $ \res ->
|
|
|
583
|
+ WriteOffAddrOp_Word8AsInt -> \args -> inlinePrimop $ \res ->
|
|
543
|
584
|
doWriteOffAddrOp Nothing b8 res args
|
|
544
|
|
- WriteOffAddrOp_Word8AsWord -> \args -> opIntoRegs $ \res ->
|
|
|
585
|
+ WriteOffAddrOp_Word8AsWord -> \args -> inlinePrimop $ \res ->
|
|
545
|
586
|
doWriteOffAddrOp Nothing b8 res args
|
|
546
|
|
- WriteOffAddrOp_Word8AsAddr -> \args -> opIntoRegs $ \res ->
|
|
|
587
|
+ WriteOffAddrOp_Word8AsAddr -> \args -> inlinePrimop $ \res ->
|
|
547
|
588
|
doWriteOffAddrOp Nothing b8 res args
|
|
548
|
|
- WriteOffAddrOp_Word8AsFloat -> \args -> opIntoRegs $ \res ->
|
|
|
589
|
+ WriteOffAddrOp_Word8AsFloat -> \args -> inlinePrimop $ \res ->
|
|
549
|
590
|
doWriteOffAddrOp Nothing b8 res args
|
|
550
|
|
- WriteOffAddrOp_Word8AsDouble -> \args -> opIntoRegs $ \res ->
|
|
|
591
|
+ WriteOffAddrOp_Word8AsDouble -> \args -> inlinePrimop $ \res ->
|
|
551
|
592
|
doWriteOffAddrOp Nothing b8 res args
|
|
552
|
|
- WriteOffAddrOp_Word8AsStablePtr -> \args -> opIntoRegs $ \res ->
|
|
|
593
|
+ WriteOffAddrOp_Word8AsStablePtr -> \args -> inlinePrimop $ \res ->
|
|
553
|
594
|
doWriteOffAddrOp Nothing b8 res args
|
|
554
|
|
- WriteOffAddrOp_Word8AsInt16 -> \args -> opIntoRegs $ \res ->
|
|
|
595
|
+ WriteOffAddrOp_Word8AsInt16 -> \args -> inlinePrimop $ \res ->
|
|
555
|
596
|
doWriteOffAddrOp Nothing b8 res args
|
|
556
|
|
- WriteOffAddrOp_Word8AsInt32 -> \args -> opIntoRegs $ \res ->
|
|
|
597
|
+ WriteOffAddrOp_Word8AsInt32 -> \args -> inlinePrimop $ \res ->
|
|
557
|
598
|
doWriteOffAddrOp Nothing b8 res args
|
|
558
|
|
- WriteOffAddrOp_Word8AsInt64 -> \args -> opIntoRegs $ \res ->
|
|
|
599
|
+ WriteOffAddrOp_Word8AsInt64 -> \args -> inlinePrimop $ \res ->
|
|
559
|
600
|
doWriteOffAddrOp Nothing b8 res args
|
|
560
|
|
- WriteOffAddrOp_Word8AsWord16 -> \args -> opIntoRegs $ \res ->
|
|
|
601
|
+ WriteOffAddrOp_Word8AsWord16 -> \args -> inlinePrimop $ \res ->
|
|
561
|
602
|
doWriteOffAddrOp Nothing b8 res args
|
|
562
|
|
- WriteOffAddrOp_Word8AsWord32 -> \args -> opIntoRegs $ \res ->
|
|
|
603
|
+ WriteOffAddrOp_Word8AsWord32 -> \args -> inlinePrimop $ \res ->
|
|
563
|
604
|
doWriteOffAddrOp Nothing b8 res args
|
|
564
|
|
- WriteOffAddrOp_Word8AsWord64 -> \args -> opIntoRegs $ \res ->
|
|
|
605
|
+ WriteOffAddrOp_Word8AsWord64 -> \args -> inlinePrimop $ \res ->
|
|
565
|
606
|
doWriteOffAddrOp Nothing b8 res args
|
|
566
|
607
|
|
|
567
|
608
|
-- IndexXXXArray
|
|
568
|
609
|
|
|
569
|
|
- IndexByteArrayOp_Char -> \args -> opIntoRegs $ \res ->
|
|
|
610
|
+ IndexByteArrayOp_Char -> \args -> inlinePrimop $ \res ->
|
|
570
|
611
|
doIndexByteArrayOp (Just (mo_u_8ToWord platform)) b8 res args
|
|
571
|
|
- IndexByteArrayOp_WideChar -> \args -> opIntoRegs $ \res ->
|
|
|
612
|
+ IndexByteArrayOp_WideChar -> \args -> inlinePrimop $ \res ->
|
|
572
|
613
|
doIndexByteArrayOp (Just (mo_u_32ToWord platform)) b32 res args
|
|
573
|
|
- IndexByteArrayOp_Int -> \args -> opIntoRegs $ \res ->
|
|
|
614
|
+ IndexByteArrayOp_Int -> \args -> inlinePrimop $ \res ->
|
|
574
|
615
|
doIndexByteArrayOp Nothing (bWord platform) res args
|
|
575
|
|
- IndexByteArrayOp_Word -> \args -> opIntoRegs $ \res ->
|
|
|
616
|
+ IndexByteArrayOp_Word -> \args -> inlinePrimop $ \res ->
|
|
576
|
617
|
doIndexByteArrayOp Nothing (bWord platform) res args
|
|
577
|
|
- IndexByteArrayOp_Addr -> \args -> opIntoRegs $ \res ->
|
|
|
618
|
+ IndexByteArrayOp_Addr -> \args -> inlinePrimop $ \res ->
|
|
578
|
619
|
doIndexByteArrayOp Nothing (bWord platform) res args
|
|
579
|
|
- IndexByteArrayOp_Float -> \args -> opIntoRegs $ \res ->
|
|
|
620
|
+ IndexByteArrayOp_Float -> \args -> inlinePrimop $ \res ->
|
|
580
|
621
|
doIndexByteArrayOp Nothing f32 res args
|
|
581
|
|
- IndexByteArrayOp_Double -> \args -> opIntoRegs $ \res ->
|
|
|
622
|
+ IndexByteArrayOp_Double -> \args -> inlinePrimop $ \res ->
|
|
582
|
623
|
doIndexByteArrayOp Nothing f64 res args
|
|
583
|
|
- IndexByteArrayOp_StablePtr -> \args -> opIntoRegs $ \res ->
|
|
|
624
|
+ IndexByteArrayOp_StablePtr -> \args -> inlinePrimop $ \res ->
|
|
584
|
625
|
doIndexByteArrayOp Nothing (bWord platform) res args
|
|
585
|
|
- IndexByteArrayOp_Int8 -> \args -> opIntoRegs $ \res ->
|
|
|
626
|
+ IndexByteArrayOp_Int8 -> \args -> inlinePrimop $ \res ->
|
|
586
|
627
|
doIndexByteArrayOp Nothing b8 res args
|
|
587
|
|
- IndexByteArrayOp_Int16 -> \args -> opIntoRegs $ \res ->
|
|
|
628
|
+ IndexByteArrayOp_Int16 -> \args -> inlinePrimop $ \res ->
|
|
588
|
629
|
doIndexByteArrayOp Nothing b16 res args
|
|
589
|
|
- IndexByteArrayOp_Int32 -> \args -> opIntoRegs $ \res ->
|
|
|
630
|
+ IndexByteArrayOp_Int32 -> \args -> inlinePrimop $ \res ->
|
|
590
|
631
|
doIndexByteArrayOp Nothing b32 res args
|
|
591
|
|
- IndexByteArrayOp_Int64 -> \args -> opIntoRegs $ \res ->
|
|
|
632
|
+ IndexByteArrayOp_Int64 -> \args -> inlinePrimop $ \res ->
|
|
592
|
633
|
doIndexByteArrayOp Nothing b64 res args
|
|
593
|
|
- IndexByteArrayOp_Word8 -> \args -> opIntoRegs $ \res ->
|
|
|
634
|
+ IndexByteArrayOp_Word8 -> \args -> inlinePrimop $ \res ->
|
|
594
|
635
|
doIndexByteArrayOp Nothing b8 res args
|
|
595
|
|
- IndexByteArrayOp_Word16 -> \args -> opIntoRegs $ \res ->
|
|
|
636
|
+ IndexByteArrayOp_Word16 -> \args -> inlinePrimop $ \res ->
|
|
596
|
637
|
doIndexByteArrayOp Nothing b16 res args
|
|
597
|
|
- IndexByteArrayOp_Word32 -> \args -> opIntoRegs $ \res ->
|
|
|
638
|
+ IndexByteArrayOp_Word32 -> \args -> inlinePrimop $ \res ->
|
|
598
|
639
|
doIndexByteArrayOp Nothing b32 res args
|
|
599
|
|
- IndexByteArrayOp_Word64 -> \args -> opIntoRegs $ \res ->
|
|
|
640
|
+ IndexByteArrayOp_Word64 -> \args -> inlinePrimop $ \res ->
|
|
600
|
641
|
doIndexByteArrayOp Nothing b64 res args
|
|
601
|
642
|
|
|
602
|
643
|
-- ReadXXXArray, identical to IndexXXXArray.
|
|
603
|
644
|
|
|
604
|
|
- ReadByteArrayOp_Char -> \args -> opIntoRegs $ \res ->
|
|
|
645
|
+ ReadByteArrayOp_Char -> \args -> inlinePrimop $ \res ->
|
|
605
|
646
|
doIndexByteArrayOp (Just (mo_u_8ToWord platform)) b8 res args
|
|
606
|
|
- ReadByteArrayOp_WideChar -> \args -> opIntoRegs $ \res ->
|
|
|
647
|
+ ReadByteArrayOp_WideChar -> \args -> inlinePrimop $ \res ->
|
|
607
|
648
|
doIndexByteArrayOp (Just (mo_u_32ToWord platform)) b32 res args
|
|
608
|
|
- ReadByteArrayOp_Int -> \args -> opIntoRegs $ \res ->
|
|
|
649
|
+ ReadByteArrayOp_Int -> \args -> inlinePrimop $ \res ->
|
|
609
|
650
|
doIndexByteArrayOp Nothing (bWord platform) res args
|
|
610
|
|
- ReadByteArrayOp_Word -> \args -> opIntoRegs $ \res ->
|
|
|
651
|
+ ReadByteArrayOp_Word -> \args -> inlinePrimop $ \res ->
|
|
611
|
652
|
doIndexByteArrayOp Nothing (bWord platform) res args
|
|
612
|
|
- ReadByteArrayOp_Addr -> \args -> opIntoRegs $ \res ->
|
|
|
653
|
+ ReadByteArrayOp_Addr -> \args -> inlinePrimop $ \res ->
|
|
613
|
654
|
doIndexByteArrayOp Nothing (bWord platform) res args
|
|
614
|
|
- ReadByteArrayOp_Float -> \args -> opIntoRegs $ \res ->
|
|
|
655
|
+ ReadByteArrayOp_Float -> \args -> inlinePrimop $ \res ->
|
|
615
|
656
|
doIndexByteArrayOp Nothing f32 res args
|
|
616
|
|
- ReadByteArrayOp_Double -> \args -> opIntoRegs $ \res ->
|
|
|
657
|
+ ReadByteArrayOp_Double -> \args -> inlinePrimop $ \res ->
|
|
617
|
658
|
doIndexByteArrayOp Nothing f64 res args
|
|
618
|
|
- ReadByteArrayOp_StablePtr -> \args -> opIntoRegs $ \res ->
|
|
|
659
|
+ ReadByteArrayOp_StablePtr -> \args -> inlinePrimop $ \res ->
|
|
619
|
660
|
doIndexByteArrayOp Nothing (bWord platform) res args
|
|
620
|
|
- ReadByteArrayOp_Int8 -> \args -> opIntoRegs $ \res ->
|
|
|
661
|
+ ReadByteArrayOp_Int8 -> \args -> inlinePrimop $ \res ->
|
|
621
|
662
|
doIndexByteArrayOp Nothing b8 res args
|
|
622
|
|
- ReadByteArrayOp_Int16 -> \args -> opIntoRegs $ \res ->
|
|
|
663
|
+ ReadByteArrayOp_Int16 -> \args -> inlinePrimop $ \res ->
|
|
623
|
664
|
doIndexByteArrayOp Nothing b16 res args
|
|
624
|
|
- ReadByteArrayOp_Int32 -> \args -> opIntoRegs $ \res ->
|
|
|
665
|
+ ReadByteArrayOp_Int32 -> \args -> inlinePrimop $ \res ->
|
|
625
|
666
|
doIndexByteArrayOp Nothing b32 res args
|
|
626
|
|
- ReadByteArrayOp_Int64 -> \args -> opIntoRegs $ \res ->
|
|
|
667
|
+ ReadByteArrayOp_Int64 -> \args -> inlinePrimop $ \res ->
|
|
627
|
668
|
doIndexByteArrayOp Nothing b64 res args
|
|
628
|
|
- ReadByteArrayOp_Word8 -> \args -> opIntoRegs $ \res ->
|
|
|
669
|
+ ReadByteArrayOp_Word8 -> \args -> inlinePrimop $ \res ->
|
|
629
|
670
|
doIndexByteArrayOp Nothing b8 res args
|
|
630
|
|
- ReadByteArrayOp_Word16 -> \args -> opIntoRegs $ \res ->
|
|
|
671
|
+ ReadByteArrayOp_Word16 -> \args -> inlinePrimop $ \res ->
|
|
631
|
672
|
doIndexByteArrayOp Nothing b16 res args
|
|
632
|
|
- ReadByteArrayOp_Word32 -> \args -> opIntoRegs $ \res ->
|
|
|
673
|
+ ReadByteArrayOp_Word32 -> \args -> inlinePrimop $ \res ->
|
|
633
|
674
|
doIndexByteArrayOp Nothing b32 res args
|
|
634
|
|
- ReadByteArrayOp_Word64 -> \args -> opIntoRegs $ \res ->
|
|
|
675
|
+ ReadByteArrayOp_Word64 -> \args -> inlinePrimop $ \res ->
|
|
635
|
676
|
doIndexByteArrayOp Nothing b64 res args
|
|
636
|
677
|
|
|
637
|
678
|
-- IndexWord8ArrayAsXXX
|
|
638
|
679
|
|
|
639
|
|
- IndexByteArrayOp_Word8AsChar -> \args -> opIntoRegs $ \res ->
|
|
|
680
|
+ IndexByteArrayOp_Word8AsChar -> \args -> inlinePrimop $ \res ->
|
|
640
|
681
|
doIndexByteArrayOpAs (Just (mo_u_8ToWord platform)) b8 b8 res args
|
|
641
|
|
- IndexByteArrayOp_Word8AsWideChar -> \args -> opIntoRegs $ \res ->
|
|
|
682
|
+ IndexByteArrayOp_Word8AsWideChar -> \args -> inlinePrimop $ \res ->
|
|
642
|
683
|
doIndexByteArrayOpAs (Just (mo_u_32ToWord platform)) b32 b8 res args
|
|
643
|
|
- IndexByteArrayOp_Word8AsInt -> \args -> opIntoRegs $ \res ->
|
|
|
684
|
+ IndexByteArrayOp_Word8AsInt -> \args -> inlinePrimop $ \res ->
|
|
644
|
685
|
doIndexByteArrayOpAs Nothing (bWord platform) b8 res args
|
|
645
|
|
- IndexByteArrayOp_Word8AsWord -> \args -> opIntoRegs $ \res ->
|
|
|
686
|
+ IndexByteArrayOp_Word8AsWord -> \args -> inlinePrimop $ \res ->
|
|
646
|
687
|
doIndexByteArrayOpAs Nothing (bWord platform) b8 res args
|
|
647
|
|
- IndexByteArrayOp_Word8AsAddr -> \args -> opIntoRegs $ \res ->
|
|
|
688
|
+ IndexByteArrayOp_Word8AsAddr -> \args -> inlinePrimop $ \res ->
|
|
648
|
689
|
doIndexByteArrayOpAs Nothing (bWord platform) b8 res args
|
|
649
|
|
- IndexByteArrayOp_Word8AsFloat -> \args -> opIntoRegs $ \res ->
|
|
|
690
|
+ IndexByteArrayOp_Word8AsFloat -> \args -> inlinePrimop $ \res ->
|
|
650
|
691
|
doIndexByteArrayOpAs Nothing f32 b8 res args
|
|
651
|
|
- IndexByteArrayOp_Word8AsDouble -> \args -> opIntoRegs $ \res ->
|
|
|
692
|
+ IndexByteArrayOp_Word8AsDouble -> \args -> inlinePrimop $ \res ->
|
|
652
|
693
|
doIndexByteArrayOpAs Nothing f64 b8 res args
|
|
653
|
|
- IndexByteArrayOp_Word8AsStablePtr -> \args -> opIntoRegs $ \res ->
|
|
|
694
|
+ IndexByteArrayOp_Word8AsStablePtr -> \args -> inlinePrimop $ \res ->
|
|
654
|
695
|
doIndexByteArrayOpAs Nothing (bWord platform) b8 res args
|
|
655
|
|
- IndexByteArrayOp_Word8AsInt16 -> \args -> opIntoRegs $ \res ->
|
|
|
696
|
+ IndexByteArrayOp_Word8AsInt16 -> \args -> inlinePrimop $ \res ->
|
|
656
|
697
|
doIndexByteArrayOpAs Nothing b16 b8 res args
|
|
657
|
|
- IndexByteArrayOp_Word8AsInt32 -> \args -> opIntoRegs $ \res ->
|
|
|
698
|
+ IndexByteArrayOp_Word8AsInt32 -> \args -> inlinePrimop $ \res ->
|
|
658
|
699
|
doIndexByteArrayOpAs Nothing b32 b8 res args
|
|
659
|
|
- IndexByteArrayOp_Word8AsInt64 -> \args -> opIntoRegs $ \res ->
|
|
|
700
|
+ IndexByteArrayOp_Word8AsInt64 -> \args -> inlinePrimop $ \res ->
|
|
660
|
701
|
doIndexByteArrayOpAs Nothing b64 b8 res args
|
|
661
|
|
- IndexByteArrayOp_Word8AsWord16 -> \args -> opIntoRegs $ \res ->
|
|
|
702
|
+ IndexByteArrayOp_Word8AsWord16 -> \args -> inlinePrimop $ \res ->
|
|
662
|
703
|
doIndexByteArrayOpAs Nothing b16 b8 res args
|
|
663
|
|
- IndexByteArrayOp_Word8AsWord32 -> \args -> opIntoRegs $ \res ->
|
|
|
704
|
+ IndexByteArrayOp_Word8AsWord32 -> \args -> inlinePrimop $ \res ->
|
|
664
|
705
|
doIndexByteArrayOpAs Nothing b32 b8 res args
|
|
665
|
|
- IndexByteArrayOp_Word8AsWord64 -> \args -> opIntoRegs $ \res ->
|
|
|
706
|
+ IndexByteArrayOp_Word8AsWord64 -> \args -> inlinePrimop $ \res ->
|
|
666
|
707
|
doIndexByteArrayOpAs Nothing b64 b8 res args
|
|
667
|
708
|
|
|
668
|
709
|
-- ReadInt8ArrayAsXXX, identical to IndexInt8ArrayAsXXX
|
|
669
|
710
|
|
|
670
|
|
- ReadByteArrayOp_Word8AsChar -> \args -> opIntoRegs $ \res ->
|
|
|
711
|
+ ReadByteArrayOp_Word8AsChar -> \args -> inlinePrimop $ \res ->
|
|
671
|
712
|
doIndexByteArrayOpAs (Just (mo_u_8ToWord platform)) b8 b8 res args
|
|
672
|
|
- ReadByteArrayOp_Word8AsWideChar -> \args -> opIntoRegs $ \res ->
|
|
|
713
|
+ ReadByteArrayOp_Word8AsWideChar -> \args -> inlinePrimop $ \res ->
|
|
673
|
714
|
doIndexByteArrayOpAs (Just (mo_u_32ToWord platform)) b32 b8 res args
|
|
674
|
|
- ReadByteArrayOp_Word8AsInt -> \args -> opIntoRegs $ \res ->
|
|
|
715
|
+ ReadByteArrayOp_Word8AsInt -> \args -> inlinePrimop $ \res ->
|
|
675
|
716
|
doIndexByteArrayOpAs Nothing (bWord platform) b8 res args
|
|
676
|
|
- ReadByteArrayOp_Word8AsWord -> \args -> opIntoRegs $ \res ->
|
|
|
717
|
+ ReadByteArrayOp_Word8AsWord -> \args -> inlinePrimop $ \res ->
|
|
677
|
718
|
doIndexByteArrayOpAs Nothing (bWord platform) b8 res args
|
|
678
|
|
- ReadByteArrayOp_Word8AsAddr -> \args -> opIntoRegs $ \res ->
|
|
|
719
|
+ ReadByteArrayOp_Word8AsAddr -> \args -> inlinePrimop $ \res ->
|
|
679
|
720
|
doIndexByteArrayOpAs Nothing (bWord platform) b8 res args
|
|
680
|
|
- ReadByteArrayOp_Word8AsFloat -> \args -> opIntoRegs $ \res ->
|
|
|
721
|
+ ReadByteArrayOp_Word8AsFloat -> \args -> inlinePrimop $ \res ->
|
|
681
|
722
|
doIndexByteArrayOpAs Nothing f32 b8 res args
|
|
682
|
|
- ReadByteArrayOp_Word8AsDouble -> \args -> opIntoRegs $ \res ->
|
|
|
723
|
+ ReadByteArrayOp_Word8AsDouble -> \args -> inlinePrimop $ \res ->
|
|
683
|
724
|
doIndexByteArrayOpAs Nothing f64 b8 res args
|
|
684
|
|
- ReadByteArrayOp_Word8AsStablePtr -> \args -> opIntoRegs $ \res ->
|
|
|
725
|
+ ReadByteArrayOp_Word8AsStablePtr -> \args -> inlinePrimop $ \res ->
|
|
685
|
726
|
doIndexByteArrayOpAs Nothing (bWord platform) b8 res args
|
|
686
|
|
- ReadByteArrayOp_Word8AsInt16 -> \args -> opIntoRegs $ \res ->
|
|
|
727
|
+ ReadByteArrayOp_Word8AsInt16 -> \args -> inlinePrimop $ \res ->
|
|
687
|
728
|
doIndexByteArrayOpAs Nothing b16 b8 res args
|
|
688
|
|
- ReadByteArrayOp_Word8AsInt32 -> \args -> opIntoRegs $ \res ->
|
|
|
729
|
+ ReadByteArrayOp_Word8AsInt32 -> \args -> inlinePrimop $ \res ->
|
|
689
|
730
|
doIndexByteArrayOpAs Nothing b32 b8 res args
|
|
690
|
|
- ReadByteArrayOp_Word8AsInt64 -> \args -> opIntoRegs $ \res ->
|
|
|
731
|
+ ReadByteArrayOp_Word8AsInt64 -> \args -> inlinePrimop $ \res ->
|
|
691
|
732
|
doIndexByteArrayOpAs Nothing b64 b8 res args
|
|
692
|
|
- ReadByteArrayOp_Word8AsWord16 -> \args -> opIntoRegs $ \res ->
|
|
|
733
|
+ ReadByteArrayOp_Word8AsWord16 -> \args -> inlinePrimop $ \res ->
|
|
693
|
734
|
doIndexByteArrayOpAs Nothing b16 b8 res args
|
|
694
|
|
- ReadByteArrayOp_Word8AsWord32 -> \args -> opIntoRegs $ \res ->
|
|
|
735
|
+ ReadByteArrayOp_Word8AsWord32 -> \args -> inlinePrimop $ \res ->
|
|
695
|
736
|
doIndexByteArrayOpAs Nothing b32 b8 res args
|
|
696
|
|
- ReadByteArrayOp_Word8AsWord64 -> \args -> opIntoRegs $ \res ->
|
|
|
737
|
+ ReadByteArrayOp_Word8AsWord64 -> \args -> inlinePrimop $ \res ->
|
|
697
|
738
|
doIndexByteArrayOpAs Nothing b64 b8 res args
|
|
698
|
739
|
|
|
699
|
740
|
-- WriteXXXoffAddr
|
|
700
|
741
|
|
|
701
|
|
- WriteOffAddrOp_Char -> \args -> opIntoRegs $ \res ->
|
|
|
742
|
+ WriteOffAddrOp_Char -> \args -> inlinePrimop $ \res ->
|
|
702
|
743
|
doWriteOffAddrOp (Just (mo_WordTo8 platform)) b8 res args
|
|
703
|
|
- WriteOffAddrOp_WideChar -> \args -> opIntoRegs $ \res ->
|
|
|
744
|
+ WriteOffAddrOp_WideChar -> \args -> inlinePrimop $ \res ->
|
|
704
|
745
|
doWriteOffAddrOp (Just (mo_WordTo32 platform)) b32 res args
|
|
705
|
|
- WriteOffAddrOp_Int -> \args -> opIntoRegs $ \res ->
|
|
|
746
|
+ WriteOffAddrOp_Int -> \args -> inlinePrimop $ \res ->
|
|
706
|
747
|
doWriteOffAddrOp Nothing (bWord platform) res args
|
|
707
|
|
- WriteOffAddrOp_Word -> \args -> opIntoRegs $ \res ->
|
|
|
748
|
+ WriteOffAddrOp_Word -> \args -> inlinePrimop $ \res ->
|
|
708
|
749
|
doWriteOffAddrOp Nothing (bWord platform) res args
|
|
709
|
|
- WriteOffAddrOp_Addr -> \args -> opIntoRegs $ \res ->
|
|
|
750
|
+ WriteOffAddrOp_Addr -> \args -> inlinePrimop $ \res ->
|
|
710
|
751
|
doWriteOffAddrOp Nothing (bWord platform) res args
|
|
711
|
|
- WriteOffAddrOp_Float -> \args -> opIntoRegs $ \res ->
|
|
|
752
|
+ WriteOffAddrOp_Float -> \args -> inlinePrimop $ \res ->
|
|
712
|
753
|
doWriteOffAddrOp Nothing f32 res args
|
|
713
|
|
- WriteOffAddrOp_Double -> \args -> opIntoRegs $ \res ->
|
|
|
754
|
+ WriteOffAddrOp_Double -> \args -> inlinePrimop $ \res ->
|
|
714
|
755
|
doWriteOffAddrOp Nothing f64 res args
|
|
715
|
|
- WriteOffAddrOp_StablePtr -> \args -> opIntoRegs $ \res ->
|
|
|
756
|
+ WriteOffAddrOp_StablePtr -> \args -> inlinePrimop $ \res ->
|
|
716
|
757
|
doWriteOffAddrOp Nothing (bWord platform) res args
|
|
717
|
|
- WriteOffAddrOp_Int8 -> \args -> opIntoRegs $ \res ->
|
|
|
758
|
+ WriteOffAddrOp_Int8 -> \args -> inlinePrimop $ \res ->
|
|
718
|
759
|
doWriteOffAddrOp Nothing b8 res args
|
|
719
|
|
- WriteOffAddrOp_Int16 -> \args -> opIntoRegs $ \res ->
|
|
|
760
|
+ WriteOffAddrOp_Int16 -> \args -> inlinePrimop $ \res ->
|
|
720
|
761
|
doWriteOffAddrOp Nothing b16 res args
|
|
721
|
|
- WriteOffAddrOp_Int32 -> \args -> opIntoRegs $ \res ->
|
|
|
762
|
+ WriteOffAddrOp_Int32 -> \args -> inlinePrimop $ \res ->
|
|
722
|
763
|
doWriteOffAddrOp Nothing b32 res args
|
|
723
|
|
- WriteOffAddrOp_Int64 -> \args -> opIntoRegs $ \res ->
|
|
|
764
|
+ WriteOffAddrOp_Int64 -> \args -> inlinePrimop $ \res ->
|
|
724
|
765
|
doWriteOffAddrOp Nothing b64 res args
|
|
725
|
|
- WriteOffAddrOp_Word8 -> \args -> opIntoRegs $ \res ->
|
|
|
766
|
+ WriteOffAddrOp_Word8 -> \args -> inlinePrimop $ \res ->
|
|
726
|
767
|
doWriteOffAddrOp Nothing b8 res args
|
|
727
|
|
- WriteOffAddrOp_Word16 -> \args -> opIntoRegs $ \res ->
|
|
|
768
|
+ WriteOffAddrOp_Word16 -> \args -> inlinePrimop $ \res ->
|
|
728
|
769
|
doWriteOffAddrOp Nothing b16 res args
|
|
729
|
|
- WriteOffAddrOp_Word32 -> \args -> opIntoRegs $ \res ->
|
|
|
770
|
+ WriteOffAddrOp_Word32 -> \args -> inlinePrimop $ \res ->
|
|
730
|
771
|
doWriteOffAddrOp Nothing b32 res args
|
|
731
|
|
- WriteOffAddrOp_Word64 -> \args -> opIntoRegs $ \res ->
|
|
|
772
|
+ WriteOffAddrOp_Word64 -> \args -> inlinePrimop $ \res ->
|
|
732
|
773
|
doWriteOffAddrOp Nothing b64 res args
|
|
733
|
774
|
|
|
734
|
775
|
-- WriteXXXArray
|
|
735
|
776
|
|
|
736
|
|
- WriteByteArrayOp_Char -> \args -> opIntoRegs $ \res ->
|
|
|
777
|
+ WriteByteArrayOp_Char -> \args -> inlinePrimop $ \res ->
|
|
737
|
778
|
doWriteByteArrayOp (Just (mo_WordTo8 platform)) b8 res args
|
|
738
|
|
- WriteByteArrayOp_WideChar -> \args -> opIntoRegs $ \res ->
|
|
|
779
|
+ WriteByteArrayOp_WideChar -> \args -> inlinePrimop $ \res ->
|
|
739
|
780
|
doWriteByteArrayOp (Just (mo_WordTo32 platform)) b32 res args
|
|
740
|
|
- WriteByteArrayOp_Int -> \args -> opIntoRegs $ \res ->
|
|
|
781
|
+ WriteByteArrayOp_Int -> \args -> inlinePrimop $ \res ->
|
|
741
|
782
|
doWriteByteArrayOp Nothing (bWord platform) res args
|
|
742
|
|
- WriteByteArrayOp_Word -> \args -> opIntoRegs $ \res ->
|
|
|
783
|
+ WriteByteArrayOp_Word -> \args -> inlinePrimop $ \res ->
|
|
743
|
784
|
doWriteByteArrayOp Nothing (bWord platform) res args
|
|
744
|
|
- WriteByteArrayOp_Addr -> \args -> opIntoRegs $ \res ->
|
|
|
785
|
+ WriteByteArrayOp_Addr -> \args -> inlinePrimop $ \res ->
|
|
745
|
786
|
doWriteByteArrayOp Nothing (bWord platform) res args
|
|
746
|
|
- WriteByteArrayOp_Float -> \args -> opIntoRegs $ \res ->
|
|
|
787
|
+ WriteByteArrayOp_Float -> \args -> inlinePrimop $ \res ->
|
|
747
|
788
|
doWriteByteArrayOp Nothing f32 res args
|
|
748
|
|
- WriteByteArrayOp_Double -> \args -> opIntoRegs $ \res ->
|
|
|
789
|
+ WriteByteArrayOp_Double -> \args -> inlinePrimop $ \res ->
|
|
749
|
790
|
doWriteByteArrayOp Nothing f64 res args
|
|
750
|
|
- WriteByteArrayOp_StablePtr -> \args -> opIntoRegs $ \res ->
|
|
|
791
|
+ WriteByteArrayOp_StablePtr -> \args -> inlinePrimop $ \res ->
|
|
751
|
792
|
doWriteByteArrayOp Nothing (bWord platform) res args
|
|
752
|
|
- WriteByteArrayOp_Int8 -> \args -> opIntoRegs $ \res ->
|
|
|
793
|
+ WriteByteArrayOp_Int8 -> \args -> inlinePrimop $ \res ->
|
|
753
|
794
|
doWriteByteArrayOp Nothing b8 res args
|
|
754
|
|
- WriteByteArrayOp_Int16 -> \args -> opIntoRegs $ \res ->
|
|
|
795
|
+ WriteByteArrayOp_Int16 -> \args -> inlinePrimop $ \res ->
|
|
755
|
796
|
doWriteByteArrayOp Nothing b16 res args
|
|
756
|
|
- WriteByteArrayOp_Int32 -> \args -> opIntoRegs $ \res ->
|
|
|
797
|
+ WriteByteArrayOp_Int32 -> \args -> inlinePrimop $ \res ->
|
|
757
|
798
|
doWriteByteArrayOp Nothing b32 res args
|
|
758
|
|
- WriteByteArrayOp_Int64 -> \args -> opIntoRegs $ \res ->
|
|
|
799
|
+ WriteByteArrayOp_Int64 -> \args -> inlinePrimop $ \res ->
|
|
759
|
800
|
doWriteByteArrayOp Nothing b64 res args
|
|
760
|
|
- WriteByteArrayOp_Word8 -> \args -> opIntoRegs $ \res ->
|
|
|
801
|
+ WriteByteArrayOp_Word8 -> \args -> inlinePrimop $ \res ->
|
|
761
|
802
|
doWriteByteArrayOp Nothing b8 res args
|
|
762
|
|
- WriteByteArrayOp_Word16 -> \args -> opIntoRegs $ \res ->
|
|
|
803
|
+ WriteByteArrayOp_Word16 -> \args -> inlinePrimop $ \res ->
|
|
763
|
804
|
doWriteByteArrayOp Nothing b16 res args
|
|
764
|
|
- WriteByteArrayOp_Word32 -> \args -> opIntoRegs $ \res ->
|
|
|
805
|
+ WriteByteArrayOp_Word32 -> \args -> inlinePrimop $ \res ->
|
|
765
|
806
|
doWriteByteArrayOp Nothing b32 res args
|
|
766
|
|
- WriteByteArrayOp_Word64 -> \args -> opIntoRegs $ \res ->
|
|
|
807
|
+ WriteByteArrayOp_Word64 -> \args -> inlinePrimop $ \res ->
|
|
767
|
808
|
doWriteByteArrayOp Nothing b64 res args
|
|
768
|
809
|
|
|
769
|
810
|
-- WriteInt8ArrayAsXXX
|
|
770
|
811
|
|
|
771
|
|
- WriteByteArrayOp_Word8AsChar -> \args -> opIntoRegs $ \res ->
|
|
|
812
|
+ WriteByteArrayOp_Word8AsChar -> \args -> inlinePrimop $ \res ->
|
|
772
|
813
|
doWriteByteArrayOp (Just (mo_WordTo8 platform)) b8 res args
|
|
773
|
|
- WriteByteArrayOp_Word8AsWideChar -> \args -> opIntoRegs $ \res ->
|
|
|
814
|
+ WriteByteArrayOp_Word8AsWideChar -> \args -> inlinePrimop $ \res ->
|
|
774
|
815
|
doWriteByteArrayOp (Just (mo_WordTo32 platform)) b8 res args
|
|
775
|
|
- WriteByteArrayOp_Word8AsInt -> \args -> opIntoRegs $ \res ->
|
|
|
816
|
+ WriteByteArrayOp_Word8AsInt -> \args -> inlinePrimop $ \res ->
|
|
776
|
817
|
doWriteByteArrayOp Nothing b8 res args
|
|
777
|
|
- WriteByteArrayOp_Word8AsWord -> \args -> opIntoRegs $ \res ->
|
|
|
818
|
+ WriteByteArrayOp_Word8AsWord -> \args -> inlinePrimop $ \res ->
|
|
778
|
819
|
doWriteByteArrayOp Nothing b8 res args
|
|
779
|
|
- WriteByteArrayOp_Word8AsAddr -> \args -> opIntoRegs $ \res ->
|
|
|
820
|
+ WriteByteArrayOp_Word8AsAddr -> \args -> inlinePrimop $ \res ->
|
|
780
|
821
|
doWriteByteArrayOp Nothing b8 res args
|
|
781
|
|
- WriteByteArrayOp_Word8AsFloat -> \args -> opIntoRegs $ \res ->
|
|
|
822
|
+ WriteByteArrayOp_Word8AsFloat -> \args -> inlinePrimop $ \res ->
|
|
782
|
823
|
doWriteByteArrayOp Nothing b8 res args
|
|
783
|
|
- WriteByteArrayOp_Word8AsDouble -> \args -> opIntoRegs $ \res ->
|
|
|
824
|
+ WriteByteArrayOp_Word8AsDouble -> \args -> inlinePrimop $ \res ->
|
|
784
|
825
|
doWriteByteArrayOp Nothing b8 res args
|
|
785
|
|
- WriteByteArrayOp_Word8AsStablePtr -> \args -> opIntoRegs $ \res ->
|
|
|
826
|
+ WriteByteArrayOp_Word8AsStablePtr -> \args -> inlinePrimop $ \res ->
|
|
786
|
827
|
doWriteByteArrayOp Nothing b8 res args
|
|
787
|
|
- WriteByteArrayOp_Word8AsInt16 -> \args -> opIntoRegs $ \res ->
|
|
|
828
|
+ WriteByteArrayOp_Word8AsInt16 -> \args -> inlinePrimop $ \res ->
|
|
788
|
829
|
doWriteByteArrayOp Nothing b8 res args
|
|
789
|
|
- WriteByteArrayOp_Word8AsInt32 -> \args -> opIntoRegs $ \res ->
|
|
|
830
|
+ WriteByteArrayOp_Word8AsInt32 -> \args -> inlinePrimop $ \res ->
|
|
790
|
831
|
doWriteByteArrayOp Nothing b8 res args
|
|
791
|
|
- WriteByteArrayOp_Word8AsInt64 -> \args -> opIntoRegs $ \res ->
|
|
|
832
|
+ WriteByteArrayOp_Word8AsInt64 -> \args -> inlinePrimop $ \res ->
|
|
792
|
833
|
doWriteByteArrayOp Nothing b8 res args
|
|
793
|
|
- WriteByteArrayOp_Word8AsWord16 -> \args -> opIntoRegs $ \res ->
|
|
|
834
|
+ WriteByteArrayOp_Word8AsWord16 -> \args -> inlinePrimop $ \res ->
|
|
794
|
835
|
doWriteByteArrayOp Nothing b8 res args
|
|
795
|
|
- WriteByteArrayOp_Word8AsWord32 -> \args -> opIntoRegs $ \res ->
|
|
|
836
|
+ WriteByteArrayOp_Word8AsWord32 -> \args -> inlinePrimop $ \res ->
|
|
796
|
837
|
doWriteByteArrayOp Nothing b8 res args
|
|
797
|
|
- WriteByteArrayOp_Word8AsWord64 -> \args -> opIntoRegs $ \res ->
|
|
|
838
|
+ WriteByteArrayOp_Word8AsWord64 -> \args -> inlinePrimop $ \res ->
|
|
798
|
839
|
doWriteByteArrayOp Nothing b8 res args
|
|
799
|
840
|
|
|
800
|
841
|
-- Copying and setting byte arrays
|
|
801
|
|
- CopyByteArrayOp -> \[src,src_off,dst,dst_off,n] -> opIntoRegs $ \[] ->
|
|
|
842
|
+ CopyByteArrayOp -> \[src,src_off,dst,dst_off,n] -> inlinePrimop $ \[] ->
|
|
802
|
843
|
doCopyByteArrayOp src src_off dst dst_off n
|
|
803
|
|
- CopyMutableByteArrayOp -> \[src,src_off,dst,dst_off,n] -> opIntoRegs $ \[] ->
|
|
|
844
|
+ CopyMutableByteArrayOp -> \[src,src_off,dst,dst_off,n] -> inlinePrimop $ \[] ->
|
|
804
|
845
|
doCopyMutableByteArrayOp src src_off dst dst_off n
|
|
805
|
|
- CopyMutableByteArrayNonOverlappingOp -> \[src,src_off,dst,dst_off,n] -> opIntoRegs $ \[] ->
|
|
|
846
|
+ CopyMutableByteArrayNonOverlappingOp -> \[src,src_off,dst,dst_off,n] -> inlinePrimop $ \[] ->
|
|
806
|
847
|
doCopyMutableByteArrayNonOverlappingOp src src_off dst dst_off n
|
|
807
|
|
- CopyByteArrayToAddrOp -> \[src,src_off,dst,n] -> opIntoRegs $ \[] ->
|
|
|
848
|
+ CopyByteArrayToAddrOp -> \[src,src_off,dst,n] -> inlinePrimop $ \[] ->
|
|
808
|
849
|
doCopyByteArrayToAddrOp src src_off dst n
|
|
809
|
|
- CopyMutableByteArrayToAddrOp -> \[src,src_off,dst,n] -> opIntoRegs $ \[] ->
|
|
|
850
|
+ CopyMutableByteArrayToAddrOp -> \[src,src_off,dst,n] -> inlinePrimop $ \[] ->
|
|
810
|
851
|
doCopyMutableByteArrayToAddrOp src src_off dst n
|
|
811
|
|
- CopyAddrToByteArrayOp -> \[src,dst,dst_off,n] -> opIntoRegs $ \[] ->
|
|
|
852
|
+ CopyAddrToByteArrayOp -> \[src,dst,dst_off,n] -> inlinePrimop $ \[] ->
|
|
812
|
853
|
doCopyAddrToByteArrayOp src dst dst_off n
|
|
813
|
|
- CopyAddrToAddrOp -> \[src,dst,n] -> opIntoRegs $ \[] ->
|
|
|
854
|
+ CopyAddrToAddrOp -> \[src,dst,n] -> inlinePrimop $ \[] ->
|
|
814
|
855
|
doCopyAddrToAddrOp src dst n
|
|
815
|
|
- CopyAddrToAddrNonOverlappingOp -> \[src,dst,n] -> opIntoRegs $ \[] ->
|
|
|
856
|
+ CopyAddrToAddrNonOverlappingOp -> \[src,dst,n] -> inlinePrimop $ \[] ->
|
|
816
|
857
|
doCopyAddrToAddrNonOverlappingOp src dst n
|
|
817
|
|
- SetByteArrayOp -> \[ba,off,len,c] -> opIntoRegs $ \[] ->
|
|
|
858
|
+ SetByteArrayOp -> \[ba,off,len,c] -> inlinePrimop $ \[] ->
|
|
818
|
859
|
doSetByteArrayOp ba off len c
|
|
819
|
|
- SetAddrRangeOp -> \[dst,len,c] -> opIntoRegs $ \[] ->
|
|
|
860
|
+ SetAddrRangeOp -> \[dst,len,c] -> inlinePrimop $ \[] ->
|
|
820
|
861
|
doSetAddrRangeOp dst len c
|
|
821
|
862
|
|
|
822
|
863
|
-- Comparing byte arrays
|
|
823
|
|
- CompareByteArraysOp -> \[ba1,ba1_off,ba2,ba2_off,n] -> opIntoRegs $ \[res] ->
|
|
|
864
|
+ CompareByteArraysOp -> \[ba1,ba1_off,ba2,ba2_off,n] -> inlinePrimop $ \[res] ->
|
|
824
|
865
|
doCompareByteArraysOp res ba1 ba1_off ba2 ba2_off n
|
|
825
|
866
|
|
|
826
|
|
- BSwap16Op -> \[w] -> opIntoRegs $ \[res] ->
|
|
|
867
|
+ BSwap16Op -> \[w] -> inlinePrimop $ \[res] ->
|
|
827
|
868
|
emitBSwapCall res w W16
|
|
828
|
|
- BSwap32Op -> \[w] -> opIntoRegs $ \[res] ->
|
|
|
869
|
+ BSwap32Op -> \[w] -> inlinePrimop $ \[res] ->
|
|
829
|
870
|
emitBSwapCall res w W32
|
|
830
|
|
- BSwap64Op -> \[w] -> opIntoRegs $ \[res] ->
|
|
|
871
|
+ BSwap64Op -> \[w] -> inlinePrimop $ \[res] ->
|
|
831
|
872
|
emitBSwapCall res w W64
|
|
832
|
|
- BSwapOp -> \[w] -> opIntoRegs $ \[res] ->
|
|
|
873
|
+ BSwapOp -> \[w] -> inlinePrimop $ \[res] ->
|
|
833
|
874
|
emitBSwapCall res w (wordWidth platform)
|
|
834
|
875
|
|
|
835
|
|
- BRev8Op -> \[w] -> opIntoRegs $ \[res] ->
|
|
|
876
|
+ BRev8Op -> \[w] -> inlinePrimop $ \[res] ->
|
|
836
|
877
|
emitBRevCall res w W8
|
|
837
|
|
- BRev16Op -> \[w] -> opIntoRegs $ \[res] ->
|
|
|
878
|
+ BRev16Op -> \[w] -> inlinePrimop $ \[res] ->
|
|
838
|
879
|
emitBRevCall res w W16
|
|
839
|
|
- BRev32Op -> \[w] -> opIntoRegs $ \[res] ->
|
|
|
880
|
+ BRev32Op -> \[w] -> inlinePrimop $ \[res] ->
|
|
840
|
881
|
emitBRevCall res w W32
|
|
841
|
|
- BRev64Op -> \[w] -> opIntoRegs $ \[res] ->
|
|
|
882
|
+ BRev64Op -> \[w] -> inlinePrimop $ \[res] ->
|
|
842
|
883
|
emitBRevCall res w W64
|
|
843
|
|
- BRevOp -> \[w] -> opIntoRegs $ \[res] ->
|
|
|
884
|
+ BRevOp -> \[w] -> inlinePrimop $ \[res] ->
|
|
844
|
885
|
emitBRevCall res w (wordWidth platform)
|
|
845
|
886
|
|
|
846
|
887
|
-- Population count
|
|
847
|
|
- PopCnt8Op -> \[w] -> opIntoRegs $ \[res] ->
|
|
|
888
|
+ PopCnt8Op -> \[w] -> inlinePrimop $ \[res] ->
|
|
848
|
889
|
emitPopCntCall res w W8
|
|
849
|
|
- PopCnt16Op -> \[w] -> opIntoRegs $ \[res] ->
|
|
|
890
|
+ PopCnt16Op -> \[w] -> inlinePrimop $ \[res] ->
|
|
850
|
891
|
emitPopCntCall res w W16
|
|
851
|
|
- PopCnt32Op -> \[w] -> opIntoRegs $ \[res] ->
|
|
|
892
|
+ PopCnt32Op -> \[w] -> inlinePrimop $ \[res] ->
|
|
852
|
893
|
emitPopCntCall res w W32
|
|
853
|
|
- PopCnt64Op -> \[w] -> opIntoRegs $ \[res] ->
|
|
|
894
|
+ PopCnt64Op -> \[w] -> inlinePrimop $ \[res] ->
|
|
854
|
895
|
emitPopCntCall res w W64
|
|
855
|
|
- PopCntOp -> \[w] -> opIntoRegs $ \[res] ->
|
|
|
896
|
+ PopCntOp -> \[w] -> inlinePrimop $ \[res] ->
|
|
856
|
897
|
emitPopCntCall res w (wordWidth platform)
|
|
857
|
898
|
|
|
858
|
899
|
-- Parallel bit deposit
|
|
859
|
|
- Pdep8Op -> \[src, mask] -> opIntoRegs $ \[res] ->
|
|
|
900
|
+ Pdep8Op -> \[src, mask] -> inlinePrimop $ \[res] ->
|
|
860
|
901
|
emitPdepCall res src mask W8
|
|
861
|
|
- Pdep16Op -> \[src, mask] -> opIntoRegs $ \[res] ->
|
|
|
902
|
+ Pdep16Op -> \[src, mask] -> inlinePrimop $ \[res] ->
|
|
862
|
903
|
emitPdepCall res src mask W16
|
|
863
|
|
- Pdep32Op -> \[src, mask] -> opIntoRegs $ \[res] ->
|
|
|
904
|
+ Pdep32Op -> \[src, mask] -> inlinePrimop $ \[res] ->
|
|
864
|
905
|
emitPdepCall res src mask W32
|
|
865
|
|
- Pdep64Op -> \[src, mask] -> opIntoRegs $ \[res] ->
|
|
|
906
|
+ Pdep64Op -> \[src, mask] -> inlinePrimop $ \[res] ->
|
|
866
|
907
|
emitPdepCall res src mask W64
|
|
867
|
|
- PdepOp -> \[src, mask] -> opIntoRegs $ \[res] ->
|
|
|
908
|
+ PdepOp -> \[src, mask] -> inlinePrimop $ \[res] ->
|
|
868
|
909
|
emitPdepCall res src mask (wordWidth platform)
|
|
869
|
910
|
|
|
870
|
911
|
-- Parallel bit extract
|
|
871
|
|
- Pext8Op -> \[src, mask] -> opIntoRegs $ \[res] ->
|
|
|
912
|
+ Pext8Op -> \[src, mask] -> inlinePrimop $ \[res] ->
|
|
872
|
913
|
emitPextCall res src mask W8
|
|
873
|
|
- Pext16Op -> \[src, mask] -> opIntoRegs $ \[res] ->
|
|
|
914
|
+ Pext16Op -> \[src, mask] -> inlinePrimop $ \[res] ->
|
|
874
|
915
|
emitPextCall res src mask W16
|
|
875
|
|
- Pext32Op -> \[src, mask] -> opIntoRegs $ \[res] ->
|
|
|
916
|
+ Pext32Op -> \[src, mask] -> inlinePrimop $ \[res] ->
|
|
876
|
917
|
emitPextCall res src mask W32
|
|
877
|
|
- Pext64Op -> \[src, mask] -> opIntoRegs $ \[res] ->
|
|
|
918
|
+ Pext64Op -> \[src, mask] -> inlinePrimop $ \[res] ->
|
|
878
|
919
|
emitPextCall res src mask W64
|
|
879
|
|
- PextOp -> \[src, mask] -> opIntoRegs $ \[res] ->
|
|
|
920
|
+ PextOp -> \[src, mask] -> inlinePrimop $ \[res] ->
|
|
880
|
921
|
emitPextCall res src mask (wordWidth platform)
|
|
881
|
922
|
|
|
882
|
923
|
-- count leading zeros
|
|
883
|
|
- Clz8Op -> \[w] -> opIntoRegs $ \[res] ->
|
|
|
924
|
+ Clz8Op -> \[w] -> inlinePrimop $ \[res] ->
|
|
884
|
925
|
emitClzCall res w W8
|
|
885
|
|
- Clz16Op -> \[w] -> opIntoRegs $ \[res] ->
|
|
|
926
|
+ Clz16Op -> \[w] -> inlinePrimop $ \[res] ->
|
|
886
|
927
|
emitClzCall res w W16
|
|
887
|
|
- Clz32Op -> \[w] -> opIntoRegs $ \[res] ->
|
|
|
928
|
+ Clz32Op -> \[w] -> inlinePrimop $ \[res] ->
|
|
888
|
929
|
emitClzCall res w W32
|
|
889
|
|
- Clz64Op -> \[w] -> opIntoRegs $ \[res] ->
|
|
|
930
|
+ Clz64Op -> \[w] -> inlinePrimop $ \[res] ->
|
|
890
|
931
|
emitClzCall res w W64
|
|
891
|
|
- ClzOp -> \[w] -> opIntoRegs $ \[res] ->
|
|
|
932
|
+ ClzOp -> \[w] -> inlinePrimop $ \[res] ->
|
|
892
|
933
|
emitClzCall res w (wordWidth platform)
|
|
893
|
934
|
|
|
894
|
935
|
-- count trailing zeros
|
|
895
|
|
- Ctz8Op -> \[w] -> opIntoRegs $ \[res] ->
|
|
|
936
|
+ Ctz8Op -> \[w] -> inlinePrimop $ \[res] ->
|
|
896
|
937
|
emitCtzCall res w W8
|
|
897
|
|
- Ctz16Op -> \[w] -> opIntoRegs $ \[res] ->
|
|
|
938
|
+ Ctz16Op -> \[w] -> inlinePrimop $ \[res] ->
|
|
898
|
939
|
emitCtzCall res w W16
|
|
899
|
|
- Ctz32Op -> \[w] -> opIntoRegs $ \[res] ->
|
|
|
940
|
+ Ctz32Op -> \[w] -> inlinePrimop $ \[res] ->
|
|
900
|
941
|
emitCtzCall res w W32
|
|
901
|
|
- Ctz64Op -> \[w] -> opIntoRegs $ \[res] ->
|
|
|
942
|
+ Ctz64Op -> \[w] -> inlinePrimop $ \[res] ->
|
|
902
|
943
|
emitCtzCall res w W64
|
|
903
|
|
- CtzOp -> \[w] -> opIntoRegs $ \[res] ->
|
|
|
944
|
+ CtzOp -> \[w] -> inlinePrimop $ \[res] ->
|
|
904
|
945
|
emitCtzCall res w (wordWidth platform)
|
|
905
|
946
|
|
|
906
|
947
|
-- Unsigned int to floating point conversions
|
|
907
|
|
- WordToFloatOp -> \[w] -> opIntoRegs $ \[res] ->
|
|
|
948
|
+ WordToFloatOp -> \[w] -> inlinePrimop $ \[res] ->
|
|
908
|
949
|
emitPrimCall [res] (MO_UF_Conv W32) [w]
|
|
909
|
|
- WordToDoubleOp -> \[w] -> opIntoRegs $ \[res] ->
|
|
|
950
|
+ WordToDoubleOp -> \[w] -> inlinePrimop $ \[res] ->
|
|
910
|
951
|
emitPrimCall [res] (MO_UF_Conv W64) [w]
|
|
911
|
952
|
|
|
912
|
953
|
-- Atomic operations
|
|
913
|
|
- InterlockedExchange_Addr -> \[src, value] -> opIntoRegs $ \[res] ->
|
|
|
954
|
+ InterlockedExchange_Addr -> \[src, value] -> inlinePrimop $ \[res] ->
|
|
914
|
955
|
emitPrimCall [res] (MO_Xchg (wordWidth platform)) [src, value]
|
|
915
|
|
- InterlockedExchange_Word -> \[src, value] -> opIntoRegs $ \[res] ->
|
|
|
956
|
+ InterlockedExchange_Word -> \[src, value] -> inlinePrimop $ \[res] ->
|
|
916
|
957
|
emitPrimCall [res] (MO_Xchg (wordWidth platform)) [src, value]
|
|
917
|
958
|
|
|
918
|
|
- FetchAddAddrOp_Word -> \[addr, n] -> opIntoRegs $ \[res] ->
|
|
|
959
|
+ FetchAddAddrOp_Word -> \[addr, n] -> inlinePrimop $ \[res] ->
|
|
919
|
960
|
doAtomicAddrRMW res AMO_Add addr (bWord platform) n
|
|
920
|
|
- FetchSubAddrOp_Word -> \[addr, n] -> opIntoRegs $ \[res] ->
|
|
|
961
|
+ FetchSubAddrOp_Word -> \[addr, n] -> inlinePrimop $ \[res] ->
|
|
921
|
962
|
doAtomicAddrRMW res AMO_Sub addr (bWord platform) n
|
|
922
|
|
- FetchAndAddrOp_Word -> \[addr, n] -> opIntoRegs $ \[res] ->
|
|
|
963
|
+ FetchAndAddrOp_Word -> \[addr, n] -> inlinePrimop $ \[res] ->
|
|
923
|
964
|
doAtomicAddrRMW res AMO_And addr (bWord platform) n
|
|
924
|
|
- FetchNandAddrOp_Word -> \[addr, n] -> opIntoRegs $ \[res] ->
|
|
|
965
|
+ FetchNandAddrOp_Word -> \[addr, n] -> inlinePrimop $ \[res] ->
|
|
925
|
966
|
doAtomicAddrRMW res AMO_Nand addr (bWord platform) n
|
|
926
|
|
- FetchOrAddrOp_Word -> \[addr, n] -> opIntoRegs $ \[res] ->
|
|
|
967
|
+ FetchOrAddrOp_Word -> \[addr, n] -> inlinePrimop $ \[res] ->
|
|
927
|
968
|
doAtomicAddrRMW res AMO_Or addr (bWord platform) n
|
|
928
|
|
- FetchXorAddrOp_Word -> \[addr, n] -> opIntoRegs $ \[res] ->
|
|
|
969
|
+ FetchXorAddrOp_Word -> \[addr, n] -> inlinePrimop $ \[res] ->
|
|
929
|
970
|
doAtomicAddrRMW res AMO_Xor addr (bWord platform) n
|
|
930
|
971
|
|
|
931
|
|
- AtomicReadAddrOp_Word -> \[addr] -> opIntoRegs $ \[res] ->
|
|
|
972
|
+ AtomicReadAddrOp_Word -> \[addr] -> inlinePrimop $ \[res] ->
|
|
932
|
973
|
doAtomicReadAddr res addr (bWord platform)
|
|
933
|
|
- AtomicWriteAddrOp_Word -> \[addr, val] -> opIntoRegs $ \[] ->
|
|
|
974
|
+ AtomicWriteAddrOp_Word -> \[addr, val] -> inlinePrimop $ \[] ->
|
|
934
|
975
|
doAtomicWriteAddr addr (bWord platform) val
|
|
935
|
976
|
|
|
936
|
|
- CasAddrOp_Addr -> \[dst, expected, new] -> opIntoRegs $ \[res] ->
|
|
|
977
|
+ CasAddrOp_Addr -> \[dst, expected, new] -> inlinePrimop $ \[res] ->
|
|
937
|
978
|
emitPrimCall [res] (MO_Cmpxchg (wordWidth platform)) [dst, expected, new]
|
|
938
|
|
- CasAddrOp_Word -> \[dst, expected, new] -> opIntoRegs $ \[res] ->
|
|
|
979
|
+ CasAddrOp_Word -> \[dst, expected, new] -> inlinePrimop $ \[res] ->
|
|
939
|
980
|
emitPrimCall [res] (MO_Cmpxchg (wordWidth platform)) [dst, expected, new]
|
|
940
|
|
- CasAddrOp_Word8 -> \[dst, expected, new] -> opIntoRegs $ \[res] ->
|
|
|
981
|
+ CasAddrOp_Word8 -> \[dst, expected, new] -> inlinePrimop $ \[res] ->
|
|
941
|
982
|
emitPrimCall [res] (MO_Cmpxchg W8) [dst, expected, new]
|
|
942
|
|
- CasAddrOp_Word16 -> \[dst, expected, new] -> opIntoRegs $ \[res] ->
|
|
|
983
|
+ CasAddrOp_Word16 -> \[dst, expected, new] -> inlinePrimop $ \[res] ->
|
|
943
|
984
|
emitPrimCall [res] (MO_Cmpxchg W16) [dst, expected, new]
|
|
944
|
|
- CasAddrOp_Word32 -> \[dst, expected, new] -> opIntoRegs $ \[res] ->
|
|
|
985
|
+ CasAddrOp_Word32 -> \[dst, expected, new] -> inlinePrimop $ \[res] ->
|
|
945
|
986
|
emitPrimCall [res] (MO_Cmpxchg W32) [dst, expected, new]
|
|
946
|
|
- CasAddrOp_Word64 -> \[dst, expected, new] -> opIntoRegs $ \[res] ->
|
|
|
987
|
+ CasAddrOp_Word64 -> \[dst, expected, new] -> inlinePrimop $ \[res] ->
|
|
947
|
988
|
emitPrimCall [res] (MO_Cmpxchg W64) [dst, expected, new]
|
|
948
|
989
|
|
|
949
|
990
|
-- SIMD primops
|
|
950
|
|
- (VecBroadcastOp vcat n w) -> \[e] -> opIntoRegs $ \[res] -> do
|
|
|
991
|
+ (VecBroadcastOp vcat n w) -> \[e] -> inlinePrimop $ \[res] -> do
|
|
951
|
992
|
checkVecCompatibility cfg vcat n w
|
|
952
|
993
|
doVecBroadcastOp ty e res
|
|
953
|
994
|
where
|
| ... |
... |
@@ -955,7 +996,7 @@ emitPrimOp cfg primop = |
|
955
|
996
|
ty :: CmmType
|
|
956
|
997
|
ty = vecCmmType vcat n w
|
|
957
|
998
|
|
|
958
|
|
- (VecPackOp vcat n w) -> \es -> opIntoRegs $ \[res] -> do
|
|
|
999
|
+ (VecPackOp vcat n w) -> \es -> inlinePrimop $ \[res] -> do
|
|
959
|
1000
|
checkVecCompatibility cfg vcat n w
|
|
960
|
1001
|
when (es `lengthIsNot` n) $
|
|
961
|
1002
|
panic "emitPrimOp: VecPackOp has wrong number of arguments"
|
| ... |
... |
@@ -964,7 +1005,7 @@ emitPrimOp cfg primop = |
|
964
|
1005
|
ty :: CmmType
|
|
965
|
1006
|
ty = vecCmmType vcat n w
|
|
966
|
1007
|
|
|
967
|
|
- (VecUnpackOp vcat n w) -> \[arg] -> opIntoRegs $ \res -> do
|
|
|
1008
|
+ (VecUnpackOp vcat n w) -> \[arg] -> inlinePrimop $ \res -> do
|
|
968
|
1009
|
checkVecCompatibility cfg vcat n w
|
|
969
|
1010
|
when (res `lengthIsNot` n) $
|
|
970
|
1011
|
panic "emitPrimOp: VecUnpackOp has wrong number of results"
|
| ... |
... |
@@ -973,56 +1014,56 @@ emitPrimOp cfg primop = |
|
973
|
1014
|
ty :: CmmType
|
|
974
|
1015
|
ty = vecCmmType vcat n w
|
|
975
|
1016
|
|
|
976
|
|
- (VecInsertOp vcat n w) -> \[v,e,i] -> opIntoRegs $ \[res] -> do
|
|
|
1017
|
+ (VecInsertOp vcat n w) -> \[v,e,i] -> inlinePrimop $ \[res] -> do
|
|
977
|
1018
|
checkVecCompatibility cfg vcat n w
|
|
978
|
1019
|
doVecInsertOp ty v e i res
|
|
979
|
1020
|
where
|
|
980
|
1021
|
ty :: CmmType
|
|
981
|
1022
|
ty = vecCmmType vcat n w
|
|
982
|
1023
|
|
|
983
|
|
- (VecIndexByteArrayOp vcat n w) -> \args -> opIntoRegs $ \res0 -> do
|
|
|
1024
|
+ (VecIndexByteArrayOp vcat n w) -> \args -> inlinePrimop $ \res0 -> do
|
|
984
|
1025
|
checkVecCompatibility cfg vcat n w
|
|
985
|
1026
|
doIndexByteArrayOp Nothing ty res0 args
|
|
986
|
1027
|
where
|
|
987
|
1028
|
ty :: CmmType
|
|
988
|
1029
|
ty = vecCmmType vcat n w
|
|
989
|
1030
|
|
|
990
|
|
- (VecReadByteArrayOp vcat n w) -> \args -> opIntoRegs $ \res0 -> do
|
|
|
1031
|
+ (VecReadByteArrayOp vcat n w) -> \args -> inlinePrimop $ \res0 -> do
|
|
991
|
1032
|
checkVecCompatibility cfg vcat n w
|
|
992
|
1033
|
doIndexByteArrayOp Nothing ty res0 args
|
|
993
|
1034
|
where
|
|
994
|
1035
|
ty :: CmmType
|
|
995
|
1036
|
ty = vecCmmType vcat n w
|
|
996
|
1037
|
|
|
997
|
|
- (VecWriteByteArrayOp vcat n w) -> \args -> opIntoRegs $ \res0 -> do
|
|
|
1038
|
+ (VecWriteByteArrayOp vcat n w) -> \args -> inlinePrimop $ \res0 -> do
|
|
998
|
1039
|
checkVecCompatibility cfg vcat n w
|
|
999
|
1040
|
doWriteByteArrayOp Nothing ty res0 args
|
|
1000
|
1041
|
where
|
|
1001
|
1042
|
ty :: CmmType
|
|
1002
|
1043
|
ty = vecCmmType vcat n w
|
|
1003
|
1044
|
|
|
1004
|
|
- (VecIndexOffAddrOp vcat n w) -> \args -> opIntoRegs $ \res0 -> do
|
|
|
1045
|
+ (VecIndexOffAddrOp vcat n w) -> \args -> inlinePrimop $ \res0 -> do
|
|
1005
|
1046
|
checkVecCompatibility cfg vcat n w
|
|
1006
|
1047
|
doIndexOffAddrOp Nothing ty res0 args
|
|
1007
|
1048
|
where
|
|
1008
|
1049
|
ty :: CmmType
|
|
1009
|
1050
|
ty = vecCmmType vcat n w
|
|
1010
|
1051
|
|
|
1011
|
|
- (VecReadOffAddrOp vcat n w) -> \args -> opIntoRegs $ \res0 -> do
|
|
|
1052
|
+ (VecReadOffAddrOp vcat n w) -> \args -> inlinePrimop $ \res0 -> do
|
|
1012
|
1053
|
checkVecCompatibility cfg vcat n w
|
|
1013
|
1054
|
doIndexOffAddrOp Nothing ty res0 args
|
|
1014
|
1055
|
where
|
|
1015
|
1056
|
ty :: CmmType
|
|
1016
|
1057
|
ty = vecCmmType vcat n w
|
|
1017
|
1058
|
|
|
1018
|
|
- (VecWriteOffAddrOp vcat n w) -> \args -> opIntoRegs $ \res0 -> do
|
|
|
1059
|
+ (VecWriteOffAddrOp vcat n w) -> \args -> inlinePrimop $ \res0 -> do
|
|
1019
|
1060
|
checkVecCompatibility cfg vcat n w
|
|
1020
|
1061
|
doWriteOffAddrOp Nothing ty res0 args
|
|
1021
|
1062
|
where
|
|
1022
|
1063
|
ty :: CmmType
|
|
1023
|
1064
|
ty = vecCmmType vcat n w
|
|
1024
|
1065
|
|
|
1025
|
|
- (VecIndexScalarByteArrayOp vcat n w) -> \args -> opIntoRegs $ \res0 -> do
|
|
|
1066
|
+ (VecIndexScalarByteArrayOp vcat n w) -> \args -> inlinePrimop $ \res0 -> do
|
|
1026
|
1067
|
checkVecCompatibility cfg vcat n w
|
|
1027
|
1068
|
doIndexByteArrayOpAs Nothing vecty ty res0 args
|
|
1028
|
1069
|
where
|
| ... |
... |
@@ -1032,7 +1073,7 @@ emitPrimOp cfg primop = |
|
1032
|
1073
|
ty :: CmmType
|
|
1033
|
1074
|
ty = vecCmmCat vcat w
|
|
1034
|
1075
|
|
|
1035
|
|
- (VecReadScalarByteArrayOp vcat n w) -> \args -> opIntoRegs $ \res0 -> do
|
|
|
1076
|
+ (VecReadScalarByteArrayOp vcat n w) -> \args -> inlinePrimop $ \res0 -> do
|
|
1036
|
1077
|
checkVecCompatibility cfg vcat n w
|
|
1037
|
1078
|
doIndexByteArrayOpAs Nothing vecty ty res0 args
|
|
1038
|
1079
|
where
|
| ... |
... |
@@ -1042,14 +1083,14 @@ emitPrimOp cfg primop = |
|
1042
|
1083
|
ty :: CmmType
|
|
1043
|
1084
|
ty = vecCmmCat vcat w
|
|
1044
|
1085
|
|
|
1045
|
|
- (VecWriteScalarByteArrayOp vcat n w) -> \args -> opIntoRegs $ \res0 -> do
|
|
|
1086
|
+ (VecWriteScalarByteArrayOp vcat n w) -> \args -> inlinePrimop $ \res0 -> do
|
|
1046
|
1087
|
checkVecCompatibility cfg vcat n w
|
|
1047
|
1088
|
doWriteByteArrayOp Nothing ty res0 args
|
|
1048
|
1089
|
where
|
|
1049
|
1090
|
ty :: CmmType
|
|
1050
|
1091
|
ty = vecCmmCat vcat w
|
|
1051
|
1092
|
|
|
1052
|
|
- (VecIndexScalarOffAddrOp vcat n w) -> \args -> opIntoRegs $ \res0 -> do
|
|
|
1093
|
+ (VecIndexScalarOffAddrOp vcat n w) -> \args -> inlinePrimop $ \res0 -> do
|
|
1053
|
1094
|
checkVecCompatibility cfg vcat n w
|
|
1054
|
1095
|
doIndexOffAddrOpAs Nothing vecty ty res0 args
|
|
1055
|
1096
|
where
|
| ... |
... |
@@ -1059,7 +1100,7 @@ emitPrimOp cfg primop = |
|
1059
|
1100
|
ty :: CmmType
|
|
1060
|
1101
|
ty = vecCmmCat vcat w
|
|
1061
|
1102
|
|
|
1062
|
|
- (VecReadScalarOffAddrOp vcat n w) -> \args -> opIntoRegs $ \res0 -> do
|
|
|
1103
|
+ (VecReadScalarOffAddrOp vcat n w) -> \args -> inlinePrimop $ \res0 -> do
|
|
1063
|
1104
|
checkVecCompatibility cfg vcat n w
|
|
1064
|
1105
|
doIndexOffAddrOpAs Nothing vecty ty res0 args
|
|
1065
|
1106
|
where
|
| ... |
... |
@@ -1069,79 +1110,79 @@ emitPrimOp cfg primop = |
|
1069
|
1110
|
ty :: CmmType
|
|
1070
|
1111
|
ty = vecCmmCat vcat w
|
|
1071
|
1112
|
|
|
1072
|
|
- (VecWriteScalarOffAddrOp vcat n w) -> \args -> opIntoRegs $ \res0 -> do
|
|
|
1113
|
+ (VecWriteScalarOffAddrOp vcat n w) -> \args -> inlinePrimop $ \res0 -> do
|
|
1073
|
1114
|
checkVecCompatibility cfg vcat n w
|
|
1074
|
1115
|
doWriteOffAddrOp Nothing ty res0 args
|
|
1075
|
1116
|
where
|
|
1076
|
1117
|
ty :: CmmType
|
|
1077
|
1118
|
ty = vecCmmCat vcat w
|
|
1078
|
1119
|
|
|
1079
|
|
- VecShuffleOp vcat n w -> \ args -> opIntoRegs $ \ [res] -> do
|
|
|
1120
|
+ VecShuffleOp vcat n w -> \ args -> inlinePrimop $ \ [res] -> do
|
|
1080
|
1121
|
checkVecCompatibility cfg vcat n w
|
|
1081
|
1122
|
doShuffleOp (vecCmmType vcat n w) args res
|
|
1082
|
1123
|
|
|
1083
|
1124
|
-- Prefetch
|
|
1084
|
|
- PrefetchByteArrayOp3 -> \args -> opIntoRegs $ \[] ->
|
|
|
1125
|
+ PrefetchByteArrayOp3 -> \args -> inlinePrimop $ \[] ->
|
|
1085
|
1126
|
doPrefetchByteArrayOp 3 args
|
|
1086
|
|
- PrefetchMutableByteArrayOp3 -> \args -> opIntoRegs $ \[] ->
|
|
|
1127
|
+ PrefetchMutableByteArrayOp3 -> \args -> inlinePrimop $ \[] ->
|
|
1087
|
1128
|
doPrefetchMutableByteArrayOp 3 args
|
|
1088
|
|
- PrefetchAddrOp3 -> \args -> opIntoRegs $ \[] ->
|
|
|
1129
|
+ PrefetchAddrOp3 -> \args -> inlinePrimop $ \[] ->
|
|
1089
|
1130
|
doPrefetchAddrOp 3 args
|
|
1090
|
|
- PrefetchValueOp3 -> \args -> opIntoRegs $ \[] ->
|
|
|
1131
|
+ PrefetchValueOp3 -> \args -> inlinePrimop $ \[] ->
|
|
1091
|
1132
|
doPrefetchValueOp 3 args
|
|
1092
|
1133
|
|
|
1093
|
|
- PrefetchByteArrayOp2 -> \args -> opIntoRegs $ \[] ->
|
|
|
1134
|
+ PrefetchByteArrayOp2 -> \args -> inlinePrimop $ \[] ->
|
|
1094
|
1135
|
doPrefetchByteArrayOp 2 args
|
|
1095
|
|
- PrefetchMutableByteArrayOp2 -> \args -> opIntoRegs $ \[] ->
|
|
|
1136
|
+ PrefetchMutableByteArrayOp2 -> \args -> inlinePrimop $ \[] ->
|
|
1096
|
1137
|
doPrefetchMutableByteArrayOp 2 args
|
|
1097
|
|
- PrefetchAddrOp2 -> \args -> opIntoRegs $ \[] ->
|
|
|
1138
|
+ PrefetchAddrOp2 -> \args -> inlinePrimop $ \[] ->
|
|
1098
|
1139
|
doPrefetchAddrOp 2 args
|
|
1099
|
|
- PrefetchValueOp2 -> \args -> opIntoRegs $ \[] ->
|
|
|
1140
|
+ PrefetchValueOp2 -> \args -> inlinePrimop $ \[] ->
|
|
1100
|
1141
|
doPrefetchValueOp 2 args
|
|
1101
|
|
- PrefetchByteArrayOp1 -> \args -> opIntoRegs $ \[] ->
|
|
|
1142
|
+ PrefetchByteArrayOp1 -> \args -> inlinePrimop $ \[] ->
|
|
1102
|
1143
|
doPrefetchByteArrayOp 1 args
|
|
1103
|
|
- PrefetchMutableByteArrayOp1 -> \args -> opIntoRegs $ \[] ->
|
|
|
1144
|
+ PrefetchMutableByteArrayOp1 -> \args -> inlinePrimop $ \[] ->
|
|
1104
|
1145
|
doPrefetchMutableByteArrayOp 1 args
|
|
1105
|
|
- PrefetchAddrOp1 -> \args -> opIntoRegs $ \[] ->
|
|
|
1146
|
+ PrefetchAddrOp1 -> \args -> inlinePrimop $ \[] ->
|
|
1106
|
1147
|
doPrefetchAddrOp 1 args
|
|
1107
|
|
- PrefetchValueOp1 -> \args -> opIntoRegs $ \[] ->
|
|
|
1148
|
+ PrefetchValueOp1 -> \args -> inlinePrimop $ \[] ->
|
|
1108
|
1149
|
doPrefetchValueOp 1 args
|
|
1109
|
1150
|
|
|
1110
|
|
- PrefetchByteArrayOp0 -> \args -> opIntoRegs $ \[] ->
|
|
|
1151
|
+ PrefetchByteArrayOp0 -> \args -> inlinePrimop $ \[] ->
|
|
1111
|
1152
|
doPrefetchByteArrayOp 0 args
|
|
1112
|
|
- PrefetchMutableByteArrayOp0 -> \args -> opIntoRegs $ \[] ->
|
|
|
1153
|
+ PrefetchMutableByteArrayOp0 -> \args -> inlinePrimop $ \[] ->
|
|
1113
|
1154
|
doPrefetchMutableByteArrayOp 0 args
|
|
1114
|
|
- PrefetchAddrOp0 -> \args -> opIntoRegs $ \[] ->
|
|
|
1155
|
+ PrefetchAddrOp0 -> \args -> inlinePrimop $ \[] ->
|
|
1115
|
1156
|
doPrefetchAddrOp 0 args
|
|
1116
|
|
- PrefetchValueOp0 -> \args -> opIntoRegs $ \[] ->
|
|
|
1157
|
+ PrefetchValueOp0 -> \args -> inlinePrimop $ \[] ->
|
|
1117
|
1158
|
doPrefetchValueOp 0 args
|
|
1118
|
1159
|
|
|
1119
|
1160
|
-- Atomic read-modify-write
|
|
1120
|
|
- FetchAddByteArrayOp_Int -> \[mba, ix, n] -> opIntoRegs $ \[res] ->
|
|
|
1161
|
+ FetchAddByteArrayOp_Int -> \[mba, ix, n] -> inlinePrimop $ \[res] ->
|
|
1121
|
1162
|
doAtomicByteArrayRMW res AMO_Add mba ix (bWord platform) n
|
|
1122
|
|
- FetchSubByteArrayOp_Int -> \[mba, ix, n] -> opIntoRegs $ \[res] ->
|
|
|
1163
|
+ FetchSubByteArrayOp_Int -> \[mba, ix, n] -> inlinePrimop $ \[res] ->
|
|
1123
|
1164
|
doAtomicByteArrayRMW res AMO_Sub mba ix (bWord platform) n
|
|
1124
|
|
- FetchAndByteArrayOp_Int -> \[mba, ix, n] -> opIntoRegs $ \[res] ->
|
|
|
1165
|
+ FetchAndByteArrayOp_Int -> \[mba, ix, n] -> inlinePrimop $ \[res] ->
|
|
1125
|
1166
|
doAtomicByteArrayRMW res AMO_And mba ix (bWord platform) n
|
|
1126
|
|
- FetchNandByteArrayOp_Int -> \[mba, ix, n] -> opIntoRegs $ \[res] ->
|
|
|
1167
|
+ FetchNandByteArrayOp_Int -> \[mba, ix, n] -> inlinePrimop $ \[res] ->
|
|
1127
|
1168
|
doAtomicByteArrayRMW res AMO_Nand mba ix (bWord platform) n
|
|
1128
|
|
- FetchOrByteArrayOp_Int -> \[mba, ix, n] -> opIntoRegs $ \[res] ->
|
|
|
1169
|
+ FetchOrByteArrayOp_Int -> \[mba, ix, n] -> inlinePrimop $ \[res] ->
|
|
1129
|
1170
|
doAtomicByteArrayRMW res AMO_Or mba ix (bWord platform) n
|
|
1130
|
|
- FetchXorByteArrayOp_Int -> \[mba, ix, n] -> opIntoRegs $ \[res] ->
|
|
|
1171
|
+ FetchXorByteArrayOp_Int -> \[mba, ix, n] -> inlinePrimop $ \[res] ->
|
|
1131
|
1172
|
doAtomicByteArrayRMW res AMO_Xor mba ix (bWord platform) n
|
|
1132
|
|
- AtomicReadByteArrayOp_Int -> \[mba, ix] -> opIntoRegs $ \[res] ->
|
|
|
1173
|
+ AtomicReadByteArrayOp_Int -> \[mba, ix] -> inlinePrimop $ \[res] ->
|
|
1133
|
1174
|
doAtomicReadByteArray res mba ix (bWord platform)
|
|
1134
|
|
- AtomicWriteByteArrayOp_Int -> \[mba, ix, val] -> opIntoRegs $ \[] ->
|
|
|
1175
|
+ AtomicWriteByteArrayOp_Int -> \[mba, ix, val] -> inlinePrimop $ \[] ->
|
|
1135
|
1176
|
doAtomicWriteByteArray mba ix (bWord platform) val
|
|
1136
|
|
- CasByteArrayOp_Int -> \[mba, ix, old, new] -> opIntoRegs $ \[res] ->
|
|
|
1177
|
+ CasByteArrayOp_Int -> \[mba, ix, old, new] -> inlinePrimop $ \[res] ->
|
|
1137
|
1178
|
doCasByteArray res mba ix (bWord platform) old new
|
|
1138
|
|
- CasByteArrayOp_Int8 -> \[mba, ix, old, new] -> opIntoRegs $ \[res] ->
|
|
|
1179
|
+ CasByteArrayOp_Int8 -> \[mba, ix, old, new] -> inlinePrimop $ \[res] ->
|
|
1139
|
1180
|
doCasByteArray res mba ix b8 old new
|
|
1140
|
|
- CasByteArrayOp_Int16 -> \[mba, ix, old, new] -> opIntoRegs $ \[res] ->
|
|
|
1181
|
+ CasByteArrayOp_Int16 -> \[mba, ix, old, new] -> inlinePrimop $ \[res] ->
|
|
1141
|
1182
|
doCasByteArray res mba ix b16 old new
|
|
1142
|
|
- CasByteArrayOp_Int32 -> \[mba, ix, old, new] -> opIntoRegs $ \[res] ->
|
|
|
1183
|
+ CasByteArrayOp_Int32 -> \[mba, ix, old, new] -> inlinePrimop $ \[res] ->
|
|
1143
|
1184
|
doCasByteArray res mba ix b32 old new
|
|
1144
|
|
- CasByteArrayOp_Int64 -> \[mba, ix, old, new] -> opIntoRegs $ \[res] ->
|
|
|
1185
|
+ CasByteArrayOp_Int64 -> \[mba, ix, old, new] -> inlinePrimop $ \[res] ->
|
|
1145
|
1186
|
doCasByteArray res mba ix b64 old new
|
|
1146
|
1187
|
|
|
1147
|
1188
|
-- The rest just translate straightforwardly
|
| ... |
... |
@@ -1671,7 +1712,7 @@ emitPrimOp cfg primop = |
|
1671
|
1712
|
|
|
1672
|
1713
|
-- tagToEnum# is special: we need to pull the constructor
|
|
1673
|
1714
|
-- out of the table, and perform an appropriate return.
|
|
1674
|
|
- TagToEnumOp -> \[amode] -> PrimopCmmEmit_Internal $ \res_ty -> do
|
|
|
1715
|
+ TagToEnumOp -> \[amode] -> PrimopCmmEmit True $ \res_ty -> do
|
|
1675
|
1716
|
-- If you're reading this code in the attempt to figure
|
|
1676
|
1717
|
-- out why the compiler panic'ed here, it is probably because
|
|
1677
|
1718
|
-- you used tagToEnum# in a non-monomorphic setting, e.g.,
|
| ... |
... |
@@ -1680,7 +1721,7 @@ emitPrimOp cfg primop = |
|
1680
|
1721
|
let tycon = fromMaybe (pprPanic "tagToEnum#: Applied to non-concrete type" (ppr res_ty)) (tyConAppTyCon_maybe res_ty)
|
|
1681
|
1722
|
massert (isEnumerationTyCon tycon)
|
|
1682
|
1723
|
platform <- getPlatform
|
|
1683
|
|
- pure [tagToClosure platform tycon amode]
|
|
|
1724
|
+ emitReturn [tagToClosure platform tycon amode]
|
|
1684
|
1725
|
|
|
1685
|
1726
|
-- Out of line primops.
|
|
1686
|
1727
|
-- TODO compiler need not know about these
|
| ... |
... |
@@ -1791,24 +1832,24 @@ emitPrimOp cfg primop = |
|
1791
|
1832
|
result_info = getPrimOpResultInfo primop
|
|
1792
|
1833
|
|
|
1793
|
1834
|
opNop :: [CmmExpr] -> PrimopCmmEmit
|
|
1794
|
|
- opNop args = opIntoRegs $ \[res] -> emitAssign (CmmLocal res) arg
|
|
|
1835
|
+ opNop args = inlinePrimop $ \[res] -> emitAssign (CmmLocal res) arg
|
|
1795
|
1836
|
where [arg] = args
|
|
1796
|
1837
|
|
|
1797
|
1838
|
opNarrow
|
|
1798
|
1839
|
:: [CmmExpr]
|
|
1799
|
1840
|
-> (Width -> Width -> MachOp, Width)
|
|
1800
|
1841
|
-> PrimopCmmEmit
|
|
1801
|
|
- opNarrow args (mop, rep) = opIntoRegs $ \[res] -> emitAssign (CmmLocal res) $
|
|
|
1842
|
+ opNarrow args (mop, rep) = inlinePrimop $ \[res] -> emitAssign (CmmLocal res) $
|
|
1802
|
1843
|
CmmMachOp (mop rep (wordWidth platform)) [CmmMachOp (mop (wordWidth platform) rep) [arg]]
|
|
1803
|
1844
|
where [arg] = args
|
|
1804
|
1845
|
|
|
1805
|
1846
|
-- These primops are implemented by CallishMachOps, because they sometimes
|
|
1806
|
1847
|
-- turn into foreign calls depending on the backend.
|
|
1807
|
1848
|
opCallish :: CallishMachOp -> [CmmExpr] -> PrimopCmmEmit
|
|
1808
|
|
- opCallish prim args = opIntoRegs $ \[res] -> emitPrimCall [res] prim args
|
|
|
1849
|
+ opCallish prim args = inlinePrimop $ \[res] -> emitPrimCall [res] prim args
|
|
1809
|
1850
|
|
|
1810
|
1851
|
opTranslate :: MachOp -> [CmmExpr] -> PrimopCmmEmit
|
|
1811
|
|
- opTranslate mop args = opIntoRegs $ \[res] -> do
|
|
|
1852
|
+ opTranslate mop args = inlinePrimop $ \[res] -> do
|
|
1812
|
1853
|
let stmt = mkAssign (CmmLocal res) (CmmMachOp mop args)
|
|
1813
|
1854
|
emit stmt
|
|
1814
|
1855
|
|
| ... |
... |
@@ -1830,28 +1871,36 @@ emitPrimOp cfg primop = |
|
1830
|
1871
|
:: Either CallishMachOp GenericOp
|
|
1831
|
1872
|
-> [CmmExpr]
|
|
1832
|
1873
|
-> PrimopCmmEmit
|
|
1833
|
|
- opCallishHandledLater callOrNot args = opIntoRegs $ \res0 -> case callOrNot of
|
|
|
1874
|
+ opCallishHandledLater callOrNot args = inlinePrimop $ \res0 -> case callOrNot of
|
|
1834
|
1875
|
Left op -> emit $ mkUnsafeCall (PrimTarget op) res0 args
|
|
1835
|
1876
|
Right gen -> gen res0 args
|
|
1836
|
1877
|
|
|
1837
|
|
- opIntoRegs
|
|
1838
|
|
- :: ([LocalReg] -- where to put the results
|
|
|
1878
|
+ inlinePrimopWithReturnType
|
|
|
1879
|
+ :: (Type -- return type
|
|
|
1880
|
+ -> [LocalReg] -- where to put the results
|
|
1839
|
1881
|
-> FCode ())
|
|
1840
|
1882
|
-> PrimopCmmEmit
|
|
1841
|
|
- opIntoRegs f = PrimopCmmEmit_Internal $ \res_ty -> do
|
|
1842
|
|
- regs <- case result_info of
|
|
1843
|
|
- ReturnsVoid -> pure []
|
|
1844
|
|
- ReturnsPrim rep
|
|
1845
|
|
- -> do reg <- newTemp (primRepCmmType platform rep)
|
|
1846
|
|
- pure [reg]
|
|
1847
|
|
-
|
|
1848
|
|
- ReturnsTuple
|
|
1849
|
|
- -> do (regs, _hints) <- newUnboxedTupleRegs res_ty
|
|
1850
|
|
- pure regs
|
|
1851
|
|
- f regs
|
|
1852
|
|
- pure $ map (CmmReg . CmmLocal) regs
|
|
1853
|
|
-
|
|
1854
|
|
- alwaysExternal = \_ -> PrimopCmmEmit_External
|
|
|
1883
|
+ inlinePrimopWithReturnType f = PrimopCmmEmit
|
|
|
1884
|
+ { primopCmmInline = True
|
|
|
1885
|
+ , primopCmmCode = \res_ty -> do
|
|
|
1886
|
+ regs <- case result_info of
|
|
|
1887
|
+ ReturnsVoid -> pure []
|
|
|
1888
|
+ ReturnsPrim rep
|
|
|
1889
|
+ -> do reg <- newTemp (primRepCmmType platform rep)
|
|
|
1890
|
+ pure [reg]
|
|
|
1891
|
+
|
|
|
1892
|
+ ReturnsTuple
|
|
|
1893
|
+ -> do (regs, _hints) <- newUnboxedTupleRegs res_ty
|
|
|
1894
|
+ pure regs
|
|
|
1895
|
+ f res_ty regs
|
|
|
1896
|
+ emitReturn (map (CmmReg . CmmLocal) regs)
|
|
|
1897
|
+ }
|
|
|
1898
|
+
|
|
|
1899
|
+ inlinePrimop :: ([LocalReg] -> FCode ()) -> PrimopCmmEmit
|
|
|
1900
|
+ inlinePrimop f = inlinePrimopWithReturnType (const f)
|
|
|
1901
|
+
|
|
|
1902
|
+ alwaysExternal = externalPrimop primop
|
|
|
1903
|
+
|
|
1855
|
1904
|
-- Note [QuotRem optimization]
|
|
1856
|
1905
|
-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
1857
|
1906
|
-- `quot` and `rem` with constant divisor can be implemented with fast bit-ops
|
| ... |
... |
@@ -1898,7 +1947,7 @@ emitPrimOp cfg primop = |
|
1898
|
1947
|
= case signs of
|
|
1899
|
1948
|
|
|
1900
|
1949
|
-- For fused multiply-add x * y + z, we fall back to the C implementation.
|
|
1901
|
|
- FMAdd -> opIntoRegs $ \ [res] -> fmaCCall w res arg_x arg_y arg_z
|
|
|
1950
|
+ FMAdd -> inlinePrimop $ \ [res] -> fmaCCall w res arg_x arg_y arg_z
|
|
1902
|
1951
|
|
|
1903
|
1952
|
-- Other fused multiply-add operations are implemented in terms of fmadd
|
|
1904
|
1953
|
-- This is sound: it does not lose any precision.
|
| ... |
... |
@@ -1913,13 +1962,17 @@ emitPrimOp cfg primop = |
|
1913
|
1962
|
= CmmMachOp (MO_VF_Neg l w) [x]
|
|
1914
|
1963
|
fmaOp _ _ _ _ = panic "fmaOp: wrong number of arguments (expected 3)"
|
|
1915
|
1964
|
|
|
1916
|
|
-data PrimopCmmEmit
|
|
1917
|
|
- -- | Out of line fake primop that's actually just a foreign call to other
|
|
1918
|
|
- -- (presumably) C--.
|
|
1919
|
|
- = PrimopCmmEmit_External
|
|
1920
|
|
- -- | Real primop turned into inline C--.
|
|
1921
|
|
- | PrimopCmmEmit_Internal (Type -- the return type, some primops are specialized to it
|
|
1922
|
|
- -> FCode [CmmExpr]) -- just for TagToEnum for now
|
|
|
1965
|
+data PrimopCmmEmit = PrimopCmmEmit
|
|
|
1966
|
+ { primopCmmInline :: !Bool
|
|
|
1967
|
+ -- ^ Is the primop code fully inline
|
|
|
1968
|
+ -- See Note [Inlining out-of-line primops and heap checks]
|
|
|
1969
|
+ -- in GHC.StgToCmm.Expr
|
|
|
1970
|
+ , primopCmmCode :: Type -> FCode ReturnKind
|
|
|
1971
|
+ -- ^ Code for the primop.
|
|
|
1972
|
+ -- May call external C-- functions if inline=false above.
|
|
|
1973
|
+ -- The return type is passed, some primops are specialized to it (just
|
|
|
1974
|
+ -- TagToEnum for now)
|
|
|
1975
|
+ }
|
|
1923
|
1976
|
|
|
1924
|
1977
|
type GenericOp = [CmmFormal] -> [CmmActual] -> FCode ()
|
|
1925
|
1978
|
|