summaryrefslogtreecommitdiff
path: root/compiler/cmm/CmmUtils.hs
diff options
context:
space:
mode:
authorIan Lynagh <ian@well-typed.com>2012-09-18 23:22:20 +0100
committerIan Lynagh <ian@well-typed.com>2012-09-18 23:22:20 +0100
commita9b986e2fe285f844e42e573e4887a4e36ba92d4 (patch)
tree30509b6c6aa091125089208631c146ca72793758 /compiler/cmm/CmmUtils.hs
parent3a4c64c1a2953bbc759a6f5c99dad31ab50dc96b (diff)
downloadhaskell-a9b986e2fe285f844e42e573e4887a4e36ba92d4.tar.gz
Make StgWord a portable type too
StgWord is a newtyped Word64, as it needed to be something that has a UArray instance.
Diffstat (limited to 'compiler/cmm/CmmUtils.hs')
-rw-r--r--compiler/cmm/CmmUtils.hs6
1 files changed, 3 insertions, 3 deletions
diff --git a/compiler/cmm/CmmUtils.hs b/compiler/cmm/CmmUtils.hs
index fab384cd3c..cde5bd1d20 100644
--- a/compiler/cmm/CmmUtils.hs
+++ b/compiler/cmm/CmmUtils.hs
@@ -156,7 +156,7 @@ mkRODataLits lbl lits
needsRelocation _ = False
mkWordCLit :: DynFlags -> StgWord -> CmmLit
-mkWordCLit dflags wd = CmmInt (fromIntegral wd) (wordWidth dflags)
+mkWordCLit dflags wd = CmmInt (fromStgWord wd) (wordWidth dflags)
packHalfWordsCLit :: DynFlags -> StgHalfWord -> StgHalfWord -> CmmLit
-- Make a single word literal in which the lower_half_word is
@@ -168,8 +168,8 @@ packHalfWordsCLit dflags lower_half_word upper_half_word
= if wORDS_BIGENDIAN dflags
then mkWordCLit dflags ((l `shiftL` hALF_WORD_SIZE_IN_BITS) .|. u)
else mkWordCLit dflags (l .|. (u `shiftL` hALF_WORD_SIZE_IN_BITS))
- where l = fromInteger (fromStgHalfWord lower_half_word)
- u = fromInteger (fromStgHalfWord upper_half_word)
+ where l = toStgWord dflags (fromStgHalfWord lower_half_word)
+ u = toStgWord dflags (fromStgHalfWord upper_half_word)
---------------------------------------------------
--