Changes between Version 12 and Version 13 of Commentary/PrimOps


Ignore:
Timestamp:
May 9, 2011 9:00:00 PM (3 years ago)
Author:
dterei
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Commentary/PrimOps

    v12 v13  
    66!PrimOps are functions that cannot be implemented in Haskell, and are provided natively by GHC.  For example, adding two {{{Int#}}} values is provided as the !PrimOp {{{+#}}}, and allocating a new mutable array is the !PrimOp {{{newArray#}}}. 
    77 
    8 PrimOps are made available to Haskell code through the virtual module {{{GHC.Prim}}}.  This module has no implementation, and its interface never resides on disk: if {{{GHC.Prim}}} is imported, we use a built-in {{{ModIface}}} value - see {{{ghcPrimIface}}} in [[GhcFile(compiler/iface/LoadIface.lhs)]]. 
     8!PrimOps are made available to Haskell code through the virtual module {{{GHC.Prim}}}.  This module has no implementation, and its interface never resides on disk: if {{{GHC.Prim}}} is imported, we use a built-in {{{ModIface}}} value - see {{{ghcPrimIface}}} in [[GhcFile(compiler/iface/LoadIface.lhs)]]. 
    99 
    1010== The primops.txt.pp file == 
     
    1414 * Its name, as it appears in Haskell code (eg. int2Integer#) 
    1515 * Its type 
    16  * The name of its constructor in GHC's {{{PrimOp}}} data type. 
     16 * The name of its constructor in GHC's {{{!PrimOp}}} data type. 
    1717 * Various properties, such as whether the operation is commutable, or has side effects. 
    1818 
     
    116116default = False 
    117117 
    118 Set to True if there is a function in PrimOps.cmm. This also changes to code generator to push the continuation 
     118Set to True if there is a function in !PrimOps.cmm. This also changes to code generator to push the continuation 
    119119of any followon code onto the stack. 
    120120 
     
    132132default = [lazyDmd, ... ] TopRes 
    133133 
    134 This is the strictness of the PrimOp. Unboxed things should be marked as lazyDmd. (Someone explain why?). 
     134This is the strictness of the !PrimOp. Unboxed things should be marked as lazyDmd. (Someone explain why?). 
    135135 
    136136=== usage === 
    137137 
    138138default = nomangle other 
    139  
    140  
    141  
    142  
    143  
    144  
    145