summaryrefslogtreecommitdiff
path: root/compiler/codeGen/StgCmmPrim.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/codeGen/StgCmmPrim.hs
parent589b628be71cda75f4a225db0f1d1fd678c06368 (diff)
downloadhaskell-2e8c769422740c001e0a247bfec61d4f78598582.tar.gz
Implement word2Float# and word2Double#
Diffstat (limited to 'compiler/codeGen/StgCmmPrim.hs')
-rw-r--r--compiler/codeGen/StgCmmPrim.hs6
1 files changed, 6 insertions, 0 deletions
diff --git a/compiler/codeGen/StgCmmPrim.hs b/compiler/codeGen/StgCmmPrim.hs
index fe2a0217e0..66832c125a 100644
--- a/compiler/codeGen/StgCmmPrim.hs
+++ b/compiler/codeGen/StgCmmPrim.hs
@@ -491,6 +491,12 @@ emitPrimOp _ [res] PopCnt32Op [w] = emitPopCntCall res w W32
emitPrimOp _ [res] PopCnt64Op [w] = emitPopCntCall res w W64
emitPrimOp dflags [res] PopCntOp [w] = emitPopCntCall res w (wordWidth dflags)
+-- Unsigned int to floating point conversions
+emitPrimOp _ [res] Word2FloatOp [w] = emitPrimCall [res]
+ (MO_UF_Conv W32) [w]
+emitPrimOp _ [res] Word2DoubleOp [w] = emitPrimCall [res]
+ (MO_UF_Conv W64) [w]
+
-- The rest just translate straightforwardly
emitPrimOp dflags [res] op [arg]
| nopOp op