-----------------------------------------------------------------------
--- $Id: primops.txt.pp,v 1.16 2002/02/17 13:02:44 panne Exp $
+-- $Id: primops.txt.pp,v 1.21 2002/06/26 08:18:38 stolz Exp $
--
-- Primitive Operations
--
-- strictness attributes, whether it is defined as a macro
-- or as out-of-line code, etc.)
--
--- - ghc/lib/std/PrelGHC.hi-boot, to declare the primop
---
-- - if the primop is inline (i.e. a macro), then:
--- ghc/includes/PrimOps.h
--- ghc/compiler/nativeGen/StixPrim.lhs
--- ghc/compiler/nativeGen/MachCode.lhs (if implementation is machine-dependent)
+-- ghc/compiler/AbsCUtils.lhs (dscCOpStmt)
+-- defines the translation of the primop into simpler
+-- abstract C operations.
--
-- - or, for an out-of-line primop:
-- ghc/includes/PrimOps.h (just add the declaration)
-- ghc/rts/PrimOps.hc (define it here)
+-- ghc/rts/Linker.c (declare the symbol for GHCi)
--
-- - the User's Guide
--
has_side_effects = True
out_of_line = True
+primop ForkProcessOp "forkProcess#" GenPrimOp
+ State# RealWorld -> (# State# RealWorld, Int# #)
+ with
+ has_side_effects = True
+ out_of_line = True
+
primop KillThreadOp "killThread#" GenPrimOp
ThreadId# -> a -> State# RealWorld -> State# RealWorld
with
with
out_of_line = True
+primop LabelThreadOp "labelThread#" GenPrimOp
+ ThreadId# -> Addr# -> State# RealWorld -> State# RealWorld
+ with
+ has_side_effects = True
+ out_of_line = True
+
------------------------------------------------------------------------
section "Weak pointers"
------------------------------------------------------------------------
usage = { mangle StableNameToIntOp [mkP] mkR }
------------------------------------------------------------------------
-section "Parallelism"
+section "Unsafe pointer equality"
+-- (#1 Bad Guy: Alistair Reid :)
------------------------------------------------------------------------
-primop SeqOp "seq#" GenPrimOp
- a -> Int#
+primop ReallyUnsafePtrEqualityOp "reallyUnsafePtrEquality#" GenPrimOp
+ a -> a -> Int#
with
- usage = { mangle SeqOp [mkO] mkR }
- strictness = { \ arity -> mkStrictSig (mkTopDmdType [evalDmd] TopRes) }
- -- Seq is strict in its argument; see notes in ConFold.lhs
- has_side_effects = True
+ usage = { mangle ReallyUnsafePtrEqualityOp [mkZ, mkZ] mkR }
+
+------------------------------------------------------------------------
+section "Parallelism"
+------------------------------------------------------------------------
primop ParOp "par#" GenPrimOp
a -> Int#