Changes between Version 15 and Version 16 of SIMDPlan


Ignore:
Timestamp:
Oct 12, 2011 5:09:40 PM (3 years ago)
Author:
pmonday
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • SIMDPlan

    v15 v16  
    7171  a. It looks like some Cmm extensions will have to be added to ensure alignment and pass vectorization information onto the back ends, the necessary MachOps will be determined after the first vertical stack is completed (using the "Double" as a model).  There may be some reuse from the existing MachOps.  There is some discussion to these extensions (or similar ones) on the original [http://hackage.haskell.org/trac/ghc/ticket/3557 Patch 3557 Documentation] 
    7272 
     73Example of modification to ./compiler/primop-data-decl.hs-incl to add the SIMD Integer Operations to PrimOp.lhs: 
     74{{{ 
     75   | VIntAddOp 
     76   | VIntSubOp 
     77   | VIntMulOp 
     78   | VIntQuotOp 
     79   | VIntNegOp 
     80}}} 
     81 
     82 
     83 
    7384== Add new MachOps to Cmm code == 
    7485It may make more sense to add the MachOps to Cmm prior to implementing the PrimOps (or at least before adding the code to the CgPrimOp.hs file).  There is a useful [http://hackage.haskell.org/trac/ghc/wiki/Commentary/Compiler/CmmType#AdditionsinCmm Cmm Wiki Page] available to aid in the definition of the new Cmm operations. 
     
    93104Modify compiler/cmm/CmmMachOp.hs, this will add the necessary MachOps for use from the PrimOps modifications to support SIMD.  Here is an example of adding a SIMD version of the MO_F_Add MachOp: 
    94105{{{ 
     106  -- Integer SIMD arithmetic 
     107  | MO_V_Add  Width Int 
     108  | MO_V_Sub  Width Int 
     109  | MO_V_Neg  Width Int         -- unary - 
     110  | MO_V_Mul  Width Int 
     111  | MO_V_Quot Width Int 
     112 
    95113  -- Floating point arithmetic 
    96114  MO_VF_Add Width Int   -- MO_VF_Add W64 4   Add 4-vector of 64-bit floats 
     115  ... 
    97116}}} 
    98117