1 -----------------------------------------------------------------------
2 -- $Id: primops.txt,v 1.19 2001/03/22 03:51:08 hwloidl 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#
790 primop ReadOffAddrOp_Char "readCharOffAddr#" GenPrimOp
791 Addr# -> Int# -> State# s -> (# State# s, Char# #)
793 primop ReadOffAddrOp_WideChar "readWideCharOffAddr#" GenPrimOp
794 Addr# -> Int# -> State# s -> (# State# s, Char# #)
796 primop ReadOffAddrOp_Int "readIntOffAddr#" GenPrimOp
797 Addr# -> Int# -> State# s -> (# State# s, Int# #)
799 primop ReadOffAddrOp_Word "readWordOffAddr#" GenPrimOp
800 Addr# -> Int# -> State# s -> (# State# s, Word# #)
802 primop ReadOffAddrOp_Addr "readAddrOffAddr#" GenPrimOp
803 Addr# -> Int# -> State# s -> (# State# s, Addr# #)
805 primop ReadOffAddrOp_Float "readFloatOffAddr#" GenPrimOp
806 Addr# -> Int# -> State# s -> (# State# s, Float# #)
808 primop ReadOffAddrOp_Double "readDoubleOffAddr#" GenPrimOp
809 Addr# -> Int# -> State# s -> (# State# s, Double# #)
811 primop ReadOffAddrOp_StablePtr "readStablePtrOffAddr#" GenPrimOp
812 Addr# -> Int# -> State# s -> (# State# s, StablePtr# a #)
814 primop ReadOffAddrOp_Int8 "readInt8OffAddr#" GenPrimOp
815 Addr# -> Int# -> State# s -> (# State# s, Int# #)
817 primop ReadOffAddrOp_Int16 "readInt16OffAddr#" GenPrimOp
818 Addr# -> Int# -> State# s -> (# State# s, Int# #)
820 primop ReadOffAddrOp_Int32 "readInt32OffAddr#" GenPrimOp
821 Addr# -> Int# -> State# s -> (# State# s, Int# #)
823 primop ReadOffAddrOp_Int64 "readInt64OffAddr#" GenPrimOp
824 Addr# -> Int# -> State# s -> (# State# s, Int64# #)
826 primop ReadOffAddrOp_Word8 "readWord8OffAddr#" GenPrimOp
827 Addr# -> Int# -> State# s -> (# State# s, Word# #)
829 primop ReadOffAddrOp_Word16 "readWord16OffAddr#" GenPrimOp
830 Addr# -> Int# -> State# s -> (# State# s, Word# #)
832 primop ReadOffAddrOp_Word32 "readWord32OffAddr#" GenPrimOp
833 Addr# -> Int# -> State# s -> (# State# s, Word# #)
835 primop ReadOffAddrOp_Word64 "readWord64OffAddr#" GenPrimOp
836 Addr# -> Int# -> State# s -> (# State# s, Word64# #)
839 primop WriteOffAddrOp_Char "writeCharOffAddr#" GenPrimOp
840 Addr# -> Int# -> Char# -> State# s -> State# s
841 with has_side_effects = True
843 primop WriteOffAddrOp_WideChar "writeWideCharOffAddr#" GenPrimOp
844 Addr# -> Int# -> Char# -> State# s -> State# s
845 with has_side_effects = True
847 primop WriteOffAddrOp_Int "writeIntOffAddr#" GenPrimOp
848 Addr# -> Int# -> Int# -> State# s -> State# s
849 with has_side_effects = True
851 primop WriteOffAddrOp_Word "writeWordOffAddr#" GenPrimOp
852 Addr# -> Int# -> Word# -> State# s -> State# s
853 with has_side_effects = True
855 primop WriteOffAddrOp_Addr "writeAddrOffAddr#" GenPrimOp
856 Addr# -> Int# -> Addr# -> State# s -> State# s
857 with has_side_effects = True
859 primop WriteOffAddrOp_ForeignObj "writeForeignObjOffAddr#" GenPrimOp
860 Addr# -> Int# -> ForeignObj# -> State# s -> State# s
861 with has_side_effects = True
863 primop WriteOffAddrOp_Float "writeFloatOffAddr#" GenPrimOp
864 Addr# -> Int# -> Float# -> State# s -> State# s
865 with has_side_effects = True
867 primop WriteOffAddrOp_Double "writeDoubleOffAddr#" GenPrimOp
868 Addr# -> Int# -> Double# -> State# s -> State# s
869 with has_side_effects = True
871 primop WriteOffAddrOp_StablePtr "writeStablePtrOffAddr#" GenPrimOp
872 Addr# -> Int# -> StablePtr# a -> State# s -> State# s
873 with has_side_effects = True
875 primop WriteOffAddrOp_Int8 "writeInt8OffAddr#" GenPrimOp
876 Addr# -> Int# -> Int# -> State# s -> State# s
877 with has_side_effects = True
879 primop WriteOffAddrOp_Int16 "writeInt16OffAddr#" GenPrimOp
880 Addr# -> Int# -> Int# -> State# s -> State# s
881 with has_side_effects = True
883 primop WriteOffAddrOp_Int32 "writeInt32OffAddr#" GenPrimOp
884 Addr# -> Int# -> Int# -> State# s -> State# s
885 with has_side_effects = True
887 primop WriteOffAddrOp_Int64 "writeInt64OffAddr#" GenPrimOp
888 Addr# -> Int# -> Int64# -> State# s -> State# s
889 with has_side_effects = True
891 primop WriteOffAddrOp_Word8 "writeWord8OffAddr#" GenPrimOp
892 Addr# -> Int# -> Word# -> State# s -> State# s
893 with has_side_effects = True
895 primop WriteOffAddrOp_Word16 "writeWord16OffAddr#" GenPrimOp
896 Addr# -> Int# -> Word# -> State# s -> State# s
897 with has_side_effects = True
899 primop WriteOffAddrOp_Word32 "writeWord32OffAddr#" GenPrimOp
900 Addr# -> Int# -> Word# -> State# s -> State# s
901 with has_side_effects = True
903 primop WriteOffAddrOp_Word64 "writeWord64OffAddr#" GenPrimOp
904 Addr# -> Int# -> Word64# -> State# s -> State# s
905 with has_side_effects = True
909 primop SameMutableArrayOp "sameMutableArray#" GenPrimOp
910 MutArr# s a -> MutArr# s a -> Bool
912 usage = { mangle SameMutableArrayOp [mkP, mkP] mkM }
914 primop SameMutableByteArrayOp "sameMutableByteArray#" GenPrimOp
915 MutByteArr# s -> MutByteArr# s -> Bool
917 primop ReadArrayOp "readArray#" GenPrimOp
918 MutArr# s a -> Int# -> State# s -> (# State# s, a #)
920 usage = { mangle ReadArrayOp [mkM, mkP, mkP] mkM }
922 primop WriteArrayOp "writeArray#" GenPrimOp
923 MutArr# s a -> Int# -> a -> State# s -> State# s
925 usage = { mangle WriteArrayOp [mkM, mkP, mkM, mkP] mkR }
926 strictness = { \ arity -> StrictnessInfo [wwPrim, wwPrim, wwLazy, wwPrim] False }
927 has_side_effects = True
929 primop IndexArrayOp "indexArray#" GenPrimOp
930 Array# a -> Int# -> (# a #)
932 usage = { mangle IndexArrayOp [mkM, mkP] mkM }
934 primop UnsafeFreezeArrayOp "unsafeFreezeArray#" GenPrimOp
935 MutArr# s a -> State# s -> (# State# s, Array# a #)
937 usage = { mangle UnsafeFreezeArrayOp [mkM, mkP] mkM }
938 has_side_effects = True
940 primop UnsafeFreezeByteArrayOp "unsafeFreezeByteArray#" GenPrimOp
941 MutByteArr# s -> State# s -> (# State# s, ByteArr# #)
943 has_side_effects = True
945 primop UnsafeThawArrayOp "unsafeThawArray#" GenPrimOp
946 Array# a -> State# s -> (# State# s, MutArr# s a #)
948 usage = { mangle UnsafeThawArrayOp [mkM, mkP] mkM }
951 primop SizeofByteArrayOp "sizeofByteArray#" GenPrimOp
954 primop SizeofMutableByteArrayOp "sizeofMutableByteArray#" GenPrimOp
955 MutByteArr# s -> Int#
957 ------------------------------------------------------------------------
958 --- Mutable variables ---
959 ------------------------------------------------------------------------
961 primop NewMutVarOp "newMutVar#" GenPrimOp
962 a -> State# s -> (# State# s, MutVar# s a #)
964 usage = { mangle NewMutVarOp [mkM, mkP] mkM }
965 strictness = { \ arity -> StrictnessInfo [wwLazy, wwPrim] False }
968 primop ReadMutVarOp "readMutVar#" GenPrimOp
969 MutVar# s a -> State# s -> (# State# s, a #)
971 usage = { mangle ReadMutVarOp [mkM, mkP] mkM }
973 primop WriteMutVarOp "writeMutVar#" GenPrimOp
974 MutVar# s a -> a -> State# s -> State# s
976 strictness = { \ arity -> StrictnessInfo [wwPrim, wwLazy, wwPrim] False }
977 usage = { mangle WriteMutVarOp [mkM, mkM, mkP] mkR }
978 has_side_effects = True
980 primop SameMutVarOp "sameMutVar#" GenPrimOp
981 MutVar# s a -> MutVar# s a -> Bool
983 usage = { mangle SameMutVarOp [mkP, mkP] mkM }
985 ------------------------------------------------------------------------
987 ------------------------------------------------------------------------
989 primop CatchOp "catch#" GenPrimOp
990 (State# RealWorld -> (# State# RealWorld, a #) )
991 -> (b -> State# RealWorld -> (# State# RealWorld, a #) )
993 -> (# State# RealWorld, a #)
995 strictness = { \ arity -> StrictnessInfo [wwLazy, wwLazy, wwPrim] False }
996 -- Catch is actually strict in its first argument
997 -- but we don't want to tell the strictness
998 -- analyser about that!
999 usage = { mangle CatchOp [mkM, mkM . (inFun CatchOp mkM mkM), mkP] mkM }
1000 -- [mkO, mkO . (inFun mkM mkO)] mkO
1001 -- might use caught action multiply
1004 primop RaiseOp "raise#" GenPrimOp
1007 strictness = { \ arity -> StrictnessInfo [wwLazy] True }
1008 -- NB: True => result is bottom
1009 usage = { mangle RaiseOp [mkM] mkM }
1012 primop BlockAsyncExceptionsOp "blockAsyncExceptions#" GenPrimOp
1013 (State# RealWorld -> (# State# RealWorld, a #))
1014 -> (State# RealWorld -> (# State# RealWorld, a #))
1016 strictness = { \ arity -> StrictnessInfo [wwLazy] False }
1019 primop UnblockAsyncExceptionsOp "unblockAsyncExceptions#" GenPrimOp
1020 (State# RealWorld -> (# State# RealWorld, a #))
1021 -> (State# RealWorld -> (# State# RealWorld, a #))
1023 strictness = { \ arity -> StrictnessInfo [wwLazy] False }
1026 ------------------------------------------------------------------------
1027 --- MVars (not the same as mutable variables!) ---
1028 ------------------------------------------------------------------------
1030 primop NewMVarOp "newMVar#" GenPrimOp
1031 State# s -> (# State# s, MVar# s a #)
1033 usage = { mangle NewMVarOp [mkP] mkR }
1036 primop TakeMVarOp "takeMVar#" GenPrimOp
1037 MVar# s a -> State# s -> (# State# s, a #)
1039 usage = { mangle TakeMVarOp [mkM, mkP] mkM }
1040 has_side_effects = True
1043 primop TryTakeMVarOp "tryTakeMVar#" GenPrimOp
1044 MVar# s a -> State# s -> (# State# s, Int#, a #)
1046 usage = { mangle TryTakeMVarOp [mkM, mkP] mkM }
1047 has_side_effects = True
1050 primop PutMVarOp "putMVar#" GenPrimOp
1051 MVar# s a -> a -> State# s -> State# s
1053 strictness = { \ arity -> StrictnessInfo [wwPrim, wwLazy, wwPrim] False }
1054 usage = { mangle PutMVarOp [mkM, mkM, mkP] mkR }
1055 has_side_effects = True
1058 primop TryPutMVarOp "tryPutMVar#" GenPrimOp
1059 MVar# s a -> a -> State# s -> (# State# s, Int# #)
1061 strictness = { \ arity -> StrictnessInfo [wwPrim, wwLazy, wwPrim] False }
1062 usage = { mangle TryPutMVarOp [mkM, mkM, mkP] mkR }
1063 has_side_effects = True
1066 primop SameMVarOp "sameMVar#" GenPrimOp
1067 MVar# s a -> MVar# s a -> Bool
1069 usage = { mangle SameMVarOp [mkP, mkP] mkM }
1071 primop IsEmptyMVarOp "isEmptyMVar#" GenPrimOp
1072 MVar# s a -> State# s -> (# State# s, Int# #)
1074 usage = { mangle IsEmptyMVarOp [mkP, mkP] mkM }
1077 ------------------------------------------------------------------------
1078 --- delay/wait operations ---
1079 ------------------------------------------------------------------------
1081 primop DelayOp "delay#" GenPrimOp
1082 Int# -> State# s -> State# s
1084 needs_wrapper = True
1085 has_side_effects = True
1088 primop WaitReadOp "waitRead#" GenPrimOp
1089 Int# -> State# s -> State# s
1091 needs_wrapper = True
1092 has_side_effects = True
1095 primop WaitWriteOp "waitWrite#" GenPrimOp
1096 Int# -> State# s -> State# s
1098 needs_wrapper = True
1099 has_side_effects = True
1102 ------------------------------------------------------------------------
1103 --- concurrency primitives ---
1104 ------------------------------------------------------------------------
1106 primop ForkOp "fork#" GenPrimOp
1107 a -> State# RealWorld -> (# State# RealWorld, ThreadId# #)
1109 usage = { mangle ForkOp [mkO, mkP] mkR }
1110 strictness = { \ arity -> StrictnessInfo [wwLazy, wwPrim] False }
1111 has_side_effects = True
1114 primop KillThreadOp "killThread#" GenPrimOp
1115 ThreadId# -> a -> State# RealWorld -> State# RealWorld
1117 usage = { mangle KillThreadOp [mkP, mkM, mkP] mkR }
1118 has_side_effects = True
1121 primop YieldOp "yield#" GenPrimOp
1122 State# RealWorld -> State# RealWorld
1124 has_side_effects = True
1127 primop MyThreadIdOp "myThreadId#" GenPrimOp
1128 State# RealWorld -> (# State# RealWorld, ThreadId# #)
1130 ------------------------------------------------------------------------
1131 --- foreign objects ---
1132 ------------------------------------------------------------------------
1134 primop MkForeignObjOp "mkForeignObj#" GenPrimOp
1135 Addr# -> State# RealWorld -> (# State# RealWorld, ForeignObj# #)
1137 has_side_effects = True
1140 primop WriteForeignObjOp "writeForeignObj#" GenPrimOp
1141 ForeignObj# -> Addr# -> State# s -> State# s
1143 has_side_effects = True
1145 primop ForeignObjToAddrOp "foreignObjToAddr#" GenPrimOp
1146 ForeignObj# -> Addr#
1148 primop TouchOp "touch#" GenPrimOp
1149 o -> State# RealWorld -> State# RealWorld
1151 strictness = { \ arity -> StrictnessInfo [wwLazy, wwPrim] False }
1153 ------------------------------------------------------------------------
1154 --- Weak pointers ---
1155 ------------------------------------------------------------------------
1157 -- note that tyvar "o" denotes openAlphaTyVar
1159 primop MkWeakOp "mkWeak#" GenPrimOp
1160 o -> b -> c -> State# RealWorld -> (# State# RealWorld, Weak# b #)
1162 strictness = { \ arity -> StrictnessInfo [wwLazy, wwLazy, wwLazy, wwPrim] False }
1163 usage = { mangle MkWeakOp [mkZ, mkM, mkM, mkP] mkM }
1164 has_side_effects = True
1167 primop DeRefWeakOp "deRefWeak#" GenPrimOp
1168 Weak# a -> State# RealWorld -> (# State# RealWorld, Int#, a #)
1170 usage = { mangle DeRefWeakOp [mkM, mkP] mkM }
1171 has_side_effects = True
1173 primop FinalizeWeakOp "finalizeWeak#" GenPrimOp
1174 Weak# a -> State# RealWorld -> (# State# RealWorld, Int#,
1175 (State# RealWorld -> (# State# RealWorld, Unit #)) #)
1177 usage = { mangle FinalizeWeakOp [mkM, mkP]
1178 (mkR . (inUB FinalizeWeakOp
1179 [id,id,inFun FinalizeWeakOp mkR mkM])) }
1180 has_side_effects = True
1183 ------------------------------------------------------------------------
1184 --- Stable pointers and names ---
1185 ------------------------------------------------------------------------
1187 primop MakeStablePtrOp "makeStablePtr#" GenPrimOp
1188 a -> State# RealWorld -> (# State# RealWorld, StablePtr# a #)
1190 strictness = { \ arity -> StrictnessInfo [wwLazy, wwPrim] False }
1191 usage = { mangle MakeStablePtrOp [mkM, mkP] mkM }
1192 has_side_effects = True
1194 primop DeRefStablePtrOp "deRefStablePtr#" GenPrimOp
1195 StablePtr# a -> State# RealWorld -> (# State# RealWorld, a #)
1197 usage = { mangle DeRefStablePtrOp [mkM, mkP] mkM }
1198 needs_wrapper = True
1199 has_side_effects = True
1201 primop EqStablePtrOp "eqStablePtr#" GenPrimOp
1202 StablePtr# a -> StablePtr# a -> Int#
1204 usage = { mangle EqStablePtrOp [mkP, mkP] mkR }
1205 has_side_effects = True
1207 primop MakeStableNameOp "makeStableName#" GenPrimOp
1208 a -> State# RealWorld -> (# State# RealWorld, StableName# a #)
1210 usage = { mangle MakeStableNameOp [mkZ, mkP] mkR }
1211 strictness = { \ arity -> StrictnessInfo [wwLazy, wwPrim] False }
1212 needs_wrapper = True
1213 has_side_effects = True
1216 primop EqStableNameOp "eqStableName#" GenPrimOp
1217 StableName# a -> StableName# a -> Int#
1219 usage = { mangle EqStableNameOp [mkP, mkP] mkR }
1221 primop StableNameToIntOp "stableNameToInt#" GenPrimOp
1222 StableName# a -> Int#
1224 usage = { mangle StableNameToIntOp [mkP] mkR }
1226 ------------------------------------------------------------------------
1227 --- Unsafe pointer equality (#1 Bad Guy: Alistair Reid :) ---
1228 ------------------------------------------------------------------------
1230 primop ReallyUnsafePtrEqualityOp "reallyUnsafePtrEquality#" GenPrimOp
1233 usage = { mangle ReallyUnsafePtrEqualityOp [mkZ, mkZ] mkR }
1235 ------------------------------------------------------------------------
1237 ------------------------------------------------------------------------
1239 primop SeqOp "seq#" GenPrimOp
1242 usage = { mangle SeqOp [mkO] mkR }
1243 strictness = { \ arity -> StrictnessInfo [wwStrict] False }
1244 -- Seq is strict in its argument; see notes in ConFold.lhs
1245 has_side_effects = True
1247 primop ParOp "par#" GenPrimOp
1250 usage = { mangle ParOp [mkO] mkR }
1251 strictness = { \ arity -> StrictnessInfo [wwLazy] False }
1252 -- Note that Par is lazy to avoid that the sparked thing
1253 -- gets evaluted strictly, which it should *not* be
1254 has_side_effects = True
1256 -- HWL: The first 4 Int# in all par... annotations denote:
1257 -- name, granularity info, size of result, degree of parallelism
1258 -- Same structure as _seq_ i.e. returns Int#
1259 -- KSW: v, the second arg in parAt# and parAtForNow#, is used only to determine
1260 -- `the processor containing the expression v'; it is not evaluated
1262 primop ParGlobalOp "parGlobal#" GenPrimOp
1263 a -> Int# -> Int# -> Int# -> Int# -> b -> Int#
1265 usage = { mangle ParGlobalOp [mkO, mkP, mkP, mkP, mkP, mkM] mkM }
1266 has_side_effects = True
1268 primop ParLocalOp "parLocal#" GenPrimOp
1269 a -> Int# -> Int# -> Int# -> Int# -> b -> Int#
1271 usage = { mangle ParLocalOp [mkO, mkP, mkP, mkP, mkP, mkM] mkM }
1272 has_side_effects = True
1274 primop ParAtOp "parAt#" GenPrimOp
1275 b -> a -> Int# -> Int# -> Int# -> Int# -> c -> Int#
1277 usage = { mangle ParAtOp [mkO, mkZ, mkP, mkP, mkP, mkP, mkM] mkM }
1278 has_side_effects = True
1280 primop ParAtAbsOp "parAtAbs#" GenPrimOp
1281 a -> Int# -> Int# -> Int# -> Int# -> Int# -> b -> Int#
1283 usage = { mangle ParAtAbsOp [mkO, mkP, mkP, mkP, mkP, mkM] mkM }
1284 has_side_effects = True
1286 primop ParAtRelOp "parAtRel#" GenPrimOp
1287 a -> Int# -> Int# -> Int# -> Int# -> Int# -> b -> Int#
1289 usage = { mangle ParAtRelOp [mkO, mkP, mkP, mkP, mkP, mkM] mkM }
1290 has_side_effects = True
1292 primop ParAtForNowOp "parAtForNow#" GenPrimOp
1293 b -> a -> Int# -> Int# -> Int# -> Int# -> c -> Int#
1295 usage = { mangle ParAtForNowOp [mkO, mkZ, mkP, mkP, mkP, mkP, mkM] mkM }
1296 has_side_effects = True
1298 -- copyable# and noFollow# have no corresponding entry in
1299 -- PrelGHC.hi-boot, so I don't know whether they should still
1300 -- be here or not. JRS, 15 Jan 01
1301 -- not implemented; please, keep the comment as reminder -- HWL 12/3/01
1303 --primop CopyableOp "copyable#" GenPrimOp
1306 -- usage = { mangle CopyableOp [mkZ] mkR }
1307 -- has_side_effects = True
1309 --primop NoFollowOp "noFollow#" GenPrimOp
1312 -- usage = { mangle NoFollowOp [mkZ] mkR }
1313 -- has_side_effects = True
1316 ------------------------------------------------------------------------
1317 --- tag to enum stuff ---
1318 ------------------------------------------------------------------------
1320 primop DataToTagOp "dataToTag#" GenPrimOp
1323 strictness = { \ arity -> StrictnessInfo [wwLazy] False }
1325 primop TagToEnumOp "tagToEnum#" GenPrimOp
1331 ------------------------------------------------------------------------
1333 ------------------------------------------------------------------------