2 -- The default attribute values which apply if you don't specify
3 -- other ones. Attribute values can be True, False, or arbitrary
4 -- text between curly brackets. This is a kludge to enable
5 -- processors of this file to easily get hold of simple info
6 -- (eg, out_of_line), whilst avoiding parsing complex expressions
7 -- needed for strictness and usage info.
10 has_side_effects = False
15 strictness = { \ arity -> StrictnessInfo (replicate arity wwPrim) False }
16 usage = { nomangle other }
19 ------------------------------------------------------------------------
21 ------------------------------------------------------------------------
23 primop AddrGtOp "gtAddr#" Compare Addr# -> Addr# -> Bool
24 primop AddrGeOp "geAddr#" Compare Addr# -> Addr# -> Bool
25 primop AddrEqOp "eqAddr#" Compare Addr# -> Addr# -> Bool
26 primop AddrNeOp "neAddr#" Compare Addr# -> Addr# -> Bool
27 primop AddrLtOp "ltAddr#" Compare Addr# -> Addr# -> Bool
28 primop AddrLeOp "leAddr#" Compare Addr# -> Addr# -> Bool
30 primop Addr2IntOp "addr2Int#" GenPrimOp Addr# -> Int#
32 primop Addr2IntegerOp "addr2Integer#" GenPrimOp
33 Addr# -> (# Int#, ByteArr# #)
34 with out_of_line = True
37 ------------------------------------------------------------------------
39 ------------------------------------------------------------------------
41 primop CharGtOp "gtChar#" Compare Char# -> Char# -> Bool
42 primop CharGeOp "geChar#" Compare Char# -> Char# -> Bool
44 primop CharEqOp "eqChar#" Compare
45 Char# -> Char# -> Bool
46 with commutable = True
48 primop CharNeOp "neChar#" Compare
49 Char# -> Char# -> Bool
50 with commutable = True
52 primop CharLtOp "ltChar#" Compare Char# -> Char# -> Bool
53 primop CharLeOp "leChar#" Compare Char# -> Char# -> Bool
55 primop OrdOp "ord#" GenPrimOp Char# -> Int#
57 ------------------------------------------------------------------------
59 ------------------------------------------------------------------------
61 primop DoubleGtOp ">##" Compare Double# -> Double# -> Bool
62 primop DoubleGeOp ">=##" Compare Double# -> Double# -> Bool
64 primop DoubleEqOp "==##" Compare
65 Double# -> Double# -> Bool
66 with commutable = True
68 primop DoubleNeOp "/=##" Compare
69 Double# -> Double# -> Bool
70 with commutable = True
72 primop DoubleLtOp "<##" Compare Double# -> Double# -> Bool
73 primop DoubleLeOp "<=##" Compare Double# -> Double# -> Bool
75 primop DoubleAddOp "+##" Dyadic
76 Double# -> Double# -> Double#
77 with commutable = True
79 primop DoubleSubOp "-##" Dyadic Double# -> Double# -> Double#
81 primop DoubleMulOp "*##" Dyadic
82 Double# -> Double# -> Double#
83 with commutable = True
85 primop DoubleDivOp "/##" Dyadic
86 Double# -> Double# -> Double#
89 primop DoubleNegOp "negateDouble#" Monadic Double# -> Double#
91 primop Double2IntOp "double2Int#" GenPrimOp Double# -> Int#
92 primop Double2FloatOp "double2Float#" GenPrimOp Double# -> Float#
94 primop DoubleExpOp "expDouble#" Monadic
96 with needs_wrapper = True
98 primop DoubleLogOp "logDouble#" Monadic
104 primop DoubleSqrtOp "sqrtDouble#" Monadic
106 with needs_wrapper = True
108 primop DoubleSinOp "sinDouble#" Monadic
110 with needs_wrapper = True
112 primop DoubleCosOp "cosDouble#" Monadic
114 with needs_wrapper = True
116 primop DoubleTanOp "tanDouble#" Monadic
118 with needs_wrapper = True
120 primop DoubleAsinOp "asinDouble#" Monadic
126 primop DoubleAcosOp "acosDouble#" Monadic
132 primop DoubleAtanOp "atanDouble#" Monadic
137 primop DoubleSinhOp "sinhDouble#" Monadic
139 with needs_wrapper = True
141 primop DoubleCoshOp "coshDouble#" Monadic
143 with needs_wrapper = True
145 primop DoubleTanhOp "tanhDouble#" Monadic
147 with needs_wrapper = True
149 primop DoublePowerOp "**##" Dyadic
150 Double# -> Double# -> Double#
151 with needs_wrapper = True
153 primop DoubleDecodeOp "decodeDouble#" GenPrimOp
154 Double# -> (# Int#, Int#, ByteArr# #)
155 with out_of_line = True
157 ------------------------------------------------------------------------
159 ------------------------------------------------------------------------
161 primop FloatGtOp "gtFloat#" Compare Float# -> Float# -> Bool
162 primop FloatGeOp "geFloat#" Compare Float# -> Float# -> Bool
164 primop FloatEqOp "eqFloat#" Compare
165 Float# -> Float# -> Bool
166 with commutable = True
168 primop FloatNeOp "neFloat#" Compare
169 Float# -> Float# -> Bool
170 with commutable = True
172 primop FloatLtOp "ltFloat#" Compare Float# -> Float# -> Bool
173 primop FloatLeOp "leFloat#" Compare Float# -> Float# -> Bool
175 primop FloatAddOp "plusFloat#" Dyadic
176 Float# -> Float# -> Float#
177 with commutable = True
179 primop FloatSubOp "minusFloat#" Dyadic Float# -> Float# -> Float#
181 primop FloatMulOp "timesFloat#" Dyadic
182 Float# -> Float# -> Float#
183 with commutable = True
185 primop FloatDivOp "divideFloat#" Dyadic
186 Float# -> Float# -> Float#
189 primop FloatNegOp "negateFloat#" Monadic Float# -> Float#
191 primop Float2IntOp "float2Int#" GenPrimOp Float# -> Int#
193 primop FloatExpOp "expFloat#" Monadic
195 with needs_wrapper = True
197 primop FloatLogOp "logFloat#" Monadic
199 with needs_wrapper = True
202 primop FloatSqrtOp "sqrtFloat#" Monadic
204 with needs_wrapper = True
206 primop FloatSinOp "sinFloat#" Monadic
208 with needs_wrapper = True
210 primop FloatCosOp "cosFloat#" Monadic
212 with needs_wrapper = True
214 primop FloatTanOp "tanFloat#" Monadic
216 with needs_wrapper = True
218 primop FloatAsinOp "asinFloat#" Monadic
220 with needs_wrapper = True
223 primop FloatAcosOp "acosFloat#" Monadic
225 with needs_wrapper = True
228 primop FloatAtanOp "atanFloat#" Monadic
230 with needs_wrapper = True
232 primop FloatSinhOp "sinhFloat#" Monadic
234 with needs_wrapper = True
236 primop FloatCoshOp "coshFloat#" Monadic
238 with needs_wrapper = True
240 primop FloatTanhOp "tanhFloat#" Monadic
242 with needs_wrapper = True
244 primop FloatPowerOp "powerFloat#" Dyadic
245 Float# -> Float# -> Float#
246 with needs_wrapper = True
248 primop Float2DoubleOp "float2Double#" GenPrimOp Float# -> Double#
250 primop FloatDecodeOp "decodeFloat#" GenPrimOp
251 Float# -> (# Int#, Int#, ByteArr# #)
252 with out_of_line = True
254 ------------------------------------------------------------------------
256 ------------------------------------------------------------------------
258 primop IntAddOp "+#" Dyadic
260 with commutable = True
262 primop IntSubOp "-#" Dyadic Int# -> Int# -> Int#
265 Dyadic Int# -> Int# -> Int#
266 with commutable = True
268 primop IntQuotOp "quotInt#" Dyadic
272 primop IntRemOp "remInt#" Dyadic
276 primop IntGcdOp "gcdInt#" Dyadic Int# -> Int# -> Int#
277 primop IntNegOp "negateInt#" Monadic Int# -> Int#
278 primop IntAddCOp "addIntC#" GenPrimOp Int# -> Int# -> (# Int#, Int# #)
279 primop IntSubCOp "subIntC#" GenPrimOp Int# -> Int# -> (# Int#, Int# #)
280 primop IntMulCOp "mulIntC#" GenPrimOp Int# -> Int# -> (# Int#, Int# #)
281 primop IntGtOp ">#" Compare Int# -> Int# -> Bool
282 primop IntGeOp ">=#" Compare Int# -> Int# -> Bool
284 primop IntEqOp "==#" Compare
286 with commutable = True
288 primop IntNeOp "/=#" Compare
290 with commutable = True
292 primop IntLtOp "<#" Compare Int# -> Int# -> Bool
293 primop IntLeOp "<=#" Compare Int# -> Int# -> Bool
295 primop ChrOp "chr#" GenPrimOp Int# -> Char#
297 primop Int2WordOp "int2Word#" GenPrimOp Int# -> Word#
298 primop Int2AddrOp "int2Addr#"GenPrimOp Int# -> Addr#
299 primop Int2FloatOp "int2Float#" GenPrimOp Int# -> Float#
300 primop Int2DoubleOp "int2Double#" GenPrimOp Int# -> Double#
302 primop Int2IntegerOp "int2Integer#"
303 GenPrimOp Int# -> (# Int#, ByteArr# #)
304 with out_of_line = True
306 primop ISllOp "iShiftL#" GenPrimOp Int# -> Int# -> Int#
307 primop ISraOp "iShiftRA#" GenPrimOp Int# -> Int# -> Int#
308 primop ISrlOp "iShiftRL#" GenPrimOp Int# -> Int# -> Int#
310 ------------------------------------------------------------------------
312 ------------------------------------------------------------------------
314 primop Int64ToIntegerOp "int64ToInteger#" GenPrimOp
315 Int64# -> (# Int#, ByteArr# #)
316 with out_of_line = True
319 ------------------------------------------------------------------------
321 ------------------------------------------------------------------------
323 primop IntegerNegOp "negateInteger#" GenPrimOp
324 Int# -> ByteArr# -> (# Int#, ByteArr# #)
326 primop IntegerAddOp "plusInteger#" GenPrimOp
327 Int# -> ByteArr# -> Int# -> ByteArr# -> (# Int#, ByteArr# #)
328 with commutable = True
331 primop IntegerSubOp "minusInteger#" GenPrimOp
332 Int# -> ByteArr# -> Int# -> ByteArr# -> (# Int#, ByteArr# #)
333 with out_of_line = True
335 primop IntegerMulOp "timesInteger#" GenPrimOp
336 Int# -> ByteArr# -> Int# -> ByteArr# -> (# Int#, ByteArr# #)
337 with commutable = True
340 primop IntegerGcdOp "gcdInteger#" GenPrimOp
341 Int# -> ByteArr# -> Int# -> ByteArr# -> (# Int#, ByteArr# #)
342 with commutable = True
345 primop IntegerIntGcdOp "gcdIntegerInt#" GenPrimOp
346 Int# -> ByteArr# -> Int# -> Int#
347 with commutable = True
349 primop IntegerDivExactOp "divExactInteger#" GenPrimOp
350 Int# -> ByteArr# -> Int# -> ByteArr# -> (# Int#, ByteArr# #)
351 with out_of_line = True
353 primop IntegerQuotOp "quotInteger#" GenPrimOp
354 Int# -> ByteArr# -> Int# -> ByteArr# -> (# Int#, ByteArr# #)
355 with out_of_line = True
357 primop IntegerRemOp "remInteger#" GenPrimOp
358 Int# -> ByteArr# -> Int# -> ByteArr# -> (# Int#, ByteArr# #)
359 with out_of_line = True
361 primop IntegerCmpOp "cmpInteger#" GenPrimOp
362 Int# -> ByteArr# -> Int# -> ByteArr# -> Int#
363 with needs_wrapper = True
365 primop IntegerCmpIntOp "cmpIntegerInt#" GenPrimOp
366 Int# -> ByteArr# -> Int# -> Int#
367 with needs_wrapper = True
369 primop IntegerQuotRemOp "quotRemInteger#" GenPrimOp
370 Int# -> ByteArr# -> Int# -> ByteArr# -> (# Int#, ByteArr#, Int#, ByteArr# #)
374 primop IntegerDivModOp "divModInteger#" GenPrimOp
375 Int# -> ByteArr# -> Int# -> ByteArr# -> (# Int#, ByteArr#, Int#, ByteArr# #)
379 primop Integer2IntOp "integer2Int#" GenPrimOp
380 Int# -> ByteArr# -> Int#
381 with needs_wrapper = True
383 primop Integer2WordOp "integer2Word#" GenPrimOp
384 Int# -> ByteArr# -> Word#
385 with needs_wrapper = True
387 primop IntegerToInt64Op "integerToInt64#" GenPrimOp
388 Int# -> ByteArr# -> Int64#
390 primop IntegerToWord64Op "integerToWord64#" GenPrimOp
391 Int# -> ByteArr# -> Word64#
393 ------------------------------------------------------------------------
395 ------------------------------------------------------------------------
397 primop WordQuotOp "quotWord#" Dyadic Word# -> Word# -> Word#
398 primop WordRemOp "remWord#" Dyadic Word# -> Word# -> Word#
400 primop AndOp "and#" Dyadic
401 Word# -> Word# -> Word#
402 with commutable = True
404 primop OrOp "or#" Dyadic
405 Word# -> Word# -> Word#
406 with commutable = True
408 primop XorOp "xor#" Dyadic
409 Word# -> Word# -> Word#
410 with commutable = True
412 primop NotOp "not#" Monadic Word# -> Word#
414 primop SllOp "shiftL#" GenPrimOp Word# -> Int# -> Word#
415 primop SrlOp "shiftRL#" GenPrimOp Word# -> Int# -> Word#
418 primop Word2IntOp "word2Int#" GenPrimOp Word# -> Int#
420 primop Word2IntegerOp "word2Integer#" GenPrimOp
421 Word# -> (# Int#, ByteArr# #)
422 with out_of_line = True
424 primop WordGtOp "gtWord#" Compare Word# -> Word# -> Bool
425 primop WordGeOp "geWord#" Compare Word# -> Word# -> Bool
426 primop WordEqOp "eqWord#" Compare Word# -> Word# -> Bool
427 primop WordNeOp "neWord#" Compare Word# -> Word# -> Bool
428 primop WordLtOp "ltWord#" Compare Word# -> Word# -> Bool
429 primop WordLeOp "leWord#" Compare Word# -> Word# -> Bool
431 ------------------------------------------------------------------------
433 ------------------------------------------------------------------------
435 primop Word64ToIntegerOp "word64ToInteger#" GenPrimOp
436 Word64# -> (# Int#, ByteArr# #)
437 with out_of_line = True
440 ------------------------------------------------------------------------
442 ------------------------------------------------------------------------
444 primop NewByteArrayOp_Char "newCharArray#" GenPrimOp
445 Int# -> State# s -> (# State# s, MutByteArr# s #)
446 with out_of_line = True
448 primop NewByteArrayOp_Int "newIntArray#" GenPrimOp
449 Int# -> State# s -> (# State# s, MutByteArr# s #)
450 with out_of_line = True
452 primop NewByteArrayOp_Word "newWordArray#" GenPrimOp
453 Int# -> State# s -> (# State# s, MutByteArr# s #)
454 with out_of_line = True
456 primop NewByteArrayOp_Addr "newAddrArray#" GenPrimOp
457 Int# -> State# s -> (# State# s, MutByteArr# s #)
458 with out_of_line = True
460 primop NewByteArrayOp_Float "newFloatArray#" GenPrimOp
461 Int# -> State# s -> (# State# s, MutByteArr# s #)
462 with out_of_line = True
464 primop NewByteArrayOp_Double "newDoubleArray#" GenPrimOp
465 Int# -> State# s -> (# State# s, MutByteArr# s #)
466 with out_of_line = True
468 primop NewByteArrayOp_StablePtr "newStablePtrArray#" GenPrimOp
469 Int# -> State# s -> (# State# s, MutByteArr# s #)
470 with out_of_line = True
474 primop ReadByteArrayOp_Char "readCharArray#" GenPrimOp
475 MutByteArr# s -> Int# -> State# s -> (# State# s, Char# #)
477 primop ReadByteArrayOp_Int "readIntArray#" GenPrimOp
478 MutByteArr# s -> Int# -> State# s -> (# State# s, Int# #)
480 primop ReadByteArrayOp_Word "readWordArray#" GenPrimOp
481 MutByteArr# s -> Int# -> State# s -> (# State# s, Word# #)
483 primop ReadByteArrayOp_Addr "readAddrArray#" GenPrimOp
484 MutByteArr# s -> Int# -> State# s -> (# State# s, Addr# #)
486 primop ReadByteArrayOp_Float "readFloatArray#" GenPrimOp
487 MutByteArr# s -> Int# -> State# s -> (# State# s, Float# #)
489 primop ReadByteArrayOp_Double "readDoubleArray#" GenPrimOp
490 MutByteArr# s -> Int# -> State# s -> (# State# s, Double# #)
492 primop ReadByteArrayOp_StablePtr "readStablePtrArray#" GenPrimOp
493 MutByteArr# s -> Int# -> State# s -> (# State# s, StablePtr# a #)
495 primop ReadByteArrayOp_Int64 "readInt64Array#" GenPrimOp
496 MutByteArr# s -> Int# -> State# s -> (# State# s, Int64# #)
498 primop ReadByteArrayOp_Word64 "readWord64Array#" GenPrimOp
499 MutByteArr# s -> Int# -> State# s -> (# State# s, Word64# #)
503 primop WriteByteArrayOp_Char "writeCharArray#" GenPrimOp
504 MutByteArr# s -> Int# -> Char# -> State# s -> State# s
505 with has_side_effects = True
507 primop WriteByteArrayOp_Int "writeIntArray#" GenPrimOp
508 MutByteArr# s -> Int# -> Int# -> State# s -> State# s
509 with has_side_effects = True
511 primop WriteByteArrayOp_Word "writeWordArray#" GenPrimOp
512 MutByteArr# s -> Int# -> Word# -> State# s -> State# s
513 with has_side_effects = True
515 primop WriteByteArrayOp_Addr "writeAddrArray#" GenPrimOp
516 MutByteArr# s -> Int# -> Addr# -> State# s -> State# s
517 with has_side_effects = True
519 primop WriteByteArrayOp_Float "writeFloatArray#" GenPrimOp
520 MutByteArr# s -> Int# -> Float# -> State# s -> State# s
521 with has_side_effects = True
523 primop WriteByteArrayOp_Double "writeDoubleArray#" GenPrimOp
524 MutByteArr# s -> Int# -> Double# -> State# s -> State# s
525 with has_side_effects = True
527 primop WriteByteArrayOp_StablePtr "writeStablePtrArray#" GenPrimOp
528 MutByteArr# s -> Int# -> StablePtr# a -> State# s -> State# s
529 with has_side_effects = True
531 primop WriteByteArrayOp_Int64 "writeInt64Array#" GenPrimOp
532 MutByteArr# s -> Int# -> Int64# -> State# s -> State# s
533 with has_side_effects = True
535 primop WriteByteArrayOp_Word64 "writeWord64Array#" GenPrimOp
536 MutByteArr# s -> Int# -> Word64# -> State# s -> State# s
537 with has_side_effects = True
540 primop IndexByteArrayOp_Char "indexCharArray#" GenPrimOp
541 ByteArr# -> Int# -> Char#
543 primop IndexByteArrayOp_Int "indexIntArray#" GenPrimOp
544 ByteArr# -> Int# -> Int#
546 primop IndexByteArrayOp_Word "indexWordArray#" GenPrimOp
547 ByteArr# -> Int# -> Word#
549 primop IndexByteArrayOp_Addr "indexAddrArray#" GenPrimOp
550 ByteArr# -> Int# -> Addr#
552 primop IndexByteArrayOp_Float "indexFloatArray#" GenPrimOp
553 ByteArr# -> Int# -> Float#
555 primop IndexByteArrayOp_Double "indexDoubleArray#" GenPrimOp
556 ByteArr# -> Int# -> Double#
558 primop IndexByteArrayOp_StablePtr "indexStablePtrArray#" GenPrimOp
559 ByteArr# -> Int# -> StablePtr# a
561 primop IndexByteArrayOp_Int64 "indexInt64Array#" GenPrimOp
562 ByteArr# -> Int# -> Int64#
564 primop IndexByteArrayOp_Word64 "indexWord64Array#" GenPrimOp
565 ByteArr# -> Int# -> Word64#
568 primop IndexOffAddrOp_Char "indexCharOffAddr#" GenPrimOp
569 Addr# -> Int# -> Char#
571 primop IndexOffAddrOp_Int "indexIntOffAddr#" GenPrimOp
572 Addr# -> Int# -> Int#
574 primop IndexOffAddrOp_Word "indexWordOffAddr#" GenPrimOp
575 Addr# -> Int# -> Word#
577 primop IndexOffAddrOp_Addr "indexAddrOffAddr#" GenPrimOp
578 Addr# -> Int# -> Addr#
580 primop IndexOffAddrOp_Float "indexFloatOffAddr#" GenPrimOp
581 Addr# -> Int# -> Float#
583 primop IndexOffAddrOp_Double "indexDoubleOffAddr#" GenPrimOp
584 Addr# -> Int# -> Double#
586 primop IndexOffAddrOp_StablePtr "indexStablePtrOffAddr#" GenPrimOp
587 Addr# -> Int# -> StablePtr# a
589 primop IndexOffAddrOp_Int64 "indexInt64OffAddr#" GenPrimOp
590 Addr# -> Int# -> Int64#
592 primop IndexOffAddrOp_Word64 "indexWord64OffAddr#" GenPrimOp
593 Addr# -> Int# -> Word64#
596 primop IndexOffForeignObjOp_Char "indexCharOffForeignObj#" GenPrimOp
597 ForeignObj# -> Int# -> Char#
599 primop IndexOffForeignObjOp_Int "indexIntOffForeignObj#" GenPrimOp
600 ForeignObj# -> Int# -> Int#
602 primop IndexOffForeignObjOp_Word "indexWordOffForeignObj#" GenPrimOp
603 ForeignObj# -> Int# -> Word#
605 primop IndexOffForeignObjOp_Addr "indexAddrOffForeignObj#" GenPrimOp
606 ForeignObj# -> Int# -> Addr#
608 primop IndexOffForeignObjOp_Float "indexFloatOffForeignObj#" GenPrimOp
609 ForeignObj# -> Int# -> Float#
611 primop IndexOffForeignObjOp_Double "indexDoubleOffForeignObj#" GenPrimOp
612 ForeignObj# -> Int# -> Double#
614 primop IndexOffForeignObjOp_StablePtr "indexStablePtrOffForeignObj#" GenPrimOp
615 ForeignObj# -> Int# -> StablePtr# a
617 primop IndexOffForeignObjOp_Int64 "indexInt64OffForeignObj#" GenPrimOp
618 ForeignObj# -> Int# -> Int64#
620 primop IndexOffForeignObjOp_Word64 "indexWord64OffForeignObj#" GenPrimOp
621 ForeignObj# -> Int# -> Word64#
625 primop ReadOffAddrOp_Char "readCharOffAddr#" GenPrimOp
626 Addr# -> Int# -> State# s -> (# State# s, Char# #)
628 primop ReadOffAddrOp_Int "readIntOffAddr#" GenPrimOp
629 Addr# -> Int# -> State# s -> (# State# s, Int# #)
631 primop ReadOffAddrOp_Word "readWordOffAddr#" GenPrimOp
632 Addr# -> Int# -> State# s -> (# State# s, Word# #)
634 primop ReadOffAddrOp_Addr "readAddrOffAddr#" GenPrimOp
635 Addr# -> Int# -> State# s -> (# State# s, Addr# #)
637 primop ReadOffAddrOp_Float "readFloatOffAddr#" GenPrimOp
638 Addr# -> Int# -> State# s -> (# State# s, Float# #)
640 primop ReadOffAddrOp_Double "readDoubleOffAddr#" GenPrimOp
641 Addr# -> Int# -> State# s -> (# State# s, Double# #)
643 primop ReadOffAddrOp_StablePtr "readStablePtrOffAddr#" GenPrimOp
644 Addr# -> Int# -> State# s -> (# State# s, StablePtr# a #)
646 primop ReadOffAddrOp_ForeignObj "readForeignObjOffAddr#" GenPrimOp
647 Addr# -> Int# -> State# s -> (# State# s, ForeignObj# #)
649 primop ReadOffAddrOp_Int64 "readInt64OffAddr#" GenPrimOp
650 Addr# -> Int# -> State# s -> (# State# s, Int64# #)
652 primop ReadOffAddrOp_Word64 "readWord64OffAddr#" GenPrimOp
653 Addr# -> Int# -> State# s -> (# State# s, Word64# #)
656 primop WriteOffAddrOp_Char "writeCharOffAddr#" GenPrimOp
657 Addr# -> Int# -> Char# -> State# s -> State# s
658 with has_side_effects = True
660 primop WriteOffAddrOp_Int "writeIntOffAddr#" GenPrimOp
661 Addr# -> Int# -> Int# -> State# s -> State# s
662 with has_side_effects = True
664 primop WriteOffAddrOp_Word "writeWordOffAddr#" GenPrimOp
665 Addr# -> Int# -> Word# -> State# s -> State# s
666 with has_side_effects = True
668 primop WriteOffAddrOp_Addr "writeAddrOffAddr#" GenPrimOp
669 Addr# -> Int# -> Addr# -> State# s -> State# s
670 with has_side_effects = True
672 primop WriteOffAddrOp_Float "writeFloatOffAddr#" GenPrimOp
673 Addr# -> Int# -> Float# -> State# s -> State# s
674 with has_side_effects = True
676 primop WriteOffAddrOp_Double "writeDoubleOffAddr#" GenPrimOp
677 Addr# -> Int# -> Double# -> State# s -> State# s
678 with has_side_effects = True
680 primop WriteOffAddrOp_StablePtr "writeStablePtrOffAddr#" GenPrimOp
681 Addr# -> Int# -> StablePtr# a -> State# s -> State# s
682 with has_side_effects = True
684 primop WriteOffAddrOp_ForeignObj "writeForeignObjOffAddr#" GenPrimOp
685 Addr# -> Int# -> ForeignObj# -> State# s -> State# s
686 with has_side_effects = True
688 primop WriteOffAddrOp_Int64 "writeInt64OffAddr#" GenPrimOp
689 Addr# -> Int# -> Int64# -> State# s -> State# s
690 with has_side_effects = True
692 primop WriteOffAddrOp_Word64 "writeWord64OffAddr#" GenPrimOp
693 Addr# -> Int# -> Word64# -> State# s -> State# s
694 with has_side_effects = True
698 primop NewArrayOp "newArray#" GenPrimOp
699 Int# -> a -> State# s -> (# State# s, MutArr# s a #)
701 strictness = { \ arity -> StrictnessInfo [wwPrim, wwLazy, wwPrim] False }
702 usage = { mangle NewArrayOp [mkP, mkM, mkP] mkM }
705 primop SameMutableArrayOp "sameMutableArray#" GenPrimOp
706 MutArr# s a -> MutArr# s a -> Bool
708 usage = { mangle SameMutableArrayOp [mkP, mkP] mkM }
710 primop SameMutableByteArrayOp "sameMutableByteArray#" GenPrimOp
711 MutByteArr# s -> MutByteArr# s -> Bool
713 primop ReadArrayOp "readArray#" GenPrimOp
714 MutArr# s a -> Int# -> State# s -> (# State# s, a #)
716 usage = { mangle ReadArrayOp [mkM, mkP, mkP] mkM }
718 primop WriteArrayOp "writeArray#" GenPrimOp
719 MutArr# s a -> Int# -> a -> State# s -> State# s
721 usage = { mangle WriteArrayOp [mkM, mkP, mkM, mkP] mkR }
722 strictness = { \ arity -> StrictnessInfo [wwPrim, wwPrim, wwLazy, wwPrim] False }
723 has_side_effects = True
725 primop IndexArrayOp "indexArray#" GenPrimOp
726 Array# a -> Int# -> (# a #)
728 usage = { mangle IndexArrayOp [mkM, mkP] mkM }
730 primop UnsafeFreezeArrayOp "unsafeFreezeArray#" GenPrimOp
731 MutArr# s a -> State# s -> (# State# s, Array# a #)
733 usage = { mangle UnsafeFreezeArrayOp [mkM, mkP] mkM }
734 has_side_effects = True
736 primop UnsafeFreezeByteArrayOp "unsafeFreezeByteArray#" GenPrimOp
737 MutByteArr# s -> State# s -> (# State# s, ByteArr# #)
739 has_side_effects = True
741 primop UnsafeThawArrayOp "unsafeThawArray#" GenPrimOp
742 Array# a -> State# s -> (# State# s, MutArr# s a #)
744 usage = { mangle UnsafeThawArrayOp [mkM, mkP] mkM }
747 primop SizeofByteArrayOp "sizeofByteArray#" GenPrimOp
750 primop SizeofMutableByteArrayOp "sizeofMutableByteArray#" GenPrimOp
751 MutByteArr# s -> Int#
753 ------------------------------------------------------------------------
754 --- Mutable variables ---
755 ------------------------------------------------------------------------
757 primop NewMutVarOp "newMutVar#" GenPrimOp
758 a -> State# s -> (# State# s, MutVar# s a #)
760 usage = { mangle NewMutVarOp [mkM, mkP] mkM }
761 strictness = { \ arity -> StrictnessInfo [wwLazy, wwPrim] False }
764 primop ReadMutVarOp "readMutVar#" GenPrimOp
765 MutVar# s a -> State# s -> (# State# s, a #)
767 usage = { mangle ReadMutVarOp [mkM, mkP] mkM }
769 primop WriteMutVarOp "writeMutVar#" GenPrimOp
770 MutVar# s a -> a -> State# s -> State# s
772 strictness = { \ arity -> StrictnessInfo [wwPrim, wwLazy, wwPrim] False }
773 usage = { mangle WriteMutVarOp [mkM, mkM, mkP] mkR }
774 has_side_effects = True
776 primop SameMutVarOp "sameMutVar#" GenPrimOp
777 MutVar# s a -> MutVar# s a -> Bool
779 usage = { mangle SameMutVarOp [mkP, mkP] mkM }
781 ------------------------------------------------------------------------
783 ------------------------------------------------------------------------
785 primop CatchOp "catch#" GenPrimOp
786 (State# RealWorld -> (# State# RealWorld, a #) )
787 -> (b -> State# RealWorld -> (# State# RealWorld, a #) )
789 -> (# State# RealWorld, a #)
791 strictness = { \ arity -> StrictnessInfo [wwLazy, wwLazy, wwPrim] False }
792 -- Catch is actually strict in its first argument
793 -- but we don't want to tell the strictness
794 -- analyser about that!
795 usage = { mangle CatchOp [mkM, mkM . (inFun CatchOp mkM mkM), mkP] mkM }
796 -- [mkO, mkO . (inFun mkM mkO)] mkO
797 -- might use caught action multiply
800 primop RaiseOp "raise#" GenPrimOp
803 strictness = { \ arity -> StrictnessInfo [wwLazy] True }
804 -- NB: True => result is bottom
805 usage = { mangle RaiseOp [mkM] mkM }
808 primop BlockAsyncExceptionsOp "blockAsyncExceptions#" GenPrimOp
809 (State# RealWorld -> (# State# RealWorld, a #))
810 -> (State# RealWorld -> (# State# RealWorld, a #))
812 strictness = { \ arity -> StrictnessInfo [wwLazy] False }
815 primop UnblockAsyncExceptionsOp "unblockAsyncExceptions#" GenPrimOp
816 (State# RealWorld -> (# State# RealWorld, a #))
817 -> (State# RealWorld -> (# State# RealWorld, a #))
819 strictness = { \ arity -> StrictnessInfo [wwLazy] False }
822 ------------------------------------------------------------------------
823 --- MVars (not the same as mutable variables!) ---
824 ------------------------------------------------------------------------
826 primop NewMVarOp "newMVar#" GenPrimOp
827 State# s -> (# State# s, MVar# s a #)
829 usage = { mangle NewMVarOp [mkP] mkR }
832 primop TakeMVarOp "takeMVar#" GenPrimOp
833 MVar# s a -> State# s -> (# State# s, a #)
835 usage = { mangle TakeMVarOp [mkM, mkP] mkM }
836 has_side_effects = True
839 primop PutMVarOp "putMVar#" GenPrimOp
840 MVar# s a -> a -> State# s -> State# s
842 strictness = { \ arity -> StrictnessInfo [wwPrim, wwLazy, wwPrim] False }
843 usage = { mangle PutMVarOp [mkM, mkM, mkP] mkR }
844 has_side_effects = True
847 primop SameMVarOp "sameMVar#" GenPrimOp
848 MVar# s a -> MVar# s a -> Bool
850 usage = { mangle SameMVarOp [mkP, mkP] mkM }
852 primop TryTakeMVarOp "tryTakeMVar#" GenPrimOp
853 MVar# s a -> State# s -> (# State# s, Int#, a #)
855 usage = { mangle TryTakeMVarOp [mkM, mkP] mkM }
856 has_side_effects = True
859 primop IsEmptyMVarOp "isEmptyMVar#" GenPrimOp
860 MVar# s a -> State# s -> (# State# s, Int# #)
862 usage = { mangle IsEmptyMVarOp [mkP, mkP] mkM }
865 ------------------------------------------------------------------------
866 --- delay/wait operations ---
867 ------------------------------------------------------------------------
869 primop DelayOp "delay#" GenPrimOp
870 Int# -> State# s -> State# s
873 has_side_effects = True
876 primop WaitReadOp "waitRead#" GenPrimOp
877 Int# -> State# s -> State# s
880 has_side_effects = True
883 primop WaitWriteOp "waitWrite#" GenPrimOp
884 Int# -> State# s -> State# s
887 has_side_effects = True
890 ------------------------------------------------------------------------
891 --- concurrency primitives ---
892 ------------------------------------------------------------------------
894 primop ForkOp "fork#" GenPrimOp
895 a -> State# RealWorld -> (# State# RealWorld, ThreadId# #)
897 usage = { mangle ForkOp [mkO, mkP] mkR }
898 strictness = { \ arity -> StrictnessInfo [wwLazy, wwPrim] False }
899 has_side_effects = True
902 primop KillThreadOp "killThread#" GenPrimOp
903 ThreadId# -> a -> State# RealWorld -> State# RealWorld
905 usage = { mangle KillThreadOp [mkP, mkM, mkP] mkR }
906 has_side_effects = True
909 primop YieldOp "yield#" GenPrimOp
910 State# RealWorld -> State# RealWorld
912 has_side_effects = True
915 primop MyThreadIdOp "myThreadId#" GenPrimOp
916 State# RealWorld -> (# State# RealWorld, ThreadId# #)
918 ------------------------------------------------------------------------
919 --- foreign objects ---
920 ------------------------------------------------------------------------
922 primop MkForeignObjOp "mkForeignObj#" GenPrimOp
923 Addr# -> State# RealWorld -> (# State# RealWorld, ForeignObj# #)
925 has_side_effects = True
928 primop WriteForeignObjOp "writeForeignObj#" GenPrimOp
929 ForeignObj# -> Addr# -> State# s -> State# s
931 has_side_effects = True
933 ------------------------------------------------------------------------
934 --- Bytecode objects ---
935 ------------------------------------------------------------------------
937 primop NewBCOOp "newBCO#" GenPrimOp
938 Int# -> Int# -> Int# -> a -> State# RealWorld -> (# State# RealWorld, BCO# #)
940 has_side_effects = True
943 primop WriteBCOPtrOp "writeBCOPtr#" GenPrimOp
944 BCO# -> Int# -> o -> State# RealWorld -> State# RealWorld
946 usage = { mangle WriteBCOPtrOp [mkP, mkP, mkM] mkR }
947 has_side_effects = True
949 primop WriteBCONonPtrOp "writeBCONonPtr#" GenPrimOp
950 BCO# -> Int# -> Word# -> State# RealWorld -> State# RealWorld
952 has_side_effects = True
954 primop WriteBCOInstrOp "writeBCOInstr#" GenPrimOp
955 BCO# -> Int# -> Word# -> State# RealWorld -> State# RealWorld
957 has_side_effects = True
959 primop ReadBCOPtrOp "readBCOPtr#" GenPrimOp
960 BCO# -> Int# -> State# RealWorld -> (# State# RealWorld, Word# #)
962 usage = { mangle ReadBCOPtrOp [mkP, mkP] mkM }
964 primop ReadBCONonPtrOp "readBCONonPtr#" GenPrimOp
965 BCO# -> Int# -> State# RealWorld -> (# State# RealWorld, Word# #)
967 primop ReadBCOInstrOp "readBCOInstr#" GenPrimOp
968 BCO# -> Int# -> State# RealWorld -> (# State# RealWorld, Word# #)
970 ------------------------------------------------------------------------
971 --- Weak pointers ---
972 ------------------------------------------------------------------------
974 -- note that tyvar "o" denoted openAlphaTyVar
976 primop MkWeakOp "mkWeak#" GenPrimOp
977 o -> b -> c -> State# RealWorld -> (# State# RealWorld, Weak# b #)
979 strictness = { \ arity -> StrictnessInfo [wwLazy, wwLazy, wwLazy, wwPrim] False }
980 usage = { mangle MkWeakOp [mkZ, mkM, mkM, mkP] mkM }
981 has_side_effects = True
984 primop DeRefWeakOp "deRefWeak#" GenPrimOp
985 Weak# a -> State# RealWorld -> (# State# RealWorld, Int#, a #)
987 usage = { mangle DeRefWeakOp [mkM, mkP] mkM }
988 has_side_effects = True
990 primop FinalizeWeakOp "finalizeWeak#" GenPrimOp
991 Weak# a -> State# RealWorld -> (# State# RealWorld, Int#,
992 (State# RealWorld -> (# State# RealWorld, Unit #)) #)
994 usage = { mangle FinalizeWeakOp [mkM, mkP]
995 (mkR . (inUB FinalizeWeakOp
996 [id,id,inFun FinalizeWeakOp mkR mkM])) }
997 has_side_effects = True
1001 ------------------------------------------------------------------------
1002 --- Stable pointers and names ---
1003 ------------------------------------------------------------------------
1005 primop MakeStablePtrOp "makeStablePtr#" GenPrimOp
1006 a -> State# RealWorld -> (# State# RealWorld, StablePtr# a #)
1008 strictness = { \ arity -> StrictnessInfo [wwLazy, wwPrim] False }
1009 usage = { mangle MakeStablePtrOp [mkM, mkP] mkM }
1010 has_side_effects = True
1012 primop DeRefStablePtrOp "deRefStablePtr#" GenPrimOp
1013 StablePtr# a -> State# RealWorld -> (# State# RealWorld, a #)
1015 usage = { mangle DeRefStablePtrOp [mkM, mkP] mkM }
1016 needs_wrapper = True
1017 has_side_effects = True
1019 primop EqStablePtrOp "eqStablePtr#" GenPrimOp
1020 StablePtr# a -> StablePtr# a -> Int#
1022 usage = { mangle EqStablePtrOp [mkP, mkP] mkR }
1023 has_side_effects = True
1025 primop MakeStableNameOp "makeStableName#" GenPrimOp
1026 a -> State# RealWorld -> (# State# RealWorld, StableName# a #)
1028 usage = { mangle MakeStableNameOp [mkZ, mkP] mkR }
1029 strictness = { \ arity -> StrictnessInfo [wwLazy, wwPrim] False }
1030 needs_wrapper = True
1031 has_side_effects = True
1034 primop EqStableNameOp "eqStableName#" GenPrimOp
1035 StableName# a -> StableName# a -> Int#
1037 usage = { mangle EqStableNameOp [mkP, mkP] mkR }
1039 primop StableNameToIntOp "stableNameToInt#" GenPrimOp
1040 StableName# a -> Int#
1042 usage = { mangle StableNameToIntOp [mkP] mkR }
1044 ------------------------------------------------------------------------
1045 --- Unsafe pointer equality (#1 Bad Guy: Alistair Reid :) ---
1046 ------------------------------------------------------------------------
1048 primop ReallyUnsafePtrEqualityOp "reallyUnsafePtrEquality#" GenPrimOp
1051 usage = { mangle ReallyUnsafePtrEqualityOp [mkZ, mkZ] mkR }
1053 ------------------------------------------------------------------------
1055 ------------------------------------------------------------------------
1057 primop SeqOp "seq#" GenPrimOp
1060 usage = { mangle SeqOp [mkO] mkR }
1061 strictness = { \ arity -> StrictnessInfo [wwStrict] False }
1062 -- Seq is strict in its argument; see notes in ConFold.lhs
1063 has_side_effects = True
1065 primop ParOp "par#" GenPrimOp
1068 usage = { mangle ParOp [mkO] mkR }
1069 strictness = { \ arity -> StrictnessInfo [wwLazy] False }
1070 -- Note that Par is lazy to avoid that the sparked thing
1071 -- gets evaluted strictly, which it should *not* be
1072 has_side_effects = True
1074 -- HWL: The first 4 Int# in all par... annotations denote:
1075 -- name, granularity info, size of result, degree of parallelism
1076 -- Same structure as _seq_ i.e. returns Int#
1077 -- KSW: v, the second arg in parAt# and parAtForNow#, is used only to determine
1078 -- `the processor containing the expression v'; it is not evaluated
1080 primop ParGlobalOp "parGlobal#" GenPrimOp
1081 a -> Int# -> Int# -> Int# -> Int# -> b -> Int#
1083 usage = { mangle ParGlobalOp [mkO, mkP, mkP, mkP, mkP, mkM] mkM }
1084 has_side_effects = True
1086 primop ParLocalOp "parLocal#" GenPrimOp
1087 a -> Int# -> Int# -> Int# -> Int# -> b -> Int#
1089 usage = { mangle ParLocalOp [mkO, mkP, mkP, mkP, mkP, mkM] mkM }
1090 has_side_effects = True
1092 primop ParAtOp "parAt#" GenPrimOp
1093 b -> a -> Int# -> Int# -> Int# -> Int# -> c -> Int#
1095 usage = { mangle ParAtOp [mkO, mkZ, mkP, mkP, mkP, mkP, mkM] mkM }
1096 has_side_effects = True
1098 primop ParAtAbsOp "parAtAbs#" GenPrimOp
1099 a -> Int# -> Int# -> Int# -> Int# -> Int# -> b -> Int#
1101 usage = { mangle ParAtAbsOp [mkO, mkP, mkP, mkP, mkP, mkM] mkM }
1102 has_side_effects = True
1104 primop ParAtRelOp "parAtRel#" GenPrimOp
1105 a -> Int# -> Int# -> Int# -> Int# -> Int# -> b -> Int#
1107 usage = { mangle ParAtRelOp [mkO, mkP, mkP, mkP, mkP, mkM] mkM }
1108 has_side_effects = True
1110 primop ParAtForNowOp "parAtForNow#" GenPrimOp
1111 b -> a -> Int# -> Int# -> Int# -> Int# -> c -> Int#
1113 usage = { mangle ParAtForNowOp [mkO, mkZ, mkP, mkP, mkP, mkP, mkM] mkM }
1114 has_side_effects = True
1116 primop CopyableOp "copyable#" GenPrimOp
1119 usage = { mangle CopyableOp [mkZ] mkR }
1120 has_side_effects = True
1122 primop NoFollowOp "noFollow#" GenPrimOp
1125 usage = { mangle NoFollowOp [mkZ] mkR }
1126 has_side_effects = True
1129 ------------------------------------------------------------------------
1130 --- tag to enum stuff ---
1131 ------------------------------------------------------------------------
1133 primop DataToTagOp "dataToTag#" GenPrimOp
1136 strictness = { \ arity -> StrictnessInfo [wwLazy] False }
1138 primop TagToEnumOp "tagToEnum#" GenPrimOp
1144 ------------------------------------------------------------------------
1146 ------------------------------------------------------------------------