summaryrefslogtreecommitdiff
path: root/compiler/llvmGen/LlvmCodeGen/CodeGen.hs
diff options
context:
space:
mode:
authorIan Lynagh <ian@well-typed.com>2012-12-13 22:00:15 +0000
committerIan Lynagh <ian@well-typed.com>2012-12-13 22:00:15 +0000
commitab9de78dc557697c03f70b46f699a6520a7985ab (patch)
treef409491d96d89c9d8c0effab7d973e8c5eb4aaf6 /compiler/llvmGen/LlvmCodeGen/CodeGen.hs
parente2564ce2878db7157f67e7710633b4cb1b2db0b0 (diff)
parent2e8c769422740c001e0a247bfec61d4f78598582 (diff)
downloadhaskell-ab9de78dc557697c03f70b46f699a6520a7985ab.tar.gz
Merge branch 'master' of darcs.haskell.org:/srv/darcs//ghc
Diffstat (limited to 'compiler/llvmGen/LlvmCodeGen/CodeGen.hs')
-rw-r--r--compiler/llvmGen/LlvmCodeGen/CodeGen.hs12
1 files changed, 12 insertions, 0 deletions
diff --git a/compiler/llvmGen/LlvmCodeGen/CodeGen.hs b/compiler/llvmGen/LlvmCodeGen/CodeGen.hs
index fd9d7011c4..c510185191 100644
--- a/compiler/llvmGen/LlvmCodeGen/CodeGen.hs
+++ b/compiler/llvmGen/LlvmCodeGen/CodeGen.hs
@@ -187,6 +187,17 @@ genCall env (PrimTarget MO_WriteBarrier) _ _
genCall env (PrimTarget MO_Touch) _ _
= return (env, nilOL, [])
+genCall env (PrimTarget (MO_UF_Conv w)) [dst] [e] = do
+ let (env1, dstV, stmts1, top1) = getCmmReg env (CmmLocal dst)
+ width = widthToLlvmFloat w
+ (env2, ve, stmts2, top2) <- exprToVar env1 e
+ let stmt = Assignment dstV $ Cast LM_Uitofp ve width
+ stmts = stmts1 `appOL` stmts2 `snocOL` stmt
+ return (env2, stmts, top1 ++ top2)
+genCall _ (PrimTarget (MO_UF_Conv _)) [_] args =
+ panic $ "genCall: Too many arguments to MO_UF_Conv. " ++
+ "Can only handle 1, given" ++ show (length args) ++ "."
+
-- Handle popcnt function specifically since GHC only really has i32 and i64
-- types and things like Word8 are backed by an i32 and just present a logical
-- i8 range. So we must handle conversions from i32 to i8 explicitly as LLVM
@@ -513,6 +524,7 @@ cmmPrimOpFunctions env mop
MO_U_Mul2 {} -> unsupported
MO_WriteBarrier -> unsupported
MO_Touch -> unsupported
+ MO_UF_Conv _ -> unsupported
where
dflags = getDflags env