diff options
author | Geoffrey Mainland <gmainlan@microsoft.com> | 2012-10-19 09:32:02 +0100 |
---|---|---|
committer | Geoffrey Mainland <gmainlan@microsoft.com> | 2013-02-01 22:00:23 +0000 |
commit | 515ba6f18b6ed8ac9167588b8c6099ef85d5e517 (patch) | |
tree | da139c9b29dc342eca13592628913fd406229432 /compiler/llvmGen/LlvmCodeGen/Data.hs | |
parent | f70b6b621153cd3af8b999eac4f6fab2162befa7 (diff) | |
download | haskell-515ba6f18b6ed8ac9167588b8c6099ef85d5e517.tar.gz |
Add Cmm support for representing 128-bit-wide SIMD vectors.
Diffstat (limited to 'compiler/llvmGen/LlvmCodeGen/Data.hs')
-rw-r--r-- | compiler/llvmGen/LlvmCodeGen/Data.hs | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/compiler/llvmGen/LlvmCodeGen/Data.hs b/compiler/llvmGen/LlvmCodeGen/Data.hs index fd0d7ccd99..83b5453aa9 100644 --- a/compiler/llvmGen/LlvmCodeGen/Data.hs +++ b/compiler/llvmGen/LlvmCodeGen/Data.hs @@ -171,6 +171,14 @@ genStaticLit (CmmInt i w) genStaticLit (CmmFloat r w) = Right $ LMStaticLit (LMFloatLit (fromRational r) (widthToLlvmFloat w)) +genStaticLit (CmmVec ls) + = Right $ LMStaticLit (LMVectorLit (map toLlvmLit ls)) + where + toLlvmLit :: CmmLit -> LlvmLit + toLlvmLit lit = case genStaticLit lit of + Right (LMStaticLit llvmLit) -> llvmLit + _ -> panic "genStaticLit" + -- Leave unresolved, will fix later genStaticLit c@(CmmLabel _ ) = Left $ c genStaticLit c@(CmmLabelOff _ _) = Left $ c |