[project @ 2000-08-07 14:11:48 by sewardj]
[ghc-hetmet.git] / ghc / compiler / prelude / primops.txt
1
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.
8
9 defaults
10    has_side_effects = False
11    out_of_line      = False
12    commutable       = False
13    needs_wrapper    = False
14    can_fail         = False
15    strictness       = { \ arity -> StrictnessInfo (replicate arity wwPrim) False }
16    usage            = { nomangle other }
17
18
19 ------------------------------------------------------------------------
20 --- Addr#                                                            ---
21 ------------------------------------------------------------------------
22
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
29
30 primop   Addr2IntOp  "addr2Int#"     GenPrimOp   Addr# -> Int#
31
32 primop   Addr2IntegerOp  "addr2Integer#" GenPrimOp   
33    Addr# -> (# Int#, ByteArr# #)
34    with out_of_line = True
35
36
37 ------------------------------------------------------------------------
38 --- Char#                                                            ---
39 ------------------------------------------------------------------------
40
41 primop   CharGtOp  "gtChar#"   Compare   Char# -> Char# -> Bool
42 primop   CharGeOp  "geChar#"   Compare   Char# -> Char# -> Bool
43
44 primop   CharEqOp  "eqChar#"   Compare
45    Char# -> Char# -> Bool
46    with commutable = True
47
48 primop   CharNeOp  "neChar#"   Compare
49    Char# -> Char# -> Bool
50    with commutable = True
51
52 primop   CharLtOp  "ltChar#"   Compare   Char# -> Char# -> Bool
53 primop   CharLeOp  "leChar#"   Compare   Char# -> Char# -> Bool
54
55 primop   OrdOp   "ord#"  GenPrimOp   Char# -> Int#
56
57 ------------------------------------------------------------------------
58 --- Double#                                                          ---
59 ------------------------------------------------------------------------
60
61 primop   DoubleGtOp ">##"   Compare   Double# -> Double# -> Bool
62 primop   DoubleGeOp ">=##"   Compare   Double# -> Double# -> Bool
63
64 primop DoubleEqOp "==##"   Compare
65    Double# -> Double# -> Bool
66    with commutable = True
67
68 primop DoubleNeOp "/=##"   Compare
69    Double# -> Double# -> Bool
70    with commutable = True
71
72 primop   DoubleLtOp "<##"   Compare   Double# -> Double# -> Bool
73 primop   DoubleLeOp "<=##"   Compare   Double# -> Double# -> Bool
74
75 primop   DoubleAddOp   "+##"   Dyadic
76    Double# -> Double# -> Double#
77    with commutable = True
78
79 primop   DoubleSubOp   "-##"   Dyadic   Double# -> Double# -> Double#
80
81 primop   DoubleMulOp   "*##"   Dyadic
82    Double# -> Double# -> Double#
83    with commutable = True
84
85 primop   DoubleDivOp   "/##"   Dyadic
86    Double# -> Double# -> Double#
87    with can_fail = True
88
89 primop   DoubleNegOp   "negateDouble#"  Monadic   Double# -> Double#
90
91 primop   Double2IntOp   "double2Int#"          GenPrimOp  Double# -> Int#
92 primop   Double2FloatOp   "double2Float#" GenPrimOp Double# -> Float#
93
94 primop   DoubleExpOp   "expDouble#"      Monadic
95    Double# -> Double#
96    with needs_wrapper = True
97
98 primop   DoubleLogOp   "logDouble#"      Monadic         
99    Double# -> Double#
100    with
101    needs_wrapper = True
102    can_fail = True
103
104 primop   DoubleSqrtOp   "sqrtDouble#"      Monadic  
105    Double# -> Double#
106    with needs_wrapper = True
107
108 primop   DoubleSinOp   "sinDouble#"      Monadic          
109    Double# -> Double#
110    with needs_wrapper = True
111
112 primop   DoubleCosOp   "cosDouble#"      Monadic          
113    Double# -> Double#
114    with needs_wrapper = True
115
116 primop   DoubleTanOp   "tanDouble#"      Monadic          
117    Double# -> Double#
118    with needs_wrapper = True
119
120 primop   DoubleAsinOp   "asinDouble#"      Monadic 
121    Double# -> Double#
122    with
123    needs_wrapper = True
124    can_fail = True
125
126 primop   DoubleAcosOp   "acosDouble#"      Monadic  
127    Double# -> Double#
128    with
129    needs_wrapper = True
130    can_fail = True
131
132 primop   DoubleAtanOp   "atanDouble#"      Monadic  
133    Double# -> Double#
134    with
135    needs_wrapper = True
136
137 primop   DoubleSinhOp   "sinhDouble#"      Monadic  
138    Double# -> Double#
139    with needs_wrapper = True
140
141 primop   DoubleCoshOp   "coshDouble#"      Monadic  
142    Double# -> Double#
143    with needs_wrapper = True
144
145 primop   DoubleTanhOp   "tanhDouble#"      Monadic  
146    Double# -> Double#
147    with needs_wrapper = True
148
149 primop   DoublePowerOp   "**##" Dyadic  
150    Double# -> Double# -> Double#
151    with needs_wrapper = True
152
153 primop   DoubleDecodeOp   "decodeDouble#" GenPrimOp    
154    Double# -> (# Int#, Int#, ByteArr# #)
155    with out_of_line = True
156
157 ------------------------------------------------------------------------
158 --- Float#                                                            ---
159 ------------------------------------------------------------------------
160
161 primop   FloatGtOp  "gtFloat#"   Compare   Float# -> Float# -> Bool
162 primop   FloatGeOp  "geFloat#"   Compare   Float# -> Float# -> Bool
163
164 primop   FloatEqOp  "eqFloat#"   Compare
165    Float# -> Float# -> Bool
166    with commutable = True
167
168 primop   FloatNeOp  "neFloat#"   Compare
169    Float# -> Float# -> Bool
170    with commutable = True
171
172 primop   FloatLtOp  "ltFloat#"   Compare   Float# -> Float# -> Bool
173 primop   FloatLeOp  "leFloat#"   Compare   Float# -> Float# -> Bool
174
175 primop   FloatAddOp   "plusFloat#"      Dyadic            
176    Float# -> Float# -> Float#
177    with commutable = True
178
179 primop   FloatSubOp   "minusFloat#"      Dyadic      Float# -> Float# -> Float#
180
181 primop   FloatMulOp   "timesFloat#"      Dyadic    
182    Float# -> Float# -> Float#
183    with commutable = True
184
185 primop   FloatDivOp   "divideFloat#"      Dyadic  
186    Float# -> Float# -> Float#
187    with can_fail = True
188
189 primop   FloatNegOp   "negateFloat#"      Monadic    Float# -> Float#
190
191 primop   Float2IntOp   "float2Int#"      GenPrimOp  Float# -> Int#
192
193 primop   FloatExpOp   "expFloat#"      Monadic          
194    Float# -> Float#
195    with needs_wrapper = True
196
197 primop   FloatLogOp   "logFloat#"      Monadic          
198    Float# -> Float#
199    with needs_wrapper = True
200         can_fail = True
201
202 primop   FloatSqrtOp   "sqrtFloat#"      Monadic          
203    Float# -> Float#
204    with needs_wrapper = True
205
206 primop   FloatSinOp   "sinFloat#"      Monadic          
207    Float# -> Float#
208    with needs_wrapper = True
209
210 primop   FloatCosOp   "cosFloat#"      Monadic          
211    Float# -> Float#
212    with needs_wrapper = True
213
214 primop   FloatTanOp   "tanFloat#"      Monadic          
215    Float# -> Float#
216    with needs_wrapper = True
217
218 primop   FloatAsinOp   "asinFloat#"      Monadic          
219    Float# -> Float#
220    with needs_wrapper = True
221         can_fail = True
222
223 primop   FloatAcosOp   "acosFloat#"      Monadic          
224    Float# -> Float#
225    with needs_wrapper = True
226         can_fail = True
227
228 primop   FloatAtanOp   "atanFloat#"      Monadic          
229    Float# -> Float#
230    with needs_wrapper = True
231
232 primop   FloatSinhOp   "sinhFloat#"      Monadic          
233    Float# -> Float#
234    with needs_wrapper = True
235
236 primop   FloatCoshOp   "coshFloat#"      Monadic          
237    Float# -> Float#
238    with needs_wrapper = True
239
240 primop   FloatTanhOp   "tanhFloat#"      Monadic          
241    Float# -> Float#
242    with needs_wrapper = True
243
244 primop   FloatPowerOp   "powerFloat#"      Dyadic   
245    Float# -> Float# -> Float#
246    with needs_wrapper = True
247
248 primop   Float2DoubleOp   "float2Double#" GenPrimOp  Float# -> Double#
249
250 primop   FloatDecodeOp   "decodeFloat#" GenPrimOp
251    Float# -> (# Int#, Int#, ByteArr# #)
252    with out_of_line = True
253
254 ------------------------------------------------------------------------
255 --- Int#                                                             ---
256 ------------------------------------------------------------------------
257
258 primop   IntAddOp    "+#"    Dyadic
259    Int# -> Int# -> Int#
260    with commutable = True
261
262 primop   IntSubOp    "-#"    Dyadic   Int# -> Int# -> Int#
263
264 primop   IntMulOp    "*#" 
265    Dyadic   Int# -> Int# -> Int#
266    with commutable = True
267
268 primop   IntQuotOp    "quotInt#"    Dyadic
269    Int# -> Int# -> Int#
270    with can_fail = True
271
272 primop   IntRemOp    "remInt#"    Dyadic
273    Int# -> Int# -> Int#
274    with can_fail = True
275
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
283
284 primop   IntEqOp  "==#"   Compare
285    Int# -> Int# -> Bool
286    with commutable = True
287
288 primop   IntNeOp  "/=#"   Compare
289    Int# -> Int# -> Bool
290    with commutable = True
291
292 primop   IntLtOp  "<#"   Compare   Int# -> Int# -> Bool
293 primop   IntLeOp  "<=#"   Compare   Int# -> Int# -> Bool
294
295 primop   ChrOp   "chr#"   GenPrimOp   Int# -> Char#
296
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#
301
302 primop   Int2IntegerOp    "int2Integer#"
303    GenPrimOp Int# -> (# Int#, ByteArr# #)
304    with out_of_line = True
305
306 primop   ISllOp   "iShiftL#" GenPrimOp  Int# -> Int# -> Int#
307 primop   ISraOp   "iShiftRA#" GenPrimOp Int# -> Int# -> Int#
308 primop   ISrlOp   "iShiftRL#" GenPrimOp Int# -> Int# -> Int#
309
310 ------------------------------------------------------------------------
311 --- Int64#                                                           ---
312 ------------------------------------------------------------------------
313
314 primop   Int64ToIntegerOp   "int64ToInteger#" GenPrimOp 
315    Int64# -> (# Int#, ByteArr# #)
316    with out_of_line = True
317
318
319 ------------------------------------------------------------------------
320 --- Integer#                                                         ---
321 ------------------------------------------------------------------------
322
323 primop   IntegerNegOp   "negateInteger#" GenPrimOp    
324    Int# -> ByteArr# -> (# Int#, ByteArr# #)
325
326 primop   IntegerAddOp   "plusInteger#" GenPrimOp   
327    Int# -> ByteArr# -> Int# -> ByteArr# -> (# Int#, ByteArr# #)
328    with commutable = True
329         out_of_line = True
330
331 primop   IntegerSubOp   "minusInteger#" GenPrimOp  
332    Int# -> ByteArr# -> Int# -> ByteArr# -> (# Int#, ByteArr# #)
333    with out_of_line = True
334
335 primop   IntegerMulOp   "timesInteger#" GenPrimOp   
336    Int# -> ByteArr# -> Int# -> ByteArr# -> (# Int#, ByteArr# #)
337    with commutable = True
338         out_of_line = True
339
340 primop   IntegerGcdOp   "gcdInteger#" GenPrimOp    
341    Int# -> ByteArr# -> Int# -> ByteArr# -> (# Int#, ByteArr# #)
342    with commutable = True
343         out_of_line = True
344
345 primop   IntegerIntGcdOp   "gcdIntegerInt#" GenPrimOp
346    Int# -> ByteArr# -> Int# -> Int#
347    with commutable = True
348
349 primop   IntegerDivExactOp   "divExactInteger#" GenPrimOp
350    Int# -> ByteArr# -> Int# -> ByteArr# -> (# Int#, ByteArr# #)
351    with out_of_line = True
352
353 primop   IntegerQuotOp   "quotInteger#" GenPrimOp
354    Int# -> ByteArr# -> Int# -> ByteArr# -> (# Int#, ByteArr# #)
355    with out_of_line = True
356
357 primop   IntegerRemOp   "remInteger#" GenPrimOp
358    Int# -> ByteArr# -> Int# -> ByteArr# -> (# Int#, ByteArr# #)
359    with out_of_line = True
360
361 primop   IntegerCmpOp   "cmpInteger#"   GenPrimOp  
362    Int# -> ByteArr# -> Int# -> ByteArr# -> Int#
363    with needs_wrapper = True
364
365 primop   IntegerCmpIntOp   "cmpIntegerInt#" GenPrimOp
366    Int# -> ByteArr# -> Int# -> Int#
367    with needs_wrapper = True
368
369 primop   IntegerQuotRemOp   "quotRemInteger#" GenPrimOp
370    Int# -> ByteArr# -> Int# -> ByteArr# -> (# Int#, ByteArr#, Int#, ByteArr# #)
371    with can_fail = True
372         out_of_line = True
373
374 primop   IntegerDivModOp    "divModInteger#"  GenPrimOp
375    Int# -> ByteArr# -> Int# -> ByteArr# -> (# Int#, ByteArr#, Int#, ByteArr# #)
376    with can_fail = True
377         out_of_line = True
378
379 primop   Integer2IntOp   "integer2Int#"    GenPrimOp
380    Int# -> ByteArr# -> Int#
381    with needs_wrapper = True
382
383 primop   Integer2WordOp   "integer2Word#"   GenPrimOp
384    Int# -> ByteArr# -> Word#
385    with needs_wrapper = True
386
387 primop   IntegerToInt64Op   "integerToInt64#" GenPrimOp
388    Int# -> ByteArr# -> Int64#
389
390 primop   IntegerToWord64Op   "integerToWord64#" GenPrimOp
391    Int# -> ByteArr# -> Word64#
392
393 ------------------------------------------------------------------------
394 --- Word#                                                            ---
395 ------------------------------------------------------------------------
396
397 primop   WordQuotOp   "quotWord#" Dyadic  Word# -> Word# -> Word#
398 primop   WordRemOp   "remWord#" Dyadic          Word# -> Word# -> Word#
399
400 primop   AndOp   "and#"  Dyadic      
401    Word# -> Word# -> Word#
402    with commutable = True
403
404 primop   OrOp   "or#"          Dyadic      
405    Word# -> Word# -> Word#
406    with commutable = True
407
408 primop   XorOp   "xor#"  Dyadic      
409    Word# -> Word# -> Word#
410    with commutable = True
411
412 primop   NotOp   "not#"  Monadic        Word# -> Word#
413
414 primop   SllOp   "shiftL#" GenPrimOp  Word# -> Int# -> Word#
415 primop   SrlOp   "shiftRL#" GenPrimOp Word# -> Int# -> Word#
416
417
418 primop   Word2IntOp "word2Int#" GenPrimOp Word# -> Int#
419
420 primop   Word2IntegerOp   "word2Integer#" GenPrimOp 
421    Word# -> (# Int#, ByteArr# #)
422    with out_of_line = True
423
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
430
431 ------------------------------------------------------------------------
432 --- Word64#                                                          ---
433 ------------------------------------------------------------------------
434
435 primop   Word64ToIntegerOp   "word64ToInteger#" GenPrimOp
436    Word64# -> (# Int#, ByteArr# #)
437    with out_of_line = True
438
439
440 ------------------------------------------------------------------------
441 --- Arrays                                                           ---
442 ------------------------------------------------------------------------
443
444 primop  NewByteArrayOp_Char "newCharArray#" GenPrimOp
445    Int# -> State# s -> (# State# s, MutByteArr# s #)
446    with out_of_line = True
447
448 primop  NewByteArrayOp_Int "newIntArray#" GenPrimOp
449    Int# -> State# s -> (# State# s, MutByteArr# s #)
450    with out_of_line = True
451
452 primop  NewByteArrayOp_Word "newWordArray#" GenPrimOp
453    Int# -> State# s -> (# State# s, MutByteArr# s #)
454    with out_of_line = True
455
456 primop  NewByteArrayOp_Addr "newAddrArray#" GenPrimOp
457    Int# -> State# s -> (# State# s, MutByteArr# s #)
458    with out_of_line = True
459
460 primop  NewByteArrayOp_Float "newFloatArray#" GenPrimOp
461    Int# -> State# s -> (# State# s, MutByteArr# s #)
462    with out_of_line = True
463
464 primop  NewByteArrayOp_Double "newDoubleArray#" GenPrimOp
465    Int# -> State# s -> (# State# s, MutByteArr# s #)
466    with out_of_line = True
467
468 primop  NewByteArrayOp_StablePtr "newStablePtrArray#" GenPrimOp
469    Int# -> State# s -> (# State# s, MutByteArr# s #)
470    with out_of_line = True
471
472
473
474 primop  ReadByteArrayOp_Char "readCharArray#" GenPrimOp
475    MutByteArr# s -> Int# -> State# s -> (# State# s, Char# #)
476
477 primop  ReadByteArrayOp_Int "readIntArray#" GenPrimOp
478    MutByteArr# s -> Int# -> State# s -> (# State# s, Int# #)
479
480 primop  ReadByteArrayOp_Word "readWordArray#" GenPrimOp
481    MutByteArr# s -> Int# -> State# s -> (# State# s, Word# #)
482
483 primop  ReadByteArrayOp_Addr "readAddrArray#" GenPrimOp
484    MutByteArr# s -> Int# -> State# s -> (# State# s, Addr# #)
485
486 primop  ReadByteArrayOp_Float "readFloatArray#" GenPrimOp
487    MutByteArr# s -> Int# -> State# s -> (# State# s, Float# #)
488
489 primop  ReadByteArrayOp_Double "readDoubleArray#" GenPrimOp
490    MutByteArr# s -> Int# -> State# s -> (# State# s, Double# #)
491
492 primop  ReadByteArrayOp_StablePtr "readStablePtrArray#" GenPrimOp
493    MutByteArr# s -> Int# -> State# s -> (# State# s, StablePtr# a #)
494
495 primop  ReadByteArrayOp_Int64 "readInt64Array#" GenPrimOp
496    MutByteArr# s -> Int# -> State# s -> (# State# s, Int64# #)
497
498 primop  ReadByteArrayOp_Word64 "readWord64Array#" GenPrimOp
499    MutByteArr# s -> Int# -> State# s -> (# State# s, Word64# #)
500
501
502
503 primop  WriteByteArrayOp_Char "writeCharArray#" GenPrimOp
504    MutByteArr# s -> Int# -> Char# -> State# s -> State# s
505    with has_side_effects = True
506
507 primop  WriteByteArrayOp_Int "writeIntArray#" GenPrimOp
508    MutByteArr# s -> Int# -> Int# -> State# s -> State# s
509    with has_side_effects = True
510
511 primop  WriteByteArrayOp_Word "writeWordArray#" GenPrimOp
512    MutByteArr# s -> Int# -> Word# -> State# s -> State# s
513    with has_side_effects = True
514
515 primop  WriteByteArrayOp_Addr "writeAddrArray#" GenPrimOp
516    MutByteArr# s -> Int# -> Addr# -> State# s -> State# s
517    with has_side_effects = True
518
519 primop  WriteByteArrayOp_Float "writeFloatArray#" GenPrimOp
520    MutByteArr# s -> Int# -> Float# -> State# s -> State# s
521    with has_side_effects = True
522
523 primop  WriteByteArrayOp_Double "writeDoubleArray#" GenPrimOp
524    MutByteArr# s -> Int# -> Double# -> State# s -> State# s
525    with has_side_effects = True
526
527 primop  WriteByteArrayOp_StablePtr "writeStablePtrArray#" GenPrimOp
528    MutByteArr# s -> Int# -> StablePtr# a -> State# s -> State# s
529    with has_side_effects = True
530
531 primop  WriteByteArrayOp_Int64 "writeInt64Array#" GenPrimOp
532    MutByteArr# s -> Int# -> Int64# -> State# s -> State# s
533    with has_side_effects = True
534
535 primop  WriteByteArrayOp_Word64 "writeWord64Array#" GenPrimOp
536    MutByteArr# s -> Int# -> Word64# -> State# s -> State# s
537    with has_side_effects = True
538
539
540 primop IndexByteArrayOp_Char "indexCharArray#" GenPrimOp
541    ByteArr# -> Int# -> Char#
542
543 primop IndexByteArrayOp_Int "indexIntArray#" GenPrimOp
544    ByteArr# -> Int# -> Int#
545
546 primop IndexByteArrayOp_Word "indexWordArray#" GenPrimOp
547    ByteArr# -> Int# -> Word#
548
549 primop IndexByteArrayOp_Addr "indexAddrArray#" GenPrimOp
550    ByteArr# -> Int# -> Addr#
551
552 primop IndexByteArrayOp_Float "indexFloatArray#" GenPrimOp
553    ByteArr# -> Int# -> Float#
554
555 primop IndexByteArrayOp_Double "indexDoubleArray#" GenPrimOp
556    ByteArr# -> Int# -> Double#
557
558 primop IndexByteArrayOp_StablePtr "indexStablePtrArray#" GenPrimOp
559    ByteArr# -> Int# -> StablePtr# a
560
561 primop IndexByteArrayOp_Int64 "indexInt64Array#" GenPrimOp
562    ByteArr# -> Int# -> Int64#
563
564 primop IndexByteArrayOp_Word64 "indexWord64Array#" GenPrimOp
565    ByteArr# -> Int# -> Word64#
566
567
568 primop IndexOffAddrOp_Char "indexCharOffAddr#" GenPrimOp
569    Addr# -> Int# -> Char#
570
571 primop IndexOffAddrOp_Int "indexIntOffAddr#" GenPrimOp
572    Addr# -> Int# -> Int#
573
574 primop IndexOffAddrOp_Word "indexWordOffAddr#" GenPrimOp
575    Addr# -> Int# -> Word#
576
577 primop IndexOffAddrOp_Addr "indexAddrOffAddr#" GenPrimOp
578    Addr# -> Int# -> Addr#
579
580 primop IndexOffAddrOp_Float "indexFloatOffAddr#" GenPrimOp
581    Addr# -> Int# -> Float#
582
583 primop IndexOffAddrOp_Double "indexDoubleOffAddr#" GenPrimOp
584    Addr# -> Int# -> Double#
585
586 primop IndexOffAddrOp_StablePtr "indexStablePtrOffAddr#" GenPrimOp
587    Addr# -> Int# -> StablePtr# a
588
589 primop IndexOffAddrOp_Int64 "indexInt64OffAddr#" GenPrimOp
590    Addr# -> Int# -> Int64#
591
592 primop IndexOffAddrOp_Word64 "indexWord64OffAddr#" GenPrimOp
593    Addr# -> Int# -> Word64#
594
595
596 primop IndexOffForeignObjOp_Char "indexCharOffForeignObj#" GenPrimOp
597    ForeignObj# -> Int# -> Char#
598
599 primop IndexOffForeignObjOp_Int "indexIntOffForeignObj#" GenPrimOp
600    ForeignObj# -> Int# -> Int#
601
602 primop IndexOffForeignObjOp_Word "indexWordOffForeignObj#" GenPrimOp
603    ForeignObj# -> Int# -> Word#
604
605 primop IndexOffForeignObjOp_Addr "indexAddrOffForeignObj#" GenPrimOp
606    ForeignObj# -> Int# -> Addr#
607
608 primop IndexOffForeignObjOp_Float "indexFloatOffForeignObj#" GenPrimOp
609    ForeignObj# -> Int# -> Float#
610
611 primop IndexOffForeignObjOp_Double "indexDoubleOffForeignObj#" GenPrimOp
612    ForeignObj# -> Int# -> Double#
613
614 primop IndexOffForeignObjOp_StablePtr "indexStablePtrOffForeignObj#" GenPrimOp
615    ForeignObj# -> Int# -> StablePtr# a
616
617 primop IndexOffForeignObjOp_Int64 "indexInt64OffForeignObj#" GenPrimOp
618    ForeignObj# -> Int# -> Int64#
619
620 primop IndexOffForeignObjOp_Word64 "indexWord64OffForeignObj#" GenPrimOp
621    ForeignObj# -> Int# -> Word64#
622
623
624
625 primop ReadOffAddrOp_Char "readCharOffAddr#" GenPrimOp
626    Addr# -> Int# -> State# s -> (# State# s, Char# #)
627
628 primop ReadOffAddrOp_Int "readIntOffAddr#" GenPrimOp
629    Addr# -> Int# -> State# s -> (# State# s, Int# #)
630
631 primop ReadOffAddrOp_Word "readWordOffAddr#" GenPrimOp
632    Addr# -> Int# -> State# s -> (# State# s, Word# #)
633
634 primop ReadOffAddrOp_Addr "readAddrOffAddr#" GenPrimOp
635    Addr# -> Int# -> State# s -> (# State# s, Addr# #)
636
637 primop ReadOffAddrOp_Float "readFloatOffAddr#" GenPrimOp
638    Addr# -> Int# -> State# s -> (# State# s, Float# #)
639
640 primop ReadOffAddrOp_Double "readDoubleOffAddr#" GenPrimOp
641    Addr# -> Int# -> State# s -> (# State# s, Double# #)
642
643 primop ReadOffAddrOp_StablePtr "readStablePtrOffAddr#" GenPrimOp
644    Addr# -> Int# -> State# s -> (# State# s, StablePtr# a #)
645
646 primop ReadOffAddrOp_ForeignObj "readForeignObjOffAddr#" GenPrimOp
647    Addr# -> Int# -> State# s -> (# State# s, ForeignObj# #)
648
649 primop ReadOffAddrOp_Int64 "readInt64OffAddr#" GenPrimOp
650    Addr# -> Int# -> State# s -> (# State# s, Int64# #)
651
652 primop ReadOffAddrOp_Word64 "readWord64OffAddr#" GenPrimOp
653    Addr# -> Int# -> State# s -> (# State# s, Word64# #)
654
655
656 primop  WriteOffAddrOp_Char "writeCharOffAddr#" GenPrimOp
657    Addr# -> Int# -> Char# -> State# s -> State# s
658    with has_side_effects = True
659
660 primop  WriteOffAddrOp_Int "writeIntOffAddr#" GenPrimOp
661    Addr# -> Int# -> Int# -> State# s -> State# s
662    with has_side_effects = True
663
664 primop  WriteOffAddrOp_Word "writeWordOffAddr#" GenPrimOp
665    Addr# -> Int# -> Word# -> State# s -> State# s
666    with has_side_effects = True
667
668 primop  WriteOffAddrOp_Addr "writeAddrOffAddr#" GenPrimOp
669    Addr# -> Int# -> Addr# -> State# s -> State# s
670    with has_side_effects = True
671
672 primop  WriteOffAddrOp_Float "writeFloatOffAddr#" GenPrimOp
673    Addr# -> Int# -> Float# -> State# s -> State# s
674    with has_side_effects = True
675
676 primop  WriteOffAddrOp_Double "writeDoubleOffAddr#" GenPrimOp
677    Addr# -> Int# -> Double# -> State# s -> State# s
678    with has_side_effects = True
679
680 primop  WriteOffAddrOp_StablePtr "writeStablePtrOffAddr#" GenPrimOp
681    Addr# -> Int# -> StablePtr# a -> State# s -> State# s
682    with has_side_effects = True
683
684 primop  WriteOffAddrOp_ForeignObj "writeForeignObjOffAddr#" GenPrimOp
685    Addr# -> Int# -> ForeignObj# -> State# s -> State# s
686    with has_side_effects = True
687
688 primop  WriteOffAddrOp_Int64 "writeInt64OffAddr#" GenPrimOp
689    Addr# -> Int# -> Int64# -> State# s -> State# s
690    with has_side_effects = True
691
692 primop  WriteOffAddrOp_Word64 "writeWord64OffAddr#" GenPrimOp
693    Addr# -> Int# -> Word64# -> State# s -> State# s
694    with has_side_effects = True
695
696
697
698 primop  NewArrayOp "newArray#" GenPrimOp
699    Int# -> a -> State# s -> (# State# s, MutArr# s a #)
700    with
701    strictness  = { \ arity -> StrictnessInfo [wwPrim, wwLazy, wwPrim] False }
702    usage       = { mangle NewArrayOp [mkP, mkM, mkP] mkM }
703    out_of_line = True
704
705 primop  SameMutableArrayOp "sameMutableArray#" GenPrimOp
706    MutArr# s a -> MutArr# s a -> Bool
707    with
708    usage = { mangle SameMutableArrayOp [mkP, mkP] mkM }
709
710 primop  SameMutableByteArrayOp "sameMutableByteArray#" GenPrimOp
711    MutByteArr# s -> MutByteArr# s -> Bool
712
713 primop  ReadArrayOp "readArray#" GenPrimOp
714    MutArr# s a -> Int# -> State# s -> (# State# s, a #)
715    with
716    usage = { mangle ReadArrayOp [mkM, mkP, mkP] mkM }
717
718 primop  WriteArrayOp "writeArray#" GenPrimOp
719    MutArr# s a -> Int# -> a -> State# s -> State# s
720    with
721    usage            = { mangle WriteArrayOp [mkM, mkP, mkM, mkP] mkR }
722    strictness       = { \ arity -> StrictnessInfo [wwPrim, wwPrim, wwLazy, wwPrim] False }
723    has_side_effects = True
724
725 primop  IndexArrayOp "indexArray#" GenPrimOp
726    Array# a -> Int# -> (# a #)
727    with
728    usage = { mangle  IndexArrayOp [mkM, mkP] mkM }
729
730 primop  UnsafeFreezeArrayOp "unsafeFreezeArray#" GenPrimOp
731    MutArr# s a -> State# s -> (# State# s, Array# a #)
732    with
733    usage            = { mangle UnsafeFreezeArrayOp [mkM, mkP] mkM }
734    has_side_effects = True
735
736 primop  UnsafeFreezeByteArrayOp "unsafeFreezeByteArray#" GenPrimOp
737    MutByteArr# s -> State# s -> (# State# s, ByteArr# #)
738    with
739    has_side_effects = True
740
741 primop  UnsafeThawArrayOp  "unsafeThawArray#" GenPrimOp
742    Array# a -> State# s -> (# State# s, MutArr# s a #)
743    with
744    usage       = { mangle UnsafeThawArrayOp [mkM, mkP] mkM }
745    out_of_line = True
746
747 primop  SizeofByteArrayOp "sizeofByteArray#" GenPrimOp  
748    ByteArr# -> Int#
749
750 primop  SizeofMutableByteArrayOp "sizeofMutableByteArray#" GenPrimOp
751    MutByteArr# s -> Int#
752
753 ------------------------------------------------------------------------
754 --- Mutable variables                                                ---
755 ------------------------------------------------------------------------
756
757 primop  NewMutVarOp "newMutVar#" GenPrimOp
758    a -> State# s -> (# State# s, MutVar# s a #)
759    with
760    usage       = { mangle NewMutVarOp [mkM, mkP] mkM }
761    strictness  = { \ arity -> StrictnessInfo [wwLazy, wwPrim] False }
762    out_of_line = True
763
764 primop  ReadMutVarOp "readMutVar#" GenPrimOp
765    MutVar# s a -> State# s -> (# State# s, a #)
766    with
767    usage = { mangle ReadMutVarOp [mkM, mkP] mkM }
768
769 primop  WriteMutVarOp "writeMutVar#"  GenPrimOp
770    MutVar# s a -> a -> State# s -> State# s
771    with
772    strictness       = { \ arity -> StrictnessInfo [wwPrim, wwLazy, wwPrim] False }
773    usage            = { mangle WriteMutVarOp [mkM, mkM, mkP] mkR }
774    has_side_effects = True
775
776 primop  SameMutVarOp "sameMutVar#" GenPrimOp
777    MutVar# s a -> MutVar# s a -> Bool
778    with
779    usage = { mangle SameMutVarOp [mkP, mkP] mkM }
780
781 ------------------------------------------------------------------------
782 --- Exceptions                                                       ---
783 ------------------------------------------------------------------------
784
785 primop  CatchOp "catch#" GenPrimOp
786           (State# RealWorld -> (# State# RealWorld, a #) )
787        -> (b -> State# RealWorld -> (# State# RealWorld, a #) ) 
788        -> State# RealWorld
789        -> (# State# RealWorld, a #)
790    with
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
798    out_of_line = True
799
800 primop  RaiseOp "raise#" GenPrimOp
801    a -> b
802    with
803    strictness  = { \ arity -> StrictnessInfo [wwLazy] True }
804       -- NB: True => result is bottom
805    usage       = { mangle RaiseOp [mkM] mkM }
806    out_of_line = True
807
808 primop  BlockAsyncExceptionsOp "blockAsyncExceptions#" GenPrimOp
809         (State# RealWorld -> (# State# RealWorld, a #))
810      -> (State# RealWorld -> (# State# RealWorld, a #))
811    with
812    strictness  = { \ arity -> StrictnessInfo [wwLazy] False }
813    out_of_line = True
814
815 primop  UnblockAsyncExceptionsOp "unblockAsyncExceptions#" GenPrimOp
816         (State# RealWorld -> (# State# RealWorld, a #))
817      -> (State# RealWorld -> (# State# RealWorld, a #))
818    with
819    strictness  = { \ arity -> StrictnessInfo [wwLazy] False }
820    out_of_line = True
821
822 ------------------------------------------------------------------------
823 --- MVars (not the same as mutable variables!)                       ---
824 ------------------------------------------------------------------------
825
826 primop  NewMVarOp "newMVar#"  GenPrimOp
827    State# s -> (# State# s, MVar# s a #)
828    with
829    usage       = { mangle NewMVarOp [mkP] mkR }
830    out_of_line = True
831
832 primop  TakeMVarOp "takeMVar#" GenPrimOp
833    MVar# s a -> State# s -> (# State# s, a #)
834    with
835    usage            = { mangle TakeMVarOp [mkM, mkP] mkM }
836    has_side_effects = True
837    out_of_line      = True
838
839 primop  PutMVarOp "putMVar#" GenPrimOp
840    MVar# s a -> a -> State# s -> State# s
841    with
842    strictness       = { \ arity -> StrictnessInfo [wwPrim, wwLazy, wwPrim] False }
843    usage            = { mangle PutMVarOp [mkM, mkM, mkP] mkR }
844    has_side_effects = True
845    out_of_line      = True
846
847 primop  SameMVarOp "sameMVar#" GenPrimOp
848    MVar# s a -> MVar# s a -> Bool
849    with
850    usage = { mangle SameMVarOp [mkP, mkP] mkM }
851
852 primop  TryTakeMVarOp "tryTakeMVar#" GenPrimOp
853    MVar# s a -> State# s -> (# State# s, Int#, a #)
854    with
855    usage            = { mangle TryTakeMVarOp [mkM, mkP] mkM }
856    has_side_effects = True
857    out_of_line      = True
858
859 primop  IsEmptyMVarOp "isEmptyMVar#" GenPrimOp
860    MVar# s a -> State# s -> (# State# s, Int# #)
861    with
862    usage = { mangle IsEmptyMVarOp [mkP, mkP] mkM }
863
864
865 ------------------------------------------------------------------------
866 --- delay/wait operations                                            ---
867 ------------------------------------------------------------------------
868
869 primop  DelayOp "delay#" GenPrimOp
870    Int# -> State# s -> State# s
871    with
872    needs_wrapper    = True
873    has_side_effects = True
874    out_of_line      = True
875
876 primop  WaitReadOp "waitRead#" GenPrimOp
877    Int# -> State# s -> State# s
878    with
879    needs_wrapper    = True
880    has_side_effects = True
881    out_of_line      = True
882
883 primop  WaitWriteOp "waitWrite#" GenPrimOp
884    Int# -> State# s -> State# s
885    with
886    needs_wrapper    = True
887    has_side_effects = True
888    out_of_line      = True
889
890 ------------------------------------------------------------------------
891 --- concurrency primitives                                           ---
892 ------------------------------------------------------------------------
893
894 primop  ForkOp "fork#" GenPrimOp
895    a -> State# RealWorld -> (# State# RealWorld, ThreadId# #)
896    with
897    usage            = { mangle ForkOp [mkO, mkP] mkR }
898    strictness       = { \ arity -> StrictnessInfo [wwLazy, wwPrim] False }
899    has_side_effects = True
900    out_of_line      = True
901
902 primop  KillThreadOp "killThread#"  GenPrimOp
903    ThreadId# -> a -> State# RealWorld -> State# RealWorld
904    with
905    usage            = { mangle KillThreadOp [mkP, mkM, mkP] mkR }
906    has_side_effects = True
907    out_of_line      = True
908
909 primop  YieldOp "yield#" GenPrimOp
910    State# RealWorld -> State# RealWorld
911    with
912    has_side_effects = True
913    out_of_line      = True
914
915 primop  MyThreadIdOp "myThreadId#" GenPrimOp
916     State# RealWorld -> (# State# RealWorld, ThreadId# #)
917
918 ------------------------------------------------------------------------
919 --- foreign objects                                                  ---
920 ------------------------------------------------------------------------
921
922 primop  MkForeignObjOp "mkForeignObj#" GenPrimOp
923    Addr# -> State# RealWorld -> (# State# RealWorld, ForeignObj# #)
924    with
925    has_side_effects = True
926    out_of_line      = True
927
928 primop  WriteForeignObjOp "writeForeignObj#" GenPrimOp
929    ForeignObj# -> Addr# -> State# s -> State# s
930    with
931    has_side_effects = True
932
933 ------------------------------------------------------------------------
934 --- Bytecode objects                                                 ---
935 ------------------------------------------------------------------------
936
937 primop  NewBCOOp "newBCO#" GenPrimOp
938    Int# -> Int# -> Int# -> a -> State# RealWorld -> (# State# RealWorld, BCO# #)
939    with
940    has_side_effects = True
941    out_of_line    = True
942
943 primop  WriteBCOPtrOp "writeBCOPtr#" GenPrimOp
944    BCO# -> Int# -> o -> State# RealWorld -> State# RealWorld
945    with
946    usage            = { mangle WriteBCOPtrOp [mkP, mkP, mkM] mkR }
947    has_side_effects = True
948
949 primop  WriteBCONonPtrOp "writeBCONonPtr#" GenPrimOp
950    BCO# -> Int# -> Word# -> State# RealWorld -> State# RealWorld
951    with
952    has_side_effects = True
953
954 primop  WriteBCOInstrOp "writeBCOInstr#" GenPrimOp
955    BCO# -> Int# -> Word# -> State# RealWorld -> State# RealWorld
956    with
957    has_side_effects = True
958
959 primop  ReadBCOPtrOp "readBCOPtr#"  GenPrimOp
960    BCO# -> Int# -> State# RealWorld -> (# State# RealWorld, Word# #)
961    with
962    usage = { mangle ReadBCOPtrOp [mkP, mkP] mkM }
963
964 primop  ReadBCONonPtrOp "readBCONonPtr#"  GenPrimOp
965    BCO# -> Int# -> State# RealWorld -> (# State# RealWorld, Word# #)
966
967 primop  ReadBCOInstrOp "readBCOInstr#" GenPrimOp
968    BCO# -> Int# -> State# RealWorld -> (# State# RealWorld, Word# #)
969
970 ------------------------------------------------------------------------
971 --- Weak pointers                                                    ---
972 ------------------------------------------------------------------------
973
974 -- note that tyvar "o" denoted openAlphaTyVar
975
976 primop  MkWeakOp "mkWeak#" GenPrimOp
977    o -> b -> c -> State# RealWorld -> (# State# RealWorld, Weak# b #)
978    with
979    strictness       = { \ arity -> StrictnessInfo [wwLazy, wwLazy, wwLazy, wwPrim] False }
980    usage            = { mangle MkWeakOp [mkZ, mkM, mkM, mkP] mkM }
981    has_side_effects = True
982    out_of_line      = True
983
984 primop  DeRefWeakOp "deRefWeak#" GenPrimOp
985    Weak# a -> State# RealWorld -> (# State# RealWorld, Int#, a #)
986    with
987    usage            = { mangle DeRefWeakOp [mkM, mkP] mkM }
988    has_side_effects = True
989
990 primop  FinalizeWeakOp "finalizeWeak#" GenPrimOp
991    Weak# a -> State# RealWorld -> (# State# RealWorld, Int#, 
992               (State# RealWorld -> (# State# RealWorld, Unit #)) #)
993    with
994    usage            = { mangle FinalizeWeakOp [mkM, mkP] 
995                                (mkR . (inUB FinalizeWeakOp 
996                                             [id,id,inFun FinalizeWeakOp mkR mkM])) }
997    has_side_effects = True
998    out_of_line      = True
999
1000
1001 ------------------------------------------------------------------------
1002 --- Stable pointers and names                                        ---
1003 ------------------------------------------------------------------------
1004
1005 primop  MakeStablePtrOp "makeStablePtr#" GenPrimOp
1006    a -> State# RealWorld -> (# State# RealWorld, StablePtr# a #)
1007    with
1008    strictness       = { \ arity -> StrictnessInfo [wwLazy, wwPrim] False }
1009    usage            = { mangle MakeStablePtrOp [mkM, mkP] mkM }
1010    has_side_effects = True
1011
1012 primop  DeRefStablePtrOp "deRefStablePtr#" GenPrimOp
1013    StablePtr# a -> State# RealWorld -> (# State# RealWorld, a #)
1014    with
1015    usage            = { mangle DeRefStablePtrOp [mkM, mkP] mkM }
1016    needs_wrapper    = True
1017    has_side_effects = True
1018
1019 primop  EqStablePtrOp "eqStablePtr#" GenPrimOp
1020    StablePtr# a -> StablePtr# a -> Int#
1021    with
1022    usage            = { mangle EqStablePtrOp [mkP, mkP] mkR }
1023    has_side_effects = True
1024
1025 primop  MakeStableNameOp "makeStableName#" GenPrimOp
1026    a -> State# RealWorld -> (# State# RealWorld, StableName# a #)
1027    with
1028    usage            = { mangle MakeStableNameOp [mkZ, mkP] mkR }
1029    strictness       = { \ arity -> StrictnessInfo [wwLazy, wwPrim] False }
1030    needs_wrapper    = True
1031    has_side_effects = True
1032    out_of_line      = True
1033
1034 primop  EqStableNameOp "eqStableName#" GenPrimOp
1035    StableName# a -> StableName# a -> Int#
1036    with
1037    usage = { mangle EqStableNameOp [mkP, mkP] mkR }
1038
1039 primop  StableNameToIntOp "stableNameToInt#" GenPrimOp
1040    StableName# a -> Int#
1041    with
1042    usage = { mangle StableNameToIntOp [mkP] mkR }
1043
1044 ------------------------------------------------------------------------
1045 --- Unsafe pointer equality (#1 Bad Guy: Alistair Reid :)            ---
1046 ------------------------------------------------------------------------
1047
1048 primop  ReallyUnsafePtrEqualityOp "reallyUnsafePtrEquality#" GenPrimOp
1049    a -> a -> Int#
1050    with
1051    usage = { mangle ReallyUnsafePtrEqualityOp [mkZ, mkZ] mkR }
1052
1053 ------------------------------------------------------------------------
1054 --- Parallelism                                                      ---
1055 ------------------------------------------------------------------------
1056
1057 primop  SeqOp "seq#" GenPrimOp
1058    a -> Int#
1059    with
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
1064
1065 primop  ParOp "par#" GenPrimOp
1066    a -> Int#
1067    with
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
1073
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
1079
1080 primop  ParGlobalOp  "parGlobal#"  GenPrimOp
1081    a -> Int# -> Int# -> Int# -> Int# -> b -> Int#
1082    with
1083    usage            = { mangle ParGlobalOp [mkO, mkP, mkP, mkP, mkP, mkM] mkM }
1084    has_side_effects = True
1085
1086 primop  ParLocalOp  "parLocal#"  GenPrimOp
1087    a -> Int# -> Int# -> Int# -> Int# -> b -> Int#
1088    with
1089    usage            = { mangle ParLocalOp [mkO, mkP, mkP, mkP, mkP, mkM] mkM }
1090    has_side_effects = True
1091
1092 primop  ParAtOp  "parAt#"  GenPrimOp
1093    b -> a -> Int# -> Int# -> Int# -> Int# -> c -> Int#
1094    with
1095    usage            = { mangle ParAtOp [mkO, mkZ, mkP, mkP, mkP, mkP, mkM] mkM }
1096    has_side_effects = True
1097
1098 primop  ParAtAbsOp  "parAtAbs#"  GenPrimOp
1099    a -> Int# -> Int# -> Int# -> Int# -> Int# -> b -> Int#
1100    with
1101    usage            = { mangle ParAtAbsOp [mkO, mkP, mkP, mkP, mkP, mkM] mkM }
1102    has_side_effects = True
1103
1104 primop  ParAtRelOp  "parAtRel#" GenPrimOp
1105    a -> Int# -> Int# -> Int# -> Int# -> Int# -> b -> Int#
1106    with
1107    usage            = { mangle ParAtRelOp [mkO, mkP, mkP, mkP, mkP, mkM] mkM }
1108    has_side_effects = True
1109
1110 primop  ParAtForNowOp  "parAtForNow#" GenPrimOp
1111    b -> a -> Int# -> Int# -> Int# -> Int# -> c -> Int#
1112    with
1113    usage            = { mangle ParAtForNowOp [mkO, mkZ, mkP, mkP, mkP, mkP, mkM] mkM }
1114    has_side_effects = True
1115
1116 primop  CopyableOp  "copyable#" GenPrimOp
1117    a -> Int#
1118    with
1119    usage            = { mangle CopyableOp [mkZ] mkR }
1120    has_side_effects = True
1121
1122 primop  NoFollowOp "noFollow#" GenPrimOp
1123    a -> Int#
1124    with
1125    usage            = { mangle NoFollowOp [mkZ] mkR }
1126    has_side_effects = True
1127
1128
1129 ------------------------------------------------------------------------
1130 --- tag to enum stuff                                                ---
1131 ------------------------------------------------------------------------
1132
1133 primop  DataToTagOp "dataToTag#" GenPrimOp
1134    a -> Int#
1135    with
1136    strictness = { \ arity -> StrictnessInfo [wwLazy] False }
1137
1138 primop  TagToEnumOp "tagToEnum#" GenPrimOp     
1139    Int# -> a
1140
1141
1142 thats_all_folks
1143
1144 ------------------------------------------------------------------------
1145 ---                                                                  ---
1146 ------------------------------------------------------------------------
1147