Changes between Version 5 and Version 6 of Commentary/PrimOps


Ignore:
Timestamp:
Sep 11, 2006 8:45:37 AM (9 years ago)
Author:
simonmar
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Commentary/PrimOps

    v5 v6  
    4747=== Inline !PrimOps ===
    4848
     49Inline !PrimOps are operations that can be compiled into a short sequence of code that never needs to allocate, block, or return to the scheduler for any reason.  An inline !PrimOp is compiled directly into [wiki:Commentary/Compiler/Cmm Cmm] by the [wiki:Commentary/Compiler/CodeGen code generator].  The code for doing this is in [[GhcFile(compiler/codeGen/CgPrimOp.hs)]].
     50
    4951=== Out-of-line !PrimOps ===
    5052
     53All other !PrimOps are classified as out-of-line, and are implemented by hand-written C-- code in the file [[GhcFile(rts/PrimOps.cmm)]].  An out-of-line !PrimOp is like a Haskell function, except that
     54
     55 * !PrimOps cannot be partially applied.  Calls to all !PrimOps are made at the correct arity; this is ensured by
     56   the [wiki:Commentary/Compiler/CorePrep CorePrep] pass.
     57
     58 * Out-of-line !PrimOps have a special, fixed, [wiki:Commentary/Rts/HaskellExecution#CallingConvention calling convention]:
     59   all arguments
     60   are in the [wiki:Commentary/Rts/HaskellExecution#Registers] registers] R1-R8.  This is to make it easy to write the
     61   C-- code for these !PrimOps: we don't have to write code for multiple calling conventions.
     62
    5163== Adding a new !PrimOp ==