Changes between Version 16 and Version 17 of SIMDPlan


Ignore:
Timestamp:
Oct 12, 2011 7:47:53 PM (4 years ago)
Author:
pmonday
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • SIMDPlan

    v16 v17  
    3737 
    3838The steps to be undertaken are: 
    39  1. Modify ./compiler/prelude/PrimOp.lhs (actually, ./compiler/primop-data-decl.hs-incl) to add the new PrimOps (VIntQuotOp, etc...) 
    4039 1. Modify ./compiler/prelude/primops.txt.pp (the following instructions may be changed a bit based on the direction) 
    4140  a. Add the following vector length constants as Int# types 
     
    6766  a. Double 
    6867   * plusDoubleVec#, minusDoubleVec#, timesDoubleVec#, quotDoubleVec#, remDoubleVec#, negateDoubleVec#, expDoubleVec#, logDoubleVec#, sqrtDoubleVec#, sinDoubleVec#, cosDoubleVec#, tanDoubleVec#, asinDoubleVec#, acosDoubleVec#, atanDoubleVec#, sinhDoubleVec#, coshDoubleVec#, tanhDoubleVec# 
     68 1. Do NOT Modify ./compiler/prelude/PrimOp.lhs (actually, ./compiler/primop-data-decl.hs-incl) to add the new PrimOps (VIntQuotOp, etc...), this will be generated based on the primops.txt.pp modifications 
    6969 1. Modify ./compiler/codeGen/CgPrimOp.hs, code for each primop (above) must be added to complete the primop addition. 
    7070  a. The code, basically, links the primops to the Cmm MachOps (that, in turn, are read by the code generators) 
    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 
    73 Example 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  
     73Example of modification to ./compiler/prelude/primops.txt.pp to add one of the additional Float operations: 
     74{{{ 
     75------------------------------------------------------------------------ 
     76section "SIMDFloat" 
     77        {Float operations that can take advantage of vectorization.} 
     78------------------------------------------------------------------------ 
     79 
     80primop   FloatVectorAddOp   "plusFloatVec#"      Dyadic             
     81   Float# -> Float# -> Float# 
     82   with can_fail = True 
     83}}} 
     84 
     85Here is an example of the update to ./compiler/codeGen/CgPrimOp.hs 
     86{{{ 
     87-- SIMD Float Ops 
     88translateOp FloatVectorAddOp    = Just (MO_VF_Add W32 4) 
     89}}} 
     90 
     91The above, after compilation, adds the following to the ./compiler/prelude/PrimOp.lhs file: 
     92{{{ 
     93   | FloatVectorAddOp 
     94}}} 
    8395 
    8496== Add new MachOps to Cmm code ==