1 -----------------------------------------------------------------------
2 -- $Id: primops.txt,v 1.18 2001/02/28 00:01:02 qrczak Exp $
4 -- Primitive Operations
6 -----------------------------------------------------------------------
8 -- To add a new primop, you currently need to update the following files:
10 -- - this file (ghc/compiler/prelude/primops.txt), which includes
11 -- the type of the primop, and various other properties (its
12 -- strictness attributes, whether it is defined as a macro
13 -- or as out-of-line code, etc.)
15 -- - ghc/lib/std/PrelGHC.hi-boot, to declare the primop
17 -- - if the primop is inline (i.e. a macro), then:
18 -- ghc/includes/PrimOps.h
19 -- ghc/compiler/nativeGen/StixPrim.lhs
21 -- - or, for an out-of-line primop:
22 -- ghc/includes/PrimOps.h (just add the declaration)
23 -- ghc/rts/PrimOps.hc (define it here)
28 -- The default attribute values which apply if you don't specify
29 -- other ones. Attribute values can be True, False, or arbitrary
30 -- text between curly brackets. This is a kludge to enable
31 -- processors of this file to easily get hold of simple info
32 -- (eg, out_of_line), whilst avoiding parsing complex expressions
33 -- needed for strictness and usage info.
36 has_side_effects = False
41 strictness = { \ arity -> StrictnessInfo (replicate arity wwPrim) False }
42 usage = { nomangle other }
45 ------------------------------------------------------------------------
46 --- Support for the bytecode interpreter and linker ---
47 ------------------------------------------------------------------------
49 -- Convert an Addr# to a followable type
50 primop AddrToHValueOp "addrToHValue#" GenPrimOp
53 primop MkApUpd0_Op "mkApUpd0#" GenPrimOp
58 primop NewBCOOp "newBCO#" GenPrimOp
59 ByteArr# -> ByteArr# -> Array# a -> ByteArr# -> State# s -> (# State# s, BCO# #)
61 has_side_effects = True
65 ------------------------------------------------------------------------
67 ------------------------------------------------------------------------
69 primop AddrGtOp "gtAddr#" Compare Addr# -> Addr# -> Bool
70 primop AddrGeOp "geAddr#" Compare Addr# -> Addr# -> Bool
71 primop AddrEqOp "eqAddr#" Compare Addr# -> Addr# -> Bool
72 primop AddrNeOp "neAddr#" Compare Addr# -> Addr# -> Bool
73 primop AddrLtOp "ltAddr#" Compare Addr# -> Addr# -> Bool
74 primop AddrLeOp "leAddr#" Compare Addr# -> Addr# -> Bool
76 primop Addr2IntOp "addr2Int#" GenPrimOp Addr# -> Int#
79 ------------------------------------------------------------------------
81 ------------------------------------------------------------------------
83 primop CharGtOp "gtChar#" Compare Char# -> Char# -> Bool
84 primop CharGeOp "geChar#" Compare Char# -> Char# -> Bool
86 primop CharEqOp "eqChar#" Compare
87 Char# -> Char# -> Bool
88 with commutable = True
90 primop CharNeOp "neChar#" Compare
91 Char# -> Char# -> Bool
92 with commutable = True
94 primop CharLtOp "ltChar#" Compare Char# -> Char# -> Bool
95 primop CharLeOp "leChar#" Compare Char# -> Char# -> Bool
97 primop OrdOp "ord#" GenPrimOp Char# -> Int#
99 ------------------------------------------------------------------------
101 ------------------------------------------------------------------------
103 primop DoubleGtOp ">##" Compare Double# -> Double# -> Bool
104 primop DoubleGeOp ">=##" Compare Double# -> Double# -> Bool
106 primop DoubleEqOp "==##" Compare
107 Double# -> Double# -> Bool
108 with commutable = True
110 primop DoubleNeOp "/=##" Compare
111 Double# -> Double# -> Bool
112 with commutable = True
114 primop DoubleLtOp "<##" Compare Double# -> Double# -> Bool
115 primop DoubleLeOp "<=##" Compare Double# -> Double# -> Bool
117 primop DoubleAddOp "+##" Dyadic
118 Double# -> Double# -> Double#
119 with commutable = True
121 primop DoubleSubOp "-##" Dyadic Double# -> Double# -> Double#
123 primop DoubleMulOp "*##" Dyadic
124 Double# -> Double# -> Double#
125 with commutable = True
127 primop DoubleDivOp "/##" Dyadic
128 Double# -> Double# -> Double#
131 primop DoubleNegOp "negateDouble#" Monadic Double# -> Double#
133 primop Double2IntOp "double2Int#" GenPrimOp Double# -> Int#
134 primop Double2FloatOp "double2Float#" GenPrimOp Double# -> Float#
136 primop DoubleExpOp "expDouble#" Monadic
138 with needs_wrapper = True
140 primop DoubleLogOp "logDouble#" Monadic
146 primop DoubleSqrtOp "sqrtDouble#" Monadic
148 with needs_wrapper = True
150 primop DoubleSinOp "sinDouble#" Monadic
152 with needs_wrapper = True
154 primop DoubleCosOp "cosDouble#" Monadic
156 with needs_wrapper = True
158 primop DoubleTanOp "tanDouble#" Monadic
160 with needs_wrapper = True
162 primop DoubleAsinOp "asinDouble#" Monadic
168 primop DoubleAcosOp "acosDouble#" Monadic
174 primop DoubleAtanOp "atanDouble#" Monadic
179 primop DoubleSinhOp "sinhDouble#" Monadic
181 with needs_wrapper = True
183 primop DoubleCoshOp "coshDouble#" Monadic
185 with needs_wrapper = True
187 primop DoubleTanhOp "tanhDouble#" Monadic
189 with needs_wrapper = True
191 primop DoublePowerOp "**##" Dyadic
192 Double# -> Double# -> Double#
193 with needs_wrapper = True
195 primop DoubleDecodeOp "decodeDouble#" GenPrimOp
196 Double# -> (# Int#, Int#, ByteArr# #)
197 with out_of_line = True
199 ------------------------------------------------------------------------
201 ------------------------------------------------------------------------
203 primop FloatGtOp "gtFloat#" Compare Float# -> Float# -> Bool
204 primop FloatGeOp "geFloat#" Compare Float# -> Float# -> Bool
206 primop FloatEqOp "eqFloat#" Compare
207 Float# -> Float# -> Bool
208 with commutable = True
210 primop FloatNeOp "neFloat#" Compare
211 Float# -> Float# -> Bool
212 with commutable = True
214 primop FloatLtOp "ltFloat#" Compare Float# -> Float# -> Bool
215 primop FloatLeOp "leFloat#" Compare Float# -> Float# -> Bool
217 primop FloatAddOp "plusFloat#" Dyadic
218 Float# -> Float# -> Float#
219 with commutable = True
221 primop FloatSubOp "minusFloat#" Dyadic Float# -> Float# -> Float#
223 primop FloatMulOp "timesFloat#" Dyadic
224 Float# -> Float# -> Float#
225 with commutable = True
227 primop FloatDivOp "divideFloat#" Dyadic
228 Float# -> Float# -> Float#
231 primop FloatNegOp "negateFloat#" Monadic Float# -> Float#
233 primop Float2IntOp "float2Int#" GenPrimOp Float# -> Int#
235 primop FloatExpOp "expFloat#" Monadic
237 with needs_wrapper = True
239 primop FloatLogOp "logFloat#" Monadic
241 with needs_wrapper = True
244 primop FloatSqrtOp "sqrtFloat#" Monadic
246 with needs_wrapper = True
248 primop FloatSinOp "sinFloat#" Monadic
250 with needs_wrapper = True
252 primop FloatCosOp "cosFloat#" Monadic
254 with needs_wrapper = True
256 primop FloatTanOp "tanFloat#" Monadic
258 with needs_wrapper = True
260 primop FloatAsinOp "asinFloat#" Monadic
262 with needs_wrapper = True
265 primop FloatAcosOp "acosFloat#" Monadic
267 with needs_wrapper = True
270 primop FloatAtanOp "atanFloat#" Monadic
272 with needs_wrapper = True
274 primop FloatSinhOp "sinhFloat#" Monadic
276 with needs_wrapper = True
278 primop FloatCoshOp "coshFloat#" Monadic
280 with needs_wrapper = True
282 primop FloatTanhOp "tanhFloat#" Monadic
284 with needs_wrapper = True
286 primop FloatPowerOp "powerFloat#" Dyadic
287 Float# -> Float# -> Float#
288 with needs_wrapper = True
290 primop Float2DoubleOp "float2Double#" GenPrimOp Float# -> Double#
292 primop FloatDecodeOp "decodeFloat#" GenPrimOp
293 Float# -> (# Int#, Int#, ByteArr# #)
294 with out_of_line = True
296 ------------------------------------------------------------------------
298 ------------------------------------------------------------------------
300 primop IntAddOp "+#" Dyadic
302 with commutable = True
304 primop IntSubOp "-#" Dyadic Int# -> Int# -> Int#
307 Dyadic Int# -> Int# -> Int#
308 with commutable = True
310 primop IntQuotOp "quotInt#" Dyadic
314 primop IntRemOp "remInt#" Dyadic
318 primop IntGcdOp "gcdInt#" Dyadic Int# -> Int# -> Int#
319 primop IntNegOp "negateInt#" Monadic Int# -> Int#
320 primop IntAddCOp "addIntC#" GenPrimOp Int# -> Int# -> (# Int#, Int# #)
321 primop IntSubCOp "subIntC#" GenPrimOp Int# -> Int# -> (# Int#, Int# #)
322 primop IntMulCOp "mulIntC#" GenPrimOp Int# -> Int# -> (# Int#, Int# #)
323 primop IntGtOp ">#" Compare Int# -> Int# -> Bool
324 primop IntGeOp ">=#" Compare Int# -> Int# -> Bool
326 primop IntEqOp "==#" Compare
328 with commutable = True
330 primop IntNeOp "/=#" Compare
332 with commutable = True
334 primop IntLtOp "<#" Compare Int# -> Int# -> Bool
335 primop IntLeOp "<=#" Compare Int# -> Int# -> Bool
337 primop ChrOp "chr#" GenPrimOp Int# -> Char#
339 primop Int2WordOp "int2Word#" GenPrimOp Int# -> Word#
340 primop Int2AddrOp "int2Addr#"GenPrimOp Int# -> Addr#
341 primop Int2FloatOp "int2Float#" GenPrimOp Int# -> Float#
342 primop Int2DoubleOp "int2Double#" GenPrimOp Int# -> Double#
344 primop Int2IntegerOp "int2Integer#"
345 GenPrimOp Int# -> (# Int#, ByteArr# #)
346 with out_of_line = True
348 primop ISllOp "iShiftL#" GenPrimOp Int# -> Int# -> Int#
349 primop ISraOp "iShiftRA#" GenPrimOp Int# -> Int# -> Int#
350 primop ISrlOp "iShiftRL#" GenPrimOp Int# -> Int# -> Int#
352 ------------------------------------------------------------------------
354 ------------------------------------------------------------------------
356 primop Int64ToIntegerOp "int64ToInteger#" GenPrimOp
357 Int64# -> (# Int#, ByteArr# #)
358 with out_of_line = True
361 ------------------------------------------------------------------------
363 ------------------------------------------------------------------------
365 primop IntegerAddOp "plusInteger#" GenPrimOp
366 Int# -> ByteArr# -> Int# -> ByteArr# -> (# Int#, ByteArr# #)
367 with commutable = True
370 primop IntegerSubOp "minusInteger#" GenPrimOp
371 Int# -> ByteArr# -> Int# -> ByteArr# -> (# Int#, ByteArr# #)
372 with out_of_line = True
374 primop IntegerMulOp "timesInteger#" GenPrimOp
375 Int# -> ByteArr# -> Int# -> ByteArr# -> (# Int#, ByteArr# #)
376 with commutable = True
379 primop IntegerGcdOp "gcdInteger#" GenPrimOp
380 Int# -> ByteArr# -> Int# -> ByteArr# -> (# Int#, ByteArr# #)
381 with commutable = True
384 primop IntegerIntGcdOp "gcdIntegerInt#" GenPrimOp
385 Int# -> ByteArr# -> Int# -> Int#
386 with commutable = True
388 primop IntegerDivExactOp "divExactInteger#" GenPrimOp
389 Int# -> ByteArr# -> Int# -> ByteArr# -> (# Int#, ByteArr# #)
390 with out_of_line = True
392 primop IntegerQuotOp "quotInteger#" GenPrimOp
393 Int# -> ByteArr# -> Int# -> ByteArr# -> (# Int#, ByteArr# #)
394 with out_of_line = True
396 primop IntegerRemOp "remInteger#" GenPrimOp
397 Int# -> ByteArr# -> Int# -> ByteArr# -> (# Int#, ByteArr# #)
398 with out_of_line = True
400 primop IntegerCmpOp "cmpInteger#" GenPrimOp
401 Int# -> ByteArr# -> Int# -> ByteArr# -> Int#
402 with needs_wrapper = True
404 primop IntegerCmpIntOp "cmpIntegerInt#" GenPrimOp
405 Int# -> ByteArr# -> Int# -> Int#
406 with needs_wrapper = True
408 primop IntegerQuotRemOp "quotRemInteger#" GenPrimOp
409 Int# -> ByteArr# -> Int# -> ByteArr# -> (# Int#, ByteArr#, Int#, ByteArr# #)
413 primop IntegerDivModOp "divModInteger#" GenPrimOp
414 Int# -> ByteArr# -> Int# -> ByteArr# -> (# Int#, ByteArr#, Int#, ByteArr# #)
418 primop Integer2IntOp "integer2Int#" GenPrimOp
419 Int# -> ByteArr# -> Int#
420 with needs_wrapper = True
422 primop Integer2WordOp "integer2Word#" GenPrimOp
423 Int# -> ByteArr# -> Word#
424 with needs_wrapper = True
426 primop IntegerToInt64Op "integerToInt64#" GenPrimOp
427 Int# -> ByteArr# -> Int64#
429 primop IntegerToWord64Op "integerToWord64#" GenPrimOp
430 Int# -> ByteArr# -> Word64#
432 primop IntegerAndOp "andInteger#" GenPrimOp
433 Int# -> ByteArr# -> Int# -> ByteArr# -> (# Int#, ByteArr# #)
434 with out_of_line = True
436 primop IntegerOrOp "orInteger#" GenPrimOp
437 Int# -> ByteArr# -> Int# -> ByteArr# -> (# Int#, ByteArr# #)
438 with out_of_line = True
440 primop IntegerXorOp "xorInteger#" GenPrimOp
441 Int# -> ByteArr# -> Int# -> ByteArr# -> (# Int#, ByteArr# #)
442 with out_of_line = True
444 primop IntegerComplementOp "complementInteger#" GenPrimOp
445 Int# -> ByteArr# -> (# Int#, ByteArr# #)
446 with out_of_line = True
448 ------------------------------------------------------------------------
450 ------------------------------------------------------------------------
452 primop WordAddOp "plusWord#" Dyadic Word# -> Word# -> Word#
453 with commutable = True
455 primop WordSubOp "minusWord#" Dyadic Word# -> Word# -> Word#
457 primop WordMulOp "timesWord#" Dyadic Word# -> Word# -> Word#
458 with commutable = True
460 primop WordQuotOp "quotWord#" Dyadic Word# -> Word# -> Word#
463 primop WordRemOp "remWord#" Dyadic Word# -> Word# -> Word#
466 primop AndOp "and#" Dyadic Word# -> Word# -> Word#
467 with commutable = True
469 primop OrOp "or#" Dyadic Word# -> Word# -> Word#
470 with commutable = True
472 primop XorOp "xor#" Dyadic Word# -> Word# -> Word#
473 with commutable = True
475 primop NotOp "not#" Monadic Word# -> Word#
477 primop SllOp "shiftL#" GenPrimOp Word# -> Int# -> Word#
479 primop SrlOp "shiftRL#" GenPrimOp Word# -> Int# -> Word#
481 primop Word2IntOp "word2Int#" GenPrimOp Word# -> Int#
483 primop Word2IntegerOp "word2Integer#" GenPrimOp
484 Word# -> (# Int#, ByteArr# #)
485 with out_of_line = True
487 primop WordGtOp "gtWord#" Compare Word# -> Word# -> Bool
488 primop WordGeOp "geWord#" Compare Word# -> Word# -> Bool
489 primop WordEqOp "eqWord#" Compare Word# -> Word# -> Bool
490 primop WordNeOp "neWord#" Compare Word# -> Word# -> Bool
491 primop WordLtOp "ltWord#" Compare Word# -> Word# -> Bool
492 primop WordLeOp "leWord#" Compare Word# -> Word# -> Bool
494 ------------------------------------------------------------------------
496 ------------------------------------------------------------------------
498 primop Word64ToIntegerOp "word64ToInteger#" GenPrimOp
499 Word64# -> (# Int#, ByteArr# #)
500 with out_of_line = True
502 ------------------------------------------------------------------------
503 --- Explicitly sized Int# and Word# ---
504 ------------------------------------------------------------------------
506 primop IntToInt8Op "intToInt8#" Monadic Int# -> Int#
507 primop IntToInt16Op "intToInt16#" Monadic Int# -> Int#
508 primop IntToInt32Op "intToInt32#" Monadic Int# -> Int#
509 primop WordToWord8Op "wordToWord8#" Monadic Word# -> Word#
510 primop WordToWord16Op "wordToWord16#" Monadic Word# -> Word#
511 primop WordToWord32Op "wordToWord32#" Monadic Word# -> Word#
513 ------------------------------------------------------------------------
515 ------------------------------------------------------------------------
517 primop NewArrayOp "newArray#" GenPrimOp
518 Int# -> a -> State# s -> (# State# s, MutArr# s a #)
520 strictness = { \ arity -> StrictnessInfo [wwPrim, wwLazy, wwPrim] False }
521 usage = { mangle NewArrayOp [mkP, mkM, mkP] mkM }
524 primop NewByteArrayOp_Char "newByteArray#" GenPrimOp
525 Int# -> State# s -> (# State# s, MutByteArr# s #)
526 with out_of_line = True
529 primop IndexByteArrayOp_Char "indexCharArray#" GenPrimOp
530 ByteArr# -> Int# -> Char#
532 primop IndexByteArrayOp_WideChar "indexWideCharArray#" GenPrimOp
533 ByteArr# -> Int# -> Char#
535 primop IndexByteArrayOp_Int "indexIntArray#" GenPrimOp
536 ByteArr# -> Int# -> Int#
538 primop IndexByteArrayOp_Word "indexWordArray#" GenPrimOp
539 ByteArr# -> Int# -> Word#
541 primop IndexByteArrayOp_Addr "indexAddrArray#" GenPrimOp
542 ByteArr# -> Int# -> Addr#
544 primop IndexByteArrayOp_Float "indexFloatArray#" GenPrimOp
545 ByteArr# -> Int# -> Float#
547 primop IndexByteArrayOp_Double "indexDoubleArray#" GenPrimOp
548 ByteArr# -> Int# -> Double#
550 primop IndexByteArrayOp_StablePtr "indexStablePtrArray#" GenPrimOp
551 ByteArr# -> Int# -> StablePtr# a
553 primop IndexByteArrayOp_Int8 "indexInt8Array#" GenPrimOp
554 ByteArr# -> Int# -> Int#
556 primop IndexByteArrayOp_Int16 "indexInt16Array#" GenPrimOp
557 ByteArr# -> Int# -> Int#
559 primop IndexByteArrayOp_Int32 "indexInt32Array#" GenPrimOp
560 ByteArr# -> Int# -> Int#
562 primop IndexByteArrayOp_Int64 "indexInt64Array#" GenPrimOp
563 ByteArr# -> Int# -> Int64#
565 primop IndexByteArrayOp_Word8 "indexWord8Array#" GenPrimOp
566 ByteArr# -> Int# -> Word#
568 primop IndexByteArrayOp_Word16 "indexWord16Array#" GenPrimOp
569 ByteArr# -> Int# -> Word#
571 primop IndexByteArrayOp_Word32 "indexWord32Array#" GenPrimOp
572 ByteArr# -> Int# -> Word#
574 primop IndexByteArrayOp_Word64 "indexWord64Array#" GenPrimOp
575 ByteArr# -> Int# -> Word64#
578 primop ReadByteArrayOp_Char "readCharArray#" GenPrimOp
579 MutByteArr# s -> Int# -> State# s -> (# State# s, Char# #)
581 primop ReadByteArrayOp_WideChar "readWideCharArray#" GenPrimOp
582 MutByteArr# s -> Int# -> State# s -> (# State# s, Char# #)
584 primop ReadByteArrayOp_Int "readIntArray#" GenPrimOp
585 MutByteArr# s -> Int# -> State# s -> (# State# s, Int# #)
587 primop ReadByteArrayOp_Word "readWordArray#" GenPrimOp
588 MutByteArr# s -> Int# -> State# s -> (# State# s, Word# #)
590 primop ReadByteArrayOp_Addr "readAddrArray#" GenPrimOp
591 MutByteArr# s -> Int# -> State# s -> (# State# s, Addr# #)
593 primop ReadByteArrayOp_Float "readFloatArray#" GenPrimOp
594 MutByteArr# s -> Int# -> State# s -> (# State# s, Float# #)
596 primop ReadByteArrayOp_Double "readDoubleArray#" GenPrimOp
597 MutByteArr# s -> Int# -> State# s -> (# State# s, Double# #)
599 primop ReadByteArrayOp_StablePtr "readStablePtrArray#" GenPrimOp
600 MutByteArr# s -> Int# -> State# s -> (# State# s, StablePtr# a #)
602 primop ReadByteArrayOp_Int8 "readInt8Array#" GenPrimOp
603 MutByteArr# s -> Int# -> State# s -> (# State# s, Int# #)
605 primop ReadByteArrayOp_Int16 "readInt16Array#" GenPrimOp
606 MutByteArr# s -> Int# -> State# s -> (# State# s, Int# #)
608 primop ReadByteArrayOp_Int32 "readInt32Array#" GenPrimOp
609 MutByteArr# s -> Int# -> State# s -> (# State# s, Int# #)
611 primop ReadByteArrayOp_Int64 "readInt64Array#" GenPrimOp
612 MutByteArr# s -> Int# -> State# s -> (# State# s, Int64# #)
614 primop ReadByteArrayOp_Word8 "readWord8Array#" GenPrimOp
615 MutByteArr# s -> Int# -> State# s -> (# State# s, Word# #)
617 primop ReadByteArrayOp_Word16 "readWord16Array#" GenPrimOp
618 MutByteArr# s -> Int# -> State# s -> (# State# s, Word# #)
620 primop ReadByteArrayOp_Word32 "readWord32Array#" GenPrimOp
621 MutByteArr# s -> Int# -> State# s -> (# State# s, Word# #)
623 primop ReadByteArrayOp_Word64 "readWord64Array#" GenPrimOp
624 MutByteArr# s -> Int# -> State# s -> (# State# s, Word64# #)
628 primop WriteByteArrayOp_Char "writeCharArray#" GenPrimOp
629 MutByteArr# s -> Int# -> Char# -> State# s -> State# s
630 with has_side_effects = True
632 primop WriteByteArrayOp_WideChar "writeWideCharArray#" GenPrimOp
633 MutByteArr# s -> Int# -> Char# -> State# s -> State# s
634 with has_side_effects = True
636 primop WriteByteArrayOp_Int "writeIntArray#" GenPrimOp
637 MutByteArr# s -> Int# -> Int# -> State# s -> State# s
638 with has_side_effects = True
640 primop WriteByteArrayOp_Word "writeWordArray#" GenPrimOp
641 MutByteArr# s -> Int# -> Word# -> State# s -> State# s
642 with has_side_effects = True
644 primop WriteByteArrayOp_Addr "writeAddrArray#" GenPrimOp
645 MutByteArr# s -> Int# -> Addr# -> State# s -> State# s
646 with has_side_effects = True
648 primop WriteByteArrayOp_Float "writeFloatArray#" GenPrimOp
649 MutByteArr# s -> Int# -> Float# -> State# s -> State# s
650 with has_side_effects = True
652 primop WriteByteArrayOp_Double "writeDoubleArray#" GenPrimOp
653 MutByteArr# s -> Int# -> Double# -> State# s -> State# s
654 with has_side_effects = True
656 primop WriteByteArrayOp_StablePtr "writeStablePtrArray#" GenPrimOp
657 MutByteArr# s -> Int# -> StablePtr# a -> State# s -> State# s
658 with has_side_effects = True
660 primop WriteByteArrayOp_Int8 "writeInt8Array#" GenPrimOp
661 MutByteArr# s -> Int# -> Int# -> State# s -> State# s
662 with has_side_effects = True
664 primop WriteByteArrayOp_Int16 "writeInt16Array#" GenPrimOp
665 MutByteArr# s -> Int# -> Int# -> State# s -> State# s
666 with has_side_effects = True
668 primop WriteByteArrayOp_Int32 "writeInt32Array#" GenPrimOp
669 MutByteArr# s -> Int# -> Int# -> State# s -> State# s
670 with has_side_effects = True
672 primop WriteByteArrayOp_Int64 "writeInt64Array#" GenPrimOp
673 MutByteArr# s -> Int# -> Int64# -> State# s -> State# s
674 with has_side_effects = True
676 primop WriteByteArrayOp_Word8 "writeWord8Array#" GenPrimOp
677 MutByteArr# s -> Int# -> Word# -> State# s -> State# s
678 with has_side_effects = True
680 primop WriteByteArrayOp_Word16 "writeWord16Array#" GenPrimOp
681 MutByteArr# s -> Int# -> Word# -> State# s -> State# s
682 with has_side_effects = True
684 primop WriteByteArrayOp_Word32 "writeWord32Array#" GenPrimOp
685 MutByteArr# s -> Int# -> Word# -> State# s -> State# s
686 with has_side_effects = True
688 primop WriteByteArrayOp_Word64 "writeWord64Array#" GenPrimOp
689 MutByteArr# s -> Int# -> Word64# -> State# s -> State# s
690 with has_side_effects = True
693 primop IndexOffAddrOp_Char "indexCharOffAddr#" GenPrimOp
694 Addr# -> Int# -> Char#
696 primop IndexOffAddrOp_WideChar "indexWideCharOffAddr#" GenPrimOp
697 Addr# -> Int# -> Char#
699 primop IndexOffAddrOp_Int "indexIntOffAddr#" GenPrimOp
700 Addr# -> Int# -> Int#
702 primop IndexOffAddrOp_Word "indexWordOffAddr#" GenPrimOp
703 Addr# -> Int# -> Word#
705 primop IndexOffAddrOp_Addr "indexAddrOffAddr#" GenPrimOp
706 Addr# -> Int# -> Addr#
708 primop IndexOffAddrOp_Float "indexFloatOffAddr#" GenPrimOp
709 Addr# -> Int# -> Float#
711 primop IndexOffAddrOp_Double "indexDoubleOffAddr#" GenPrimOp
712 Addr# -> Int# -> Double#
714 primop IndexOffAddrOp_StablePtr "indexStablePtrOffAddr#" GenPrimOp
715 Addr# -> Int# -> StablePtr# a
717 primop IndexOffAddrOp_Int8 "indexInt8OffAddr#" GenPrimOp
718 Addr# -> Int# -> Int#
720 primop IndexOffAddrOp_Int16 "indexInt16OffAddr#" GenPrimOp
721 Addr# -> Int# -> Int#
723 primop IndexOffAddrOp_Int32 "indexInt32OffAddr#" GenPrimOp
724 Addr# -> Int# -> Int#
726 primop IndexOffAddrOp_Int64 "indexInt64OffAddr#" GenPrimOp
727 Addr# -> Int# -> Int64#
729 primop IndexOffAddrOp_Word8 "indexWord8OffAddr#" GenPrimOp
730 Addr# -> Int# -> Word#
732 primop IndexOffAddrOp_Word16 "indexWord16OffAddr#" GenPrimOp
733 Addr# -> Int# -> Word#
735 primop IndexOffAddrOp_Word32 "indexWord32OffAddr#" GenPrimOp
736 Addr# -> Int# -> Word#
738 primop IndexOffAddrOp_Word64 "indexWord64OffAddr#" GenPrimOp
739 Addr# -> Int# -> Word64#
742 primop IndexOffForeignObjOp_Char "indexCharOffForeignObj#" GenPrimOp
743 ForeignObj# -> Int# -> Char#
745 primop IndexOffForeignObjOp_WideChar "indexWideCharOffForeignObj#" GenPrimOp
746 ForeignObj# -> Int# -> Char#
748 primop IndexOffForeignObjOp_Int "indexIntOffForeignObj#" GenPrimOp
749 ForeignObj# -> Int# -> Int#
751 primop IndexOffForeignObjOp_Word "indexWordOffForeignObj#" GenPrimOp
752 ForeignObj# -> Int# -> Word#
754 primop IndexOffForeignObjOp_Addr "indexAddrOffForeignObj#" GenPrimOp
755 ForeignObj# -> Int# -> Addr#
757 primop IndexOffForeignObjOp_Float "indexFloatOffForeignObj#" GenPrimOp
758 ForeignObj# -> Int# -> Float#
760 primop IndexOffForeignObjOp_Double "indexDoubleOffForeignObj#" GenPrimOp
761 ForeignObj# -> Int# -> Double#
763 primop IndexOffForeignObjOp_StablePtr "indexStablePtrOffForeignObj#" GenPrimOp
764 ForeignObj# -> Int# -> StablePtr# a
766 primop IndexOffForeignObjOp_Int8 "indexInt8OffForeignObj#" GenPrimOp
767 ForeignObj# -> Int# -> Int#
769 primop IndexOffForeignObjOp_Int16 "indexInt16OffForeignObj#" GenPrimOp
770 ForeignObj# -> Int# -> Int#
772 primop IndexOffForeignObjOp_Int32 "indexInt32OffForeignObj#" GenPrimOp
773 ForeignObj# -> Int# -> Int#
775 primop IndexOffForeignObjOp_Int64 "indexInt64OffForeignObj#" GenPrimOp
776 ForeignObj# -> Int# -> Int64#
778 primop IndexOffForeignObjOp_Word8 "indexWord8OffForeignObj#" GenPrimOp
779 ForeignObj# -> Int# -> Word#
781 primop IndexOffForeignObjOp_Word16 "indexWord16OffForeignObj#" GenPrimOp
782 ForeignObj# -> Int# -> Word#
784 primop IndexOffForeignObjOp_Word32 "indexWord32OffForeignObj#" GenPrimOp
785 ForeignObj# -> Int# -> Word#
787 primop IndexOffForeignObjOp_Word64 "indexWord64OffForeignObj#" GenPrimOp
788 ForeignObj# -> Int# -> Word64#
792 primop ReadOffAddrOp_Char "readCharOffAddr#" GenPrimOp
793 Addr# -> Int# -> State# s -> (# State# s, Char# #)
795 primop ReadOffAddrOp_WideChar "readWideCharOffAddr#" GenPrimOp
796 Addr# -> Int# -> State# s -> (# State# s, Char# #)
798 primop ReadOffAddrOp_Int "readIntOffAddr#" GenPrimOp
799 Addr# -> Int# -> State# s -> (# State# s, Int# #)
801 primop ReadOffAddrOp_Word "readWordOffAddr#" GenPrimOp
802 Addr# -> Int# -> State# s -> (# State# s, Word# #)
804 primop ReadOffAddrOp_Addr "readAddrOffAddr#" GenPrimOp
805 Addr# -> Int# -> State# s -> (# State# s, Addr# #)
807 primop ReadOffAddrOp_Float "readFloatOffAddr#" GenPrimOp
808 Addr# -> Int# -> State# s -> (# State# s, Float# #)
810 primop ReadOffAddrOp_Double "readDoubleOffAddr#" GenPrimOp
811 Addr# -> Int# -> State# s -> (# State# s, Double# #)
813 primop ReadOffAddrOp_StablePtr "readStablePtrOffAddr#" GenPrimOp
814 Addr# -> Int# -> State# s -> (# State# s, StablePtr# a #)
816 primop ReadOffAddrOp_Int8 "readInt8OffAddr#" GenPrimOp
817 Addr# -> Int# -> State# s -> (# State# s, Int# #)
819 primop ReadOffAddrOp_Int16 "readInt16OffAddr#" GenPrimOp
820 Addr# -> Int# -> State# s -> (# State# s, Int# #)
822 primop ReadOffAddrOp_Int32 "readInt32OffAddr#" GenPrimOp
823 Addr# -> Int# -> State# s -> (# State# s, Int# #)
825 primop ReadOffAddrOp_Int64 "readInt64OffAddr#" GenPrimOp
826 Addr# -> Int# -> State# s -> (# State# s, Int64# #)
828 primop ReadOffAddrOp_Word8 "readWord8OffAddr#" GenPrimOp
829 Addr# -> Int# -> State# s -> (# State# s, Word# #)
831 primop ReadOffAddrOp_Word16 "readWord16OffAddr#" GenPrimOp
832 Addr# -> Int# -> State# s -> (# State# s, Word# #)
834 primop ReadOffAddrOp_Word32 "readWord32OffAddr#" GenPrimOp
835 Addr# -> Int# -> State# s -> (# State# s, Word# #)
837 primop ReadOffAddrOp_Word64 "readWord64OffAddr#" GenPrimOp
838 Addr# -> Int# -> State# s -> (# State# s, Word64# #)
841 primop WriteOffAddrOp_Char "writeCharOffAddr#" GenPrimOp
842 Addr# -> Int# -> Char# -> State# s -> State# s
843 with has_side_effects = True
845 primop WriteOffAddrOp_WideChar "writeWideCharOffAddr#" GenPrimOp
846 Addr# -> Int# -> Char# -> State# s -> State# s
847 with has_side_effects = True
849 primop WriteOffAddrOp_Int "writeIntOffAddr#" GenPrimOp
850 Addr# -> Int# -> Int# -> State# s -> State# s
851 with has_side_effects = True
853 primop WriteOffAddrOp_Word "writeWordOffAddr#" GenPrimOp
854 Addr# -> Int# -> Word# -> State# s -> State# s
855 with has_side_effects = True
857 primop WriteOffAddrOp_Addr "writeAddrOffAddr#" GenPrimOp
858 Addr# -> Int# -> Addr# -> State# s -> State# s
859 with has_side_effects = True
861 primop WriteOffAddrOp_ForeignObj "writeForeignObjOffAddr#" GenPrimOp
862 Addr# -> Int# -> ForeignObj# -> State# s -> State# s
863 with has_side_effects = True
865 primop WriteOffAddrOp_Float "writeFloatOffAddr#" GenPrimOp
866 Addr# -> Int# -> Float# -> State# s -> State# s
867 with has_side_effects = True
869 primop WriteOffAddrOp_Double "writeDoubleOffAddr#" GenPrimOp
870 Addr# -> Int# -> Double# -> State# s -> State# s
871 with has_side_effects = True
873 primop WriteOffAddrOp_StablePtr "writeStablePtrOffAddr#" GenPrimOp
874 Addr# -> Int# -> StablePtr# a -> State# s -> State# s
875 with has_side_effects = True
877 primop WriteOffAddrOp_Int8 "writeInt8OffAddr#" GenPrimOp
878 Addr# -> Int# -> Int# -> State# s -> State# s
879 with has_side_effects = True
881 primop WriteOffAddrOp_Int16 "writeInt16OffAddr#" GenPrimOp
882 Addr# -> Int# -> Int# -> State# s -> State# s
883 with has_side_effects = True
885 primop WriteOffAddrOp_Int32 "writeInt32OffAddr#" GenPrimOp
886 Addr# -> Int# -> Int# -> State# s -> State# s
887 with has_side_effects = True
889 primop WriteOffAddrOp_Int64 "writeInt64OffAddr#" GenPrimOp
890 Addr# -> Int# -> Int64# -> State# s -> State# s
891 with has_side_effects = True
893 primop WriteOffAddrOp_Word8 "writeWord8OffAddr#" GenPrimOp
894 Addr# -> Int# -> Word# -> State# s -> State# s
895 with has_side_effects = True
897 primop WriteOffAddrOp_Word16 "writeWord16OffAddr#" GenPrimOp
898 Addr# -> Int# -> Word# -> State# s -> State# s
899 with has_side_effects = True
901 primop WriteOffAddrOp_Word32 "writeWord32OffAddr#" GenPrimOp
902 Addr# -> Int# -> Word# -> State# s -> State# s
903 with has_side_effects = True
905 primop WriteOffAddrOp_Word64 "writeWord64OffAddr#" GenPrimOp
906 Addr# -> Int# -> Word64# -> State# s -> State# s
907 with has_side_effects = True
911 primop SameMutableArrayOp "sameMutableArray#" GenPrimOp
912 MutArr# s a -> MutArr# s a -> Bool
914 usage = { mangle SameMutableArrayOp [mkP, mkP] mkM }
916 primop SameMutableByteArrayOp "sameMutableByteArray#" GenPrimOp
917 MutByteArr# s -> MutByteArr# s -> Bool
919 primop ReadArrayOp "readArray#" GenPrimOp
920 MutArr# s a -> Int# -> State# s -> (# State# s, a #)
922 usage = { mangle ReadArrayOp [mkM, mkP, mkP] mkM }
924 primop WriteArrayOp "writeArray#" GenPrimOp
925 MutArr# s a -> Int# -> a -> State# s -> State# s
927 usage = { mangle WriteArrayOp [mkM, mkP, mkM, mkP] mkR }
928 strictness = { \ arity -> StrictnessInfo [wwPrim, wwPrim, wwLazy, wwPrim] False }
929 has_side_effects = True
931 primop IndexArrayOp "indexArray#" GenPrimOp
932 Array# a -> Int# -> (# a #)
934 usage = { mangle IndexArrayOp [mkM, mkP] mkM }
936 primop UnsafeFreezeArrayOp "unsafeFreezeArray#" GenPrimOp
937 MutArr# s a -> State# s -> (# State# s, Array# a #)
939 usage = { mangle UnsafeFreezeArrayOp [mkM, mkP] mkM }
940 has_side_effects = True
942 primop UnsafeFreezeByteArrayOp "unsafeFreezeByteArray#" GenPrimOp
943 MutByteArr# s -> State# s -> (# State# s, ByteArr# #)
945 has_side_effects = True
947 primop UnsafeThawArrayOp "unsafeThawArray#" GenPrimOp
948 Array# a -> State# s -> (# State# s, MutArr# s a #)
950 usage = { mangle UnsafeThawArrayOp [mkM, mkP] mkM }
953 primop SizeofByteArrayOp "sizeofByteArray#" GenPrimOp
956 primop SizeofMutableByteArrayOp "sizeofMutableByteArray#" GenPrimOp
957 MutByteArr# s -> Int#
959 ------------------------------------------------------------------------
960 --- Mutable variables ---
961 ------------------------------------------------------------------------
963 primop NewMutVarOp "newMutVar#" GenPrimOp
964 a -> State# s -> (# State# s, MutVar# s a #)
966 usage = { mangle NewMutVarOp [mkM, mkP] mkM }
967 strictness = { \ arity -> StrictnessInfo [wwLazy, wwPrim] False }
970 primop ReadMutVarOp "readMutVar#" GenPrimOp
971 MutVar# s a -> State# s -> (# State# s, a #)
973 usage = { mangle ReadMutVarOp [mkM, mkP] mkM }
975 primop WriteMutVarOp "writeMutVar#" GenPrimOp
976 MutVar# s a -> a -> State# s -> State# s
978 strictness = { \ arity -> StrictnessInfo [wwPrim, wwLazy, wwPrim] False }
979 usage = { mangle WriteMutVarOp [mkM, mkM, mkP] mkR }
980 has_side_effects = True
982 primop SameMutVarOp "sameMutVar#" GenPrimOp
983 MutVar# s a -> MutVar# s a -> Bool
985 usage = { mangle SameMutVarOp [mkP, mkP] mkM }
987 ------------------------------------------------------------------------
989 ------------------------------------------------------------------------
991 primop CatchOp "catch#" GenPrimOp
992 (State# RealWorld -> (# State# RealWorld, a #) )
993 -> (b -> State# RealWorld -> (# State# RealWorld, a #) )
995 -> (# State# RealWorld, a #)
997 strictness = { \ arity -> StrictnessInfo [wwLazy, wwLazy, wwPrim] False }
998 -- Catch is actually strict in its first argument
999 -- but we don't want to tell the strictness
1000 -- analyser about that!
1001 usage = { mangle CatchOp [mkM, mkM . (inFun CatchOp mkM mkM), mkP] mkM }
1002 -- [mkO, mkO . (inFun mkM mkO)] mkO
1003 -- might use caught action multiply
1006 primop RaiseOp "raise#" GenPrimOp
1009 strictness = { \ arity -> StrictnessInfo [wwLazy] True }
1010 -- NB: True => result is bottom
1011 usage = { mangle RaiseOp [mkM] mkM }
1014 primop BlockAsyncExceptionsOp "blockAsyncExceptions#" GenPrimOp
1015 (State# RealWorld -> (# State# RealWorld, a #))
1016 -> (State# RealWorld -> (# State# RealWorld, a #))
1018 strictness = { \ arity -> StrictnessInfo [wwLazy] False }
1021 primop UnblockAsyncExceptionsOp "unblockAsyncExceptions#" GenPrimOp
1022 (State# RealWorld -> (# State# RealWorld, a #))
1023 -> (State# RealWorld -> (# State# RealWorld, a #))
1025 strictness = { \ arity -> StrictnessInfo [wwLazy] False }
1028 ------------------------------------------------------------------------
1029 --- MVars (not the same as mutable variables!) ---
1030 ------------------------------------------------------------------------
1032 primop NewMVarOp "newMVar#" GenPrimOp
1033 State# s -> (# State# s, MVar# s a #)
1035 usage = { mangle NewMVarOp [mkP] mkR }
1038 primop TakeMVarOp "takeMVar#" GenPrimOp
1039 MVar# s a -> State# s -> (# State# s, a #)
1041 usage = { mangle TakeMVarOp [mkM, mkP] mkM }
1042 has_side_effects = True
1045 primop TryTakeMVarOp "tryTakeMVar#" GenPrimOp
1046 MVar# s a -> State# s -> (# State# s, Int#, a #)
1048 usage = { mangle TryTakeMVarOp [mkM, mkP] mkM }
1049 has_side_effects = True
1052 primop PutMVarOp "putMVar#" GenPrimOp
1053 MVar# s a -> a -> State# s -> State# s
1055 strictness = { \ arity -> StrictnessInfo [wwPrim, wwLazy, wwPrim] False }
1056 usage = { mangle PutMVarOp [mkM, mkM, mkP] mkR }
1057 has_side_effects = True
1060 primop TryPutMVarOp "tryPutMVar#" GenPrimOp
1061 MVar# s a -> a -> State# s -> (# State# s, Int# #)
1063 strictness = { \ arity -> StrictnessInfo [wwPrim, wwLazy, wwPrim] False }
1064 usage = { mangle TryPutMVarOp [mkM, mkM, mkP] mkR }
1065 has_side_effects = True
1068 primop SameMVarOp "sameMVar#" GenPrimOp
1069 MVar# s a -> MVar# s a -> Bool
1071 usage = { mangle SameMVarOp [mkP, mkP] mkM }
1073 primop IsEmptyMVarOp "isEmptyMVar#" GenPrimOp
1074 MVar# s a -> State# s -> (# State# s, Int# #)
1076 usage = { mangle IsEmptyMVarOp [mkP, mkP] mkM }
1079 ------------------------------------------------------------------------
1080 --- delay/wait operations ---
1081 ------------------------------------------------------------------------
1083 primop DelayOp "delay#" GenPrimOp
1084 Int# -> State# s -> State# s
1086 needs_wrapper = True
1087 has_side_effects = True
1090 primop WaitReadOp "waitRead#" GenPrimOp
1091 Int# -> State# s -> State# s
1093 needs_wrapper = True
1094 has_side_effects = True
1097 primop WaitWriteOp "waitWrite#" GenPrimOp
1098 Int# -> State# s -> State# s
1100 needs_wrapper = True
1101 has_side_effects = True
1104 ------------------------------------------------------------------------
1105 --- concurrency primitives ---
1106 ------------------------------------------------------------------------
1108 primop ForkOp "fork#" GenPrimOp
1109 a -> State# RealWorld -> (# State# RealWorld, ThreadId# #)
1111 usage = { mangle ForkOp [mkO, mkP] mkR }
1112 strictness = { \ arity -> StrictnessInfo [wwLazy, wwPrim] False }
1113 has_side_effects = True
1116 primop KillThreadOp "killThread#" GenPrimOp
1117 ThreadId# -> a -> State# RealWorld -> State# RealWorld
1119 usage = { mangle KillThreadOp [mkP, mkM, mkP] mkR }
1120 has_side_effects = True
1123 primop YieldOp "yield#" GenPrimOp
1124 State# RealWorld -> State# RealWorld
1126 has_side_effects = True
1129 primop MyThreadIdOp "myThreadId#" GenPrimOp
1130 State# RealWorld -> (# State# RealWorld, ThreadId# #)
1132 ------------------------------------------------------------------------
1133 --- foreign objects ---
1134 ------------------------------------------------------------------------
1136 primop MkForeignObjOp "mkForeignObj#" GenPrimOp
1137 Addr# -> State# RealWorld -> (# State# RealWorld, ForeignObj# #)
1139 has_side_effects = True
1142 primop WriteForeignObjOp "writeForeignObj#" GenPrimOp
1143 ForeignObj# -> Addr# -> State# s -> State# s
1145 has_side_effects = True
1147 primop ForeignObjToAddrOp "foreignObjToAddr#" GenPrimOp
1148 ForeignObj# -> Addr#
1150 primop TouchOp "touch#" GenPrimOp
1151 o -> State# RealWorld -> State# RealWorld
1153 strictness = { \ arity -> StrictnessInfo [wwLazy, wwPrim] False }
1156 ------------------------------------------------------------------------
1157 --- Weak pointers ---
1158 ------------------------------------------------------------------------
1160 -- note that tyvar "o" denotes openAlphaTyVar
1162 primop MkWeakOp "mkWeak#" GenPrimOp
1163 o -> b -> c -> State# RealWorld -> (# State# RealWorld, Weak# b #)
1165 strictness = { \ arity -> StrictnessInfo [wwLazy, wwLazy, wwLazy, wwPrim] False }
1166 usage = { mangle MkWeakOp [mkZ, mkM, mkM, mkP] mkM }
1167 has_side_effects = True
1170 primop DeRefWeakOp "deRefWeak#" GenPrimOp
1171 Weak# a -> State# RealWorld -> (# State# RealWorld, Int#, a #)
1173 usage = { mangle DeRefWeakOp [mkM, mkP] mkM }
1174 has_side_effects = True
1176 primop FinalizeWeakOp "finalizeWeak#" GenPrimOp
1177 Weak# a -> State# RealWorld -> (# State# RealWorld, Int#,
1178 (State# RealWorld -> (# State# RealWorld, Unit #)) #)
1180 usage = { mangle FinalizeWeakOp [mkM, mkP]
1181 (mkR . (inUB FinalizeWeakOp
1182 [id,id,inFun FinalizeWeakOp mkR mkM])) }
1183 has_side_effects = True
1187 ------------------------------------------------------------------------
1188 --- Stable pointers and names ---
1189 ------------------------------------------------------------------------
1191 primop MakeStablePtrOp "makeStablePtr#" GenPrimOp
1192 a -> State# RealWorld -> (# State# RealWorld, StablePtr# a #)
1194 strictness = { \ arity -> StrictnessInfo [wwLazy, wwPrim] False }
1195 usage = { mangle MakeStablePtrOp [mkM, mkP] mkM }
1196 has_side_effects = True
1198 primop DeRefStablePtrOp "deRefStablePtr#" GenPrimOp
1199 StablePtr# a -> State# RealWorld -> (# State# RealWorld, a #)
1201 usage = { mangle DeRefStablePtrOp [mkM, mkP] mkM }
1202 needs_wrapper = True
1203 has_side_effects = True
1205 primop EqStablePtrOp "eqStablePtr#" GenPrimOp
1206 StablePtr# a -> StablePtr# a -> Int#
1208 usage = { mangle EqStablePtrOp [mkP, mkP] mkR }
1209 has_side_effects = True
1211 primop MakeStableNameOp "makeStableName#" GenPrimOp
1212 a -> State# RealWorld -> (# State# RealWorld, StableName# a #)
1214 usage = { mangle MakeStableNameOp [mkZ, mkP] mkR }
1215 strictness = { \ arity -> StrictnessInfo [wwLazy, wwPrim] False }
1216 needs_wrapper = True
1217 has_side_effects = True
1220 primop EqStableNameOp "eqStableName#" GenPrimOp
1221 StableName# a -> StableName# a -> Int#
1223 usage = { mangle EqStableNameOp [mkP, mkP] mkR }
1225 primop StableNameToIntOp "stableNameToInt#" GenPrimOp
1226 StableName# a -> Int#
1228 usage = { mangle StableNameToIntOp [mkP] mkR }
1230 ------------------------------------------------------------------------
1231 --- Unsafe pointer equality (#1 Bad Guy: Alistair Reid :) ---
1232 ------------------------------------------------------------------------
1234 primop ReallyUnsafePtrEqualityOp "reallyUnsafePtrEquality#" GenPrimOp
1237 usage = { mangle ReallyUnsafePtrEqualityOp [mkZ, mkZ] mkR }
1239 ------------------------------------------------------------------------
1241 ------------------------------------------------------------------------
1243 primop SeqOp "seq#" GenPrimOp
1246 usage = { mangle SeqOp [mkO] mkR }
1247 strictness = { \ arity -> StrictnessInfo [wwStrict] False }
1248 -- Seq is strict in its argument; see notes in ConFold.lhs
1249 has_side_effects = True
1251 primop ParOp "par#" GenPrimOp
1254 usage = { mangle ParOp [mkO] mkR }
1255 strictness = { \ arity -> StrictnessInfo [wwLazy] False }
1256 -- Note that Par is lazy to avoid that the sparked thing
1257 -- gets evaluted strictly, which it should *not* be
1258 has_side_effects = True
1260 -- HWL: The first 4 Int# in all par... annotations denote:
1261 -- name, granularity info, size of result, degree of parallelism
1262 -- Same structure as _seq_ i.e. returns Int#
1263 -- KSW: v, the second arg in parAt# and parAtForNow#, is used only to determine
1264 -- `the processor containing the expression v'; it is not evaluated
1266 primop ParGlobalOp "parGlobal#" GenPrimOp
1267 a -> Int# -> Int# -> Int# -> Int# -> b -> Int#
1269 usage = { mangle ParGlobalOp [mkO, mkP, mkP, mkP, mkP, mkM] mkM }
1270 has_side_effects = True
1272 primop ParLocalOp "parLocal#" GenPrimOp
1273 a -> Int# -> Int# -> Int# -> Int# -> b -> Int#
1275 usage = { mangle ParLocalOp [mkO, mkP, mkP, mkP, mkP, mkM] mkM }
1276 has_side_effects = True
1278 primop ParAtOp "parAt#" GenPrimOp
1279 b -> a -> Int# -> Int# -> Int# -> Int# -> c -> Int#
1281 usage = { mangle ParAtOp [mkO, mkZ, mkP, mkP, mkP, mkP, mkM] mkM }
1282 has_side_effects = True
1284 primop ParAtAbsOp "parAtAbs#" GenPrimOp
1285 a -> Int# -> Int# -> Int# -> Int# -> Int# -> b -> Int#
1287 usage = { mangle ParAtAbsOp [mkO, mkP, mkP, mkP, mkP, mkM] mkM }
1288 has_side_effects = True
1290 primop ParAtRelOp "parAtRel#" GenPrimOp
1291 a -> Int# -> Int# -> Int# -> Int# -> Int# -> b -> Int#
1293 usage = { mangle ParAtRelOp [mkO, mkP, mkP, mkP, mkP, mkM] mkM }
1294 has_side_effects = True
1296 primop ParAtForNowOp "parAtForNow#" GenPrimOp
1297 b -> a -> Int# -> Int# -> Int# -> Int# -> c -> Int#
1299 usage = { mangle ParAtForNowOp [mkO, mkZ, mkP, mkP, mkP, mkP, mkM] mkM }
1300 has_side_effects = True
1302 -- copyable# and noFollow# have no corresponding entry in
1303 -- PrelGHC.hi-boot, so I don't know whether they should still
1304 -- be here or not. JRS, 15 Jan 01
1306 --primop CopyableOp "copyable#" GenPrimOp
1309 -- usage = { mangle CopyableOp [mkZ] mkR }
1310 -- has_side_effects = True
1312 --primop NoFollowOp "noFollow#" GenPrimOp
1315 -- usage = { mangle NoFollowOp [mkZ] mkR }
1316 -- has_side_effects = True
1319 ------------------------------------------------------------------------
1320 --- tag to enum stuff ---
1321 ------------------------------------------------------------------------
1323 primop DataToTagOp "dataToTag#" GenPrimOp
1326 strictness = { \ arity -> StrictnessInfo [wwLazy] False }
1328 primop TagToEnumOp "tagToEnum#" GenPrimOp
1334 ------------------------------------------------------------------------
1336 ------------------------------------------------------------------------