Changes between Version 24 and Version 25 of Commentary/PrimOps


Ignore:
Timestamp:
Mar 7, 2013 11:18:28 PM (14 months ago)
Author:
ezyang
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Commentary/PrimOps

    v24 v25  
    108108  * [[GhcFile(compiler/prelude/PrelNames.lhs)]] -- add a new unique id using mkPreludeTyConUnique 
    109109 
    110   * [[GhcFile(compiler/prelude/TysPrim.lhs)]] -- there are a raft of changes here; you need to create {{{*PrimTy}}}, {{{*PrimTyCon}}} and  {{{*PrimTyConName}}} variables. The most important thing to make sure you get right is when you make a PrimTyCon, you pick the correct {{{PrimRep}} for your type.  For example, if you’ve introduced a new GC'able object, you should use {{{PtrRep}}}; however, if it's a pointer that shouldn't be GC'd, you should use {{{AddrRep}}} instead.  The full list is in [[GhcFile(compiler/types/TyCon.lhs)]] 
     110  * [[GhcFile(compiler/prelude/TysPrim.lhs)]] -- there are a raft of changes here; you need to create {{{*PrimTy}}}, {{{*PrimTyCon}}} and  {{{*PrimTyConName}}} variables. The most important thing to make sure you get right is when you make a PrimTyCon, you pick the correct {{{PrimRep}}} for your type.  For example, if you’ve introduced a new GC'able object, you should use {{{PtrRep}}}; however, if it's a pointer that shouldn't be GC'd, you should use {{{AddrRep}}} instead.  The full list is in [[GhcFile(compiler/types/TyCon.lhs)]] 
    111111 
    112112See also AddingNewPrimitiveOperations, a blow-by-blow description of the process for adding a new out-of-line primop from someone who went through the process.