diff options
| author | Simon Marlow <marlowsd@gmail.com> | 2013-11-29 10:32:26 +0000 |
|---|---|---|
| committer | Johan Tibell <johan.tibell@gmail.com> | 2014-03-11 20:01:54 +0100 |
| commit | a70e7b4762c75812254f7781bcd48139c4ec40dd (patch) | |
| tree | 0a1641c4edf3b78277f86cee225333d211b1f4af /compiler/cmm/CmmUtils.hs | |
| parent | 22f010e08e58ba40b0ab59ec7a7c02cce0938cce (diff) | |
| download | haskell-a70e7b4762c75812254f7781bcd48139c4ec40dd.tar.gz | |
Represent offsets into heap objects with byte, not word, offsets
I'd like to be able to pack together non-pointer fields that are less
than a word in size, and this is a necessary prerequisite.
Diffstat (limited to 'compiler/cmm/CmmUtils.hs')
| -rw-r--r-- | compiler/cmm/CmmUtils.hs | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/compiler/cmm/CmmUtils.hs b/compiler/cmm/CmmUtils.hs index f6d1ddde58..afba245fbc 100644 --- a/compiler/cmm/CmmUtils.hs +++ b/compiler/cmm/CmmUtils.hs @@ -286,22 +286,23 @@ cmmOffsetLitB = cmmOffsetLit ----------------------- -- The "W" variants take word offsets + cmmOffsetExprW :: DynFlags -> CmmExpr -> CmmExpr -> CmmExpr -- The second arg is a *word* offset; need to change it to bytes cmmOffsetExprW dflags e (CmmLit (CmmInt n _)) = cmmOffsetW dflags e (fromInteger n) cmmOffsetExprW dflags e wd_off = cmmIndexExpr dflags (wordWidth dflags) e wd_off cmmOffsetW :: DynFlags -> CmmExpr -> WordOff -> CmmExpr -cmmOffsetW dflags e n = cmmOffsetB dflags e (wORD_SIZE dflags * n) +cmmOffsetW dflags e n = cmmOffsetB dflags e (wordsToBytes dflags n) cmmRegOffW :: DynFlags -> CmmReg -> WordOff -> CmmExpr -cmmRegOffW dflags reg wd_off = cmmRegOffB reg (wd_off * wORD_SIZE dflags) +cmmRegOffW dflags reg wd_off = cmmRegOffB reg (wordsToBytes dflags wd_off) cmmOffsetLitW :: DynFlags -> CmmLit -> WordOff -> CmmLit -cmmOffsetLitW dflags lit wd_off = cmmOffsetLitB lit (wORD_SIZE dflags * wd_off) +cmmOffsetLitW dflags lit wd_off = cmmOffsetLitB lit (wordsToBytes dflags wd_off) cmmLabelOffW :: DynFlags -> CLabel -> WordOff -> CmmLit -cmmLabelOffW dflags lbl wd_off = cmmLabelOffB lbl (wORD_SIZE dflags * wd_off) +cmmLabelOffW dflags lbl wd_off = cmmLabelOffB lbl (wordsToBytes dflags wd_off) cmmLoadIndexW :: DynFlags -> CmmExpr -> Int -> CmmType -> CmmExpr cmmLoadIndexW dflags base off ty = CmmLoad (cmmOffsetW dflags base off) ty |
