Changes between Version 7 and Version 8 of Commentary/Compiler/CmmType
- Timestamp:
- 12/06/06 21:07:15 (7 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Commentary/Compiler/CmmType
v7 v8 238 238 || `float32` || `F_` || `StgFloat` || 239 239 || `float64` || `D_` || `StgDouble` || 240 241 240 242 241 [[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. … … 820 819 The `MachOp` and `CallishMachOp` data types are defined in [[GhcFile(compiler/cmm/MachOp.hs)]]. 821 820 821 Both 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 822 823 ==== Operators ==== 823 824 {{{ … … 868 869 869 870 ==== Primitive Operations ==== 871 Primitive Operations generally involve more than one machine instruction and may not always be inlined. 872 870 873 {{{ 871 874 -- These MachOps tend to be implemented by foreign calls in some backends, … … 902 905 | MO_WriteBarrier 903 906 }}} 907 For 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 904 909 905 910 == Cmm Design: Observations and Areas for Potential Improvement ==
