From: simonmar Date: Mon, 21 Aug 2000 13:34:06 +0000 (+0000) Subject: [project @ 2000-08-21 13:34:06 by simonmar] X-Git-Tag: Approximately_9120_patches~3853 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=2d60ede8c29f55e004af7eea08b7c335037fdacd;p=ghc-hetmet.git [project @ 2000-08-21 13:34:06 by simonmar] - Add touch# and foreignObjToAddr#. - Add a long comment to the beginning of this file listing the files that need to be updated when adding a new primop. --- diff --git a/ghc/compiler/prelude/primops.txt b/ghc/compiler/prelude/primops.txt index 64e7864..8e505c8 100644 --- a/ghc/compiler/prelude/primops.txt +++ b/ghc/compiler/prelude/primops.txt @@ -1,3 +1,29 @@ +----------------------------------------------------------------------- +-- $Id: primops.txt,v 1.2 2000/08/21 13:34:06 simonmar Exp $ +-- +-- Primitive Operations +-- +----------------------------------------------------------------------- + +-- To add a new primop, you currently need to update the following files: +-- +-- - this file (ghc/compiler/prelude/primops.txt), which includes +-- the type of the primop, and various other properties (its +-- 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 +-- +-- - or, for an out-of-line primop: +-- ghc/includes/PrimOps.h (just add the declaration) +-- ghc/rts/PrimOps.hc (define it here) +-- +-- - the User's Guide +-- -- The default attribute values which apply if you don't specify -- other ones. Attribute values can be True, False, or arbitrary @@ -15,7 +41,6 @@ defaults strictness = { \ arity -> StrictnessInfo (replicate arity wwPrim) False } usage = { nomangle other } - ------------------------------------------------------------------------ --- Addr# --- ------------------------------------------------------------------------ @@ -930,6 +955,14 @@ primop WriteForeignObjOp "writeForeignObj#" GenPrimOp with has_side_effects = True +primop ForeignObjToAddrOp "foreignObjToAddr#" GenPrimOp + ForeignObj# -> Addr# + +primop TouchOp "touch#" GenPrimOp + o -> State# RealWorld -> State# RealWorld + with + strictness = { \ arity -> StrictnessInfo [wwLazy, wwPrim] False } + ------------------------------------------------------------------------ --- Bytecode objects --- ------------------------------------------------------------------------