1 -----------------------------------------------------------------------
2 -- $Id: primops.txt.pp,v 1.2 2001/08/08 10:50:36 simonmar 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.pp), 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.pp, 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)
31 -- The default attribute values which apply if you don't specify
32 -- other ones. Attribute values can be True, False, or arbitrary
33 -- text between curly brackets. This is a kludge to enable
34 -- processors of this file to easily get hold of simple info
35 -- (eg, out_of_line), whilst avoiding parsing complex expressions
36 -- needed for strictness and usage info.
39 has_side_effects = False
44 strictness = { \ arity -> StrictnessInfo (replicate arity wwPrim) False }
45 usage = { nomangle other }
48 ------------------------------------------------------------------------
49 --- Support for the bytecode interpreter and linker ---
50 ------------------------------------------------------------------------
52 -- Convert an Addr# to a followable type
53 primop AddrToHValueOp "addrToHValue#" GenPrimOp
56 primop MkApUpd0_Op "mkApUpd0#" GenPrimOp
61 primop NewBCOOp "newBCO#" GenPrimOp
62 ByteArr# -> ByteArr# -> Array# a -> ByteArr# -> State# s -> (# State# s, BCO# #)
64 has_side_effects = True
68 ------------------------------------------------------------------------
70 ------------------------------------------------------------------------
72 primop AddrGtOp "gtAddr#" Compare Addr# -> Addr# -> Bool
73 primop AddrGeOp "geAddr#" Compare Addr# -> Addr# -> Bool
74 primop AddrEqOp "eqAddr#" Compare Addr# -> Addr# -> Bool
75 primop AddrNeOp "neAddr#" Compare Addr# -> Addr# -> Bool
76 primop AddrLtOp "ltAddr#" Compare Addr# -> Addr# -> Bool
77 primop AddrLeOp "leAddr#" Compare Addr# -> Addr# -> Bool
79 primop Addr2IntOp "addr2Int#" GenPrimOp Addr# -> Int#
82 ------------------------------------------------------------------------
84 ------------------------------------------------------------------------
86 primop CharGtOp "gtChar#" Compare Char# -> Char# -> Bool
87 primop CharGeOp "geChar#" Compare Char# -> Char# -> Bool
89 primop CharEqOp "eqChar#" Compare
90 Char# -> Char# -> Bool
91 with commutable = True
93 primop CharNeOp "neChar#" Compare
94 Char# -> Char# -> Bool
95 with commutable = True
97 primop CharLtOp "ltChar#" Compare Char# -> Char# -> Bool
98 primop CharLeOp "leChar#" Compare Char# -> Char# -> Bool
100 primop OrdOp "ord#" GenPrimOp Char# -> Int#
102 ------------------------------------------------------------------------
104 ------------------------------------------------------------------------
106 primop DoubleGtOp ">##" Compare Double# -> Double# -> Bool
107 primop DoubleGeOp ">=##" Compare Double# -> Double# -> Bool
109 primop DoubleEqOp "==##" Compare
110 Double# -> Double# -> Bool
111 with commutable = True
113 primop DoubleNeOp "/=##" Compare
114 Double# -> Double# -> Bool
115 with commutable = True
117 primop DoubleLtOp "<##" Compare Double# -> Double# -> Bool
118 primop DoubleLeOp "<=##" Compare Double# -> Double# -> Bool
120 primop DoubleAddOp "+##" Dyadic
121 Double# -> Double# -> Double#
122 with commutable = True
124 primop DoubleSubOp "-##" Dyadic Double# -> Double# -> Double#
126 primop DoubleMulOp "*##" Dyadic
127 Double# -> Double# -> Double#
128 with commutable = True
130 primop DoubleDivOp "/##" Dyadic
131 Double# -> Double# -> Double#
134 primop DoubleNegOp "negateDouble#" Monadic Double# -> Double#
136 primop Double2IntOp "double2Int#" GenPrimOp Double# -> Int#
137 primop Double2FloatOp "double2Float#" GenPrimOp Double# -> Float#
139 primop DoubleExpOp "expDouble#" Monadic
141 with needs_wrapper = True
143 primop DoubleLogOp "logDouble#" Monadic
149 primop DoubleSqrtOp "sqrtDouble#" Monadic
151 with needs_wrapper = True
153 primop DoubleSinOp "sinDouble#" Monadic
155 with needs_wrapper = True
157 primop DoubleCosOp "cosDouble#" Monadic
159 with needs_wrapper = True
161 primop DoubleTanOp "tanDouble#" Monadic
163 with needs_wrapper = True
165 primop DoubleAsinOp "asinDouble#" Monadic
171 primop DoubleAcosOp "acosDouble#" Monadic
177 primop DoubleAtanOp "atanDouble#" Monadic
182 primop DoubleSinhOp "sinhDouble#" Monadic
184 with needs_wrapper = True
186 primop DoubleCoshOp "coshDouble#" Monadic
188 with needs_wrapper = True
190 primop DoubleTanhOp "tanhDouble#" Monadic
192 with needs_wrapper = True
194 primop DoublePowerOp "**##" Dyadic
195 Double# -> Double# -> Double#
196 with needs_wrapper = True
198 primop DoubleDecodeOp "decodeDouble#" GenPrimOp
199 Double# -> (# Int#, Int#, ByteArr# #)
200 with out_of_line = True
202 ------------------------------------------------------------------------
204 ------------------------------------------------------------------------
206 primop FloatGtOp "gtFloat#" Compare Float# -> Float# -> Bool
207 primop FloatGeOp "geFloat#" Compare Float# -> Float# -> Bool
209 primop FloatEqOp "eqFloat#" Compare
210 Float# -> Float# -> Bool
211 with commutable = True
213 primop FloatNeOp "neFloat#" Compare
214 Float# -> Float# -> Bool
215 with commutable = True
217 primop FloatLtOp "ltFloat#" Compare Float# -> Float# -> Bool
218 primop FloatLeOp "leFloat#" Compare Float# -> Float# -> Bool
220 primop FloatAddOp "plusFloat#" Dyadic
221 Float# -> Float# -> Float#
222 with commutable = True
224 primop FloatSubOp "minusFloat#" Dyadic Float# -> Float# -> Float#
226 primop FloatMulOp "timesFloat#" Dyadic
227 Float# -> Float# -> Float#
228 with commutable = True
230 primop FloatDivOp "divideFloat#" Dyadic
231 Float# -> Float# -> Float#
234 primop FloatNegOp "negateFloat#" Monadic Float# -> Float#
236 primop Float2IntOp "float2Int#" GenPrimOp Float# -> Int#
238 primop FloatExpOp "expFloat#" Monadic
240 with needs_wrapper = True
242 primop FloatLogOp "logFloat#" Monadic
244 with needs_wrapper = True
247 primop FloatSqrtOp "sqrtFloat#" Monadic
249 with needs_wrapper = True
251 primop FloatSinOp "sinFloat#" Monadic
253 with needs_wrapper = True
255 primop FloatCosOp "cosFloat#" Monadic
257 with needs_wrapper = True
259 primop FloatTanOp "tanFloat#" Monadic
261 with needs_wrapper = True
263 primop FloatAsinOp "asinFloat#" Monadic
265 with needs_wrapper = True
268 primop FloatAcosOp "acosFloat#" Monadic
270 with needs_wrapper = True
273 primop FloatAtanOp "atanFloat#" Monadic
275 with needs_wrapper = True
277 primop FloatSinhOp "sinhFloat#" Monadic
279 with needs_wrapper = True
281 primop FloatCoshOp "coshFloat#" Monadic
283 with needs_wrapper = True
285 primop FloatTanhOp "tanhFloat#" Monadic
287 with needs_wrapper = True
289 primop FloatPowerOp "powerFloat#" Dyadic
290 Float# -> Float# -> Float#
291 with needs_wrapper = True
293 primop Float2DoubleOp "float2Double#" GenPrimOp Float# -> Double#
295 primop FloatDecodeOp "decodeFloat#" GenPrimOp
296 Float# -> (# Int#, Int#, ByteArr# #)
297 with out_of_line = True
299 ------------------------------------------------------------------------
301 ------------------------------------------------------------------------
303 primop IntAddOp "+#" Dyadic
305 with commutable = True
307 primop IntSubOp "-#" Dyadic Int# -> Int# -> Int#
310 Dyadic Int# -> Int# -> Int#
311 with commutable = True
313 primop IntQuotOp "quotInt#" Dyadic
317 primop IntRemOp "remInt#" Dyadic
321 primop IntGcdOp "gcdInt#" Dyadic Int# -> Int# -> Int#
322 primop IntNegOp "negateInt#" Monadic Int# -> Int#
323 primop IntAddCOp "addIntC#" GenPrimOp Int# -> Int# -> (# Int#, Int# #)
324 primop IntSubCOp "subIntC#" GenPrimOp Int# -> Int# -> (# Int#, Int# #)
325 primop IntMulCOp "mulIntC#" GenPrimOp Int# -> Int# -> (# Int#, Int# #)
326 primop IntGtOp ">#" Compare Int# -> Int# -> Bool
327 primop IntGeOp ">=#" Compare Int# -> Int# -> Bool
329 primop IntEqOp "==#" Compare
331 with commutable = True
333 primop IntNeOp "/=#" Compare
335 with commutable = True
337 primop IntLtOp "<#" Compare Int# -> Int# -> Bool
338 primop IntLeOp "<=#" Compare Int# -> Int# -> Bool
340 primop ChrOp "chr#" GenPrimOp Int# -> Char#
342 primop Int2WordOp "int2Word#" GenPrimOp Int# -> Word#
343 primop Int2AddrOp "int2Addr#"GenPrimOp Int# -> Addr#
344 primop Int2FloatOp "int2Float#" GenPrimOp Int# -> Float#
345 primop Int2DoubleOp "int2Double#" GenPrimOp Int# -> Double#
347 primop Int2IntegerOp "int2Integer#"
348 GenPrimOp Int# -> (# Int#, ByteArr# #)
349 with out_of_line = True
351 primop ISllOp "iShiftL#" GenPrimOp Int# -> Int# -> Int#
352 primop ISraOp "iShiftRA#" GenPrimOp Int# -> Int# -> Int#
353 primop ISrlOp "iShiftRL#" GenPrimOp Int# -> Int# -> Int#
355 ------------------------------------------------------------------------
357 ------------------------------------------------------------------------
359 #ifdef SUPPORT_LONG_LONGS
360 primop Int64ToIntegerOp "int64ToInteger#" GenPrimOp
361 Int64# -> (# Int#, ByteArr# #)
362 with out_of_line = True
366 ------------------------------------------------------------------------
368 ------------------------------------------------------------------------
370 primop IntegerAddOp "plusInteger#" GenPrimOp
371 Int# -> ByteArr# -> Int# -> ByteArr# -> (# Int#, ByteArr# #)
372 with commutable = True
375 primop IntegerSubOp "minusInteger#" GenPrimOp
376 Int# -> ByteArr# -> Int# -> ByteArr# -> (# Int#, ByteArr# #)
377 with out_of_line = True
379 primop IntegerMulOp "timesInteger#" GenPrimOp
380 Int# -> ByteArr# -> Int# -> ByteArr# -> (# Int#, ByteArr# #)
381 with commutable = True
384 primop IntegerGcdOp "gcdInteger#" GenPrimOp
385 Int# -> ByteArr# -> Int# -> ByteArr# -> (# Int#, ByteArr# #)
386 with commutable = True
389 primop IntegerIntGcdOp "gcdIntegerInt#" GenPrimOp
390 Int# -> ByteArr# -> Int# -> Int#
391 with commutable = True
393 primop IntegerDivExactOp "divExactInteger#" GenPrimOp
394 Int# -> ByteArr# -> Int# -> ByteArr# -> (# Int#, ByteArr# #)
395 with out_of_line = True
397 primop IntegerQuotOp "quotInteger#" GenPrimOp
398 Int# -> ByteArr# -> Int# -> ByteArr# -> (# Int#, ByteArr# #)
399 with out_of_line = True
401 primop IntegerRemOp "remInteger#" GenPrimOp
402 Int# -> ByteArr# -> Int# -> ByteArr# -> (# Int#, ByteArr# #)
403 with out_of_line = True
405 primop IntegerCmpOp "cmpInteger#" GenPrimOp
406 Int# -> ByteArr# -> Int# -> ByteArr# -> Int#
407 with needs_wrapper = True
409 primop IntegerCmpIntOp "cmpIntegerInt#" GenPrimOp
410 Int# -> ByteArr# -> Int# -> Int#
411 with needs_wrapper = True
413 primop IntegerQuotRemOp "quotRemInteger#" GenPrimOp
414 Int# -> ByteArr# -> Int# -> ByteArr# -> (# Int#, ByteArr#, Int#, ByteArr# #)
418 primop IntegerDivModOp "divModInteger#" GenPrimOp
419 Int# -> ByteArr# -> Int# -> ByteArr# -> (# Int#, ByteArr#, Int#, ByteArr# #)
423 primop Integer2IntOp "integer2Int#" GenPrimOp
424 Int# -> ByteArr# -> Int#
425 with needs_wrapper = True
427 primop Integer2WordOp "integer2Word#" GenPrimOp
428 Int# -> ByteArr# -> Word#
429 with needs_wrapper = True
431 #ifdef SUPPORT_LONG_LONGS
432 primop IntegerToInt64Op "integerToInt64#" GenPrimOp
433 Int# -> ByteArr# -> Int64#
435 primop IntegerToWord64Op "integerToWord64#" GenPrimOp
436 Int# -> ByteArr# -> Word64#
439 primop IntegerAndOp "andInteger#" GenPrimOp
440 Int# -> ByteArr# -> Int# -> ByteArr# -> (# Int#, ByteArr# #)
441 with out_of_line = True
443 primop IntegerOrOp "orInteger#" GenPrimOp
444 Int# -> ByteArr# -> Int# -> ByteArr# -> (# Int#, ByteArr# #)
445 with out_of_line = True
447 primop IntegerXorOp "xorInteger#" GenPrimOp
448 Int# -> ByteArr# -> Int# -> ByteArr# -> (# Int#, ByteArr# #)
449 with out_of_line = True
451 primop IntegerComplementOp "complementInteger#" GenPrimOp
452 Int# -> ByteArr# -> (# Int#, ByteArr# #)
453 with out_of_line = True
455 ------------------------------------------------------------------------
457 ------------------------------------------------------------------------
459 primop WordAddOp "plusWord#" Dyadic Word# -> Word# -> Word#
460 with commutable = True
462 primop WordSubOp "minusWord#" Dyadic Word# -> Word# -> Word#
464 primop WordMulOp "timesWord#" Dyadic Word# -> Word# -> Word#
465 with commutable = True
467 primop WordQuotOp "quotWord#" Dyadic Word# -> Word# -> Word#
470 primop WordRemOp "remWord#" Dyadic Word# -> Word# -> Word#
473 primop AndOp "and#" Dyadic Word# -> Word# -> Word#
474 with commutable = True
476 primop OrOp "or#" Dyadic Word# -> Word# -> Word#
477 with commutable = True
479 primop XorOp "xor#" Dyadic Word# -> Word# -> Word#
480 with commutable = True
482 primop NotOp "not#" Monadic Word# -> Word#
484 primop SllOp "shiftL#" GenPrimOp Word# -> Int# -> Word#
486 primop SrlOp "shiftRL#" GenPrimOp Word# -> Int# -> Word#
488 primop Word2IntOp "word2Int#" GenPrimOp Word# -> Int#
490 primop Word2IntegerOp "word2Integer#" GenPrimOp
491 Word# -> (# Int#, ByteArr# #)
492 with out_of_line = True
494 primop WordGtOp "gtWord#" Compare Word# -> Word# -> Bool
495 primop WordGeOp "geWord#" Compare Word# -> Word# -> Bool
496 primop WordEqOp "eqWord#" Compare Word# -> Word# -> Bool
497 primop WordNeOp "neWord#" Compare Word# -> Word# -> Bool
498 primop WordLtOp "ltWord#" Compare Word# -> Word# -> Bool
499 primop WordLeOp "leWord#" Compare Word# -> Word# -> Bool
501 ------------------------------------------------------------------------
503 ------------------------------------------------------------------------
505 #ifdef SUPPORT_LONG_LONGS
506 primop Word64ToIntegerOp "word64ToInteger#" GenPrimOp
507 Word64# -> (# Int#, ByteArr# #)
508 with out_of_line = True
511 ------------------------------------------------------------------------
512 --- Explicitly sized Int# and Word# ---
513 ------------------------------------------------------------------------
515 primop IntToInt8Op "intToInt8#" Monadic Int# -> Int#
516 primop IntToInt16Op "intToInt16#" Monadic Int# -> Int#
517 primop IntToInt32Op "intToInt32#" Monadic Int# -> Int#
518 primop WordToWord8Op "wordToWord8#" Monadic Word# -> Word#
519 primop WordToWord16Op "wordToWord16#" Monadic Word# -> Word#
520 primop WordToWord32Op "wordToWord32#" Monadic Word# -> Word#
522 ------------------------------------------------------------------------
524 ------------------------------------------------------------------------
526 primop NewArrayOp "newArray#" GenPrimOp
527 Int# -> a -> State# s -> (# State# s, MutArr# s a #)
529 strictness = { \ arity -> StrictnessInfo [wwPrim, wwLazy, wwPrim] False }
530 usage = { mangle NewArrayOp [mkP, mkM, mkP] mkM }
533 primop NewByteArrayOp_Char "newByteArray#" GenPrimOp
534 Int# -> State# s -> (# State# s, MutByteArr# s #)
535 with out_of_line = True
537 primop NewPinnedByteArrayOp_Char "newPinnedByteArray#" GenPrimOp
538 Int# -> State# s -> (# State# s, MutByteArr# s #)
539 with out_of_line = True
541 primop ByteArrayContents_Char "byteArrayContents#" GenPrimOp
544 primop IndexByteArrayOp_Char "indexCharArray#" GenPrimOp
545 ByteArr# -> Int# -> Char#
547 primop IndexByteArrayOp_WideChar "indexWideCharArray#" GenPrimOp
548 ByteArr# -> Int# -> Char#
550 primop IndexByteArrayOp_Int "indexIntArray#" GenPrimOp
551 ByteArr# -> Int# -> Int#
553 primop IndexByteArrayOp_Word "indexWordArray#" GenPrimOp
554 ByteArr# -> Int# -> Word#
556 primop IndexByteArrayOp_Addr "indexAddrArray#" GenPrimOp
557 ByteArr# -> Int# -> Addr#
559 primop IndexByteArrayOp_Float "indexFloatArray#" GenPrimOp
560 ByteArr# -> Int# -> Float#
562 primop IndexByteArrayOp_Double "indexDoubleArray#" GenPrimOp
563 ByteArr# -> Int# -> Double#
565 primop IndexByteArrayOp_StablePtr "indexStablePtrArray#" GenPrimOp
566 ByteArr# -> Int# -> StablePtr# a
568 primop IndexByteArrayOp_Int8 "indexInt8Array#" GenPrimOp
569 ByteArr# -> Int# -> Int#
571 primop IndexByteArrayOp_Int16 "indexInt16Array#" GenPrimOp
572 ByteArr# -> Int# -> Int#
574 primop IndexByteArrayOp_Int32 "indexInt32Array#" GenPrimOp
575 ByteArr# -> Int# -> Int#
577 #ifdef SUPPORT_LONG_LONGS
578 primop IndexByteArrayOp_Int64 "indexInt64Array#" GenPrimOp
579 ByteArr# -> Int# -> Int64#
582 primop IndexByteArrayOp_Word8 "indexWord8Array#" GenPrimOp
583 ByteArr# -> Int# -> Word#
585 primop IndexByteArrayOp_Word16 "indexWord16Array#" GenPrimOp
586 ByteArr# -> Int# -> Word#
588 primop IndexByteArrayOp_Word32 "indexWord32Array#" GenPrimOp
589 ByteArr# -> Int# -> Word#
591 #ifdef SUPPORT_LONG_LONGS
592 primop IndexByteArrayOp_Word64 "indexWord64Array#" GenPrimOp
593 ByteArr# -> Int# -> Word64#
597 primop ReadByteArrayOp_Char "readCharArray#" GenPrimOp
598 MutByteArr# s -> Int# -> State# s -> (# State# s, Char# #)
600 primop ReadByteArrayOp_WideChar "readWideCharArray#" GenPrimOp
601 MutByteArr# s -> Int# -> State# s -> (# State# s, Char# #)
603 primop ReadByteArrayOp_Int "readIntArray#" GenPrimOp
604 MutByteArr# s -> Int# -> State# s -> (# State# s, Int# #)
606 primop ReadByteArrayOp_Word "readWordArray#" GenPrimOp
607 MutByteArr# s -> Int# -> State# s -> (# State# s, Word# #)
609 primop ReadByteArrayOp_Addr "readAddrArray#" GenPrimOp
610 MutByteArr# s -> Int# -> State# s -> (# State# s, Addr# #)
612 primop ReadByteArrayOp_Float "readFloatArray#" GenPrimOp
613 MutByteArr# s -> Int# -> State# s -> (# State# s, Float# #)
615 primop ReadByteArrayOp_Double "readDoubleArray#" GenPrimOp
616 MutByteArr# s -> Int# -> State# s -> (# State# s, Double# #)
618 primop ReadByteArrayOp_StablePtr "readStablePtrArray#" GenPrimOp
619 MutByteArr# s -> Int# -> State# s -> (# State# s, StablePtr# a #)
621 primop ReadByteArrayOp_Int8 "readInt8Array#" GenPrimOp
622 MutByteArr# s -> Int# -> State# s -> (# State# s, Int# #)
624 primop ReadByteArrayOp_Int16 "readInt16Array#" GenPrimOp
625 MutByteArr# s -> Int# -> State# s -> (# State# s, Int# #)
627 primop ReadByteArrayOp_Int32 "readInt32Array#" GenPrimOp
628 MutByteArr# s -> Int# -> State# s -> (# State# s, Int# #)
630 #ifdef SUPPORT_LONG_LONGS
631 primop ReadByteArrayOp_Int64 "readInt64Array#" GenPrimOp
632 MutByteArr# s -> Int# -> State# s -> (# State# s, Int64# #)
635 primop ReadByteArrayOp_Word8 "readWord8Array#" GenPrimOp
636 MutByteArr# s -> Int# -> State# s -> (# State# s, Word# #)
638 primop ReadByteArrayOp_Word16 "readWord16Array#" GenPrimOp
639 MutByteArr# s -> Int# -> State# s -> (# State# s, Word# #)
641 primop ReadByteArrayOp_Word32 "readWord32Array#" GenPrimOp
642 MutByteArr# s -> Int# -> State# s -> (# State# s, Word# #)
644 #ifdef SUPPORT_LONG_LONGS
645 primop ReadByteArrayOp_Word64 "readWord64Array#" GenPrimOp
646 MutByteArr# s -> Int# -> State# s -> (# State# s, Word64# #)
651 primop WriteByteArrayOp_Char "writeCharArray#" GenPrimOp
652 MutByteArr# s -> Int# -> Char# -> State# s -> State# s
653 with has_side_effects = True
655 primop WriteByteArrayOp_WideChar "writeWideCharArray#" GenPrimOp
656 MutByteArr# s -> Int# -> Char# -> State# s -> State# s
657 with has_side_effects = True
659 primop WriteByteArrayOp_Int "writeIntArray#" GenPrimOp
660 MutByteArr# s -> Int# -> Int# -> State# s -> State# s
661 with has_side_effects = True
663 primop WriteByteArrayOp_Word "writeWordArray#" GenPrimOp
664 MutByteArr# s -> Int# -> Word# -> State# s -> State# s
665 with has_side_effects = True
667 primop WriteByteArrayOp_Addr "writeAddrArray#" GenPrimOp
668 MutByteArr# s -> Int# -> Addr# -> State# s -> State# s
669 with has_side_effects = True
671 primop WriteByteArrayOp_Float "writeFloatArray#" GenPrimOp
672 MutByteArr# s -> Int# -> Float# -> State# s -> State# s
673 with has_side_effects = True
675 primop WriteByteArrayOp_Double "writeDoubleArray#" GenPrimOp
676 MutByteArr# s -> Int# -> Double# -> State# s -> State# s
677 with has_side_effects = True
679 primop WriteByteArrayOp_StablePtr "writeStablePtrArray#" GenPrimOp
680 MutByteArr# s -> Int# -> StablePtr# a -> State# s -> State# s
681 with has_side_effects = True
683 primop WriteByteArrayOp_Int8 "writeInt8Array#" GenPrimOp
684 MutByteArr# s -> Int# -> Int# -> State# s -> State# s
685 with has_side_effects = True
687 primop WriteByteArrayOp_Int16 "writeInt16Array#" GenPrimOp
688 MutByteArr# s -> Int# -> Int# -> State# s -> State# s
689 with has_side_effects = True
691 primop WriteByteArrayOp_Int32 "writeInt32Array#" GenPrimOp
692 MutByteArr# s -> Int# -> Int# -> State# s -> State# s
693 with has_side_effects = True
695 #ifdef SUPPORT_LONG_LONGS
696 primop WriteByteArrayOp_Int64 "writeInt64Array#" GenPrimOp
697 MutByteArr# s -> Int# -> Int64# -> State# s -> State# s
698 with has_side_effects = True
701 primop WriteByteArrayOp_Word8 "writeWord8Array#" GenPrimOp
702 MutByteArr# s -> Int# -> Word# -> State# s -> State# s
703 with has_side_effects = True
705 primop WriteByteArrayOp_Word16 "writeWord16Array#" GenPrimOp
706 MutByteArr# s -> Int# -> Word# -> State# s -> State# s
707 with has_side_effects = True
709 primop WriteByteArrayOp_Word32 "writeWord32Array#" GenPrimOp
710 MutByteArr# s -> Int# -> Word# -> State# s -> State# s
711 with has_side_effects = True
713 #ifdef SUPPORT_LONG_LONGS
714 primop WriteByteArrayOp_Word64 "writeWord64Array#" GenPrimOp
715 MutByteArr# s -> Int# -> Word64# -> State# s -> State# s
716 with has_side_effects = True
720 primop IndexOffAddrOp_Char "indexCharOffAddr#" GenPrimOp
721 Addr# -> Int# -> Char#
723 primop IndexOffAddrOp_WideChar "indexWideCharOffAddr#" GenPrimOp
724 Addr# -> Int# -> Char#
726 primop IndexOffAddrOp_Int "indexIntOffAddr#" GenPrimOp
727 Addr# -> Int# -> Int#
729 primop IndexOffAddrOp_Word "indexWordOffAddr#" GenPrimOp
730 Addr# -> Int# -> Word#
732 primop IndexOffAddrOp_Addr "indexAddrOffAddr#" GenPrimOp
733 Addr# -> Int# -> Addr#
735 primop IndexOffAddrOp_Float "indexFloatOffAddr#" GenPrimOp
736 Addr# -> Int# -> Float#
738 primop IndexOffAddrOp_Double "indexDoubleOffAddr#" GenPrimOp
739 Addr# -> Int# -> Double#
741 primop IndexOffAddrOp_StablePtr "indexStablePtrOffAddr#" GenPrimOp
742 Addr# -> Int# -> StablePtr# a
744 primop IndexOffAddrOp_Int8 "indexInt8OffAddr#" GenPrimOp
745 Addr# -> Int# -> Int#
747 primop IndexOffAddrOp_Int16 "indexInt16OffAddr#" GenPrimOp
748 Addr# -> Int# -> Int#
750 primop IndexOffAddrOp_Int32 "indexInt32OffAddr#" GenPrimOp
751 Addr# -> Int# -> Int#
753 #ifdef SUPPORT_LONG_LONGS
754 primop IndexOffAddrOp_Int64 "indexInt64OffAddr#" GenPrimOp
755 Addr# -> Int# -> Int64#
758 primop IndexOffAddrOp_Word8 "indexWord8OffAddr#" GenPrimOp
759 Addr# -> Int# -> Word#
761 primop IndexOffAddrOp_Word16 "indexWord16OffAddr#" GenPrimOp
762 Addr# -> Int# -> Word#
764 primop IndexOffAddrOp_Word32 "indexWord32OffAddr#" GenPrimOp
765 Addr# -> Int# -> Word#
767 #ifdef SUPPORT_LONG_LONGS
768 primop IndexOffAddrOp_Word64 "indexWord64OffAddr#" GenPrimOp
769 Addr# -> Int# -> Word64#
773 primop EqForeignObj "eqForeignObj#" GenPrimOp
774 ForeignObj# -> ForeignObj# -> Bool
775 with commutable = True
777 primop IndexOffForeignObjOp_Char "indexCharOffForeignObj#" GenPrimOp
778 ForeignObj# -> Int# -> Char#
780 primop IndexOffForeignObjOp_WideChar "indexWideCharOffForeignObj#" GenPrimOp
781 ForeignObj# -> Int# -> Char#
783 primop IndexOffForeignObjOp_Int "indexIntOffForeignObj#" GenPrimOp
784 ForeignObj# -> Int# -> Int#
786 primop IndexOffForeignObjOp_Word "indexWordOffForeignObj#" GenPrimOp
787 ForeignObj# -> Int# -> Word#
789 primop IndexOffForeignObjOp_Addr "indexAddrOffForeignObj#" GenPrimOp
790 ForeignObj# -> Int# -> Addr#
792 primop IndexOffForeignObjOp_Float "indexFloatOffForeignObj#" GenPrimOp
793 ForeignObj# -> Int# -> Float#
795 primop IndexOffForeignObjOp_Double "indexDoubleOffForeignObj#" GenPrimOp
796 ForeignObj# -> Int# -> Double#
798 primop IndexOffForeignObjOp_StablePtr "indexStablePtrOffForeignObj#" GenPrimOp
799 ForeignObj# -> Int# -> StablePtr# a
801 primop IndexOffForeignObjOp_Int8 "indexInt8OffForeignObj#" GenPrimOp
802 ForeignObj# -> Int# -> Int#
804 primop IndexOffForeignObjOp_Int16 "indexInt16OffForeignObj#" GenPrimOp
805 ForeignObj# -> Int# -> Int#
807 primop IndexOffForeignObjOp_Int32 "indexInt32OffForeignObj#" GenPrimOp
808 ForeignObj# -> Int# -> Int#
810 #ifdef SUPPORT_LONG_LONGS
811 primop IndexOffForeignObjOp_Int64 "indexInt64OffForeignObj#" GenPrimOp
812 ForeignObj# -> Int# -> Int64#
815 primop IndexOffForeignObjOp_Word8 "indexWord8OffForeignObj#" GenPrimOp
816 ForeignObj# -> Int# -> Word#
818 primop IndexOffForeignObjOp_Word16 "indexWord16OffForeignObj#" GenPrimOp
819 ForeignObj# -> Int# -> Word#
821 primop IndexOffForeignObjOp_Word32 "indexWord32OffForeignObj#" GenPrimOp
822 ForeignObj# -> Int# -> Word#
824 #ifdef SUPPORT_LONG_LONGS
825 primop IndexOffForeignObjOp_Word64 "indexWord64OffForeignObj#" GenPrimOp
826 ForeignObj# -> Int# -> Word64#
829 primop ReadOffAddrOp_Char "readCharOffAddr#" GenPrimOp
830 Addr# -> Int# -> State# s -> (# State# s, Char# #)
832 primop ReadOffAddrOp_WideChar "readWideCharOffAddr#" GenPrimOp
833 Addr# -> Int# -> State# s -> (# State# s, Char# #)
835 primop ReadOffAddrOp_Int "readIntOffAddr#" GenPrimOp
836 Addr# -> Int# -> State# s -> (# State# s, Int# #)
838 primop ReadOffAddrOp_Word "readWordOffAddr#" GenPrimOp
839 Addr# -> Int# -> State# s -> (# State# s, Word# #)
841 primop ReadOffAddrOp_Addr "readAddrOffAddr#" GenPrimOp
842 Addr# -> Int# -> State# s -> (# State# s, Addr# #)
844 primop ReadOffAddrOp_Float "readFloatOffAddr#" GenPrimOp
845 Addr# -> Int# -> State# s -> (# State# s, Float# #)
847 primop ReadOffAddrOp_Double "readDoubleOffAddr#" GenPrimOp
848 Addr# -> Int# -> State# s -> (# State# s, Double# #)
850 primop ReadOffAddrOp_StablePtr "readStablePtrOffAddr#" GenPrimOp
851 Addr# -> Int# -> State# s -> (# State# s, StablePtr# a #)
853 primop ReadOffAddrOp_Int8 "readInt8OffAddr#" GenPrimOp
854 Addr# -> Int# -> State# s -> (# State# s, Int# #)
856 primop ReadOffAddrOp_Int16 "readInt16OffAddr#" GenPrimOp
857 Addr# -> Int# -> State# s -> (# State# s, Int# #)
859 primop ReadOffAddrOp_Int32 "readInt32OffAddr#" GenPrimOp
860 Addr# -> Int# -> State# s -> (# State# s, Int# #)
862 #ifdef SUPPORT_LONG_LONGS
863 primop ReadOffAddrOp_Int64 "readInt64OffAddr#" GenPrimOp
864 Addr# -> Int# -> State# s -> (# State# s, Int64# #)
867 primop ReadOffAddrOp_Word8 "readWord8OffAddr#" GenPrimOp
868 Addr# -> Int# -> State# s -> (# State# s, Word# #)
870 primop ReadOffAddrOp_Word16 "readWord16OffAddr#" GenPrimOp
871 Addr# -> Int# -> State# s -> (# State# s, Word# #)
873 primop ReadOffAddrOp_Word32 "readWord32OffAddr#" GenPrimOp
874 Addr# -> Int# -> State# s -> (# State# s, Word# #)
876 #ifdef SUPPORT_LONG_LONGS
877 primop ReadOffAddrOp_Word64 "readWord64OffAddr#" GenPrimOp
878 Addr# -> Int# -> State# s -> (# State# s, Word64# #)
882 primop WriteOffAddrOp_Char "writeCharOffAddr#" GenPrimOp
883 Addr# -> Int# -> Char# -> State# s -> State# s
884 with has_side_effects = True
886 primop WriteOffAddrOp_WideChar "writeWideCharOffAddr#" GenPrimOp
887 Addr# -> Int# -> Char# -> State# s -> State# s
888 with has_side_effects = True
890 primop WriteOffAddrOp_Int "writeIntOffAddr#" GenPrimOp
891 Addr# -> Int# -> Int# -> State# s -> State# s
892 with has_side_effects = True
894 primop WriteOffAddrOp_Word "writeWordOffAddr#" GenPrimOp
895 Addr# -> Int# -> Word# -> State# s -> State# s
896 with has_side_effects = True
898 primop WriteOffAddrOp_Addr "writeAddrOffAddr#" GenPrimOp
899 Addr# -> Int# -> Addr# -> State# s -> State# s
900 with has_side_effects = True
902 primop WriteOffAddrOp_ForeignObj "writeForeignObjOffAddr#" GenPrimOp
903 Addr# -> Int# -> ForeignObj# -> State# s -> State# s
904 with has_side_effects = True
906 primop WriteOffAddrOp_Float "writeFloatOffAddr#" GenPrimOp
907 Addr# -> Int# -> Float# -> State# s -> State# s
908 with has_side_effects = True
910 primop WriteOffAddrOp_Double "writeDoubleOffAddr#" GenPrimOp
911 Addr# -> Int# -> Double# -> State# s -> State# s
912 with has_side_effects = True
914 primop WriteOffAddrOp_StablePtr "writeStablePtrOffAddr#" GenPrimOp
915 Addr# -> Int# -> StablePtr# a -> State# s -> State# s
916 with has_side_effects = True
918 primop WriteOffAddrOp_Int8 "writeInt8OffAddr#" GenPrimOp
919 Addr# -> Int# -> Int# -> State# s -> State# s
920 with has_side_effects = True
922 primop WriteOffAddrOp_Int16 "writeInt16OffAddr#" GenPrimOp
923 Addr# -> Int# -> Int# -> State# s -> State# s
924 with has_side_effects = True
926 primop WriteOffAddrOp_Int32 "writeInt32OffAddr#" GenPrimOp
927 Addr# -> Int# -> Int# -> State# s -> State# s
928 with has_side_effects = True
930 #ifdef SUPPORT_LONG_LONGS
931 primop WriteOffAddrOp_Int64 "writeInt64OffAddr#" GenPrimOp
932 Addr# -> Int# -> Int64# -> State# s -> State# s
933 with has_side_effects = True
936 primop WriteOffAddrOp_Word8 "writeWord8OffAddr#" GenPrimOp
937 Addr# -> Int# -> Word# -> State# s -> State# s
938 with has_side_effects = True
940 primop WriteOffAddrOp_Word16 "writeWord16OffAddr#" GenPrimOp
941 Addr# -> Int# -> Word# -> State# s -> State# s
942 with has_side_effects = True
944 primop WriteOffAddrOp_Word32 "writeWord32OffAddr#" GenPrimOp
945 Addr# -> Int# -> Word# -> State# s -> State# s
946 with has_side_effects = True
948 #ifdef SUPPORT_LONG_LONGS
949 primop WriteOffAddrOp_Word64 "writeWord64OffAddr#" GenPrimOp
950 Addr# -> Int# -> Word64# -> State# s -> State# s
951 with has_side_effects = True
956 primop SameMutableArrayOp "sameMutableArray#" GenPrimOp
957 MutArr# s a -> MutArr# s a -> Bool
959 usage = { mangle SameMutableArrayOp [mkP, mkP] mkM }
961 primop SameMutableByteArrayOp "sameMutableByteArray#" GenPrimOp
962 MutByteArr# s -> MutByteArr# s -> Bool
964 primop ReadArrayOp "readArray#" GenPrimOp
965 MutArr# s a -> Int# -> State# s -> (# State# s, a #)
967 usage = { mangle ReadArrayOp [mkM, mkP, mkP] mkM }
969 primop WriteArrayOp "writeArray#" GenPrimOp
970 MutArr# s a -> Int# -> a -> State# s -> State# s
972 usage = { mangle WriteArrayOp [mkM, mkP, mkM, mkP] mkR }
973 strictness = { \ arity -> StrictnessInfo [wwPrim, wwPrim, wwLazy, wwPrim] False }
974 has_side_effects = True
976 primop IndexArrayOp "indexArray#" GenPrimOp
977 Array# a -> Int# -> (# a #)
979 usage = { mangle IndexArrayOp [mkM, mkP] mkM }
981 primop UnsafeFreezeArrayOp "unsafeFreezeArray#" GenPrimOp
982 MutArr# s a -> State# s -> (# State# s, Array# a #)
984 usage = { mangle UnsafeFreezeArrayOp [mkM, mkP] mkM }
985 has_side_effects = True
987 primop UnsafeFreezeByteArrayOp "unsafeFreezeByteArray#" GenPrimOp
988 MutByteArr# s -> State# s -> (# State# s, ByteArr# #)
990 has_side_effects = True
992 primop UnsafeThawArrayOp "unsafeThawArray#" GenPrimOp
993 Array# a -> State# s -> (# State# s, MutArr# s a #)
995 usage = { mangle UnsafeThawArrayOp [mkM, mkP] mkM }
998 primop SizeofByteArrayOp "sizeofByteArray#" GenPrimOp
1001 primop SizeofMutableByteArrayOp "sizeofMutableByteArray#" GenPrimOp
1002 MutByteArr# s -> Int#
1004 ------------------------------------------------------------------------
1005 --- Mutable variables ---
1006 ------------------------------------------------------------------------
1008 primop NewMutVarOp "newMutVar#" GenPrimOp
1009 a -> State# s -> (# State# s, MutVar# s a #)
1011 usage = { mangle NewMutVarOp [mkM, mkP] mkM }
1012 strictness = { \ arity -> StrictnessInfo [wwLazy, wwPrim] False }
1015 primop ReadMutVarOp "readMutVar#" GenPrimOp
1016 MutVar# s a -> State# s -> (# State# s, a #)
1018 usage = { mangle ReadMutVarOp [mkM, mkP] mkM }
1020 primop WriteMutVarOp "writeMutVar#" GenPrimOp
1021 MutVar# s a -> a -> State# s -> State# s
1023 strictness = { \ arity -> StrictnessInfo [wwPrim, wwLazy, wwPrim] False }
1024 usage = { mangle WriteMutVarOp [mkM, mkM, mkP] mkR }
1025 has_side_effects = True
1027 primop SameMutVarOp "sameMutVar#" GenPrimOp
1028 MutVar# s a -> MutVar# s a -> Bool
1030 usage = { mangle SameMutVarOp [mkP, mkP] mkM }
1032 ------------------------------------------------------------------------
1034 ------------------------------------------------------------------------
1036 primop CatchOp "catch#" GenPrimOp
1037 (State# RealWorld -> (# State# RealWorld, a #) )
1038 -> (b -> State# RealWorld -> (# State# RealWorld, a #) )
1040 -> (# State# RealWorld, a #)
1042 strictness = { \ arity -> StrictnessInfo [wwLazy, wwLazy, wwPrim] False }
1043 -- Catch is actually strict in its first argument
1044 -- but we don't want to tell the strictness
1045 -- analyser about that!
1046 usage = { mangle CatchOp [mkM, mkM . (inFun CatchOp mkM mkM), mkP] mkM }
1047 -- [mkO, mkO . (inFun mkM mkO)] mkO
1048 -- might use caught action multiply
1051 primop RaiseOp "raise#" GenPrimOp
1054 strictness = { \ arity -> StrictnessInfo [wwLazy] True }
1055 -- NB: True => result is bottom
1056 usage = { mangle RaiseOp [mkM] mkM }
1059 primop BlockAsyncExceptionsOp "blockAsyncExceptions#" GenPrimOp
1060 (State# RealWorld -> (# State# RealWorld, a #))
1061 -> (State# RealWorld -> (# State# RealWorld, a #))
1063 strictness = { \ arity -> StrictnessInfo [wwLazy,wwPrim] False }
1066 primop UnblockAsyncExceptionsOp "unblockAsyncExceptions#" GenPrimOp
1067 (State# RealWorld -> (# State# RealWorld, a #))
1068 -> (State# RealWorld -> (# State# RealWorld, a #))
1070 strictness = { \ arity -> StrictnessInfo [wwLazy,wwPrim] False }
1073 ------------------------------------------------------------------------
1074 --- MVars (not the same as mutable variables!) ---
1075 ------------------------------------------------------------------------
1077 primop NewMVarOp "newMVar#" GenPrimOp
1078 State# s -> (# State# s, MVar# s a #)
1080 usage = { mangle NewMVarOp [mkP] mkR }
1083 primop TakeMVarOp "takeMVar#" GenPrimOp
1084 MVar# s a -> State# s -> (# State# s, a #)
1086 usage = { mangle TakeMVarOp [mkM, mkP] mkM }
1087 has_side_effects = True
1090 primop TryTakeMVarOp "tryTakeMVar#" GenPrimOp
1091 MVar# s a -> State# s -> (# State# s, Int#, a #)
1093 usage = { mangle TryTakeMVarOp [mkM, mkP] mkM }
1094 has_side_effects = True
1097 primop PutMVarOp "putMVar#" GenPrimOp
1098 MVar# s a -> a -> State# s -> State# s
1100 strictness = { \ arity -> StrictnessInfo [wwPrim, wwLazy, wwPrim] False }
1101 usage = { mangle PutMVarOp [mkM, mkM, mkP] mkR }
1102 has_side_effects = True
1105 primop TryPutMVarOp "tryPutMVar#" GenPrimOp
1106 MVar# s a -> a -> State# s -> (# State# s, Int# #)
1108 strictness = { \ arity -> StrictnessInfo [wwPrim, wwLazy, wwPrim] False }
1109 usage = { mangle TryPutMVarOp [mkM, mkM, mkP] mkR }
1110 has_side_effects = True
1113 primop SameMVarOp "sameMVar#" GenPrimOp
1114 MVar# s a -> MVar# s a -> Bool
1116 usage = { mangle SameMVarOp [mkP, mkP] mkM }
1118 primop IsEmptyMVarOp "isEmptyMVar#" GenPrimOp
1119 MVar# s a -> State# s -> (# State# s, Int# #)
1121 usage = { mangle IsEmptyMVarOp [mkP, mkP] mkM }
1124 ------------------------------------------------------------------------
1125 --- delay/wait operations ---
1126 ------------------------------------------------------------------------
1128 primop DelayOp "delay#" GenPrimOp
1129 Int# -> State# s -> State# s
1131 needs_wrapper = True
1132 has_side_effects = True
1135 primop WaitReadOp "waitRead#" GenPrimOp
1136 Int# -> State# s -> State# s
1138 needs_wrapper = True
1139 has_side_effects = True
1142 primop WaitWriteOp "waitWrite#" GenPrimOp
1143 Int# -> State# s -> State# s
1145 needs_wrapper = True
1146 has_side_effects = True
1149 ------------------------------------------------------------------------
1150 --- concurrency primitives ---
1151 ------------------------------------------------------------------------
1153 primop ForkOp "fork#" GenPrimOp
1154 a -> State# RealWorld -> (# State# RealWorld, ThreadId# #)
1156 usage = { mangle ForkOp [mkO, mkP] mkR }
1157 strictness = { \ arity -> StrictnessInfo [wwLazy, wwPrim] False }
1158 has_side_effects = True
1161 primop KillThreadOp "killThread#" GenPrimOp
1162 ThreadId# -> a -> State# RealWorld -> State# RealWorld
1164 usage = { mangle KillThreadOp [mkP, mkM, mkP] mkR }
1165 has_side_effects = True
1168 primop YieldOp "yield#" GenPrimOp
1169 State# RealWorld -> State# RealWorld
1171 has_side_effects = True
1174 primop MyThreadIdOp "myThreadId#" GenPrimOp
1175 State# RealWorld -> (# State# RealWorld, ThreadId# #)
1177 ------------------------------------------------------------------------
1178 --- foreign objects ---
1179 ------------------------------------------------------------------------
1181 primop MkForeignObjOp "mkForeignObj#" GenPrimOp
1182 Addr# -> State# RealWorld -> (# State# RealWorld, ForeignObj# #)
1184 has_side_effects = True
1187 primop WriteForeignObjOp "writeForeignObj#" GenPrimOp
1188 ForeignObj# -> Addr# -> State# s -> State# s
1190 has_side_effects = True
1192 primop ForeignObjToAddrOp "foreignObjToAddr#" GenPrimOp
1193 ForeignObj# -> Addr#
1195 primop TouchOp "touch#" GenPrimOp
1196 o -> State# RealWorld -> State# RealWorld
1198 has_side_effects = True
1199 strictness = { \ arity -> StrictnessInfo [wwLazy, wwPrim] False }
1201 ------------------------------------------------------------------------
1202 --- Weak pointers ---
1203 ------------------------------------------------------------------------
1205 -- note that tyvar "o" denotes openAlphaTyVar
1207 primop MkWeakOp "mkWeak#" GenPrimOp
1208 o -> b -> c -> State# RealWorld -> (# State# RealWorld, Weak# b #)
1210 strictness = { \ arity -> StrictnessInfo [wwLazy, wwLazy, wwLazy, wwPrim] False }
1211 usage = { mangle MkWeakOp [mkZ, mkM, mkM, mkP] mkM }
1212 has_side_effects = True
1215 primop DeRefWeakOp "deRefWeak#" GenPrimOp
1216 Weak# a -> State# RealWorld -> (# State# RealWorld, Int#, a #)
1218 usage = { mangle DeRefWeakOp [mkM, mkP] mkM }
1219 has_side_effects = True
1221 primop FinalizeWeakOp "finalizeWeak#" GenPrimOp
1222 Weak# a -> State# RealWorld -> (# State# RealWorld, Int#,
1223 (State# RealWorld -> (# State# RealWorld, Unit #)) #)
1225 usage = { mangle FinalizeWeakOp [mkM, mkP]
1226 (mkR . (inUB FinalizeWeakOp
1227 [id,id,inFun FinalizeWeakOp mkR mkM])) }
1228 has_side_effects = True
1231 ------------------------------------------------------------------------
1232 --- Stable pointers and names ---
1233 ------------------------------------------------------------------------
1235 primop MakeStablePtrOp "makeStablePtr#" GenPrimOp
1236 a -> State# RealWorld -> (# State# RealWorld, StablePtr# a #)
1238 strictness = { \ arity -> StrictnessInfo [wwLazy, wwPrim] False }
1239 usage = { mangle MakeStablePtrOp [mkM, mkP] mkM }
1240 has_side_effects = True
1242 primop DeRefStablePtrOp "deRefStablePtr#" GenPrimOp
1243 StablePtr# a -> State# RealWorld -> (# State# RealWorld, a #)
1245 usage = { mangle DeRefStablePtrOp [mkM, mkP] mkM }
1246 needs_wrapper = True
1247 has_side_effects = True
1249 primop EqStablePtrOp "eqStablePtr#" GenPrimOp
1250 StablePtr# a -> StablePtr# a -> Int#
1252 usage = { mangle EqStablePtrOp [mkP, mkP] mkR }
1253 has_side_effects = True
1255 primop MakeStableNameOp "makeStableName#" GenPrimOp
1256 a -> State# RealWorld -> (# State# RealWorld, StableName# a #)
1258 usage = { mangle MakeStableNameOp [mkZ, mkP] mkR }
1259 strictness = { \ arity -> StrictnessInfo [wwLazy, wwPrim] False }
1260 needs_wrapper = True
1261 has_side_effects = True
1264 primop EqStableNameOp "eqStableName#" GenPrimOp
1265 StableName# a -> StableName# a -> Int#
1267 usage = { mangle EqStableNameOp [mkP, mkP] mkR }
1269 primop StableNameToIntOp "stableNameToInt#" GenPrimOp
1270 StableName# a -> Int#
1272 usage = { mangle StableNameToIntOp [mkP] mkR }
1274 ------------------------------------------------------------------------
1275 --- Unsafe pointer equality (#1 Bad Guy: Alistair Reid :) ---
1276 ------------------------------------------------------------------------
1278 primop ReallyUnsafePtrEqualityOp "reallyUnsafePtrEquality#" GenPrimOp
1281 usage = { mangle ReallyUnsafePtrEqualityOp [mkZ, mkZ] mkR }
1283 ------------------------------------------------------------------------
1285 ------------------------------------------------------------------------
1287 primop SeqOp "seq#" GenPrimOp
1290 usage = { mangle SeqOp [mkO] mkR }
1291 strictness = { \ arity -> StrictnessInfo [wwStrict] False }
1292 -- Seq is strict in its argument; see notes in ConFold.lhs
1293 has_side_effects = True
1295 primop ParOp "par#" GenPrimOp
1298 usage = { mangle ParOp [mkO] mkR }
1299 strictness = { \ arity -> StrictnessInfo [wwLazy] False }
1300 -- Note that Par is lazy to avoid that the sparked thing
1301 -- gets evaluted strictly, which it should *not* be
1302 has_side_effects = True
1304 -- HWL: The first 4 Int# in all par... annotations denote:
1305 -- name, granularity info, size of result, degree of parallelism
1306 -- Same structure as _seq_ i.e. returns Int#
1307 -- KSW: v, the second arg in parAt# and parAtForNow#, is used only to determine
1308 -- `the processor containing the expression v'; it is not evaluated
1310 primop ParGlobalOp "parGlobal#" GenPrimOp
1311 a -> Int# -> Int# -> Int# -> Int# -> b -> Int#
1313 usage = { mangle ParGlobalOp [mkO, mkP, mkP, mkP, mkP, mkM] mkM }
1314 has_side_effects = True
1316 primop ParLocalOp "parLocal#" GenPrimOp
1317 a -> Int# -> Int# -> Int# -> Int# -> b -> Int#
1319 usage = { mangle ParLocalOp [mkO, mkP, mkP, mkP, mkP, mkM] mkM }
1320 has_side_effects = True
1322 primop ParAtOp "parAt#" GenPrimOp
1323 b -> a -> Int# -> Int# -> Int# -> Int# -> c -> Int#
1325 usage = { mangle ParAtOp [mkO, mkZ, mkP, mkP, mkP, mkP, mkM] mkM }
1326 has_side_effects = True
1328 primop ParAtAbsOp "parAtAbs#" GenPrimOp
1329 a -> Int# -> Int# -> Int# -> Int# -> Int# -> b -> Int#
1331 usage = { mangle ParAtAbsOp [mkO, mkP, mkP, mkP, mkP, mkM] mkM }
1332 has_side_effects = True
1334 primop ParAtRelOp "parAtRel#" GenPrimOp
1335 a -> Int# -> Int# -> Int# -> Int# -> Int# -> b -> Int#
1337 usage = { mangle ParAtRelOp [mkO, mkP, mkP, mkP, mkP, mkM] mkM }
1338 has_side_effects = True
1340 primop ParAtForNowOp "parAtForNow#" GenPrimOp
1341 b -> a -> Int# -> Int# -> Int# -> Int# -> c -> Int#
1343 usage = { mangle ParAtForNowOp [mkO, mkZ, mkP, mkP, mkP, mkP, mkM] mkM }
1344 has_side_effects = True
1346 -- copyable# and noFollow# are yet to be implemented (for GpH)
1348 --primop CopyableOp "copyable#" GenPrimOp
1351 -- usage = { mangle CopyableOp [mkZ] mkR }
1352 -- has_side_effects = True
1354 --primop NoFollowOp "noFollow#" GenPrimOp
1357 -- usage = { mangle NoFollowOp [mkZ] mkR }
1358 -- has_side_effects = True
1361 ------------------------------------------------------------------------
1362 --- tag to enum stuff ---
1363 ------------------------------------------------------------------------
1365 primop DataToTagOp "dataToTag#" GenPrimOp
1368 strictness = { \ arity -> StrictnessInfo [wwLazy] False }
1370 primop TagToEnumOp "tagToEnum#" GenPrimOp
1376 ------------------------------------------------------------------------
1378 ------------------------------------------------------------------------