summaryrefslogtreecommitdiff
path: root/compiler/llvmGen
diff options
context:
space:
mode:
authorGeoffrey Mainland <gmainlan@microsoft.com>2013-01-03 16:59:03 +0000
committerGeoffrey Mainland <gmainlan@microsoft.com>2013-01-03 16:59:03 +0000
commit6d5f25f5e0b33173fb2e7983cab40808c723f220 (patch)
tree422eb237d3529f02c1baf39e2441b10461040895 /compiler/llvmGen
parent71feb1025eed0c3cc849c85e2b00e16bc1a21790 (diff)
downloadhaskell-6d5f25f5e0b33173fb2e7983cab40808c723f220.tar.gz
Fix LLVM code generated for word2Float# and word2Double#.
Diffstat (limited to 'compiler/llvmGen')
-rw-r--r--compiler/llvmGen/LlvmCodeGen/CodeGen.hs8
1 files changed, 6 insertions, 2 deletions
diff --git a/compiler/llvmGen/LlvmCodeGen/CodeGen.hs b/compiler/llvmGen/LlvmCodeGen/CodeGen.hs
index c510185191..763656a53b 100644
--- a/compiler/llvmGen/LlvmCodeGen/CodeGen.hs
+++ b/compiler/llvmGen/LlvmCodeGen/CodeGen.hs
@@ -189,11 +189,15 @@ genCall env (PrimTarget MO_Touch) _ _
genCall env (PrimTarget (MO_UF_Conv w)) [dst] [e] = do
let (env1, dstV, stmts1, top1) = getCmmReg env (CmmLocal dst)
+ ty = cmmToLlvmType $ localRegType dst
width = widthToLlvmFloat w
+ castV <- mkLocalVar ty
(env2, ve, stmts2, top2) <- exprToVar env1 e
- let stmt = Assignment dstV $ Cast LM_Uitofp ve width
- stmts = stmts1 `appOL` stmts2 `snocOL` stmt
+ let stmt3 = Assignment castV $ Cast LM_Uitofp ve width
+ stmt4 = Store castV dstV
+ stmts = stmts1 `appOL` stmts2 `snocOL` stmt3 `snocOL` stmt4
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) ++ "."