Changes between Version 7 and Version 8 of Commentary/Compiler/CmmType


Ignore:
Timestamp:
Dec 7, 2006 5:07:15 AM (7 years ago)
Author:
p_tanski
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Commentary/Compiler/CmmType

    v7 v8  
    238238|| `float32` || `F_` || `StgFloat` || 
    239239|| `float64` || `D_` || `StgDouble` || 
    240  
    241240 
    242241[[GhcFile(includes/Cmm.h)]] also defines `L_` for `bits64`, so `F_`, `D_` and `L_` correspond to the `GlobalReg` data type constructors `FloatReg`, `DoubleReg` and `LongReg`.  Note that although GHC may generate other register types supported by the `MachRep` data type, such as `I128`, they are not parseable tokens.  That is, they are internal to GHC.  The special defines `CInt` and `CLong` are used for compatibility with C on the target architecture, typically for making `foreign "C"` calls. 
     
    820819The `MachOp` and `CallishMachOp` data types are defined in [[GhcFile(compiler/cmm/MachOp.hs)]]. 
    821820 
     821Both Cmm Operators and Primitive Operations are handled in Haskell as [wiki:Commentary/PrimOps#InlinePrimOps Inline PrimOps], though what I am calling Cmm ''primitive operations'' may be implemented as out-of-line foreign calls. 
     822 
    822823==== Operators ==== 
    823824{{{ 
     
    868869 
    869870==== Primitive Operations ==== 
     871Primitive Operations generally involve more than one machine instruction and may not always be inlined.   
     872 
    870873{{{ 
    871874-- These MachOps tend to be implemented by foreign calls in some backends, 
     
    902905  | MO_WriteBarrier 
    903906}}} 
     907For an example, the floating point sine function, `sinFloat#` in [[GhcFile(compiler/prelude/primops.txt.pp)]] is piped through the `callishOp` function in [[GhcFile(compiler/codegen/CgPrimOp.hs)]] to become `Just MO_F32_Sin`.  The `CallishMachOp` constructor `MO_F32_Sin` is piped through [[GhcFile(compiler/nativeGen/MachCodeGen.hs)]], where the function `genCCall` will (for most architectures) call `outOfLineFloatOp` to issue a call to a C function such as `sin`. 
     908 
    904909 
    905910== Cmm Design: Observations and Areas for Potential Improvement  ==