summaryrefslogtreecommitdiff
path: root/compiler/nativeGen/X86
diff options
context:
space:
mode:
authorJohan Tibell <johan.tibell@gmail.com>2012-12-05 19:08:48 -0800
committerJohan Tibell <johan.tibell@gmail.com>2012-12-13 13:54:22 -0800
commit2e8c769422740c001e0a247bfec61d4f78598582 (patch)
treedc9ad5736694e1c9282800d88e9a110d13290a72 /compiler/nativeGen/X86
parent589b628be71cda75f4a225db0f1d1fd678c06368 (diff)
downloadhaskell-2e8c769422740c001e0a247bfec61d4f78598582.tar.gz
Implement word2Float# and word2Double#
Diffstat (limited to 'compiler/nativeGen/X86')
-rw-r--r--compiler/nativeGen/X86/CodeGen.hs13
1 files changed, 13 insertions, 0 deletions
diff --git a/compiler/nativeGen/X86/CodeGen.hs b/compiler/nativeGen/X86/CodeGen.hs
index 36f9e2d231..30cf060e74 100644
--- a/compiler/nativeGen/X86/CodeGen.hs
+++ b/compiler/nativeGen/X86/CodeGen.hs
@@ -1659,6 +1659,17 @@ genCCall is32Bit (PrimTarget (MO_PopCnt width)) dest_regs@[dst]
size = intSize width
lbl = mkCmmCodeLabel primPackageId (fsLit (popCntLabel width))
+genCCall is32Bit (PrimTarget (MO_UF_Conv width)) dest_regs args = do
+ dflags <- getDynFlags
+ targetExpr <- cmmMakeDynamicReference dflags addImportNat
+ CallReference lbl
+ let target = ForeignTarget targetExpr (ForeignConvention CCallConv
+ [NoHint] [NoHint]
+ CmmMayReturn)
+ genCCall is32Bit target dest_regs args
+ where
+ lbl = mkCmmCodeLabel primPackageId (fsLit (word2FloatLabel width))
+
genCCall is32Bit target dest_regs args
| is32Bit = genCCall32 target dest_regs args
| otherwise = genCCall64 target dest_regs args
@@ -2280,6 +2291,8 @@ outOfLineCmmOp mop res args
MO_PopCnt _ -> fsLit "popcnt"
+ MO_UF_Conv _ -> unsupported
+
MO_S_QuotRem {} -> unsupported
MO_U_QuotRem {} -> unsupported
MO_U_QuotRem2 {} -> unsupported