summaryrefslogtreecommitdiff
path: root/compiler/nativeGen/CPrim.hs
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/CPrim.hs
parent589b628be71cda75f4a225db0f1d1fd678c06368 (diff)
downloadhaskell-2e8c769422740c001e0a247bfec61d4f78598582.tar.gz
Implement word2Float# and word2Double#
Diffstat (limited to 'compiler/nativeGen/CPrim.hs')
-rw-r--r--compiler/nativeGen/CPrim.hs12
1 files changed, 11 insertions, 1 deletions
diff --git a/compiler/nativeGen/CPrim.hs b/compiler/nativeGen/CPrim.hs
index 09707ac5ae..dd9d38f434 100644
--- a/compiler/nativeGen/CPrim.hs
+++ b/compiler/nativeGen/CPrim.hs
@@ -1,5 +1,8 @@
-- | Generating C symbol names emitted by the compiler.
-module CPrim (popCntLabel) where
+module CPrim
+ ( popCntLabel
+ , word2FloatLabel
+ ) where
import CmmType
import Outputable
@@ -12,3 +15,10 @@ popCntLabel w = "hs_popcnt" ++ pprWidth w
pprWidth W32 = "32"
pprWidth W64 = "64"
pprWidth w = pprPanic "popCntLabel: Unsupported word width " (ppr w)
+
+word2FloatLabel :: Width -> String
+word2FloatLabel w = "hs_word2float" ++ pprWidth w
+ where
+ pprWidth W32 = "32"
+ pprWidth W64 = "64"
+ pprWidth w = pprPanic "word2FloatLabel: Unsupported word width " (ppr w)