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