summaryrefslogtreecommitdiff
path: root/compiler/cmm/PprC.hs
diff options
context:
space:
mode:
authorSimon Marlow <marlowsd@gmail.com>2018-04-22 12:48:11 +0100
committerSimon Marlow <marlowsd@gmail.com>2018-05-16 13:36:13 +0100
commitfbd28e2c6b5f1302cd2d36d79149e3b0a9f01d84 (patch)
tree347862078aab1df4d1c268ae4cd880e46fc55de3 /compiler/cmm/PprC.hs
parenteb8e692cab7970c495681e14721d05ecadd21581 (diff)
downloadhaskell-fbd28e2c6b5f1302cd2d36d79149e3b0a9f01d84.tar.gz
Allow CmmLabelDiffOff with different widths
Summary: This change makes it possible to generate a static 32-bit relative label offset on x86_64. Currently we can only generate word-sized label offsets. This will be used in D4634 to shrink info tables. See D4632 for more details. Test Plan: See D4632 Reviewers: bgamari, niteria, michalt, erikd, jrtc27, osa1 Subscribers: thomie, carter Differential Revision: https://phabricator.haskell.org/D4633
Diffstat (limited to 'compiler/cmm/PprC.hs')
-rw-r--r--compiler/cmm/PprC.hs6
1 files changed, 3 insertions, 3 deletions
diff --git a/compiler/cmm/PprC.hs b/compiler/cmm/PprC.hs
index 1e50c8591b..f3f9d3c0b3 100644
--- a/compiler/cmm/PprC.hs
+++ b/compiler/cmm/PprC.hs
@@ -495,7 +495,7 @@ pprLit lit = case lit of
CmmHighStackMark -> panic "PprC printing high stack mark"
CmmLabel clbl -> mkW_ <> pprCLabelAddr clbl
CmmLabelOff clbl i -> mkW_ <> pprCLabelAddr clbl <> char '+' <> int i
- CmmLabelDiffOff clbl1 _ i
+ CmmLabelDiffOff clbl1 _ i _ -- non-word widths not supported via C
-- WARNING:
-- * the lit must occur in the info table clbl2
-- * clbl1 must be an SRT, a slow entry point or a large bitmap
@@ -506,7 +506,7 @@ pprLit lit = case lit of
pprLit1 :: CmmLit -> SDoc
pprLit1 lit@(CmmLabelOff _ _) = parens (pprLit lit)
-pprLit1 lit@(CmmLabelDiffOff _ _ _) = parens (pprLit lit)
+pprLit1 lit@(CmmLabelDiffOff _ _ _ _) = parens (pprLit lit)
pprLit1 lit@(CmmFloat _ _) = parens (pprLit lit)
pprLit1 other = pprLit other
@@ -1083,7 +1083,7 @@ te_BB block = mapM_ te_Stmt (blockToList mid) >> te_Stmt last
te_Lit :: CmmLit -> TE ()
te_Lit (CmmLabel l) = te_lbl l
te_Lit (CmmLabelOff l _) = te_lbl l
-te_Lit (CmmLabelDiffOff l1 _ _) = te_lbl l1
+te_Lit (CmmLabelDiffOff l1 _ _ _) = te_lbl l1
te_Lit _ = return ()
te_Stmt :: CmmNode e x -> TE ()