Changes between Version 30 and Version 31 of SIMDPlan


Ignore:
Timestamp:
Oct 26, 2011 4:54:39 PM (4 years ago)
Author:
pmonday
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • SIMDPlan

    v30 v31  
    307307 
    308308== Modify LLVM Code Generator == 
    309  
    310309Take the MachOps in the Cmm definition and translate correctly to the corresponding LLVM instructions.  LLVM code generation is in the /compiler/llvmGen directory.  The following will have to be modified (at a minimum): 
    311310 * /compiler/llvmGen/Llvm/Types.hs - add the MachOps from Cmm and how they bridge to the LLVM vector operations 
     
    313312* Remaining /compiler/llvmGen/* - Supporting changes 
    314313 
    315 Once the LLVM Code Generator is modified to support Double instructions, tests can be run to ensure the “bottom half” of the stack works. 
     314At this point, CodeGen is not modified, though it will likely have to be eventually.  Types.hs has a new LMVector type added to support vectors.  As the operations on vectors are the same as all LLVM types (for float vectors use fadd, etc...), I have not made changes to the operators yet (though I'm guessing I will have to eventually).  Here is the diff of changes to Types.hs: 
     315{{{ 
     316[paul.monday@pg155-n19 Llvm]$ git diff Types.hs 
     317diff --git a/compiler/llvmGen/Llvm/Types.hs b/compiler/llvmGen/Llvm/Types.hs 
     318index 1013426..1133d37 100644 
     319--- a/compiler/llvmGen/Llvm/Types.hs 
     320+++ b/compiler/llvmGen/Llvm/Types.hs 
     321@@ -38,6 +38,7 @@ data LlvmType 
     322   | LMFloat128           -- ^ 128 bit floating point 
     323   | LMPointer LlvmType   -- ^ A pointer to a 'LlvmType' 
     324   | LMArray Int LlvmType -- ^ An array of 'LlvmType' 
     325+  | LMVector Int LlvmType -- ^ A vector of 'LlvmType' 
     326   | LMLabel              -- ^ A 'LlvmVar' can represent a label (address) 
     327   | LMVoid               -- ^ Void type 
     328   | LMStruct [LlvmType]  -- ^ Structure type 
     329@@ -55,6 +56,7 @@ instance Show LlvmType where 
     330   show (LMFloat128    ) = "fp128" 
     331   show (LMPointer x   ) = show x ++ "*" 
     332   show (LMArray nr tp ) = "[" ++ show nr ++ " x " ++ show tp ++ "]" 
     333+  show (LMVector nr tp ) = "<" ++ show nr ++ " x " ++ show tp ++ ">"   
     334   show (LMLabel       ) = "label" 
     335   show (LMVoid        ) = "void" 
     336   show (LMStruct tys  ) = "<{" ++ (commaCat tys) ++ "}>" 
     337@@ -295,6 +297,7 @@ llvmWidthInBits (LMFloat128)    = 128 
     338 -- it points to. We will go with the former for now. 
     339 llvmWidthInBits (LMPointer _)   = llvmWidthInBits llvmWord 
     340 llvmWidthInBits (LMArray _ _)   = llvmWidthInBits llvmWord 
     341+llvmWidthInBits (LMVector _ _)   = llvmWidthInBits llvmWord 
     342 llvmWidthInBits LMLabel         = 0 
     343 llvmWidthInBits LMVoid          = 0 
     344 llvmWidthInBits (LMStruct tys)  = sum $ map llvmWidthInBits tys 
     345}}} 
    316346 
    317347== Modify Native Code Generator ==